summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorNirav Dave <niravd@google.com>2016-07-29 14:42:00 +0000
committerNirav Dave <niravd@google.com>2016-07-29 14:42:00 +0000
commit8b3dc876ea494f2b1e403721041116daf80dbe30 (patch)
tree8115af6e1ae96cc8b10d1c0f418c9230eda9ac7b /llvm/lib
parent22ae7df6f430596f81e616476fe1cc6ded72d26c (diff)
downloadbcm5719-llvm-8b3dc876ea494f2b1e403721041116daf80dbe30.tar.gz
bcm5719-llvm-8b3dc876ea494f2b1e403721041116daf80dbe30.zip
[MC] When emitting output hash comments always use standard line comment seperator
llvm-svn: 277146
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCAsmStreamer.cpp7
-rw-r--r--llvm/lib/MC/MCParser/AsmLexer.cpp2
2 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index ef2f7810dea..ed85f153002 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -357,9 +357,10 @@ void MCAsmStreamer::addExplicitComment(const Twine &T) {
ExplicitCommentToEmit.append("\t");
ExplicitCommentToEmit.append(c.str());
} else if (c.front() == '#') {
- // # are comments for ## commentString. Output extra #.
- ExplicitCommentToEmit.append("\t#");
- ExplicitCommentToEmit.append(c.str());
+
+ ExplicitCommentToEmit.append("\t");
+ ExplicitCommentToEmit.append(MAI->getCommentString());
+ ExplicitCommentToEmit.append(c.slice(1, c.size()).str());
} else
assert(false && "Unexpected Assembly Comment");
// full line comments immediately output
diff --git a/llvm/lib/MC/MCParser/AsmLexer.cpp b/llvm/lib/MC/MCParser/AsmLexer.cpp
index d56071aea4d..7037bb1d5fa 100644
--- a/llvm/lib/MC/MCParser/AsmLexer.cpp
+++ b/llvm/lib/MC/MCParser/AsmLexer.cpp
@@ -197,7 +197,7 @@ AsmToken AsmLexer::LexLineComment() {
CurChar = getNextChar();
IsAtStartOfLine = true;
- // Whis is a whole line comment. leave newline
+ // This is a whole line comment. leave newline
if (IsAtStartOfStatement)
return AsmToken(AsmToken::EndOfStatement,
StringRef(TokStart, CurPtr - TokStart));
OpenPOWER on IntegriCloud