[cfe-commits] r79584 - in /cfe/trunk: include/clang/AST/Decl.h include/clang/AST/DeclTemplate.h lib/AST/Decl.cpp lib/AST/DeclTemplate.cpp lib/CodeGen/CGBlocks.cpp lib/Frontend/PCHReaderDecl.cpp lib/Frontend/PCHWriterDecl.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaExprCXX.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Thu Aug 20 17:31:55 PDT 2009


Author: akirtzidis
Date: Thu Aug 20 19:31:54 2009
New Revision: 79584

URL: http://llvm.org/viewvc/llvm-project?rev=79584&view=rev
Log:
Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.

Modified:
    cfe/trunk/include/clang/AST/Decl.h
    cfe/trunk/include/clang/AST/DeclTemplate.h
    cfe/trunk/lib/AST/Decl.cpp
    cfe/trunk/lib/AST/DeclTemplate.cpp
    cfe/trunk/lib/CodeGen/CGBlocks.cpp
    cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
    cfe/trunk/lib/Frontend/PCHWriterDecl.cpp
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    cfe/trunk/lib/Sema/SemaExprCXX.cpp
    cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp

Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=79584&r1=79583&r2=79584&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Thu Aug 20 19:31:54 2009
@@ -236,7 +236,9 @@
 public:
   DeclaratorInfo *getDeclaratorInfo() const { return DeclInfo; }
   void setDeclaratorInfo(DeclaratorInfo *DInfo) { DeclInfo = DInfo; }
-  
+
+  SourceLocation getTypeSpecStartLoc() const;
+
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) {
     return D->getKind() >= DeclaratorFirst && D->getKind() <= DeclaratorLast;
@@ -299,16 +301,13 @@
   /// condition, e.g., if (int x = foo()) { ... }.
   bool DeclaredInCondition : 1;
 
-  // Move to DeclGroup when it is implemented.
-  SourceLocation TypeSpecStartLoc;
   friend class StmtIteratorBase;
 protected:
   VarDecl(Kind DK, DeclContext *DC, SourceLocation L, IdentifierInfo *Id,
-          QualType T, DeclaratorInfo *DInfo,
-          StorageClass SC, SourceLocation TSSL = SourceLocation())
+          QualType T, DeclaratorInfo *DInfo, StorageClass SC)
     : DeclaratorDecl(DK, DC, L, Id, T, DInfo), Init(),
       ThreadSpecified(false), HasCXXDirectInit(false),
-      DeclaredInCondition(false), TypeSpecStartLoc(TSSL) { 
+      DeclaredInCondition(false) { 
     SClass = SC; 
   }
 
@@ -326,8 +325,7 @@
 
   static VarDecl *Create(ASTContext &C, DeclContext *DC,
                          SourceLocation L, IdentifierInfo *Id,
-                         QualType T, DeclaratorInfo *DInfo, StorageClass S,
-                         SourceLocation TypeSpecStartLoc = SourceLocation());
+                         QualType T, DeclaratorInfo *DInfo, StorageClass S);
 
   virtual ~VarDecl();
   virtual void Destroy(ASTContext& C);
@@ -337,12 +335,6 @@
   
   virtual SourceRange getSourceRange() const;
 
-  //FIXME: Use DeclaratorInfo for this.
-  SourceLocation getTypeSpecStartLoc() const { return TypeSpecStartLoc; }
-  void setTypeSpecStartLoc(SourceLocation SL) {
-    TypeSpecStartLoc = SL;
-  }
-
   const Expr *getInit() const { 
     if (Init.isNull())
       return 0;
@@ -731,9 +723,6 @@
   bool IsTrivial : 1; // sunk from CXXMethodDecl
   bool IsCopyAssignment : 1;  // sunk from CXXMethodDecl
   bool HasImplicitReturnZero : 1;
-
-  // Move to DeclGroup when it is implemented.
-  SourceLocation TypeSpecStartLoc;
   
   /// \brief End part of this FunctionDecl's source range.
   ///
@@ -763,8 +752,7 @@
 protected:
   FunctionDecl(Kind DK, DeclContext *DC, SourceLocation L,
                DeclarationName N, QualType T, DeclaratorInfo *DInfo,
-               StorageClass S, bool isInline,
-               SourceLocation TSSL = SourceLocation())
+               StorageClass S, bool isInline)
     : DeclaratorDecl(DK, DC, L, N, T, DInfo), 
       DeclContext(DK),
       ParamInfo(0), Body(),
