[cfe-dev] CharacterLiteral get/set location.

Chris Lattner clattner at apple.com
Mon Aug 24 09:43:26 PDT 2009


On Aug 24, 2009, at 5:46 AM, Enea Zaffanella wrote:

> Class CharacterLiteral has the following public methods, which are  
> inconsistently named:
>
>  SourceLocation getLoc() const { return Loc; }
>  void setLocation(SourceLocation Location) { Loc = Location; }
>
> The attached patch makes these names consistent.

Looks great, please attach the patch as an attachment (instead of  
inline) to make it easier to apply. Thanks!

-Chris

>
> Cheers,
> Enea Zaffanella.
> Index: include/clang/AST/Expr.h
> ===================================================================
> --- include/clang/AST/Expr.h	(revision 79913)
> +++ include/clang/AST/Expr.h	(working copy)
> @@ -444,7 +444,7 @@
>   /// \brief Construct an empty character literal.
>   CharacterLiteral(EmptyShell Empty) : Expr(CharacterLiteralClass,  
> Empty) { }
>
> -  SourceLocation getLoc() const { return Loc; }
> +  SourceLocation getLocation() const { return Loc; }
>   bool isWide() const { return IsWide; }
>
>   virtual SourceRange getSourceRange() const { return  
> SourceRange(Loc); }
> Index: lib/Frontend/PCHWriterStmt.cpp
> ===================================================================
> --- lib/Frontend/PCHWriterStmt.cpp	(revision 79913)
> +++ lib/Frontend/PCHWriterStmt.cpp	(working copy)
> @@ -355,7 +355,7 @@
> void PCHStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
>   VisitExpr(E);
>   Record.push_back(E->getValue());
> -  Writer.AddSourceLocation(E->getLoc(), Record);
> +  Writer.AddSourceLocation(E->getLocation(), Record);
>   Record.push_back(E->isWide());
>   Code = pch::EXPR_CHARACTER_LITERAL;
> }
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list