[cfe-commits] PATCH: Add parens source locations to several AST nodes

Douglas Gregor dgregor at apple.com
Wed Oct 20 20:46:25 PDT 2010


On Oct 20, 2010, at 6:56 PM, Chandler Carruth wrote:

> Hello,
> 
> This patch was originally prepared by Samuel Benzaquen, but I'm taking it over. The style is somewhat all over the place, but is trying to be consistent with the surrounding code. Let me know if it should really just move in one direction or another (such as, using a SourceRange versus storing the left and right parentheses).

I don't have a strong preference either way. However, we are trying to move away from having setters in the AST:

@@ -1085,6 +1091,11 @@ public:
   void setStartLoc(SourceLocation L) { StartLoc = L; }
   SourceLocation getEndLoc() const { return EndLoc; }
   void setEndLoc(SourceLocation L) { EndLoc = L; }
+
+  SourceLocation getConstructorLParen() const { return ConstructorLParen; }
+  void setConstructorLParen(SourceLocation L) { ConstructorLParen = L; }
+  SourceLocation getConstructorRParen() const { return ConstructorRParen; }
+  void setConstructorRParen(SourceLocation L) { ConstructorRParen = L; }
   
Instead, make ASTReaderDecl a friend and let is set ConstructorLParen and ConstructorRParen directly.

> Also, what's a good way to test this?

I don't know of any :(

	- Doug





More information about the cfe-commits mailing list