Skip to content

Commit e739669

Browse files
committed
[SYCLomatic] Fix CMake script migration
Signed-off-by: Jiang, Zhiwei <[email protected]>
1 parent c725bae commit e739669

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

clang/lib/DPCT/DPCT.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,6 @@ static void loadMainSrcFileInfo(clang::tooling::UnifiedPath YamlFilePath) {
520520
}
521521
DpctGlobalInfo::setMainSourceYamlTUR(PreTU);
522522

523-
for (auto &Entry : PreTU->MainSourceFilesDigest) {
524-
if (Entry.HasCUDASyntax)
525-
MainSrcFilesHasCudaSyntex.insert(Entry.MainSourceFile);
526-
}
527-
528523
// Currently, when "--use-experimental-features=device_global" and
529524
// "--use-experimental-features=all" are specified, the migrated code should
530525
// be compiled with C++20 or later.

clang/lib/DPCT/UserDefinedRules/PatternRewriter.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
namespace clang {
2929
namespace dpct {
3030

31-
std::set<std::string> MainSrcFilesHasCudaSyntex;
3231
bool LANG_Cplusplus_20_Used = false;
3332

3433
struct SpacingElement {};
@@ -465,9 +464,13 @@ static void applyExtenstionNameChange(
465464
std::string SrcFile = Input.substr(Pos, Next + ExtensionType.length() +
466465
1 /*strlen of "."*/ - Pos);
467466
bool HasCudaSyntax = false;
468-
467+
std::set<std::string> MainSrcFilesHasCudaSyntex;
468+
for (auto &Entry :
469+
DpctGlobalInfo::getMainSourceYamlTUR()->MainSourceFilesDigest) {
470+
if (Entry.HasCUDASyntax)
471+
MainSrcFilesHasCudaSyntex.insert(Entry.MainSourceFile);
472+
}
469473
for (const auto &_File : MainSrcFilesHasCudaSyntex) {
470-
471474
llvm::SmallString<512> File(_File);
472475
llvm::sys::path::native(File);
473476

clang/lib/DPCT/UserDefinedRules/PatternRewriter.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ bool fixLineEndings(const std::string &Input, std::string &Output);
2727
enum SourceFileType { SFT_CAndCXXSource, SFT_CMakeScript, SFT_PySetupScript };
2828
void setFileTypeProcessed(enum SourceFileType FileType);
2929

30-
extern std::set<std::string> MainSrcFilesHasCudaSyntex;
3130
extern bool LANG_Cplusplus_20_Used;
3231

3332
} // namespace dpct

0 commit comments

Comments
 (0)