summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-12-09 00:31:40 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-12-09 00:31:40 +0000
commit4996f5fba2c3aaf530559229d5582b595f09edcb (patch)
tree499972ca6f10b016bd9e2434c240ce406b386569 /clang/lib
parent7487a0ae1fca6ac0b665c45ea0179e3d90e3bda0 (diff)
downloadbcm5719-llvm-4996f5fba2c3aaf530559229d5582b595f09edcb.tar.gz
bcm5719-llvm-4996f5fba2c3aaf530559229d5582b595f09edcb.zip
Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!
llvm-svn: 146213
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTImporter.cpp4
-rw-r--r--clang/lib/AST/DeclObjC.cpp5
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp2
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp3
-rw-r--r--clang/lib/Serialization/ASTWriterDecl.cpp1
5 files changed, 10 insertions, 5 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index 981cc5ebd9e..c7160316771 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -3303,11 +3303,13 @@ Decl *ASTNodeImporter::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) {
if (!DC)
return 0;
+ SourceLocation CategoryNameLoc = Importer.Import(D->getCategoryNameLoc());
ToImpl = ObjCCategoryImplDecl::Create(Importer.getToContext(), DC,
Importer.Import(D->getIdentifier()),
Category->getClassInterface(),
Importer.Import(D->getLocation()),
- Importer.Import(D->getAtStartLoc()));
+ Importer.Import(D->getAtStartLoc()),
+ CategoryNameLoc);
DeclContext *LexicalDC = DC;
if (D->getDeclContext() != D->getLexicalDeclContext()) {
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index d4e32a3b5f2..2157762e7fd 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -1039,9 +1039,10 @@ ObjCCategoryImplDecl::Create(ASTContext &C, DeclContext *DC,
IdentifierInfo *Id,
ObjCInterfaceDecl *ClassInterface,
SourceLocation nameLoc,
- SourceLocation atStartLoc) {
+ SourceLocation atStartLoc,
+ SourceLocation CategoryNameLoc) {
return new (C) ObjCCategoryImplDecl(DC, Id, ClassInterface,
- nameLoc, atStartLoc);
+ nameLoc, atStartLoc, CategoryNameLoc);
}
ObjCCategoryDecl *ObjCCategoryImplDecl::getCategoryDecl() const {
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index b271ae66a10..0fd3b25defe 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -831,7 +831,7 @@ Decl *Sema::ActOnStartCategoryImplementation(
ObjCCategoryImplDecl *CDecl =
ObjCCategoryImplDecl::Create(Context, CurContext, CatName, IDecl,
- ClassLoc, AtCatImplLoc);
+ ClassLoc, AtCatImplLoc, CatLoc);
/// Check that class of this category is already completely declared.
if (!IDecl) {
Diag(ClassLoc, diag::err_undef_interface) << ClassName;
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index e9833c394c9..0641b855019 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -700,6 +700,7 @@ void ASTDeclReader::VisitObjCImplDecl(ObjCImplDecl *D) {
void ASTDeclReader::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) {
VisitObjCImplDecl(D);
D->setIdentifier(Reader.GetIdentifierInfo(F, Record, Idx));
+ D->CategoryNameLoc = ReadSourceLocation(Record, Idx);
}
void ASTDeclReader::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {
@@ -1725,7 +1726,7 @@ Decl *ASTReader::ReadDeclRecord(DeclID ID) {
break;
case DECL_OBJC_CATEGORY_IMPL:
D = ObjCCategoryImplDecl::Create(Context, 0, 0, 0, SourceLocation(),
- SourceLocation());
+ SourceLocation(), SourceLocation());
break;
case DECL_OBJC_IMPLEMENTATION:
D = ObjCImplementationDecl::Create(Context, 0, 0, 0, SourceLocation(),
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index afb7ca9f9f0..070ff8058cb 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -593,6 +593,7 @@ void ASTDeclWriter::VisitObjCImplDecl(ObjCImplDecl *D) {
void ASTDeclWriter::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) {
VisitObjCImplDecl(D);
Writer.AddIdentifierRef(D->getIdentifier(), Record);
+ Writer.AddSourceLocation(D->getCategoryNameLoc(), Record);
Code = serialization::DECL_OBJC_CATEGORY_IMPL;
}
OpenPOWER on IntegriCloud