diff options
author | Rafael Stahl <r.stahl@tum.de> | 2019-01-10 17:44:04 +0000 |
---|---|---|
committer | Rafael Stahl <r.stahl@tum.de> | 2019-01-10 17:44:04 +0000 |
commit | 8c48705a19753ea10a99fd0223c5eee75de776cb (patch) | |
tree | cb4abdbbd7951093d5eadf7df880e5890ace1fb7 /clang/lib | |
parent | b8819dc1e3cd59619b21276f0207e5377353db70 (diff) | |
download | bcm5719-llvm-8c48705a19753ea10a99fd0223c5eee75de776cb.tar.gz bcm5719-llvm-8c48705a19753ea10a99fd0223c5eee75de776cb.zip |
[analyzer][CrossTU][NFC] Generalize to external definitions instead of external functions
Summary: This is just changing naming and documentation to be general about external definitions that can be imported for cross translation unit analysis. There is at least a plan to add VarDecls: D46421
Reviewers: NoQ, xazax.hun, martong, a.sidorin, george.karpenkov, serge-sans-paille
Reviewed By: xazax.hun, martong
Subscribers: mgorny, whisperity, baloghadamsoftware, szepet, rnkovacs, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits
Differential Revision: https://reviews.llvm.org/D56441
llvm-svn: 350852
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CrossTU/CrossTranslationUnit.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/CrossTU/CrossTranslationUnit.cpp b/clang/lib/CrossTU/CrossTranslationUnit.cpp index 915b5246c9e..7c97beb498a 100644 --- a/clang/lib/CrossTU/CrossTranslationUnit.cpp +++ b/clang/lib/CrossTU/CrossTranslationUnit.cpp @@ -120,26 +120,26 @@ std::error_code IndexError::convertToErrorCode() const { llvm::Expected<llvm::StringMap<std::string>> parseCrossTUIndex(StringRef IndexPath, StringRef CrossTUDir) { - std::ifstream ExternalFnMapFile(IndexPath); - if (!ExternalFnMapFile) + std::ifstream ExternalMapFile(IndexPath); + if (!ExternalMapFile) return llvm::make_error<IndexError>(index_error_code::missing_index_file, IndexPath.str()); llvm::StringMap<std::string> Result; std::string Line; unsigned LineNo = 1; - while (std::getline(ExternalFnMapFile, Line)) { + while (std::getline(ExternalMapFile, Line)) { const size_t Pos = Line.find(" "); if (Pos > 0 && Pos != std::string::npos) { StringRef LineRef{Line}; - StringRef FunctionLookupName = LineRef.substr(0, Pos); - if (Result.count(FunctionLookupName)) + StringRef LookupName = LineRef.substr(0, Pos); + if (Result.count(LookupName)) return llvm::make_error<IndexError>( index_error_code::multiple_definitions, IndexPath.str(), LineNo); StringRef FileName = LineRef.substr(Pos + 1); SmallString<256> FilePath = CrossTUDir; llvm::sys::path::append(FilePath, FileName); - Result[FunctionLookupName] = FilePath.str().str(); + Result[LookupName] = FilePath.str().str(); } else return llvm::make_error<IndexError>( index_error_code::invalid_index_format, IndexPath.str(), LineNo); @@ -250,7 +250,7 @@ void CrossTranslationUnitContext::emitCrossTUDiagnostics(const IndexError &IE) { << IE.getFileName(); break; case index_error_code::invalid_index_format: - Context.getDiagnostics().Report(diag::err_fnmap_parsing) + Context.getDiagnostics().Report(diag::err_extdefmap_parsing) << IE.getFileName() << IE.getLineNum(); break; case index_error_code::multiple_definitions: |