diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2017-12-21 21:42:42 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2017-12-21 21:42:42 +0000 |
commit | fcc28fd8cc8139cf1e4763459447880768579d8e (patch) | |
tree | cca36e3b5227643ab50d39e42cfd545c71497884 /include | |
parent | c98d5adb4e64815effa4855a3804cc1a9a7d2958 (diff) |
Re-commit r321223, which adds a printing policy to the ASTDumper.
This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms.
Fixes the -Wreorder issue and fixes the ast-dump-color.cpp test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321310 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/Type.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 7247838947..882878bb7e 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -976,16 +976,14 @@ public: return LHS.Value != RHS.Value; } - std::string getAsString() const { - return getAsString(split()); + static std::string getAsString(SplitQualType split, + const PrintingPolicy &Policy) { + return getAsString(split.Ty, split.Quals, Policy); } + static std::string getAsString(const Type *ty, Qualifiers qs, + const PrintingPolicy &Policy); - static std::string getAsString(SplitQualType split) { - return getAsString(split.Ty, split.Quals); - } - - static std::string getAsString(const Type *ty, Qualifiers qs); - + std::string getAsString() const; std::string getAsString(const PrintingPolicy &Policy) const; void print(raw_ostream &OS, const PrintingPolicy &Policy, |