@@ -773,7 +761,7 @@
       HasWrittenPrototype(true), IsDeleted(false), IsTrivial(false),
       IsCopyAssignment(false),
       HasImplicitReturnZero(false),
-      TypeSpecStartLoc(TSSL), EndRangeLoc(L), TemplateOrSpecialization() {}
+      EndRangeLoc(L), TemplateOrSpecialization() {}
 
   virtual ~FunctionDecl() {}
   virtual void Destroy(ASTContext& C);
@@ -794,8 +782,7 @@
                               DeclarationName N, QualType T,
                               DeclaratorInfo *DInfo,
                               StorageClass S = None, bool isInline = false,
-                              bool hasWrittenPrototype = true,
-                              SourceLocation TSStartLoc = SourceLocation());
+                              bool hasWrittenPrototype = true);
 
   virtual SourceRange getSourceRange() const {
     return SourceRange(getLocation(), EndRangeLoc);
@@ -803,10 +790,6 @@
   void setLocEnd(SourceLocation E) {
     EndRangeLoc = E;
   }
-  
-  //FIXME: Use DeclaratorInfo for this.
-  SourceLocation getTypeSpecStartLoc() const { return TypeSpecStartLoc; }
-  void setTypeSpecStartLoc(SourceLocation TS) { TypeSpecStartLoc = TS; }
 
   /// getBody - Retrieve the body (definition) of the function. The
   /// function body might be in any of the (re-)declarations of this
@@ -1091,20 +1074,17 @@
   // FIXME: This can be packed into the bitfields in Decl.
   bool Mutable : 1;
   Expr *BitWidth;
-  SourceLocation TypeSpecStartLoc;
 protected:
   FieldDecl(Kind DK, DeclContext *DC, SourceLocation L, 
             IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
-            Expr *BW, bool Mutable, SourceLocation TSSL = SourceLocation())
-    : DeclaratorDecl(DK, DC, L, Id, T, DInfo), Mutable(Mutable), BitWidth(BW),
-      TypeSpecStartLoc(TSSL) { }
+            Expr *BW, bool Mutable)
+    : DeclaratorDecl(DK, DC, L, Id, T, DInfo), Mutable(Mutable), BitWidth(BW)
+      { }
 
 public:
   static FieldDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L, 
                            IdentifierInfo *Id, QualType T,
-                           DeclaratorInfo *DInfo, Expr *BW,
-                           bool Mutable,
-                           SourceLocation TypeSpecStartLoc = SourceLocation());
+                           DeclaratorInfo *DInfo, Expr *BW, bool Mutable);
 
   /// isMutable - Determines whether this field is mutable (C++ only).
   bool isMutable() const { return Mutable; }
@@ -1112,10 +1092,6 @@
   /// \brief Set whether this field is mutable (C++ only).
   void setMutable(bool M) { Mutable = M; }
 
-  //FIXME: Use DeclaratorInfo for this.
-  SourceLocation getTypeSpecStartLoc() const { return TypeSpecStartLoc; }
-  void setTypeSpecStartLoc(SourceLocation TSSL) { TypeSpecStartLoc = TSSL; }
-
   /// isBitfield - Determines whether this field is a bitfield.
   bool isBitField() const { return BitWidth != NULL; }
 

Modified: cfe/trunk/include/clang/AST/DeclTemplate.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclTemplate.h?rev=79584&r1=79583&r2=79584&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclTemplate.h (original)
+++ cfe/trunk/include/clang/AST/DeclTemplate.h Thu Aug 20 19:31:54 2009
@@ -747,17 +747,15 @@
 
   NonTypeTemplateParmDecl(DeclContext *DC, SourceLocation L, unsigned D,
                           unsigned P, IdentifierInfo *Id, QualType T,
-                          DeclaratorInfo *DInfo,
-                          SourceLocation TSSL = SourceLocation())
-    : VarDecl(NonTypeTemplateParm, DC, L, Id, T, DInfo, VarDecl::None, TSSL),
+                          DeclaratorInfo *DInfo)
+    : VarDecl(NonTypeTemplateParm, DC, L, Id, T, DInfo, VarDecl::None),
       TemplateParmPosition(D, P), DefaultArgument(0) 
   { }
 
 public:
   static NonTypeTemplateParmDecl *
   Create(ASTContext &C, DeclContext *DC, SourceLocation L, unsigned D,
-         unsigned P, IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
-         SourceLocation TypeSpecStartLoc = SourceLocation());
+         unsigned P, IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo);
 
   using TemplateParmPosition::getDepth;
   using TemplateParmPosition::getPosition;

Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=79584&r1=79583&r2=79584&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Thu Aug 20 19:31:54 2009
@@ -140,11 +140,9 @@
                                    DeclarationName N, QualType T,
                                    DeclaratorInfo *DInfo,
                                    StorageClass S, bool isInline, 
