diff options
author | Steve Naroff <snaroff@apple.com> | 2009-07-14 14:58:18 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-07-14 14:58:18 +0000 |
commit | ea218b8e8f9ba82d1c76bcb7e86d121a5f65ebed (patch) | |
tree | f99a9a206cec20abda08741b4f3e77499238fdb6 /include/clang/AST/Decl.h | |
parent | 1a75ee270941dd8b5c7fdd23dffb5e81a0fd7290 (diff) |
Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.
Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/Decl.h')
-rw-r--r-- | include/clang/AST/Decl.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 66099217b0..a5c3ea0680 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -1137,16 +1137,19 @@ class FieldDecl : public ValueDecl { // FIXME: This can be packed into the bitfields in Decl. bool Mutable : 1; Expr *BitWidth; + SourceLocation TypeSpecStartLoc; protected: FieldDecl(Kind DK, DeclContext *DC, SourceLocation L, - IdentifierInfo *Id, QualType T, Expr *BW, bool Mutable) - : ValueDecl(DK, DC, L, Id, T), Mutable(Mutable), BitWidth(BW) - { } + IdentifierInfo *Id, QualType T, Expr *BW, bool Mutable, + SourceLocation TSSL = SourceLocation()) + : ValueDecl(DK, DC, L, Id, T), Mutable(Mutable), BitWidth(BW), + TypeSpecStartLoc(TSSL) { } public: static FieldDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, Expr *BW, - bool Mutable); + bool Mutable, + SourceLocation TypeSpecStartLoc = SourceLocation()); /// isMutable - Determines whether this field is mutable (C++ only). bool isMutable() const { return Mutable; } @@ -1154,6 +1157,9 @@ public: /// \brief Set whether this field is mutable (C++ only). void setMutable(bool M) { Mutable = M; } + SourceLocation getTypeSpecStartLoc() const { return TypeSpecStartLoc; } + void setTypeSpecStartLoc(SourceLocation TSSL) { TypeSpecStartLoc = TSSL; } + /// isBitfield - Determines whether this field is a bitfield. bool isBitField() const { return BitWidth != NULL; } |