[PATCH] D16931: [codeview] Describe int local variables using .cv_def_range

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 12:56:13 PST 2016


majnemer added inline comments.

================
Comment at: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:23-25
@@ -22,2 +22,5 @@
 #include "llvm/Support/COFF.h"
+#include "llvm/Target/TargetSubtargetInfo.h"
+#include "llvm/Target/TargetRegisterInfo.h"
+#include "llvm/Target/TargetFrameLowering.h"
 
----------------
Sort these.

================
Comment at: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:30-42
@@ -25,3 +29,15 @@
 
-namespace llvm {
+CodeViewDebug::CodeViewDebug(AsmPrinter *AP)
+    : DebugHandlerBase(AP), OS(*Asm->OutStreamer), CurFn(nullptr) {
+  // If module doesn't have named metadata anchors or COFF debug section
+  // is not available, skip any debug info related stuff.
+  if (!MMI->getModule()->getNamedMetadata("llvm.dbg.cu") ||
+      !AP->getObjFileLowering().getCOFFDebugSymbolsSection()) {
+    Asm = nullptr;
+    return;
+  }
+
+  // Tell MMI that we have debug info.
+  MMI->setDebugInfoAvailability(true);
+}
 
----------------
Any reason why this had to move?


http://reviews.llvm.org/D16931





More information about the llvm-commits mailing list