5151#include " clang/Lex/HeaderSearchOptions.h"
5252#include " clang/Lex/Preprocessor.h"
5353#include " clang/Serialization/ASTReader.h"
54+ #include " llvm/ADT/StringRef.h"
5455#include " llvm/ADT/StringSet.h"
5556#include " llvm/Config/config.h"
5657#include " llvm/IR/Constants.h"
@@ -775,10 +776,8 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
775776 // include path set to the working directory.
776777 auto &HSI =
777778 CI.getClangPreprocessor ().getHeaderSearchInfo ().getHeaderSearchOpts ();
778- if (HSI.ModuleFileHomeIsCwd ) {
779- Desc = ASTSourceDescriptor (Desc.getModuleName (), Opts.DebugCompilationDir ,
780- Desc.getASTFile (), Desc.getSignature ());
781- }
779+ StringRef IncludePath =
780+ HSI.ModuleFileHomeIsCwd ? Opts.DebugCompilationDir : Desc.getPath ();
782781
783782 // Handle Clang modules.
784783 if (ClangModule) {
@@ -800,11 +799,11 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
800799 ClangModule->Parent );
801800 }
802801 return getOrCreateModule (ClangModule, Parent, Desc.getModuleName (),
803- Desc. getPath () , Signature, Desc.getASTFile ());
802+ IncludePath , Signature, Desc.getASTFile ());
804803 }
805804 // Handle PCH.
806805 return getOrCreateModule (Desc.getASTFile ().bytes_begin (), nullptr ,
807- Desc.getModuleName (), Desc. getPath () , Signature,
806+ Desc.getModuleName (), IncludePath , Signature,
808807 Desc.getASTFile ());
809808 };
810809
0 commit comments