51
51
#include " clang/Lex/HeaderSearchOptions.h"
52
52
#include " clang/Lex/Preprocessor.h"
53
53
#include " clang/Serialization/ASTReader.h"
54
+ #include " llvm/ADT/StringRef.h"
54
55
#include " llvm/ADT/StringSet.h"
55
56
#include " llvm/Config/config.h"
56
57
#include " llvm/IR/Constants.h"
@@ -775,10 +776,8 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
775
776
// include path set to the working directory.
776
777
auto &HSI =
777
778
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 ();
782
781
783
782
// Handle Clang modules.
784
783
if (ClangModule) {
@@ -800,11 +799,11 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
800
799
ClangModule->Parent );
801
800
}
802
801
return getOrCreateModule (ClangModule, Parent, Desc.getModuleName (),
803
- Desc. getPath () , Signature, Desc.getASTFile ());
802
+ IncludePath , Signature, Desc.getASTFile ());
804
803
}
805
804
// Handle PCH.
806
805
return getOrCreateModule (Desc.getASTFile ().bytes_begin (), nullptr ,
807
- Desc.getModuleName (), Desc. getPath () , Signature,
806
+ Desc.getModuleName (), IncludePath , Signature,
808
807
Desc.getASTFile ());
809
808
};
810
809
0 commit comments