summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/plugin.hxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-08-03 14:56:33 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-08-03 23:18:58 +0200
commit5c7e838714f5d071c4882115cef9c843fb603287 (patch)
tree8373a8b33fef444b1840c43adb172c30e8417935 /compilerplugins/clang/plugin.hxx
parente0018be102edd6e376e0622e0a9384176d2f119c (diff)
Revert "Adapt to changed clang::ASTContext::getParents behavior on Clang 11 trunk"
This reverts commit 09aa5a9be8b9b3c88cf25b85e0eda28c5ef19aa4, now that <https://github.com/llvm/llvm-project/commit/ 551092bc3dfb86f1e11a55f3bee0c8ee1be6fdd6> "Revert AST Matchers default to AsIs mode" reverted the Clang commit that prompted this compilerplugins change. Change-Id: I75c8b4cb2894cd67a791db460f2886a783856c73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100026 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang/plugin.hxx')
-rw-r--r--compilerplugins/clang/plugin.hxx15
1 files changed, 2 insertions, 13 deletions
diff --git a/compilerplugins/clang/plugin.hxx b/compilerplugins/clang/plugin.hxx
index 66d22adf97d6..577e8998b187 100644
--- a/compilerplugins/clang/plugin.hxx
+++ b/compilerplugins/clang/plugin.hxx
@@ -18,8 +18,6 @@
#include <clang/Basic/SourceManager.h>
#include <clang/Frontend/CompilerInstance.h>
#include <clang/Lex/Preprocessor.h>
-
-#include <memory>
#include <unordered_map>
#include <vector>
@@ -28,10 +26,6 @@
#include "compat.hxx"
#include "pluginhandler.hxx"
-#if CLANG_VERSION >= 110000
-#include "clang/AST/ParentMapContext.h"
-#endif
-
using namespace clang;
using namespace llvm;
@@ -84,11 +78,8 @@ protected:
Returns the parent of the given AST node. Clang's internal AST representation doesn't provide this information,
it can only provide children, but getting the parent is often useful for inspecting a part of the AST.
*/
- compat::DynTypedNodeList getParents(Decl const & decl);
- compat::DynTypedNodeList getParents(Stmt const & stmt);
const Stmt* getParentStmt( const Stmt* stmt );
Stmt* getParentStmt( Stmt* stmt );
- const Decl* getFunctionDeclContext(const Stmt* stmt);
const FunctionDecl* getParentFunctionDecl( const Stmt* stmt );
/**
@@ -121,10 +112,6 @@ private:
enum { isRewriter = false };
const char* name;
-
-#if CLANG_VERSION >= 110000
- std::unique_ptr<ParentMapContext> parentMapContext_;
-#endif
};
template<typename Derived>
@@ -321,6 +308,8 @@ bool hasExternalLinkage(VarDecl const * decl);
bool isSmartPointerType(const Expr*);
+const Decl* getFunctionDeclContext(ASTContext& context, const Stmt* stmt);
+
} // namespace
#endif // COMPILEPLUGIN_H