diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-05-16 02:28:53 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-05-16 02:28:53 +0000 |
commit | 2b63d15f4986904e249f0464b2e985bef0740019 (patch) | |
tree | b3aacf00d288fee77ad024c6b519d7be259e824f /clang/lib/Frontend/CompilerInstance.cpp | |
parent | d3967635bc0442aba6eed8c99c8d8561fe8091dd (diff) | |
download | llvm-2b63d15f4986904e249f0464b2e985bef0740019.zip llvm-2b63d15f4986904e249f0464b2e985bef0740019.tar.gz llvm-2b63d15f4986904e249f0464b2e985bef0740019.tar.bz2 |
[modules] Retain the name as written for umbrella headers and directories, rather than converting to an absolute path. No observable change expected, but this allows us to correctly compute the module for an umbrella header, which later changes will require.
llvm-svn: 237508
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index b64424a9a..2d8bb71 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -949,16 +949,18 @@ static bool compileModuleImpl(CompilerInstance &ImportingInstance, FrontendOpts.Inputs.push_back( FrontendInputFile(ModuleMapFile->getName(), IK)); } else { + SmallString<128> FakeModuleMapFile(Module->Directory->getName()); + llvm::sys::path::append(FakeModuleMapFile, "__inferred_module.map"); + FrontendOpts.Inputs.push_back(FrontendInputFile(FakeModuleMapFile, IK)); + llvm::raw_string_ostream OS(InferredModuleMapContent); Module->print(OS); OS.flush(); - FrontendOpts.Inputs.push_back( - FrontendInputFile("__inferred_module.map", IK)); std::unique_ptr<llvm::MemoryBuffer> ModuleMapBuffer = llvm::MemoryBuffer::getMemBuffer(InferredModuleMapContent); ModuleMapFile = Instance.getFileManager().getVirtualFile( - "__inferred_module.map", InferredModuleMapContent.size(), 0); + FakeModuleMapFile, InferredModuleMapContent.size(), 0); SourceMgr.overrideFileContents(ModuleMapFile, std::move(ModuleMapBuffer)); } |