diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-11-17 00:13:31 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-11-17 00:13:31 +0000 |
commit | 68dbaead7b3ecd2a13e38488e4aa32c363733d4d (patch) | |
tree | a668996ed2c7ddf8270656a22a4bcf410ef69e20 /clang/lib/Frontend/ASTUnit.cpp | |
parent | 5b26f65b3d63cf230f20c0e6bff4bc6253032f70 (diff) | |
download | bcm5719-llvm-68dbaead7b3ecd2a13e38488e4aa32c363733d4d.tar.gz bcm5719-llvm-68dbaead7b3ecd2a13e38488e4aa32c363733d4d.zip |
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
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 80ce5220b62..fb93fca84a3 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -81,6 +81,11 @@ namespace { /// preamble. const unsigned DefaultPreambleRebuildInterval = 5; +/// \brief Tracks the number of ASTUnit objects that are currently active. +/// +/// Used for debugging purposes only. +static unsigned ActiveASTUnitObjects; + ASTUnit::ASTUnit(bool _MainFileIsAST) : CaptureDiagnostics(false), MainFileIsAST(_MainFileIsAST), CompleteTranslationUnit(true), WantTiming(getenv("LIBCLANG_TIMING")), @@ -91,6 +96,10 @@ ASTUnit::ASTUnit(bool _MainFileIsAST) NumTopLevelDeclsAtLastCompletionCache(0), CacheCodeCompletionCoolDown(0), UnsafeToFree(false) { + if (getenv("LIBCLANG_OBJTRACKING")) { + ++ActiveASTUnitObjects; + fprintf(stderr, "+++ %d translation units\n", ActiveASTUnitObjects); + } } ASTUnit::~ASTUnit() { @@ -117,6 +126,11 @@ ASTUnit::~ASTUnit() { delete PreambleBuffer; ClearCachedCompletionResults(); + + if (getenv("LIBCLANG_OBJTRACKING")) { + --ActiveASTUnitObjects; + fprintf(stderr, "--- %d translation units\n", ActiveASTUnitObjects); + } } void ASTUnit::CleanTemporaryFiles() { |