Skip to content

Commit 3006eef

Browse files
[SYCLomatic][Python Migration][Bug] Fix case_010_include_rule_file lit case (#2861)
1 parent 78c271a commit 3006eef

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

clang/lib/DPCT/UserDefinedRules/UserDefinedRules.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace clang {
2626
namespace dpct {
2727
std::vector<clang::tooling::UnifiedPath> MetaRuleObject::RuleFiles;
2828
std::vector<std::shared_ptr<MetaRuleObject>> MetaRules;
29-
llvm::DenseSet<llvm::StringRef> ProcessedYamlFiles;
29+
std::unordered_set<std::string> ProcessedYamlFiles;
3030

3131
OutputBuilder::~OutputBuilder() {}
3232

@@ -370,7 +370,7 @@ std::unique_ptr<llvm::MemoryBuffer>
370370
readYAMLFile(const llvm::StringRef &RuleFilePath) {
371371
// Check if the rule file has already been processed
372372
// to avoid infinite recursion
373-
if (!ProcessedYamlFiles.insert(RuleFilePath).second) {
373+
if (!ProcessedYamlFiles.insert(RuleFilePath.str()).second) {
374374
return llvm::MemoryBuffer::getMemBufferCopy("");
375375
}
376376

@@ -385,7 +385,7 @@ readYAMLFile(const llvm::StringRef &RuleFilePath) {
385385
}
386386

387387
// Get the directory path of the rule file.
388-
llvm::SmallString<128> DirectoryPath(RuleFilePath);
388+
llvm::SmallString<256> DirectoryPath(RuleFilePath);
389389
llvm::sys::path::remove_filename(DirectoryPath);
390390

391391
// Iterate over the input line by line.
@@ -451,7 +451,7 @@ readYAMLFile(const llvm::StringRef &RuleFilePath) {
451451

452452
if (!IncRuleFilePathStr.empty()) {
453453
// Find the absolute path for the included rule file path
454-
llvm::SmallString<128> IncRuleFileAbsPath = DirectoryPath;
454+
llvm::SmallString<256> IncRuleFileAbsPath(DirectoryPath);
455455
llvm::sys::path::append(IncRuleFileAbsPath, IncRuleFilePathStr);
456456

457457
// Recursively process the included file

clang/test/dpct/python_migration/case_010/include_rule_file.cpp renamed to clang/test/dpct/python_migration/case_010/case_010_include_rule_file.cpp

File renamed without changes.

0 commit comments

Comments
 (0)