[cfe-commits] r62164 - in /cfe/trunk: Driver/ASTConsumers.cpp include/clang/AST/DeclBase.h
Argiris Kirtzidis
akyrtzi at gmail.com
Tue Jan 13 05:11:59 PST 2009
Author: akirtzidis
Date: Tue Jan 13 07:11:58 2009
New Revision: 62164
URL: http://llvm.org/viewvc/llvm-project?rev=62164&view=rev
Log:
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.
Modified:
cfe/trunk/Driver/ASTConsumers.cpp
cfe/trunk/include/clang/AST/DeclBase.h
Modified: cfe/trunk/Driver/ASTConsumers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.cpp?rev=62164&r1=62163&r2=62164&view=diff
==============================================================================
--- cfe/trunk/Driver/ASTConsumers.cpp (original)
+++ cfe/trunk/Driver/ASTConsumers.cpp Tue Jan 13 07:11:58 2009
@@ -575,8 +575,7 @@
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;
Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=62164&r1=62163&r2=62164&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Tue Jan 13 07:11:58 2009
@@ -376,6 +376,10 @@
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;
More information about the cfe-commits
mailing list