llvm-6502/lib/Target/ARM/MCTargetDesc
Greg Fitzgerald 148c7f286c 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199818 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-22 18:32:35 +00:00
..
ARMAddressingModes.h
ARMArchName.def Recognize armv7a and friends as aliases for armv7-a etc. for the purpose 2013-12-26 11:50:28 +00:00
ARMArchName.h Recognize armv7a and friends as aliases for armv7-a etc. for the purpose 2013-12-26 11:50:28 +00:00
ARMAsmBackend.cpp Remove support for armv7f slice. <rdar://problem/12478440> 2014-01-15 21:44:14 +00:00
ARMBaseInfo.h
ARMELFObjectWriter.cpp ARM: add tlsldo relocation 2014-01-20 11:00:40 +00:00
ARMELFStreamer.cpp Fix inline assembly that switches between ARM and Thumb modes 2014-01-22 18:32:35 +00:00
ARMFixupKinds.h
ARMMachObjectWriter.cpp Fixed a bug in getARMFixupKindMachOInfo() where three ARM fixup kinds 2013-12-13 22:46:54 +00:00
ARMMachORelocationInfo.cpp Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
ARMMCAsmInfo.cpp
ARMMCAsmInfo.h
ARMMCCodeEmitter.cpp ARM IAS: support emitting constant values in target expressions 2014-01-11 23:03:48 +00:00
ARMMCExpr.cpp
ARMMCExpr.h
ARMMCTargetDesc.cpp Clean up an inconsistency in v7s feature default. 2014-01-09 20:24:00 +00:00
ARMMCTargetDesc.h
ARMUnwindOpAsm.cpp ARM IAS: support .personalityindex 2014-01-21 02:33:02 +00:00
ARMUnwindOpAsm.h ARM IAS: add support for .unwind_raw directive 2014-01-21 02:33:10 +00:00
CMakeLists.txt Move ARM build attributes into Support 2014-01-19 08:25:27 +00:00
LLVMBuild.txt
Makefile