[llvm-commits] [llvm] r110792 - /llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Daniel Dunbar
daniel at zuster.org
Tue Aug 10 23:37:12 PDT 2010
Author: ddunbar
Date: Wed Aug 11 01:37:12 2010
New Revision: 110792
URL: http://llvm.org/viewvc/llvm-project?rev=110792&view=rev
Log:
MC/ARM: Fill in ARMOperand::dump a bit.
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=110792&r1=110791&r2=110792&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Wed Aug 11 01:37:12 2010
@@ -19,6 +19,7 @@
#include "llvm/Target/TargetAsmParser.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/SourceMgr.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
@@ -234,7 +235,7 @@
addExpr(Inst, getImm());
}
- virtual void dump(raw_ostream &OS) const {}
+ virtual void dump(raw_ostream &OS) const;
static void CreateToken(OwningPtr<ARMOperand> &Op, StringRef Str,
SMLoc S) {
@@ -295,6 +296,25 @@
} // end anonymous namespace.
+void ARMOperand::dump(raw_ostream &OS) const {
+ switch (Kind) {
+ case CondCode:
+ OS << ARMCondCodeToString(getCondCode());
+ break;
+ case Immediate:
+ getImm()->print(OS);
+ break;
+ case Memory:
+ OS << "<memory>";
+ break;
+ case Register:
+ OS << "<register " << getReg() << ">";
+ break;
+ case Token:
+ OS << "'" << getToken() << "'";
+ break;
+ }
+}
/// @name Auto-generated Match Functions
/// {
More information about the llvm-commits
mailing list