[llvm] [BOLT][DWARF][NFC] Add mc opt to DWARFRewriter.cpp (PR #100800)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 13:06:04 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-bolt

Author: Sayhaan Siddiqui (sayhaan)

<details>
<summary>Changes</summary>

Running into an error with removing DWP where the assertion `RelaxAllView &&
"RegisterMCTargetOptionsFlags not created."'` failed. This is a result of DWP bringing the mc::RegisterMCTargetOptionsFlags option in, and the option being removed with DWP. The option didn't originally exist because we didn't use MC in DWARFRewriter, but we switched to using DWARFStreamer which needed the option.

https://reviews.llvm.org/D75579 
https://reviews.llvm.org/D106417

---
Full diff: https://github.com/llvm/llvm-project/pull/100800.diff


1 Files Affected:

- (modified) bolt/lib/Rewrite/DWARFRewriter.cpp (+3) 


``````````diff
diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp
index 674b5f17adb3f..1fe6eb938cec1 100644
--- a/bolt/lib/Rewrite/DWARFRewriter.cpp
+++ b/bolt/lib/Rewrite/DWARFRewriter.cpp
@@ -32,6 +32,7 @@
 #include "llvm/MC/MCAssembler.h"
 #include "llvm/MC/MCObjectWriter.h"
 #include "llvm/MC/MCStreamer.h"
+#include "llvm/MC/MCTargetOptionsCommandFlags.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/CommandLine.h"
@@ -56,6 +57,8 @@
 #undef DEBUG_TYPE
 #define DEBUG_TYPE "bolt"
 
+static mc::RegisterMCTargetOptionsFlags MOF;
+
 static void printDie(const DWARFDie &DIE) {
   DIDumpOptions DumpOpts;
   DumpOpts.ShowForm = true;

``````````

</details>


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


More information about the llvm-commits mailing list