aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index fc19e61a09..41ba1f1df9 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -22,6 +22,8 @@
#include "clang/AST/PrettyPrinter.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/IdentifierTable.h"
+#include "clang/Parse/DeclSpec.h"
+#include "llvm/Support/ErrorHandling.h"
#include <vector>
using namespace clang;
@@ -708,6 +710,16 @@ TagDecl* TagDecl::getDefinition(ASTContext& C) const {
return 0;
}
+TagDecl::TagKind TagDecl::getTagKindForTypeSpec(unsigned TypeSpec) {
+ switch (TypeSpec) {
+ default: llvm::llvm_unreachable("unexpected type specifier");
+ case DeclSpec::TST_struct: return TK_struct;
+ case DeclSpec::TST_class: return TK_class;
+ case DeclSpec::TST_union: return TK_union;
+ case DeclSpec::TST_enum: return TK_enum;
+ }
+}
+
//===----------------------------------------------------------------------===//
// RecordDecl Implementation
//===----------------------------------------------------------------------===//