On Sep 10, 2010, at 2:59 PM, Douglas Gregor wrote:

> 
> On Sep 10, 2010, at 2:15 PM, Sebastian Redl wrote:
> 
>> Author: cornedbee
>> Date: Fri Sep 10 16:15:56 2010
>> New Revision: 113634
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=113634&view=rev
>> Log:
>> Follow Ted's example and hide CXXNoexceptExpr's setters from all but 
>> serialization.
> 
> I've actually been leaning toward removing the setters entirely, then letting 
> serialization poke at the fields directly.

I completely agree.  In the Expr classes, I think that all the ivars should be 
public.  Ones that are fixed at construction time (like the ivars in types) 
should just be marked const:

class FloatingLiteral : public Expr {
public:
  APFloatStorage Num;
  bool IsExact : 1;
  SourceLocation Loc;
private:
  FloatingLiteral(ASTContext &C, const llvm::APFloat &V, bool isexact,
                  QualType Type, SourceLocation L)
    : Expr(FloatingLiteralClass, Type, false, false),
      IsExact(isexact), Loc(L) {
    setValue(C, V);
  }
...

I don't see any reason to have tons of ivars that have trivial getters and 
setters, it's just a lot of redundant code.

I fully admit that this is all my fault :-)

-Chris
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to