aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-07-13 15:34:57 +0000
committerJim Grosbach <grosbach@apple.com>2011-07-13 15:34:57 +0000
commitb7f689bab98777236a2bf600f299d232d246bb61 (patch)
tree73b58b82db39a23ab728b4c75c4a05237e101d7a /lib/MC
parent75f67e0d8daa6201675d7bdec86e7e4f995f969f (diff)
downloadexternal_llvm-b7f689bab98777236a2bf600f299d232d246bb61.zip
external_llvm-b7f689bab98777236a2bf600f299d232d246bb61.tar.gz
external_llvm-b7f689bab98777236a2bf600f299d232d246bb61.tar.bz2
Update MCParsedAsmOperand debug methods.
Update the debug output interface for MCParsedAsmOperand to have a print() method which takes an output stream argument, an << operator which invokes the print method using the given stream, and a dump() method which prints the operand to the dbgs() stream. This makes the interface more consistent with the rest of LLVM, and more convenient to use at the debugger command line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135043 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp2
-rw-r--r--lib/MC/MCParser/MCAsmParser.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index db188f7..0c181f3 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -1194,7 +1194,7 @@ bool AsmParser::ParseStatement() {
for (unsigned i = 0; i != ParsedOperands.size(); ++i) {
if (i != 0)
OS << ", ";
- ParsedOperands[i]->dump(OS);
+ ParsedOperands[i]->print(OS);
}
OS << "]";
diff --git a/lib/MC/MCParser/MCAsmParser.cpp b/lib/MC/MCParser/MCAsmParser.cpp
index 70295ef..4030e41 100644
--- a/lib/MC/MCParser/MCAsmParser.cpp
+++ b/lib/MC/MCParser/MCAsmParser.cpp
@@ -12,6 +12,8 @@
#include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/Support/SourceMgr.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetAsmParser.h"
using namespace llvm;
@@ -41,4 +43,6 @@ bool MCAsmParser::ParseExpression(const MCExpr *&Res) {
return ParseExpression(Res, L);
}
-
+void MCParsedAsmOperand::dump() const {
+ dbgs() << " " << *this;
+}