diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-10-29 23:55:17 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-10-29 23:55:17 +0000 |
commit | 5be59eace58e5a92bb851c4885f9cea7236ac30f (patch) | |
tree | 1b5a0f3c6afa3db0d07e5a0790fd9b63d7216022 /lib/Target | |
parent | ef5784ef9b9cdfbc9819a96440c6873196eade76 (diff) | |
download | external_llvm-5be59eace58e5a92bb851c4885f9cea7236ac30f.zip external_llvm-5be59eace58e5a92bb851c4885f9cea7236ac30f.tar.gz external_llvm-5be59eace58e5a92bb851c4885f9cea7236ac30f.tar.bz2 |
Add debugging support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/ARMConstantPoolValue.cpp | 11 | ||||
-rw-r--r-- | lib/Target/ARM/ARMConstantPoolValue.h | 16 |
2 files changed, 26 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMConstantPoolValue.cpp b/lib/Target/ARM/ARMConstantPoolValue.cpp index 04db164..002ebf1 100644 --- a/lib/Target/ARM/ARMConstantPoolValue.cpp +++ b/lib/Target/ARM/ARMConstantPoolValue.cpp @@ -15,7 +15,9 @@ #include "llvm/ADT/FoldingSet.h" #include "llvm/GlobalValue.h" #include "llvm/Type.h" +#include "llvm/Support/Streams.h" #include "llvm/Support/raw_ostream.h" +#include <ostream> using namespace llvm; ARMConstantPoolValue::ARMConstantPoolValue(GlobalValue *gv, unsigned id, @@ -73,6 +75,15 @@ ARMConstantPoolValue::AddSelectionDAGCSEId(FoldingSetNodeID &ID) { ID.AddInteger(PCAdjust); } +void ARMConstantPoolValue::dump() const { + cerr << " " << *this; +} + +void ARMConstantPoolValue::print(std::ostream &O) const { + raw_os_ostream RawOS(O); + print(RawOS); +} + void ARMConstantPoolValue::print(raw_ostream &O) const { if (GV) O << GV->getName(); diff --git a/lib/Target/ARM/ARMConstantPoolValue.h b/lib/Target/ARM/ARMConstantPoolValue.h index caf8d54..b5f8325 100644 --- a/lib/Target/ARM/ARMConstantPoolValue.h +++ b/lib/Target/ARM/ARMConstantPoolValue.h @@ -69,9 +69,23 @@ public: virtual void AddSelectionDAGCSEId(FoldingSetNodeID &ID); - virtual void print(raw_ostream &O) const; + void print(std::ostream *O) const { if (O) print(*O); } + void print(std::ostream &O) const; + void print(raw_ostream *O) const { if (O) print(*O); } + void print(raw_ostream &O) const; + void dump() const; }; + + inline std::ostream &operator<<(std::ostream &O, const ARMConstantPoolValue &V) { + V.print(O); + return O; +} +inline raw_ostream &operator<<(raw_ostream &O, const ARMConstantPoolValue &V) { + V.print(O); + return O; } +} // End llvm namespace + #endif |