================
@@ -196,15 +209,36 @@ def get_prefixes(self) -> None:
             )
         assert expect_diagnosis or self.expect_no_diagnosis
 
+    def _sanitize_content(self, text: str) -> str:
+        return re.sub("// *CHECK-[A-Z0-9\\-]*:[^\r\n]*", "//", text)
+
+    def _filter_prefixes(self, prefixes: Sequence[str], check_file: str) -> 
List[str]:
+        if check_file == self.input_file_name:
+            content = self.input_text
+        else:
+            with open(check_file, "r", encoding="utf-8") as f:
+                content = f.read()
+        return [p for p in prefixes if p in content]
----------------
EugeneZelenko wrote:

```suggestion
        return list(filter(content.contains, prefixes))
```

I think this should do trick :-)


https://github.com/llvm/llvm-project/pull/175735
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to