avoid copying MCAsmInfo by value, add an (extremely low prio) fixme.
authorChris Lattner <sabre@nondot.org>
Sun, 27 Sep 2009 19:38:39 +0000 (19:38 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 27 Sep 2009 19:38:39 +0000 (19:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82911 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-mc/AsmLexer.cpp
tools/llvm-mc/AsmLexer.h

index be8f60d2dd7b3a458a9fb2bab31a8f758445acb9..99055c6855ed05abcf2ff2ceb36f6f917f066edd 100644 (file)
@@ -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() {
index 0c2ec138924e4e40dd1b370958df721460f0e298..0696abc887f548cd91fb28a5dda5686216a0266c 100644 (file)
@@ -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;