summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.h
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-10-15 17:51:08 -0700
committerRichard Smith <richard@metafoo.co.uk>2019-10-29 15:29:44 -0700
commitdbcb690fb78193e99452748c4af72eccb262e4e2 (patch)
tree4672493e8bb64edd651192515ad209501b058456 /clang/lib/CodeGen/CGDebugInfo.h
parenta69bbe02a2352271e8b14542073f177e24c499c1 (diff)
downloadbcm5719-llvm-dbcb690fb78193e99452748c4af72eccb262e4e2.tar.gz
bcm5719-llvm-dbcb690fb78193e99452748c4af72eccb262e4e2.zip
Replace std::function in PrintingPolicy with a callbacks object.
This makes PrintingPolicy significantly more lightweight and provides groundwork for more printing customization hooks.
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.h')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 7edbea86633..5e26af4a4f7 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -89,6 +89,18 @@ class CGDebugInfo {
/// represented by instantiated Metadata nodes.
llvm::SmallDenseMap<QualType, llvm::Metadata *> SizeExprCache;
+ /// Callbacks to use when printing names and types.
+ class PrintingCallbacks final : public clang::PrintingCallbacks {
+ const CGDebugInfo &Self;
+
+ public:
+ PrintingCallbacks(const CGDebugInfo &Self) : Self(Self) {}
+ std::string remapPath(StringRef Path) const override {
+ return Self.remapDIPath(Path);
+ }
+ };
+ PrintingCallbacks PrintCB = {*this};
+
struct ObjCInterfaceCacheEntry {
const ObjCInterfaceType *Type;
llvm::DIType *Decl;
OpenPOWER on IntegriCloud