summaryrefslogtreecommitdiff
path: root/tools/libclang
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-04-22 17:40:12 +0000
committerBen Langmuir <blangmuir@apple.com>2014-04-22 17:40:12 +0000
commit13e41baf7883704f60e86c06d794652330c2bd93 (patch)
tree53566265f3859f9265d8008b5ca62f5b4ac45a9f /tools/libclang
parent1b710a8d225a503a9c44cfd15de18794403e6a83 (diff)
downloadclang-13e41baf7883704f60e86c06d794652330c2bd93.tar.gz
clang-13e41baf7883704f60e86c06d794652330c2bd93.tar.bz2
clang-13e41baf7883704f60e86c06d794652330c2bd93.tar.xz
Attempt to fix null ASTContext in ASTUnit error path
We don't need the ASTContext for the diagnostics, only the language options, which we can get from the compiler invocation. It worries me how many categorically different states the ASTUnit class can be in depending on how it is being constructed/used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206909 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang')
-rw-r--r--tools/libclang/CIndex.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 1290c72067..9d59fa7c7b 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -6720,7 +6720,7 @@ void cxindex::printDiagsToStderr(ASTUnit *Unit) {
for (ASTUnit::stored_diag_iterator D = Unit->stored_diag_begin(),
DEnd = Unit->stored_diag_end();
D != DEnd; ++D) {
- CXStoredDiagnostic Diag(*D, Unit->getASTContext().getLangOpts());
+ CXStoredDiagnostic Diag(*D, Unit->getLangOpts());
CXString Msg = clang_formatDiagnostic(&Diag,
clang_defaultDiagnosticDisplayOptions());
fprintf(stderr, "%s\n", clang_getCString(Msg));