[llvm] [MIR] Replace bespoke DIExpression parser (PR #96827)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 09:38:35 PDT 2024


================
@@ -0,0 +1,152 @@
+# RUN: not llc -run-pass none -o - %s 2>&1 | FileCheck %s
+# Note: generated via:
----------------
OCHyams wrote:

For this one, which looks like it really only needs a single DBG_VALUE with a broken expression, I'd probably just write it by hand. A method that avoids hand-writing the needed metadata might look like this: 

1. Compile an empty function to IR
2. Run `opt -passes=debugify` on it
3. Remove !dbg attachments from instructions, remove all but 1 of the dbg.values if there are multiple
4. llc -stop-after=...

And I think we could probably combine both tests into one file using a `sed` command to replace the bad DW_OP_... with a correctly spelled one. There should be `sed` examples in some of the llvm/test/DebugInfo tests iirc (you can test different outputs in the same test using the FileCheck `--check-prefixes` argument).

https://github.com/llvm/llvm-project/pull/96827


More information about the llvm-commits mailing list