-                                   bool hasWrittenPrototype,
-                                   SourceLocation TypeSpecStartLoc) {
+                                   bool hasWrittenPrototype) {
   FunctionDecl *New 
-    = new (C) FunctionDecl(Function, DC, L, N, T, DInfo, S, isInline, 
-                           TypeSpecStartLoc);
+    = new (C) FunctionDecl(Function, DC, L, N, T, DInfo, S, isInline);
   New->HasWrittenPrototype = hasWrittenPrototype;
   return New;
 }
@@ -155,9 +153,8 @@
 
 FieldDecl *FieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
                              IdentifierInfo *Id, QualType T,
-                             DeclaratorInfo *DInfo, Expr *BW,
-                             bool Mutable, SourceLocation TSSL) {
-  return new (C) FieldDecl(Decl::Field, DC, L, Id, T, DInfo, BW, Mutable, TSSL);
+                             DeclaratorInfo *DInfo, Expr *BW, bool Mutable) {
+  return new (C) FieldDecl(Decl::Field, DC, L, Id, T, DInfo, BW, Mutable);
 }
 
 bool FieldDecl::isAnonymousStructOrUnion() const {
@@ -317,13 +314,23 @@
 }
 
 //===----------------------------------------------------------------------===//
+// DeclaratorDecl Implementation
+//===----------------------------------------------------------------------===//
+
+SourceLocation DeclaratorDecl::getTypeSpecStartLoc() const {
+  if (DeclInfo)
+    return DeclInfo->getTypeLoc().getTypeSpecRange().getBegin();
+  return SourceLocation();
+}
+
+//===----------------------------------------------------------------------===//
 // VarDecl Implementation
 //===----------------------------------------------------------------------===//
 
 VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
                          IdentifierInfo *Id, QualType T, DeclaratorInfo *DInfo,
-                         StorageClass S, SourceLocation TypeSpecStartLoc) {
-  return new (C) VarDecl(Var, DC, L, Id, T, DInfo, S, TypeSpecStartLoc);
+                         StorageClass S) {
+  return new (C) VarDecl(Var, DC, L, Id, T, DInfo, S);
 }
 
 void VarDecl::Destroy(ASTContext& C) {

Modified: cfe/trunk/lib/AST/DeclTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclTemplate.cpp?rev=79584&r1=79583&r2=79584&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclTemplate.cpp (original)
+++ cfe/trunk/lib/AST/DeclTemplate.cpp Thu Aug 20 19:31:54 2009
@@ -236,10 +236,8 @@
 NonTypeTemplateParmDecl::Create(ASTContext &C, DeclContext *DC,
                                 SourceLocation L, unsigned D, unsigned P,
                                 IdentifierInfo *Id, QualType T,
-                                DeclaratorInfo *DInfo,
-                                SourceLocation TypeSpecStartLoc) {
-  return new (C) NonTypeTemplateParmDecl(DC, L, D, P, Id, T, DInfo,
-                                         TypeSpecStartLoc);
+                                DeclaratorInfo *DInfo) {
+  return new (C) NonTypeTemplateParmDecl(DC, L, D, P, Id, T, DInfo);
 }
 
 SourceLocation NonTypeTemplateParmDecl::getDefaultArgumentLoc() const {

Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=79584&r1=79583&r2=79584&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Thu Aug 20 19:31:54 2009
@@ -694,8 +694,7 @@
                                                        llvm::APInt(32, Pad),
                                                        ArrayType::Normal, 0);
     ValueDecl *PadDecl = VarDecl::Create(getContext(), 0, SourceLocation(),
-                                         0, QualType(PadTy), 0, VarDecl::None,
-                                         SourceLocation());
+                                         0, QualType(PadTy), 0, VarDecl::None);
     Expr *E;
     E = new (getContext()) DeclRefExpr(PadDecl, PadDecl->getType(),
                                        SourceLocation(), false, false);

Modified: cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReaderDecl.cpp?rev=79584&r1=79583&r2=79584&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReaderDecl.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReaderDecl.cpp Thu Aug 20 19:31:54 2009
@@ -231,7 +231,6 @@
   FD->setHasInheritedPrototype(Record[Idx++]);
   FD->setHasWrittenPrototype(Record[Idx++]);
   FD->setDeleted(Record[Idx++]);
