]> granicus.if.org Git - clang/commitdiff
Minor libclang tweaks
authorDouglas Gregor <dgregor@apple.com>
Mon, 9 Aug 2010 21:00:09 +0000 (21:00 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 9 Aug 2010 21:00:09 +0000 (21:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110599 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/CIndex.cpp
tools/libclang/CIndexCodeCompletion.cpp

index 60eef4d2839b9953c1f76ce406b3b745131e97ff..344960f813c70ffda68e3ba3fbed65f4d4a78f3c 100644 (file)
@@ -30,6 +30,7 @@
 #include "clang/Lex/PreprocessingRecord.h"
 #include "clang/Lex/Preprocessor.h"
 #include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/Timer.h"
 #include "llvm/System/Program.h"
 #include "llvm/System/Signals.h"
 
@@ -1144,6 +1145,8 @@ CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
 void clang_disposeIndex(CXIndex CIdx) {
   if (CIdx)
     delete static_cast<CIndexer *>(CIdx);
+  if (getenv("LIBCLANG_TIMING"))
+    llvm::TimerGroup::printAll(llvm::errs());
 }
 
 void clang_setUseExternalASTGeneration(CXIndex CIdx, int value) {
index 790f32fbda4d67cfb5bc0f4c486f6f8fec0ff269..c0a072760e1387cae996a965e1723e333f1f5669 100644 (file)
@@ -283,8 +283,8 @@ CXCodeCompleteResults *clang_codeComplete(CXIndex CIdx,
   if (getenv("LIBCLANG_TIMING")) {
     llvm::SmallString<128> TimerName;
     llvm::raw_svector_ostream TimerNameOut(TimerName);
-    TimerNameOut << "Code completion @ " << complete_filename << ":"
-      << complete_line << ":" << complete_column;
+    TimerNameOut << "Code completion (out-of-process) @ " << complete_filename 
+      << ":" << complete_line << ":" << complete_column;
     CCTimer.reset(new llvm::NamedRegionTimer(TimerNameOut.str()));
   }