diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2013-09-17 00:51:29 +0000 | 
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2013-09-17 00:51:29 +0000 | 
| commit | 963ff2c3663ab215557a1211a307671b37533e27 (patch) | |
| tree | 8f10c0523568076175557b02cd7eb49726c9f37f /clang | |
| parent | 1f84980bbf2ce9e8c4c59eedc9ad859d6e636fe4 (diff) | |
| download | bcm5719-llvm-963ff2c3663ab215557a1211a307671b37533e27.tar.gz bcm5719-llvm-963ff2c3663ab215557a1211a307671b37533e27.zip  | |
Fix potential race in module building code.
Let the module building code handle the case of overwriting an existing file
itself, so the existing locking infrastructure works correctly.
<rdar://problem/14403381>
llvm-svn: 190833
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 10 | 
1 files changed, 2 insertions, 8 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 455f71f15d9..7c5ca012726 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1186,15 +1186,9 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,      case ASTReader::Success:        break; -    case ASTReader::OutOfDate: { -      // The module file is out-of-date. Remove it, then rebuild it. -      bool Existed; -      llvm::sys::fs::remove(ModuleFileName, Existed); -    } -    // Fall through to build the module again. - +    case ASTReader::OutOfDate:      case ASTReader::Missing: { -      // The module file is (now) missing. Build it. +      // The module file is missing or out-of-date. Build it.        // If we don't have a module, we don't know how to build the module file.        // Complain and return.  | 