-  FD->setTypeSpecStartLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
   FD->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++]));
   // FIXME: C++ TemplateOrInstantiation
   unsigned NumParams = Record[Idx++];
@@ -405,7 +404,6 @@
 void PCHDeclReader::VisitFieldDecl(FieldDecl *FD) {
   VisitDeclaratorDecl(FD);
   FD->setMutable(Record[Idx++]);
-  FD->setTypeSpecStartLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
   if (Record[Idx++])
     FD->setBitWidth(Reader.ReadDeclExpr());
 }
@@ -418,7 +416,6 @@
   VD->setDeclaredInCondition(Record[Idx++]);
   VD->setPreviousDeclaration(
                          cast_or_null<VarDecl>(Reader.GetDecl(Record[Idx++])));
-  VD->setTypeSpecStartLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
   if (Record[Idx++])
     VD->setInit(*Reader.getContext(), Reader.ReadDeclExpr());
 }
@@ -741,11 +738,11 @@
     break;
   case pch::DECL_FIELD:
     D = FieldDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0, 0, 
-                          false, SourceLocation());
+                          false);
     break;
   case pch::DECL_VAR:
     D = VarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0,
-                        VarDecl::None, SourceLocation());
+                        VarDecl::None);
     break;
 
   case pch::DECL_IMPLICIT_PARAM:

Modified: cfe/trunk/lib/Frontend/PCHWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriterDecl.cpp?rev=79584&r1=79583&r2=79584&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriterDecl.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriterDecl.cpp Thu Aug 20 19:31:54 2009
@@ -229,7 +229,6 @@
   Record.push_back(D->hasInheritedPrototype());
   Record.push_back(D->hasWrittenPrototype());
   Record.push_back(D->isDeleted());
-  Writer.AddSourceLocation(D->getTypeSpecStartLoc(), Record);
   Writer.AddSourceLocation(D->getLocEnd(), Record);
   // FIXME: C++ TemplateOrInstantiation
   Record.push_back(D->param_size());
@@ -395,7 +394,6 @@
 void PCHDeclWriter::VisitFieldDecl(FieldDecl *D) {
   VisitDeclaratorDecl(D);
   Record.push_back(D->isMutable());
-  Writer.AddSourceLocation(D->getTypeSpecStartLoc(), Record);
   Record.push_back(D->getBitWidth()? 1 : 0);
   if (D->getBitWidth())
     Writer.AddStmt(D->getBitWidth());
@@ -409,7 +407,6 @@
   Record.push_back(D->hasCXXDirectInitializer());
   Record.push_back(D->isDeclaredInCondition());
   Writer.AddDeclRef(D->getPreviousDeclaration(), Record);
-  Writer.AddSourceLocation(D->getTypeSpecStartLoc(), Record);
   Record.push_back(D->getInit()? 1 : 0);
   if (D->getInit())
     Writer.AddStmt(D->getInit());
@@ -524,7 +521,6 @@
   Abv->Add(BitCodeAbbrevOp(0));                       // hasCXXDirectInitializer
   Abv->Add(BitCodeAbbrevOp(0));                       // isDeclaredInCondition
   Abv->Add(BitCodeAbbrevOp(0));                       // PrevDecl
-  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypeSpecStartLoc
   Abv->Add(BitCodeAbbrevOp(0));                       // HasInit
   // ParmVarDecl
   Abv->Add(BitCodeAbbrevOp(0));                       // ObjCDeclQualifier

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=79584&r1=79583&r2=79584&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Thu Aug 20 19:31:54 2009
@@ -1509,9 +1509,10 @@
   if (RecordDecl *OwningClass = dyn_cast<RecordDecl>(Owner)) {
     Anon = FieldDecl::Create(Context, OwningClass, Record->getLocation(),
                              /*IdentifierInfo=*/0, 
-                             Context.getTypeDeclType(Record), /*DInfo=*/0,
-                             /*BitWidth=*/0, /*Mutable=*/false,
-                             DS.getSourceRange().getBegin());
+                             Context.getTypeDeclType(Record),
+                             // FIXME: Type source info.
+                             /*DInfo=*/0,
+                             /*BitWidth=*/0, /*Mutable=*/false);
     Anon->setAccess(AS_public);
     if (getLangOptions().CPlusPlus)
       FieldCollector->Add(cast<FieldDecl>(Anon));
@@ -1536,8 +1537,10 @@
 
     Anon = VarDecl::Create(Context, Owner, Record->getLocation(),
                            /*IdentifierInfo=*/0, 
-                           Context.getTypeDeclType(Record), /*DInfo=*/0,
-                           SC, DS.getSourceRange().getBegin());
+                           Context.getTypeDeclType(Record),
+                           // FIXME: Type source info.
+                           /*DInfo=*/0,
+                           SC);
   }
   Anon->setImplicit();
 
