[cfe-commits] r126945 - in /cfe/trunk: include/clang/AST/DeclCXX.h lib/AST/DeclCXX.cpp lib/Sema/SemaDeclCXX.cpp lib/Serialization/ASTReaderDecl.cpp lib/Serialization/ASTWriterDecl.cpp

Douglas Gregor dgregor at apple.com
Thu Mar 3 09:27:22 PST 2011


Thanks!

	- Doug

On Mar 3, 2011, at 8:52 AM, Abramo Bagnara wrote:

> Author: abramo
> Date: Thu Mar  3 10:52:29 2011
> New Revision: 126945
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=126945&view=rev
> Log:
> Removed left brace location from LinkageSpecDecl.
> 
> Modified:
>    cfe/trunk/include/clang/AST/DeclCXX.h
>    cfe/trunk/lib/AST/DeclCXX.cpp
>    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
>    cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
>    cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
> 
> Modified: cfe/trunk/include/clang/AST/DeclCXX.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=126945&r1=126944&r2=126945&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/AST/DeclCXX.h (original)
> +++ cfe/trunk/include/clang/AST/DeclCXX.h Thu Mar  3 10:52:29 2011
> @@ -1711,20 +1711,17 @@
>   /// Language - The language for this linkage specification.
>   LanguageIDs Language;
> 
> -  /// LBraceLoc - The source location for the left brace (if valid).
> -  SourceLocation LBraceLoc;
>   /// RBraceLoc - The source location for the right brace (if valid).
>   SourceLocation RBraceLoc;
> 
>   LinkageSpecDecl(DeclContext *DC, SourceLocation L, LanguageIDs lang,
> -                  SourceLocation LBLoc, SourceLocation RBLoc)
> +                  SourceLocation RBLoc)
>     : Decl(LinkageSpec, DC, L), DeclContext(LinkageSpec),
> -      Language(lang), LBraceLoc(LBLoc), RBraceLoc(RBLoc) { }
> +      Language(lang), RBraceLoc(RBLoc) { }
> 
> public:
>   static LinkageSpecDecl *Create(ASTContext &C, DeclContext *DC,
>                                  SourceLocation L, LanguageIDs Lang,
> -                                 SourceLocation LBraceLoc,
>                                  SourceLocation RBraceLoc = SourceLocation());
> 
>   /// \brief Return the language specified by this linkage specification.
> @@ -1736,9 +1733,7 @@
>   /// \brief Determines whether this linkage specification had braces in
>   /// its syntactic form.
>   bool hasBraces() const { return RBraceLoc.isValid(); }
> -  SourceLocation getLBraceLoc() const { return LBraceLoc; }
>   SourceLocation getRBraceLoc() const { return RBraceLoc; }
> -  void setLBraceLoc(SourceLocation L) { LBraceLoc = L; }
>   void setRBraceLoc(SourceLocation L) { RBraceLoc = L; }
> 
>   SourceLocation getLocEnd() const {
> 
> Modified: cfe/trunk/lib/AST/DeclCXX.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=126945&r1=126944&r2=126945&view=diff
> ==============================================================================
> --- cfe/trunk/lib/AST/DeclCXX.cpp (original)
> +++ cfe/trunk/lib/AST/DeclCXX.cpp Thu Mar  3 10:52:29 2011
> @@ -1271,9 +1271,8 @@
>                                          DeclContext *DC,
>                                          SourceLocation L,
>                                          LanguageIDs Lang,
> -                                         SourceLocation LBraceLoc,
>                                          SourceLocation RBraceLoc) {
> -  return new (C) LinkageSpecDecl(DC, L, Lang, LBraceLoc, RBraceLoc);
> +  return new (C) LinkageSpecDecl(DC, L, Lang, RBraceLoc);
> }
> 
> UsingDirectiveDecl *UsingDirectiveDecl::Create(ASTContext &C, DeclContext *DC,
> 
> Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=126945&r1=126944&r2=126945&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Mar  3 10:52:29 2011
> @@ -6575,8 +6575,7 @@
>   // FIXME: Add all the various semantics of linkage specifications
> 
>   LinkageSpecDecl *D = LinkageSpecDecl::Create(Context, CurContext,
> -                                               LangLoc, Language,
> -                                               LBraceLoc);
> +                                               LangLoc, Language);
>   CurContext->addDecl(D);
>   PushDeclContext(S, D);
>   return D;
> 
> Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=126945&r1=126944&r2=126945&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
> +++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Thu Mar  3 10:52:29 2011
> @@ -721,7 +721,6 @@
> void ASTDeclReader::VisitLinkageSpecDecl(LinkageSpecDecl *D) {
>   VisitDecl(D);
>   D->setLanguage((LinkageSpecDecl::LanguageIDs)Record[Idx++]);
> -  D->setLBraceLoc(ReadSourceLocation(Record, Idx));
>   D->setRBraceLoc(ReadSourceLocation(Record, Idx));
> }
> 
> @@ -1419,7 +1418,7 @@
>   case DECL_LINKAGE_SPEC:
>     D = LinkageSpecDecl::Create(*Context, 0, SourceLocation(),
>                                 (LinkageSpecDecl::LanguageIDs)0,
> -                                SourceLocation(), SourceLocation());
> +                                SourceLocation());
>     break;
>   case DECL_LABEL:
>     D = LabelDecl::Create(*Context, 0, SourceLocation(), 0);
> 
> Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=126945&r1=126944&r2=126945&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)
> +++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Thu Mar  3 10:52:29 2011
> @@ -647,7 +647,6 @@
> void ASTDeclWriter::VisitLinkageSpecDecl(LinkageSpecDecl *D) {
>   VisitDecl(D);
>   Record.push_back(D->getLanguage());
> -  Writer.AddSourceLocation(D->getLBraceLoc(), Record);
>   Writer.AddSourceLocation(D->getRBraceLoc(), Record);
>   Code = serialization::DECL_LINKAGE_SPEC;
> }
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list