mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Teach the MC to output code/data region marker labels in MachO and ELF modes. These are used by disassemblers to provide better disassembly, particularly on targets like ARM Thumb that like to intermingle data in the TEXT segment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141135 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -290,6 +290,8 @@ void ARMAsmPrinter::EmitDwarfRegOp(const MachineLocation &MLoc) const {
|
||||
}
|
||||
|
||||
void ARMAsmPrinter::EmitFunctionEntryLabel() {
|
||||
OutStreamer.ForceCodeRegion();
|
||||
|
||||
if (AFI->isThumbFunction()) {
|
||||
OutStreamer.EmitAssemblerFlag(MCAF_Code16);
|
||||
OutStreamer.EmitThumbFunc(CurrentFnSym);
|
||||
@@ -905,6 +907,9 @@ void ARMAsmPrinter::EmitJumpTable(const MachineInstr *MI) {
|
||||
const MachineOperand &MO2 = MI->getOperand(OpNum+1); // Unique Id
|
||||
unsigned JTI = MO1.getIndex();
|
||||
|
||||
// Tag the jump table appropriately for precise disassembly.
|
||||
OutStreamer.EmitJumpTable32Region();
|
||||
|
||||
// Emit a label for the jump table.
|
||||
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel2(JTI, MO2.getImm());
|
||||
OutStreamer.EmitLabel(JTISymbol);
|
||||
@@ -947,6 +952,14 @@ void ARMAsmPrinter::EmitJump2Table(const MachineInstr *MI) {
|
||||
unsigned JTI = MO1.getIndex();
|
||||
|
||||
// Emit a label for the jump table.
|
||||
if (MI->getOpcode() == ARM::t2TBB_JT) {
|
||||
OutStreamer.EmitJumpTable8Region();
|
||||
} else if (MI->getOpcode() == ARM::t2TBH_JT) {
|
||||
OutStreamer.EmitJumpTable16Region();
|
||||
} else {
|
||||
OutStreamer.EmitJumpTable32Region();
|
||||
}
|
||||
|
||||
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel2(JTI, MO2.getImm());
|
||||
OutStreamer.EmitLabel(JTISymbol);
|
||||
|
||||
@@ -1165,6 +1178,9 @@ extern cl::opt<bool> EnableARMEHABI;
|
||||
#include "ARMGenMCPseudoLowering.inc"
|
||||
|
||||
void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
if (MI->getOpcode() != ARM::CONSTPOOL_ENTRY)
|
||||
OutStreamer.EmitCodeRegion();
|
||||
|
||||
// Emit unwinding stuff for frame-related instructions
|
||||
if (EnableARMEHABI && MI->getFlag(MachineInstr::FrameSetup))
|
||||
EmitUnwindingInstruction(MI);
|
||||
@@ -1470,6 +1486,10 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
unsigned CPIdx = (unsigned)MI->getOperand(1).getIndex();
|
||||
|
||||
EmitAlignment(2);
|
||||
|
||||
// Mark the constant pool entry as data if we're not already in a data
|
||||
// region.
|
||||
OutStreamer.EmitDataRegion();
|
||||
OutStreamer.EmitLabel(GetCPISymbol(LabelId));
|
||||
|
||||
const MachineConstantPoolEntry &MCPE = MCP->getConstants()[CPIdx];
|
||||
@@ -1477,7 +1497,6 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
EmitMachineConstantPoolValue(MCPE.Val.MachineCPVal);
|
||||
else
|
||||
EmitGlobalConstant(MCPE.Val.ConstVal);
|
||||
|
||||
return;
|
||||
}
|
||||
case ARM::t2BR_JT: {
|
||||
|
@@ -592,6 +592,8 @@ static void LowerTlsAddr(MCStreamer &OutStreamer,
|
||||
}
|
||||
|
||||
void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
OutStreamer.EmitCodeRegion();
|
||||
|
||||
X86MCInstLower MCInstLowering(Mang, *MF, *this);
|
||||
switch (MI->getOpcode()) {
|
||||
case TargetOpcode::DBG_VALUE:
|
||||
@@ -608,7 +610,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
if (OutStreamer.hasRawTextSupport())
|
||||
OutStreamer.EmitRawText(StringRef("\t#MEMBARRIER"));
|
||||
return;
|
||||
|
||||
|
||||
|
||||
case X86::EH_RETURN:
|
||||
case X86::EH_RETURN64: {
|
||||
|
Reference in New Issue
Block a user