summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser/AsmLexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmLexer.cpp')
-rw-r--r--llvm/lib/MC/MCParser/AsmLexer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCParser/AsmLexer.cpp b/llvm/lib/MC/MCParser/AsmLexer.cpp
index d0c8bce0382..0fa7fbdc7b6 100644
--- a/llvm/lib/MC/MCParser/AsmLexer.cpp
+++ b/llvm/lib/MC/MCParser/AsmLexer.cpp
@@ -511,16 +511,16 @@ size_t AsmLexer::peekTokens(MutableArrayRef<AsmToken> Buf,
}
bool AsmLexer::isAtStartOfComment(const char *Ptr) {
- const char *CommentString = MAI.getCommentString();
+ StringRef CommentString = MAI.getCommentString();
- if (CommentString[1] == '\0')
+ if (CommentString.size() == 1)
return CommentString[0] == Ptr[0];
// Allow # preprocessor commments also be counted as comments for "##" cases
if (CommentString[1] == '#')
return CommentString[0] == Ptr[0];
- return strncmp(Ptr, CommentString, strlen(CommentString)) == 0;
+ return strncmp(Ptr, CommentString.data(), CommentString.size()) == 0;
}
bool AsmLexer::isAtStatementSeparator(const char *Ptr) {
OpenPOWER on IntegriCloud