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(deplibs);
KEYWORD(datalayout);
KEYWORD(volatile);
- KEYWORD(signed);
- KEYWORD(unsigned);
+ KEYWORD(nuw);
+ KEYWORD(nsw);
KEYWORD(exact);
+ KEYWORD(inbounds);
KEYWORD(align);
KEYWORD(addrspace);
KEYWORD(section);