[PATCH] D52217: [codeview] Emit S_FRAMEPROC and use S_DEFRANGE_FRAMEPOINTER_REL

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 18 09:44:46 PDT 2018


zturner added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:108
+  default:
+    report_fatal_error("target architecture doesn't map to a CodeView CPUType");
+  }
----------------
Similarly here, shouldn't this just be `assert(false)`?


================
Comment at: llvm/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp:496
+    }
+    llvm_unreachable("bad encoding");
+  case CPUType::X64:
----------------
This should probably be an `assert(false)` as opposed to an `llvm_unreachable`.  This function operates on user input, so it can technically be any value that fits in the underlying type, and we want the program to at least work with bad user input.  If we use `llvm_unreachable` then entering this codepath would be undefined behavior.


https://reviews.llvm.org/D52217





More information about the llvm-commits mailing list