case ';':
SkipLineComment();
return LexToken();
- case '!': return lltok::Metadata;
+ case '!': return LexMetadata();
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case '-':
return false;
}
+/// LexMetadata:
+/// !{...}
+/// !42
+/// !foo
+lltok::Kind LLLexer::LexMetadata() {
+ if (isalpha(CurPtr[0])) {
+ ++CurPtr;
+ while (isalnum(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
+ CurPtr[0] == '.' || CurPtr[0] == '_')
+ ++CurPtr;
+ StrVal.assign(TokStart+1, CurPtr); // Skip !
+ return lltok::NamedMD;
+ }
+ return lltok::Metadata;
+}
+
/// LexIdentifier: Handle several related productions:
/// Label [-a-zA-Z$._0-9]+:
/// IntegerType i[0-9]+
Error("bitwidth for integer type out of range!");
return lltok::Error;
}
- TyVal = Context.getIntegerType(NumBits);
+ TyVal = IntegerType::get(NumBits);
return lltok::Type;
}
KEYWORD(global); KEYWORD(constant);
KEYWORD(private);
+ KEYWORD(linker_private);
KEYWORD(internal);
KEYWORD(available_externally);
KEYWORD(linkonce);
KEYWORD(deplibs);
KEYWORD(datalayout);
KEYWORD(volatile);
+ KEYWORD(nuw);
+ KEYWORD(nsw);
+ KEYWORD(exact);
+ KEYWORD(inbounds);
KEYWORD(align);
KEYWORD(addrspace);
KEYWORD(section);
KEYWORD(sspreq);
KEYWORD(noredzone);
KEYWORD(noimplicitfloat);
+ KEYWORD(naked);
KEYWORD(type);
KEYWORD(opaque);
uint64_t Pair[2];
switch (Kind) {
- default: LLVM_UNREACHABLE("Unknown kind!");
+ default: llvm_unreachable("Unknown kind!");
case 'K':
// F80HexFPConstant - x87 long double in hexadecimal format (10 bytes)
FP80HexToIntPair(TokStart+3, CurPtr, Pair);