diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-10 18:54:52 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-10 18:54:52 +0000 |
commit | c6f5c6a58d34833d1fe458a518d5f59462926c7b (patch) | |
tree | 4d0ff3cd0e3a1a64017e966b5e127548633bdc60 /tools/libclang/CIndexCodeCompletion.cpp | |
parent | 30f3b450c63a99ff5eef24b45cd999f8c2cf9b91 (diff) |
[libclang] Enhance logging capabilities of libclang.
-provide a "raw_ostream'ish" class to make it convenient to output logging info.
-use macros to automate a bit the logging functionality inside libclang functions
-when logging, print a stack trace if "LIBCLANG_LOGGING=2" environment is set.
-add logging to more functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172089 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CIndexCodeCompletion.cpp')
-rw-r--r-- | tools/libclang/CIndexCodeCompletion.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp index df3ed9044c..6bd31e786e 100644 --- a/tools/libclang/CIndexCodeCompletion.cpp +++ b/tools/libclang/CIndexCodeCompletion.cpp @@ -17,6 +17,7 @@ #include "CXCursor.h" #include "CXString.h" #include "CXTranslationUnit.h" +#include "CLog.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/Type.h" @@ -48,6 +49,7 @@ using namespace clang; using namespace clang::cxstring; +using namespace clang::cxindex; extern "C" { @@ -821,6 +823,11 @@ CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, unsigned options) { + LOG_FUNC_SECTION { + *Log << TU << ' ' + << complete_filename << ':' << complete_line << ':' << complete_column; + } + CodeCompleteAtInfo CCAI = { TU, complete_filename, complete_line, complete_column, unsaved_files, num_unsaved_files, options, 0 }; |