aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Driver/ASTConsumers.cpp3
-rw-r--r--include/clang/AST/DeclBase.h4
2 files changed, 5 insertions, 2 deletions
diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp
index d16b494888..9487a05072 100644
--- a/Driver/ASTConsumers.cpp
+++ b/Driver/ASTConsumers.cpp
@@ -575,8 +575,7 @@ public:
void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
unsigned Indentation) {
// Print DeclContext name.
- Decl::Kind DK = DeclContext::KindTrait<DeclContext>::getKind(DC);
- switch (DK) {
+ switch (DC->getDeclKind()) {
case Decl::TranslationUnit:
Out << "[translation unit] " << DC;
break;
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index b506436e26..d11c78d6a0 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -376,6 +376,10 @@ protected:
public:
~DeclContext();
+ Decl::Kind getDeclKind() const {
+ return DeclKind;
+ }
+
/// getParent - Returns the containing DeclContext if this is a ScopedDecl,
/// else returns NULL.
const DeclContext *getParent() const;