summaryrefslogtreecommitdiff
path: root/include/clang/AST
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-17 20:22:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-17 20:22:49 +0000
commit1ce08792766261dcaa25d8215f9d1c2f70d7b7e9 (patch)
tree4022bfb5dc1b2e6f7fc5c337048e370656cc2260 /include/clang/AST
parent2410013d9382b8129702fa3a3bf19a370ae7afc3 (diff)
Notes
Diffstat (limited to 'include/clang/AST')
-rw-r--r--include/clang/AST/Decl.h10
-rw-r--r--include/clang/AST/DeclBase.h14
2 files changed, 14 insertions, 10 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index facef8e55f7aa..4f8042ac92918 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -301,16 +301,6 @@ public:
using Decl::isModulePrivate;
using Decl::setModulePrivate;
- /// \brief Determine whether this declaration is hidden from name lookup.
- bool isHidden() const { return Hidden; }
-
- /// \brief Set whether this declaration is hidden from name lookup.
- void setHidden(bool Hide) {
- assert((!Hide || isFromASTFile() || hasLocalOwningModuleStorage()) &&
- "declaration with no owning module can't be hidden");
- Hidden = Hide;
- }
-
/// \brief Determine whether this declaration is a C++ class member.
bool isCXXClassMember() const {
const DeclContext *DC = getDeclContext();
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index 15ac11a5a7770..08879b36cce54 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -706,6 +706,20 @@ public:
reinterpret_cast<Module **>(this)[-1] = M;
}
+ Module *getOwningModule() const {
+ return isFromASTFile() ? getImportedOwningModule() : getLocalOwningModule();
+ }
+
+ /// \brief Determine whether this declaration is hidden from name lookup.
+ bool isHidden() const { return Hidden; }
+
+ /// \brief Set whether this declaration is hidden from name lookup.
+ void setHidden(bool Hide) {
+ assert((!Hide || isFromASTFile() || hasLocalOwningModuleStorage()) &&
+ "declaration with no owning module can't be hidden");
+ Hidden = Hide;
+ }
+
unsigned getIdentifierNamespace() const {
return IdentifierNamespace;
}