nik updated this revision to Diff 119823.
nik added a comment.
Rebased and took over better wording/description from Ilya.
https://reviews.llvm.org/D37554
Files:
tools/libclang/CIndex.cpp
tools/libclang/CIndexCodeCompletion.cpp
tools/libclang/Indexing.cpp
Index: tools/libclang/Indexing.cpp
===================================================================
--- tools/libclang/Indexing.cpp
+++ tools/libclang/Indexing.cpp
@@ -880,11 +880,6 @@
TU_options);
};
- if (getenv("LIBCLANG_NOTHREADS")) {
- IndexSourceFileImpl();
- return result;
- }
-
llvm::CrashRecoveryContext CRC;
if (!RunSafely(CRC, IndexSourceFileImpl)) {
@@ -934,11 +929,6 @@
index_options, TU);
};
- if (getenv("LIBCLANG_NOTHREADS")) {
- IndexTranslationUnitImpl();
- return result;
- }
-
llvm::CrashRecoveryContext CRC;
if (!RunSafely(CRC, IndexTranslationUnitImpl)) {
Index: tools/libclang/CIndexCodeCompletion.cpp
===================================================================
--- tools/libclang/CIndexCodeCompletion.cpp
+++ tools/libclang/CIndexCodeCompletion.cpp
@@ -806,11 +806,6 @@
llvm::makeArrayRef(unsaved_files, num_unsaved_files), options);
};
- if (getenv("LIBCLANG_NOTHREADS")) {
- CodeCompleteAtImpl();
- return result;
- }
-
llvm::CrashRecoveryContext CRC;
if (!RunSafely(CRC, CodeCompleteAtImpl)) {
Index: tools/libclang/CIndex.cpp
===================================================================
--- tools/libclang/CIndex.cpp
+++ tools/libclang/CIndex.cpp
@@ -3508,11 +3508,6 @@
llvm::makeArrayRef(unsaved_files, num_unsaved_files), options, out_TU);
};
- if (getenv("LIBCLANG_NOTHREADS")) {
- ParseTranslationUnitImpl();
- return result;
- }
-
llvm::CrashRecoveryContext CRC;
if (!RunSafely(CRC, ParseTranslationUnitImpl)) {
@@ -3921,8 +3916,7 @@
result = clang_saveTranslationUnit_Impl(TU, FileName, options);
};
- if (!CXXUnit->getDiagnostics().hasUnrecoverableErrorOccurred() ||
- getenv("LIBCLANG_NOTHREADS")) {
+ if (!CXXUnit->getDiagnostics().hasUnrecoverableErrorOccurred()) {
SaveTranslationUnitImpl();
if (getenv("LIBCLANG_RESOURCE_USAGE"))
@@ -4045,11 +4039,6 @@
TU, llvm::makeArrayRef(unsaved_files, num_unsaved_files), options);
};
- if (getenv("LIBCLANG_NOTHREADS")) {
- ReparseTranslationUnitImpl();
- return result;
- }
-
llvm::CrashRecoveryContext CRC;
if (!RunSafely(CRC, ReparseTranslationUnitImpl)) {
@@ -8164,7 +8153,7 @@
unsigned Size) {
if (!Size)
Size = GetSafetyThreadStackSize();
- if (Size)
+ if (Size && !getenv("LIBCLANG_NOTHREADS"))
return CRC.RunSafelyOnThread(Fn, Size);
return CRC.RunSafely(Fn);
}
Index: tools/libclang/Indexing.cpp
===================================================================
--- tools/libclang/Indexing.cpp
+++ tools/libclang/Indexing.cpp
@@ -880,11 +880,6 @@
TU_options);
};
- if (getenv("LIBCLANG_NOTHREADS")) {
- IndexSourceFileImpl();
- return result;
- }
-
llvm::CrashRecoveryContext CRC;
if (!RunSafely(CRC, IndexSourceFileImpl)) {
@@ -934,11 +929,6 @@
index_options, TU);
};
- if (getenv("LIBCLANG_NOTHREADS")) {
- IndexTranslationUnitImpl();
- return result;
- }
-
llvm::CrashRecoveryContext CRC;
if (!RunSafely(CRC, IndexTranslationUnitImpl)) {
Index: tools/libclang/CIndexCodeCompletion.cpp
===================================================================
--- tools/libclang/CIndexCodeCompletion.cpp
+++ tools/libclang/CIndexCodeCompletion.cpp
@@ -806,11 +806,6 @@
llvm::makeArrayRef(unsaved_files, num_unsaved_files), options);
};
- if (getenv("LIBCLANG_NOTHREADS")) {
- CodeCompleteAtImpl();
- return result;
- }
-
llvm::CrashRecoveryContext CRC;
if (!RunSafely(CRC, CodeCompleteAtImpl)) {
Index: tools/libclang/CIndex.cpp
===================================================================
--- tools/libclang/CIndex.cpp
+++ tools/libclang/CIndex.cpp
@@ -3508,11 +3508,6 @@
llvm::makeArrayRef(unsaved_files, num_unsaved_files), options, out_TU);
};
- if (getenv("LIBCLANG_NOTHREADS")) {
- ParseTranslationUnitImpl();
- return result;
- }
-
llvm::CrashRecoveryContext CRC;
if (!RunSafely(CRC, ParseTranslationUnitImpl)) {
@@ -3921,8 +3916,7 @@
result = clang_saveTranslationUnit_Impl(TU, FileName, options);
};
- if (!CXXUnit->getDiagnostics().hasUnrecoverableErrorOccurred() ||
- getenv("LIBCLANG_NOTHREADS")) {
+ if (!CXXUnit->getDiagnostics().hasUnrecoverableErrorOccurred()) {
SaveTranslationUnitImpl();
if (getenv("LIBCLANG_RESOURCE_USAGE"))
@@ -4045,11 +4039,6 @@
TU, llvm::makeArrayRef(unsaved_files, num_unsaved_files), options);
};
- if (getenv("LIBCLANG_NOTHREADS")) {
- ReparseTranslationUnitImpl();
- return result;
- }
-
llvm::CrashRecoveryContext CRC;
if (!RunSafely(CRC, ReparseTranslationUnitImpl)) {
@@ -8164,7 +8153,7 @@
unsigned Size) {
if (!Size)
Size = GetSafetyThreadStackSize();
- if (Size)
+ if (Size && !getenv("LIBCLANG_NOTHREADS"))
return CRC.RunSafelyOnThread(Fn, Size);
return CRC.RunSafely(Fn);
}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits