Store attributes in a global hash map instead.

llvm-svn: 47193
This commit is contained in:
Anders Carlsson 2008-02-15 23:57:38 +00:00
parent e1f41fc68e
commit 8321a155a5
2 changed files with 11 additions and 1 deletions

View File

@ -14,6 +14,8 @@
#ifndef LLVM_CLANG_AST_ATTR_H
#define LLVM_CLANG_AST_ATTR_H
#include <assert.h>
namespace clang {
/// Attr - This represents one attribute.

View File

@ -14,6 +14,7 @@
#ifndef LLVM_CLANG_AST_DECL_H
#define LLVM_CLANG_AST_DECL_H
#include "clang/AST/Attr.h"
#include "clang/AST/Type.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/APSInt.h"
@ -24,7 +25,6 @@ class Decl;
}
namespace clang {
class Attr;
class Expr;
class Stmt;
class StringLiteral;
@ -138,6 +138,14 @@ public:
void addAttr(Attr *attr);
const Attr *getAttrs() const;
template<typename T> T *getAttr() {
for (Attr *attr = getAttrs(); attr; attr = attr->getNext())
if (isa<T>(attr))
return cast<T>(attr);
return 0;
}
/// setInvalidDecl - Indicates the Decl had a semantic error. This
/// allows for graceful error recovery.
void setInvalidDecl() { InvalidDecl = 1; }