aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-11-17 00:13:31 +0000
committerDouglas Gregor <dgregor@apple.com>2010-11-17 00:13:31 +0000
commite3c60a7ce9e0f42c7ca2344b33203266aceca1db (patch)
treee343de8a6513e0319f84b008942f1b2a0eeba8e5 /lib/Frontend/ASTUnit.cpp
parent74fb0edb44b7ed52af9b8053032ccaab29b5c0cc (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r--lib/Frontend/ASTUnit.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index 80ce5220b6..fb93fca84a 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/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() {