diff --git a/llvm/tools/llvm-mc/AsmLexer.cpp b/llvm/tools/llvm-mc/AsmLexer.cpp index be8f60d2dd7b..99055c6855ed 100644 --- a/llvm/tools/llvm-mc/AsmLexer.cpp +++ b/llvm/tools/llvm-mc/AsmLexer.cpp @@ -243,10 +243,8 @@ StringRef AsmLexer::LexUntilEndOfStatement() { } bool AsmLexer::isAtStartOfComment(char Char) { - for (const char *p = MAI.getCommentString(); *p != 0; ++p) - if (Char == *p) - return true; - return false; + // FIXME: This won't work for multi-character comment indicators like "//". + return Char == *MAI.getCommentString(); } AsmToken AsmLexer::LexToken() { diff --git a/llvm/tools/llvm-mc/AsmLexer.h b/llvm/tools/llvm-mc/AsmLexer.h index 0c2ec138924e..0696abc887f5 100644 --- a/llvm/tools/llvm-mc/AsmLexer.h +++ b/llvm/tools/llvm-mc/AsmLexer.h @@ -30,7 +30,7 @@ class MCAsmInfo; /// AsmLexer - Lexer class for assembly files. class AsmLexer : public MCAsmLexer { SourceMgr &SrcMgr; - const MCAsmInfo MAI; + const MCAsmInfo &MAI; const char *CurPtr; const MemoryBuffer *CurBuf;