[PATCH] D116438: [ORC] Set useNamesOnTempLabels as true when emiting object code

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 31 01:15:16 PST 2021


StephenFan created this revision.
StephenFan added a reviewer: lhames.
Herald added subscribers: luke957, luismarques, s.egerton, PkmX, simoncook, hiraditya.
StephenFan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

As far as I known, In JITLink's linkgraph, every defined symbol must need a name.

In RISCV, some temp symbols will be emited in object code's symbol table. Because RISCV need to use these temp symbols to do something like generating dwarf, eh_frame sectinos...

To solve this contradiction, I want to set the useNamesOnTempLabels as true in addPassesToEmitMC


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116438

Files:
  llvm/lib/CodeGen/LLVMTargetMachine.cpp


Index: llvm/lib/CodeGen/LLVMTargetMachine.cpp
===================================================================
--- llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -254,6 +254,7 @@
   Ctx = &MMIWP->getMMI().getContext();
   if (Options.MCOptions.MCSaveTempLabels)
     Ctx->setAllowTemporaryLabels(false);
+  Ctx->setUseNamesOnTempLabels(true);
 
   // Create the code emitter for the target if it exists.  If not, .o file
   // emission fails.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116438.396768.patch
Type: text/x-patch
Size: 484 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211231/6a5ff39d/attachment.bin>


More information about the llvm-commits mailing list