From bbaa88a8485565cd6ef66255e640c8d515eb58ea Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 11 Aug 2010 06:37:12 +0000 Subject: [PATCH] MC/ARM: Fill in ARMOperand::dump a bit. llvm-svn: 110792 --- lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 2f6ac8d86d4..fec3c828766 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -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 @@ public: addExpr(Inst, getImm()); } - virtual void dump(raw_ostream &OS) const {} + virtual void dump(raw_ostream &OS) const; static void CreateToken(OwningPtr &Op, StringRef Str, SMLoc S) { @@ -295,6 +296,25 @@ public: } // 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 << ""; + break; + case Register: + OS << ""; + break; + case Token: + OS << "'" << getToken() << "'"; + break; + } +} /// @name Auto-generated Match Functions /// {