llvm-6502/include/llvm
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
..
ADT Add operator!= for FoldingSetNodeID and FoldingSetNodeIDRef. Implementation in 2014-01-21 01:29:37 +00:00
Analysis Fix PR18449: SCEV needs more precise max BECount for multi-exit loop. 2014-01-15 06:42:11 +00:00
AsmParser
Bitcode Make parseBitcodeFile return an ErrorOr<Module *>. 2014-01-15 01:08:23 +00:00
CodeGen Adding new LTO APIs to parse metadata nodes and extract linker options and 2014-01-21 18:31:27 +00:00
Config Remove the test for endianness in configure.ac and regenerate. 2014-01-09 01:09:57 +00:00
DebugInfo llvm-dwarfdump: type unit dwo support 2014-01-09 05:08:24 +00:00
ExecutionEngine
IR MIPS: mark intrinsics IntrNoMem so all patterns using them are consistent. 2014-01-21 10:41:16 +00:00
IRReader
LTO Adding new LTO APIs to parse metadata nodes and extract linker options and 2014-01-21 18:31:27 +00:00
MC Fix inline assembly that switches between ARM and Thumb modes 2014-01-22 18:32:35 +00:00
Object Pass the computed magic to createBinary and createObjectFile if available. 2014-01-22 16:04:52 +00:00
Option
Support Add unused result attr to the casting templates 2014-01-22 07:28:49 +00:00
TableGen
Target Adding new LTO APIs to parse metadata nodes and extract linker options and 2014-01-21 18:31:27 +00:00
Transforms [asan] Remove -fsanitize-address-zero-base-shadow command line 2014-01-16 10:19:12 +00:00
AutoUpgrade.h
CMakeLists.txt
DebugInfo.h
DIBuilder.h typo 2014-01-18 02:12:10 +00:00
GVMaterializer.h
InitializePasses.h [PM] Wire up the Verifier for the new pass manager and connect it to the 2014-01-20 11:34:08 +00:00
InstVisitor.h
LinkAllIR.h [cleanup] Move the Dominators.h and Verifier.h headers into the IR 2014-01-13 09:26:24 +00:00
LinkAllPasses.h [PM] Simplify the interface exposed for IR printing passes. 2014-01-12 11:30:46 +00:00
Linker.h
Pass.h
PassAnalysisSupport.h
PassManager.h
PassRegistry.h
PassSupport.h [opt][PassInfo] Allow opt to run passes that need target machine. 2014-01-16 21:44:34 +00:00