mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 12:19:23 +08:00
Add some missing concurrency checks into libclang
llvm-svn: 114682
This commit is contained in:
@@ -2309,6 +2309,7 @@ struct ReparseTranslationUnitInfo {
|
||||
unsigned options;
|
||||
int result;
|
||||
};
|
||||
|
||||
static void clang_reparseTranslationUnit_Impl(void *UserData) {
|
||||
ReparseTranslationUnitInfo *RTUI =
|
||||
static_cast<ReparseTranslationUnitInfo*>(UserData);
|
||||
@@ -2321,6 +2322,9 @@ static void clang_reparseTranslationUnit_Impl(void *UserData) {
|
||||
|
||||
if (!TU)
|
||||
return;
|
||||
|
||||
ASTUnit *CXXUnit = static_cast<ASTUnit *>(TU);
|
||||
ASTUnit::ConcurrencyCheck Check(*CXXUnit);
|
||||
|
||||
llvm::SmallVector<ASTUnit::RemappedFile, 4> RemappedFiles;
|
||||
for (unsigned I = 0; I != num_unsaved_files; ++I) {
|
||||
@@ -2331,10 +2335,10 @@ static void clang_reparseTranslationUnit_Impl(void *UserData) {
|
||||
Buffer));
|
||||
}
|
||||
|
||||
if (!static_cast<ASTUnit *>(TU)->Reparse(RemappedFiles.data(),
|
||||
RemappedFiles.size()))
|
||||
RTUI->result = 0;
|
||||
if (!CXXUnit->Reparse(RemappedFiles.data(), RemappedFiles.size()))
|
||||
RTUI->result = 0;
|
||||
}
|
||||
|
||||
int clang_reparseTranslationUnit(CXTranslationUnit TU,
|
||||
unsigned num_unsaved_files,
|
||||
struct CXUnsavedFile *unsaved_files,
|
||||
|
||||
@@ -622,6 +622,8 @@ void clang_codeCompleteAt_Impl(void *UserData) {
|
||||
if (!AST)
|
||||
return;
|
||||
|
||||
ASTUnit::ConcurrencyCheck Check(*AST);
|
||||
|
||||
// Perform the remapping of source files.
|
||||
llvm::SmallVector<ASTUnit::RemappedFile, 4> RemappedFiles;
|
||||
for (unsigned I = 0; I != num_unsaved_files; ++I) {
|
||||
|
||||
Reference in New Issue
Block a user