aboutsummaryrefslogtreecommitdiffstats
path: root/obfuscator
diff options
context:
space:
mode:
Diffstat (limited to 'obfuscator')
-rw-r--r--obfuscator/obfuscator.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/obfuscator/obfuscator.cpp b/obfuscator/obfuscator.cpp
index 4ea03e1..a28df21 100644
--- a/obfuscator/obfuscator.cpp
+++ b/obfuscator/obfuscator.cpp
@@ -519,11 +519,19 @@ public:
}
std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI, StringRef file) override {
+#if __clang_major__ <= 9
CI.getPreprocessor().addPPCallbacks(llvm::make_unique<PPInclusion>(&CI.getSourceManager(), &TheRewriter));
+#elif __clang_major__ >= 10
+ CI.getPreprocessor().addPPCallbacks(std::make_unique<PPInclusion>(&CI.getSourceManager(), &TheRewriter));
+#endif
DiagnosticsEngine &DE = CI.getPreprocessor().getDiagnostics();
DE.setClient(BDCProto, false);
TheRewriter.setSourceMgr(CI.getSourceManager(), CI.getLangOpts());
+#if __clang_major__ <= 9
return llvm::make_unique<MyASTConsumer>(TheRewriter);
+#elif __clang_major__ >= 10
+ return std::make_unique<MyASTConsumer>(TheRewriter);
+#endif
}
private: