summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-16 16:28:37 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-16 16:28:37 +0000
commit0b694814a80054fc3b7d6feab614efc353569505 (patch)
tree7d78993fe83935beafae25c5c4def122c4a0a175 /llvm/lib/MC
parent4d20f0c00f4e5ba6bfc7164864348d8489434197 (diff)
downloadbcm5719-llvm-0b694814a80054fc3b7d6feab614efc353569505.tar.gz
bcm5719-llvm-0b694814a80054fc3b7d6feab614efc353569505.zip
Add an emitRawComment function and use it to simplify some uses of EmitRawText.
llvm-svn: 199397
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCAsmStreamer.cpp9
-rw-r--r--llvm/lib/MC/MCStreamer.cpp2
2 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index 099ce3048db..64bcb83b225 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -115,6 +115,8 @@ public:
return CommentStream;
}
+ void emitRawComment(const Twine &T, bool TabPrefix = true) LLVM_OVERRIDE;
+
/// AddBlankLine - Emit a blank line to a .s file to pretty it up.
virtual void AddBlankLine() {
EmitEOL();
@@ -311,6 +313,13 @@ static inline int64_t truncateToSize(int64_t Value, unsigned Bytes) {
return Value & ((uint64_t) (int64_t) -1 >> (64 - Bytes * 8));
}
+void MCAsmStreamer::emitRawComment(const Twine &T, bool TabPrefix) {
+ if (TabPrefix)
+ OS << '\t';
+ OS << MAI->getCommentString() << T;
+ EmitEOL();
+}
+
void MCAsmStreamer::ChangeSection(const MCSection *Section,
const MCExpr *Subsection) {
assert(Section && "Cannot switch to a null section!");
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index 7cf1ffa95e4..11b9c58957e 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -81,6 +81,8 @@ raw_ostream &MCStreamer::GetCommentOS() {
return nulls();
}
+void MCStreamer::emitRawComment(const Twine &T, bool TabPrefix) {}
+
void MCStreamer::generateCompactUnwindEncodings(MCAsmBackend *MAB) {
for (std::vector<MCDwarfFrameInfo>::iterator I = FrameInfos.begin(),
E = FrameInfos.end(); I != E; ++I)
OpenPOWER on IntegriCloud