diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 1b3e81b6f7d9..e43bdb42269e 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -980,7 +980,7 @@ bool ASTUnit::Parse(llvm::MemoryBuffer *OverrideMainBuffer) { goto error; if (OverrideMainBuffer) { - std::string ModName = "$" + PreambleFile; + std::string ModName = PreambleFile; TranslateStoredDiagnostics(Clang->getModuleManager(), ModName, getSourceManager(), PreambleDiagnostics, StoredDiagnostics); @@ -2293,7 +2293,7 @@ void ASTUnit::CodeComplete(llvm::StringRef File, unsigned Line, unsigned Column, if (Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0].second, Clang->getFrontendOpts().Inputs[0].first)) { if (OverrideMainBuffer) { - std::string ModName = "$" + PreambleFile; + std::string ModName = PreambleFile; TranslateStoredDiagnostics(Clang->getModuleManager(), ModName, getSourceManager(), PreambleDiagnostics, StoredDiagnostics); diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index ecb24e730a96..424d6313ec2c 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -2643,8 +2643,8 @@ ASTReader::ASTReadResult ASTReader::ReadASTCore(llvm::StringRef FileName, else FirstInSource = &F; F.Loaders.push_back(Prev); - // A non-module AST file's module name is $filename. - Modules["$" + FileName.str()] = &F; + + Modules[FileName.str()] = &F; // Set the AST file name. F.FileName = FileName;