Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions clang/lib/DPCT/DPCT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,6 @@ static void loadMainSrcFileInfo(clang::tooling::UnifiedPath YamlFilePath) {
}
DpctGlobalInfo::setMainSourceYamlTUR(PreTU);

for (auto &Entry : PreTU->MainSourceFilesDigest) {
if (Entry.HasCUDASyntax)
MainSrcFilesHasCudaSyntex.insert(Entry.MainSourceFile);
}

// Currently, when "--use-experimental-features=device_global" and
// "--use-experimental-features=all" are specified, the migrated code should
// be compiled with C++20 or later.
Expand Down
9 changes: 6 additions & 3 deletions clang/lib/DPCT/UserDefinedRules/PatternRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
namespace clang {
namespace dpct {

std::set<std::string> MainSrcFilesHasCudaSyntex;
bool LANG_Cplusplus_20_Used = false;

struct SpacingElement {};
Expand Down Expand Up @@ -465,9 +464,13 @@ static void applyExtenstionNameChange(
std::string SrcFile = Input.substr(Pos, Next + ExtensionType.length() +
1 /*strlen of "."*/ - Pos);
bool HasCudaSyntax = false;

std::set<std::string> MainSrcFilesHasCudaSyntex;
for (auto &Entry :
DpctGlobalInfo::getMainSourceYamlTUR()->MainSourceFilesDigest) {
if (Entry.HasCUDASyntax)
MainSrcFilesHasCudaSyntex.insert(Entry.MainSourceFile);
}
for (const auto &_File : MainSrcFilesHasCudaSyntex) {

llvm::SmallString<512> File(_File);
llvm::sys::path::native(File);

Expand Down
1 change: 0 additions & 1 deletion clang/lib/DPCT/UserDefinedRules/PatternRewriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ bool fixLineEndings(const std::string &Input, std::string &Output);
enum SourceFileType { SFT_CAndCXXSource, SFT_CMakeScript, SFT_PySetupScript };
void setFileTypeProcessed(enum SourceFileType FileType);

extern std::set<std::string> MainSrcFilesHasCudaSyntex;
extern bool LANG_Cplusplus_20_Used;

} // namespace dpct
Expand Down
Loading