1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
llvm-mirror/include/llvm/MC
Greg Fitzgerald d54e246d6a Fix inline assembly that switches between ARM and Thumb modes
This patch restores the ARM mode if the user's inline assembly
does not.  In the object streamer, it ensures that instructions
following the inline assembly are encoded correctly and that
correct mapping symbols are emitted.  For the asm streamer, it
emits a .arm or .thumb directive.

This patch does not ensure that the inline assembly contains
the ADR instruction to switch modes at runtime.

The problem we need to solve is code like this:

  int foo(int a, int b) {
    int r = a + b;
    asm volatile(
        ".align 2     \n"
        ".arm         \n"
        "add r0,r0,r0 \n"
    : : "r"(r));
    return r+1;
  }

If we compile this function in thumb mode then the inline assembly
will switch to arm mode. We need to make sure that we switch back to
thumb mode after emitting the inline assembly or we will incorrectly
encode the instructions that follow (i.e. the assembly instructions
for return r+1).

Based on patch by David Peixotto

Change-Id: Ib57f6d2d78a22afad5de8693fba6230ff56ba48b
llvm-svn: 199818
2014-01-22 18:32:35 +00:00
..
MCParser Fix parsing of .symver directive on ARM 2014-01-15 22:40:02 +00:00
MachineLocation.h Explicitly request unsigned enum types when desired 2013-09-23 23:26:57 +00:00
MCAsmBackend.h Remove extra } in documentation comment 2014-01-13 23:11:48 +00:00
MCAsmInfo.h CommentColumn is always 40. Simplify. 2014-01-16 07:04:11 +00:00
MCAsmInfoCOFF.h
MCAsmInfoDarwin.h
MCAsmInfoELF.h Add a MCAsmInfoELF class and factor some code into it. 2013-10-16 01:34:32 +00:00
MCAsmLayout.h
MCAssembler.h Move the STT_FILE symbols out of the normal symbol table processing for 2013-10-29 01:06:17 +00:00
MCAtom.h [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
MCCodeEmitter.h
MCCodeGenInfo.h Teach ISel not to optimize 'optnone' functions (revised). 2013-11-22 19:11:24 +00:00
MCContext.h Fix a crash that occurs when PWD is invalid. 2013-12-10 04:39:09 +00:00
MCDirectives.h
MCDisassembler.h Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
MCDwarf.h Implements parsing and emitting of .cfi_window_save in MC. 2013-09-26 14:49:40 +00:00
MCELF.h
MCELFObjectWriter.h
MCELFStreamer.h Move .ident handling to MCStreamer. 2013-10-16 01:05:45 +00:00
MCELFSymbolFlags.h [mc] Fix ELF st_other flag. 2013-12-05 00:34:11 +00:00
MCExpr.h ARM: add tlsldo relocation 2014-01-20 11:00:40 +00:00
MCExternalSymbolizer.h
MCFixedLenDisassembler.h
MCFixup.h
MCFixupKindInfo.h
MCFunction.h
MCInst.h
MCInstBuilder.h
MCInstPrinter.h
MCInstrAnalysis.h MC: Add some missing include guards 2014-01-17 22:39:45 +00:00
MCInstrDesc.h
MCInstrInfo.h
MCInstrItineraries.h
MCLabel.h
MCMachObjectWriter.h
MCMachOSymbolFlags.h Fix ODR violation. 2013-10-25 03:29:42 +00:00
MCModule.h
MCModuleYAML.h
MCObjectDisassembler.h
MCObjectFileInfo.h DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers 2013-12-13 21:33:40 +00:00
MCObjectStreamer.h Add a MCTargetStreamer interface. 2013-10-08 13:08:17 +00:00
MCObjectSymbolizer.h
MCObjectWriter.h
MCRegisterInfo.h
MCRelocationInfo.h
MCSchedule.h Machine model comments. Explain a ProcessorUnit's BufferSize. 2013-12-05 17:55:53 +00:00
MCSection.h
MCSectionCOFF.h Support multiple COFF sections with the same name but different COMDAT. 2013-11-19 19:52:52 +00:00
MCSectionELF.h DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers 2013-12-13 21:33:40 +00:00
MCSectionMachO.h Explicitly request unsigned enum types when desired 2013-09-23 23:26:57 +00:00
MCStreamer.h Fix inline assembly that switches between ARM and Thumb modes 2014-01-22 18:32:35 +00:00
MCSubtargetInfo.h
MCSymbol.h Correct word hyphenations 2013-12-05 05:44:44 +00:00
MCSymbolizer.h
MCTargetAsmParser.h Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
MCValue.h
MCWin64EH.h
MCWinCOFFObjectWriter.h [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
SectionKind.h
SubtargetFeature.h MC: Don't assume incoming StringRef's are null terminated. 2013-10-13 22:09:26 +00:00