[PATCH] Fix PR18345: ldr= pseudo instruction produces incorrect code when using in inline assembly

David Peixotto dpeixott at codeaurora.org
Mon Jan 27 19:05:06 PST 2014


Hi rafael, rengolin, grosbach,

This patch fixes the ldr-pseudo implementation to work when used in
inline assembly.  The fix is to move arm assembler constant pools
from the ARMAsmParser class to the ARMTargetStreamer class.

Previously we kept the assembler generated constant pools in the
ARMAsmParser object. This does not work for inline assembly because
a new parser object is created for each blob of inline assembly.
This patch moves the constant pools to the ARMTargetStreamer class
so that the constant pool will remain alive for the entire code
generation process.

This patch also adds the ARMTargetMachOStreamer class. There was no
existing definition of the ARMTargetMachOStreamer class because the
target streamer was not previously needed when generating MachO
objects. We now require the ARMTargetStreamer class to exist because
it is used to hold the assembler constant pools.

http://llvm-reviews.chandlerc.com/D2638

Files:
  include/llvm/MC/MCStreamer.h
  include/llvm/MC/MCTargetAsmParser.h
  lib/MC/MCParser/AsmParser.cpp
  lib/MC/MCStreamer.cpp
  lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
  lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
  lib/Target/ARM/MCTargetDesc/ARMTargetMachOStreamer.h
  lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp
  lib/Target/ARM/MCTargetDesc/CMakeLists.txt
  test/CodeGen/ARM/inlineasm-ldr-pseudo.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2638.1.patch
Type: text/x-patch
Size: 20698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140127/026c1080/attachment.bin>


More information about the llvm-commits mailing list