aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-01-13 13:11:58 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-01-13 13:11:58 +0000
commit9b9ca01ff3136a7539dc08a4c4e1a3dd8c8d3a7d (patch)
tree5114e872a41ff439b0e3defbf3ae922100d0c67c
parent18a7c8cc40bd5b066ba1eeba3ea369ac079ccb00 (diff)
DeclContext::KindTrait was not meant to be used outside of DeclContext::CastTo (causes compilation error on MSVC).
Add DeclContext::getDeclKind() and use that instead of DeclContext::KindTrait. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62164 91177308-0d34-0410-b5e6-96231b3b80d8
-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;