File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1487,18 +1487,9 @@ std::string DpctGlobalInfo::getStringForRegexReplacement(StringRef MatchedStr) {
14871487 HelperFuncType::HFT_DefaultQueuePtr, Index);
14881488 case ' E' : {
14891489 auto &Vec = DpctGlobalInfo::getInstance ().getCSourceFileList ();
1490- SourceProcessType FileType = GetSourceFileType (Vec[Index].first );
1491-
14921490 const bool HasCUDASyntax = DpctGlobalInfo::hasCUDASyntax (Vec[Index].first );
1493- const bool IsCppSource = (FileType & SPT_CppSource);
14941491 const auto Extention = Vec[Index].second ;
1495-
1496- if (Extention == " .cc" ) {
1497- return (HasCUDASyntax && IsCppSource)
1498- ? " cc" + DpctGlobalInfo::getSYCLSourceExtension ()
1499- : " cc" ;
1500- }
1501- return HasCUDASyntax ? " c" + DpctGlobalInfo::getSYCLSourceExtension () : " c" ;
1492+ return HasCUDASyntax ? Extention + DpctGlobalInfo::getSYCLSourceExtension () : Extention;
15021493 }
15031494 case ' P' : {
15041495 std::string ReplStr;
Original file line number Diff line number Diff line change @@ -180,8 +180,8 @@ void IncludesCallbacks::InclusionDirective(
180180 auto &Vec = DpctGlobalInfo::getInstance ().getCSourceFileList ();
181181 path::replace_extension (
182182 NewFileName, " {{NEEDREPLACEE" + std::to_string (Vec.size ()) + " }}" );
183- Vec.push_back (std::pair<tooling::UnifiedPath, std::string>(IncludedFile,
184- Extension));
183+ Vec.push_back (std::pair<tooling::UnifiedPath, std::string>(
184+ IncludedFile, Extension. substr ( 1 ) ));
185185 } else {
186186 clang::tooling::UnifiedPath NewFilePath = FileName;
187187 rewriteFileName (NewFilePath, IncludedFile);
Original file line number Diff line number Diff line change 6666// CHECK: #include "test9.cc.dp.cpp"
6767#include " test9.cc"
6868// case 10: source file has CUDA syntax, not in database.
69- // CHECK: #include "test10.cc"
69+ // CHECK: #include "test10.cc.dp.cpp "
7070#include " test10.cc"
7171// case 11: source file does not have CUDA syntax, in database.
7272// CHECK: #include "test11.cc"
You can’t perform that action at this time.
0 commit comments