aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-09 21:00:09 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-09 21:00:09 +0000
commit7a07fcb8f10fe45ea65a0a41798eb1c40777bde4 (patch)
treea1aa64ea4365bacbe5a095f85e4ae7985b0cadcb /tools/libclang
parentdf95a13ec73d2cdaea79555cb412d767f4963120 (diff)
Minor libclang tweaks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110599 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang')
-rw-r--r--tools/libclang/CIndex.cpp3
-rw-r--r--tools/libclang/CIndexCodeCompletion.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 60eef4d283..344960f813 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -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) {
diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp
index 790f32fbda..c0a072760e 100644
--- a/tools/libclang/CIndexCodeCompletion.cpp
+++ b/tools/libclang/CIndexCodeCompletion.cpp
@@ -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()));
}