@@ -26,7 +26,7 @@ namespace clang {
2626namespace dpct {
2727std::vector<clang::tooling::UnifiedPath> MetaRuleObject::RuleFiles;
2828std::vector<std::shared_ptr<MetaRuleObject>> MetaRules;
29- llvm::DenseSet<llvm::StringRef > ProcessedYamlFiles;
29+ std::unordered_set<std::string > ProcessedYamlFiles;
3030
3131OutputBuilder::~OutputBuilder () {}
3232
@@ -370,7 +370,7 @@ std::unique_ptr<llvm::MemoryBuffer>
370370readYAMLFile (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
0 commit comments