@@ -2151,9 +2154,7 @@
   }        
   
   NewVD = VarDecl::Create(Context, DC, D.getIdentifierLoc(), 
-                          II, R, DInfo, SC, 
-                          // FIXME: Move to DeclGroup...
-                          D.getDeclSpec().getSourceRange().getBegin());
+                          II, R, DInfo, SC);
 
   if (D.isInvalidType())
     NewVD->setInvalidDecl();
@@ -2459,9 +2460,7 @@
       // code path.
       NewFD = FunctionDecl::Create(Context, DC, D.getIdentifierLoc(),
                                    Name, R, DInfo, SC, isInline, 
-                                   /*hasPrototype=*/true,
-                                   // FIXME: Move to DeclGroup...
-                                   D.getDeclSpec().getSourceRange().getBegin());
+                                   /*hasPrototype=*/true);
       D.setInvalidType();
     }
   } else if (D.getKind() == Declarator::DK_Conversion) {
@@ -2510,9 +2509,7 @@
     
     NewFD = FunctionDecl::Create(Context, DC,
                                  D.getIdentifierLoc(),
-                                 Name, R, DInfo, SC, isInline, HasPrototype,
-                                 // FIXME: Move to DeclGroup...
-                                 D.getDeclSpec().getSourceRange().getBegin());
+                                 Name, R, DInfo, SC, isInline, HasPrototype);
   }
 
   if (D.isInvalidType())
@@ -4546,7 +4543,7 @@
   }
   
   FieldDecl *NewFD = FieldDecl::Create(Context, Record, Loc, II, T, DInfo,
-                                       BitWidth, Mutable, TSSL);
+                                       BitWidth, Mutable);
   if (InvalidDecl)
     NewFD->setInvalidDecl();
 

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=79584&r1=79583&r2=79584&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Aug 20 19:31:54 2009
@@ -3279,8 +3279,7 @@
   // FIXME: Need to check for abstract classes.
 
   VarDecl *ExDecl = VarDecl::Create(Context, CurContext, Loc, 
-                                    Name, ExDeclType, DInfo, VarDecl::None, 
-                                    Range.getBegin());
+                                    Name, ExDeclType, DInfo, VarDecl::None);
 
   if (Invalid)
     ExDecl->setInvalidDecl();

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=79584&r1=79583&r2=79584&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Thu Aug 20 19:31:54 2009
@@ -676,8 +676,7 @@
   QualType FnType = Context.getFunctionType(Return, &Argument, 1, false, 0);
   FunctionDecl *Alloc =
     FunctionDecl::Create(Context, GlobalCtx, SourceLocation(), Name,
-                         FnType, /*DInfo=*/0, FunctionDecl::None, false, true,
-                         SourceLocation());
+                         FnType, /*DInfo=*/0, FunctionDecl::None, false, true);
   Alloc->setImplicit();
   ParmVarDecl *Param = ParmVarDecl::Create(Context, Alloc, SourceLocation(),
                                            0, Argument, /*DInfo=*/0,

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=79584&r1=79583&r2=79584&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Thu Aug 20 19:31:54 2009
@@ -125,7 +125,7 @@
   VarDecl *Var = VarDecl::Create(SemaRef.Context, Owner,
                                  D->getLocation(), D->getIdentifier(),
                                  T, D->getDeclaratorInfo(),
-                                 D->getStorageClass(),D->getTypeSpecStartLoc());
+                                 D->getStorageClass());
   Var->setThreadSpecified(D->isThreadSpecified());
   Var->setCXXDirectInitializer(D->hasCXXDirectInitializer());
   Var->setDeclaredInCondition(D->isDeclaredInCondition());
@@ -416,8 +416,7 @@
       FunctionDecl::Create(SemaRef.Context, Owner, D->getLocation(), 
                            D->getDeclName(), T, D->getDeclaratorInfo(),
                            D->getStorageClass(),
-                           D->isInline(), D->hasWrittenPrototype(),
-                           D->getTypeSpecStartLoc());
+                           D->isInline(), D->hasWrittenPrototype());
   }
   
   // Attach the parameters





More information about the cfe-commits mailing list