X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAsmParser%2FLLLexer.cpp;h=cb4a9557d43793abe5af079d03a8e863170432d1;hb=78f686d37cc3b4e70bbfc2acdfcfec8443fd3250;hp=1e5bcdd930cec2924a352a22aa6ab2e982334368;hpb=c8a1169c935ad9d3dfbdd4f72d80abf8f5acb03c;p=oota-llvm.git diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp index 1e5bcdd930c..cb4a9557d43 100644 --- a/lib/AsmParser/LLLexer.cpp +++ b/lib/AsmParser/LLLexer.cpp @@ -161,14 +161,10 @@ static const char *isLabelTail(const char *CurPtr) { // Lexer definition. //===----------------------------------------------------------------------===// -LLLexer::LLLexer(MemoryBuffer *StartBuf, SourceMgr &sm, SMDiagnostic &Err, +LLLexer::LLLexer(StringRef StartBuf, SourceMgr &sm, SMDiagnostic &Err, LLVMContext &C) : CurBuf(StartBuf), ErrorInfo(Err), SM(sm), Context(C), APFloatVal(0.0) { - CurPtr = CurBuf->getBufferStart(); -} - -std::string LLLexer::getFilename() const { - return CurBuf->getBufferIdentifier(); + CurPtr = CurBuf.begin(); } int LLLexer::getNextChar() { @@ -178,7 +174,7 @@ int LLLexer::getNextChar() { case 0: // A nul character in the stream is either the end of the current buffer or // a random nul in the file. Disambiguate that here. - if (CurPtr-1 != CurBuf->getBufferEnd()) + if (CurPtr-1 != CurBuf.end()) return 0; // Just whitespace. // Otherwise, return end of file. @@ -516,8 +512,6 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(private); KEYWORD(internal); - KEYWORD(linker_private); // NOTE: deprecated, for parser compatibility - KEYWORD(linker_private_weak); // NOTE: deprecated, for parser compatibility KEYWORD(available_externally); KEYWORD(linkonce); KEYWORD(linkonce_odr); @@ -612,6 +606,7 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(byval); KEYWORD(inalloca); KEYWORD(cold); + KEYWORD(dereferenceable); KEYWORD(inlinehint); KEYWORD(inreg); KEYWORD(jumptable);