aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/DeclBase.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/DeclBase.h')
-rw-r--r--include/clang/AST/DeclBase.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index 699950ef6b..0aa60ce978 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -198,7 +198,7 @@ private:
return DeclCtx.get<DeclContext*>();
}
- /// Loc - The location of this decl.
+ /// Loc - The location that this decl.
SourceLocation Loc;
/// DeclKind - This indicates which class this is.
@@ -316,7 +316,12 @@ public:
void swapAttrs(Decl *D);
void dropAttrs();
- void addAttr(Attr *A);
+ void addAttr(Attr *A) {
+ if (hasAttrs())
+ getAttrs().push_back(A);
+ else
+ setAttrs(AttrVec(1, A));
+ }
typedef AttrVec::const_iterator attr_iterator;