aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/AsmParser/LLParser.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/AsmParser/LLParser.h')
-rw-r--r--contrib/llvm/lib/AsmParser/LLParser.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/contrib/llvm/lib/AsmParser/LLParser.h b/contrib/llvm/lib/AsmParser/LLParser.h
index d5b059355c42..94e4c1ae96d5 100644
--- a/contrib/llvm/lib/AsmParser/LLParser.h
+++ b/contrib/llvm/lib/AsmParser/LLParser.h
@@ -139,11 +139,16 @@ namespace llvm {
std::map<Value*, std::vector<unsigned> > ForwardRefAttrGroups;
std::map<unsigned, AttrBuilder> NumberedAttrBuilders;
+ /// Only the llvm-as tool may set this to false to bypass
+ /// UpgradeDebuginfo so it can generate broken bitcode.
+ bool UpgradeDebugInfo;
+
public:
LLParser(StringRef F, SourceMgr &SM, SMDiagnostic &Err, Module *M,
- SlotMapping *Slots = nullptr)
+ SlotMapping *Slots = nullptr, bool UpgradeDebugInfo = true)
: Context(M->getContext()), Lex(F, SM, Err, M->getContext()), M(M),
- Slots(Slots), BlockAddressPFS(nullptr) {}
+ Slots(Slots), BlockAddressPFS(nullptr),
+ UpgradeDebugInfo(UpgradeDebugInfo) {}
bool Run();
bool parseStandaloneConstantValue(Constant *&C, const SlotMapping *Slots);
@@ -188,7 +193,7 @@ namespace llvm {
FastMathFlags FMF;
while (true)
switch (Lex.getKind()) {
- case lltok::kw_fast: FMF.setUnsafeAlgebra(); Lex.Lex(); continue;
+ case lltok::kw_fast: FMF.setFast(); Lex.Lex(); continue;
case lltok::kw_nnan: FMF.setNoNaNs(); Lex.Lex(); continue;
case lltok::kw_ninf: FMF.setNoInfs(); Lex.Lex(); continue;
case lltok::kw_nsz: FMF.setNoSignedZeros(); Lex.Lex(); continue;
@@ -197,6 +202,8 @@ namespace llvm {
FMF.setAllowContract(true);
Lex.Lex();
continue;
+ case lltok::kw_reassoc: FMF.setAllowReassoc(); Lex.Lex(); continue;
+ case lltok::kw_afn: FMF.setApproxFunc(); Lex.Lex(); continue;
default: return FMF;
}
return FMF;
@@ -235,7 +242,9 @@ namespace llvm {
bool ParseOptionalParamAttrs(AttrBuilder &B);
bool ParseOptionalReturnAttrs(AttrBuilder &B);
bool ParseOptionalLinkage(unsigned &Linkage, bool &HasLinkage,
- unsigned &Visibility, unsigned &DLLStorageClass);
+ unsigned &Visibility, unsigned &DLLStorageClass,
+ bool &DSOLocal);
+ void ParseOptionalDSOLocal(bool &DSOLocal);
void ParseOptionalVisibility(unsigned &Visibility);
void ParseOptionalDLLStorageClass(unsigned &DLLStorageClass);
bool ParseOptionalCallingConv(unsigned &CC);
@@ -279,12 +288,12 @@ namespace llvm {
bool ParseNamedGlobal();
bool ParseGlobal(const std::string &Name, LocTy Loc, unsigned Linkage,
bool HasLinkage, unsigned Visibility,
- unsigned DLLStorageClass,
+ unsigned DLLStorageClass, bool DSOLocal,
GlobalVariable::ThreadLocalMode TLM,
GlobalVariable::UnnamedAddr UnnamedAddr);
bool parseIndirectSymbol(const std::string &Name, LocTy Loc,
unsigned Linkage, unsigned Visibility,
- unsigned DLLStorageClass,
+ unsigned DLLStorageClass, bool DSOLocal,
GlobalVariable::ThreadLocalMode TLM,
GlobalVariable::UnnamedAddr UnnamedAddr);
bool parseComdat();