[llvm] [IR] Add source location filtering to pass dumps (PR #203393)
Yaxun Liu via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 30 14:40:07 PDT 2026
================
@@ -163,7 +177,151 @@ bool llvm::isFilterPassesEmpty() { return FilterPasses.empty(); }
bool llvm::isFunctionInPrintList(StringRef FunctionName) {
static const StringSet<> PrintFuncNames(llvm::from_range, PrintFuncsList);
- return PrintFuncNames.empty() || PrintFuncNames.contains(FunctionName);
+ return PrintFuncNames.empty() || PrintFuncNames.contains(FunctionName) ||
+ PrintFuncNames.contains("*");
+}
+
+namespace {
+
+struct PrintLineRange {
+ unsigned First;
+ unsigned Last;
+};
+
+struct PrintSourceLocSpec {
+ std::string File;
+ SmallVector<PrintLineRange, 4> Lines;
+};
+
+[[noreturn]] void reportBadLocSpec(StringRef Spec) {
+ report_fatal_error(Twine("Invalid -filter-print-source-locs value '") + Spec +
+ "'. Expected file:line[,line-line][,line].");
+}
+
+std::string normalizeSlashes(StringRef Path) {
----------------
yxsamliu wrote:
Yes, debug info can contain Windows-style paths. I now normalize backslashes before matching and added a Windows-style path test.
https://github.com/llvm/llvm-project/pull/203393
More information about the llvm-commits
mailing list