[llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #202120)

Carlos Alberto Enciso via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 14 07:03:24 PDT 2026


================
@@ -56,15 +56,17 @@ Error LVReaderHandler::createReader(StringRef Filename, LVReaders &Readers,
         return std::make_unique<LVDWARFReader>(Filename, FileFormatName, Obj,
                                                W);
     }
-    if (isa<PDBFile *>(Input)) {
-      PDBFile &Pdb = *cast<PDBFile *>(Input);
+    if (std::holds_alternative<PDBFile *>(Input)) {
+      PDBFile &Pdb = *std::get<PDBFile *>(Input);
       return std::make_unique<LVCodeViewReader>(Filename, FileFormatName, Pdb,
                                                 W, ExePath);
     }
-    if (IRObjectFile *Ir = dyn_cast<IRObjectFile *>(Input)) {
+    if (std::holds_alternative<IRObjectFile *>(Input)) {
+      IRObjectFile *Ir = std::get<IRObjectFile *>(Input);
----------------
CarlosAlbertoEnciso wrote:

Great suggestion. Changed to use [`std::get_if()`](https://en.cppreference.com/cpp/utility/variant/get_if).

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


More information about the llvm-commits mailing list