]> granicus.if.org Git - clang/commitdiff
Removed left brace location from LinkageSpecDecl.
authorAbramo Bagnara <abramo.bagnara@gmail.com>
Thu, 3 Mar 2011 16:52:29 +0000 (16:52 +0000)
committerAbramo Bagnara <abramo.bagnara@gmail.com>
Thu, 3 Mar 2011 16:52:29 +0000 (16:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126945 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclCXX.h
lib/AST/DeclCXX.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Serialization/ASTReaderDecl.cpp
lib/Serialization/ASTWriterDecl.cpp

index 499f3c822ccd65b1c2f7006374ca39484648323b..302aac739f9493ab50c059c12e16bf6894bb3f17 100644 (file)
@@ -1711,20 +1711,17 @@ private:
   /// 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 @@ public:
   /// \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 {
index 8bd0ae7611ded10b6f179db8ac85c77886600beb..b6cba0a04c8f5d192043776fda889e9af9498d49 100644 (file)
@@ -1271,9 +1271,8 @@ LinkageSpecDecl *LinkageSpecDecl::Create(ASTContext &C,
                                          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,
index 82cf031c698b67d907ec0b0badbc6c4a2329d862..45105a14ec4418aa72622a67c8a6b51dc92ecd23 100644 (file)
@@ -6575,8 +6575,7 @@ Decl *Sema::ActOnStartLinkageSpecification(Scope *S, SourceLocation ExternLoc,
   // 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;
index 8f1d9a53956a687c900e0c1fa0087b8e16027ebe..2b690310fe2652b8a814b8b826df46b2933f302a 100644 (file)
@@ -721,7 +721,6 @@ void ASTDeclReader::VisitBlockDecl(BlockDecl *BD) {
 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 @@ Decl *ASTReader::ReadDeclRecord(unsigned Index, DeclID ID) {
   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);
index bfd343a7d490e01939231394bd32f06d09ed32a7..7c0c15cb0021117146276181dc03415e3572743e 100644 (file)
@@ -647,7 +647,6 @@ void ASTDeclWriter::VisitBlockDecl(BlockDecl *D) {
 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;
 }