diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-09-29 19:43:35 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-09-29 19:43:35 +0000 |
commit | 73360e1bbbb17d9fd9f95943d928663c36d12106 (patch) | |
tree | 3304a64560f39a511a28056951f31294653dd723 /clang/lib/Frontend | |
parent | a7a36dfdb6583fb2bb469d3b9403a8c380a4d0ff (diff) | |
download | bcm5719-llvm-73360e1bbbb17d9fd9f95943d928663c36d12106.tar.gz bcm5719-llvm-73360e1bbbb17d9fd9f95943d928663c36d12106.zip |
Introduce ObjCProtocolListLoc for keeping source location information for protocol references.
llvm-svn: 83094
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/PCHReaderDecl.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Frontend/PCHWriterDecl.cpp | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Frontend/PCHReaderDecl.cpp b/clang/lib/Frontend/PCHReaderDecl.cpp index 77721bdf629..550f4dba799 100644 --- a/clang/lib/Frontend/PCHReaderDecl.cpp +++ b/clang/lib/Frontend/PCHReaderDecl.cpp @@ -179,6 +179,12 @@ void TypeLocReader::VisitDefaultTypeSpecLoc(DefaultTypeSpecLoc TyLoc) { void TypeLocReader::VisitTypedefLoc(TypedefLoc TyLoc) { TyLoc.setNameLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); } +void TypeLocReader::VisitObjCProtocolListLoc(ObjCProtocolListLoc TyLoc) { + TyLoc.setLAngleLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + TyLoc.setRAngleLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + for (unsigned i = 0, e = TyLoc.getNumProtocols(); i != e; ++i) + TyLoc.setProtocolLoc(i, SourceLocation::getFromRawEncoding(Record[Idx++])); +} void TypeLocReader::VisitPointerLoc(PointerLoc TyLoc) { TyLoc.setStarLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); } diff --git a/clang/lib/Frontend/PCHWriterDecl.cpp b/clang/lib/Frontend/PCHWriterDecl.cpp index 6261db5ff6f..7a8f3e85021 100644 --- a/clang/lib/Frontend/PCHWriterDecl.cpp +++ b/clang/lib/Frontend/PCHWriterDecl.cpp @@ -177,6 +177,12 @@ void TypeLocWriter::VisitDefaultTypeSpecLoc(DefaultTypeSpecLoc TyLoc) { void TypeLocWriter::VisitTypedefLoc(TypedefLoc TyLoc) { Writer.AddSourceLocation(TyLoc.getNameLoc(), Record); } +void TypeLocWriter::VisitObjCProtocolListLoc(ObjCProtocolListLoc TyLoc) { + Writer.AddSourceLocation(TyLoc.getLAngleLoc(), Record); + Writer.AddSourceLocation(TyLoc.getRAngleLoc(), Record); + for (unsigned i = 0, e = TyLoc.getNumProtocols(); i != e; ++i) + Writer.AddSourceLocation(TyLoc.getProtocolLoc(i), Record); +} void TypeLocWriter::VisitPointerLoc(PointerLoc TyLoc) { Writer.AddSourceLocation(TyLoc.getStarLoc(), Record); } |