diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-16 07:46:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-16 07:46:48 +0000 |
commit | 64c34f1c6f613eef02a7b488f8edadbe7a8650a8 (patch) | |
tree | 6abe3e2ce972d7bb6bed83437451f44e82df4d66 /include/clang/AST/APValue.h | |
parent | a9ab5d6bcf42dfd4f058ee3b1fbb32456c0bdfe8 (diff) | |
download | clang-64c34f1c6f613eef02a7b488f8edadbe7a8650a8.tar.gz clang-64c34f1c6f613eef02a7b488f8edadbe7a8650a8.tar.bz2 clang-64c34f1c6f613eef02a7b488f8edadbe7a8650a8.tar.xz |
add dump and print methods, add operator<< for APValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59411 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/APValue.h')
-rw-r--r-- | include/clang/AST/APValue.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/clang/AST/APValue.h b/include/clang/AST/APValue.h index eac97a613e..48a9bf1a6e 100644 --- a/include/clang/AST/APValue.h +++ b/include/clang/AST/APValue.h @@ -92,6 +92,9 @@ public: bool isComplexFloat() const { return Kind == ComplexFloat; } bool isLValue() const { return Kind == LValue; } + void print(llvm::raw_ostream &OS) const; + void dump() const; + APSInt &getInt() { assert(isInt() && "Invalid accessor"); return *(APSInt*)(void*)Data; @@ -204,6 +207,11 @@ private: } }; +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const APValue &V) { + V.print(OS); + return OS; } + +} // end namespace clang. #endif |