]> granicus.if.org Git - clang/commitdiff
DeclContext::KindTrait was not meant to be used outside of DeclContext::CastTo (cause...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 13 Jan 2009 13:11:58 +0000 (13:11 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 13 Jan 2009 13:11:58 +0000 (13:11 +0000)
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

Driver/ASTConsumers.cpp
include/clang/AST/DeclBase.h

index d16b49488842a721b9fae8958d4074d0450ca284..9487a05072937890a68996a103ec0cbc378d96b5 100644 (file)
@@ -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;
index b506436e26f289d39cae2c6ea995ddefb7b9a2c6..d11c78d6a05ce80f8b3063b341fcabe27f9fb1cf 100644 (file)
@@ -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;