Fix source-range information for Objective-C properties. Previously,

we were just getting a range covering only the property name, which is
certainly not correct (and broke token annotation, among other
things). 

Also, teach libclang about the relationship between
@synthesize/@dynamic and @property, so we get property name and
cursor-reference information for @synthesize and @dynamic.

llvm-svn: 119409
This commit is contained in:
Douglas Gregor
2010-11-17 00:13:31 +00:00
parent 5b26f65b3d
commit 68dbaead7b
7 changed files with 99 additions and 19 deletions

View File

@@ -250,9 +250,20 @@ struct AllocatedCXCodeCompleteResults : public CXCodeCompleteResults {
llvm::SmallVector<const llvm::MemoryBuffer *, 1> TemporaryBuffers;
};
/// \brief Tracks the number of code-completion result objects that are
/// currently active.
///
/// Used for debugging purposes only.
static unsigned CodeCompletionResultObjects;
AllocatedCXCodeCompleteResults::AllocatedCXCodeCompleteResults()
: CXCodeCompleteResults(), Diag(new Diagnostic),
SourceMgr(*Diag, FileMgr, FileSystemOpts) { }
SourceMgr(*Diag, FileMgr, FileSystemOpts) {
if (getenv("LIBCLANG_OBJTRACKING")) {
++CodeCompletionResultObjects;
fprintf(stderr, "+++ %d completion results\n", CodeCompletionResultObjects);
}
}
AllocatedCXCodeCompleteResults::~AllocatedCXCodeCompleteResults() {
for (unsigned I = 0, N = NumResults; I != N; ++I)
@@ -263,6 +274,11 @@ AllocatedCXCodeCompleteResults::~AllocatedCXCodeCompleteResults() {
TemporaryFiles[I].eraseFromDisk();
for (unsigned I = 0, N = TemporaryBuffers.size(); I != N; ++I)
delete TemporaryBuffers[I];
if (getenv("LIBCLANG_OBJTRACKING")) {
--CodeCompletionResultObjects;
fprintf(stderr, "--- %d completion results\n", CodeCompletionResultObjects);
}
}
} // end extern "C"