[PATCH] D36821: [libclang]: Honor LIBCLANG_NOTHREADS for clang_parseTranslationUnit*

Erik Verbruggen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 29 02:09:12 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL311990: [libclang]: Honor LIBCLANG_NOTHREADS for clang_parseTranslationUnit* (authored by erikjv).

Changed prior to commit:
  https://reviews.llvm.org/D36821?vs=111472&id=113041#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D36821

Files:
  cfe/trunk/tools/libclang/CIndex.cpp


Index: cfe/trunk/tools/libclang/CIndex.cpp
===================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp
+++ cfe/trunk/tools/libclang/CIndex.cpp
@@ -3504,6 +3504,12 @@
         CIdx, source_filename, command_line_args, num_command_line_args,
         llvm::makeArrayRef(unsaved_files, num_unsaved_files), options, out_TU);
   };
+
+  if (getenv("LIBCLANG_NOTHREADS")) {
+    ParseTranslationUnitImpl();
+    return result;
+  }
+
   llvm::CrashRecoveryContext CRC;
 
   if (!RunSafely(CRC, ParseTranslationUnitImpl)) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36821.113041.patch
Type: text/x-patch
Size: 565 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170829/27a4158a/attachment.bin>


More information about the cfe-commits mailing list