[PATCH] D24317: Emit S_COMPILE3 CodeView record

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 14:48:19 PDT 2016


majnemer added a subscriber: majnemer.
majnemer added a comment.

Forgive my naïveté but under what circumstance does the debugger need to know C vs C++ vs whatever?


================
Comment at: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:542-543
@@ +541,4 @@
+      .Case("pentium4", CPUType::Pentium3)
+      .Case("sandybridge", CPUType::Ia64)
+      .Case("haswell", CPUType::Ia64_2)
+      .Case("i686", CPUType::PentiumPro)
----------------
This shouldn't map to IA64, that would be Itanium. It's also not correct to map it to X64 because it could be 32-bit sandybridge.

Does MSVC actually change what it sticks in here depending on /arch? If not, I'd just use the ArchType from the Triple to reconstruct this info.

================
Comment at: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:593
@@ +592,3 @@
+  StringRef Triple = Asm->getTargetTriple();
+  StringRef CPUName = Triple.take_front(Triple.find("-"));
+  CPUType CPU = MapCPUtoCVCPU(CPUName);
----------------
Using the triple for this looks weird.  I'd grab the cpu name from the TM via `Asm->TM.getTargetCPU()`


https://reviews.llvm.org/D24317





More information about the llvm-commits mailing list