Re-enable ARM/Thumb disassembler and add a workaround for a memcpy() call in
authorJohnny Chen <johnny.chen@apple.com>
Wed, 7 Apr 2010 20:53:12 +0000 (20:53 +0000)
committerJohnny Chen <johnny.chen@apple.com>
Wed, 7 Apr 2010 20:53:12 +0000 (20:53 +0000)
ARMDecoderEmitter.cpp, with FIXME comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100690 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/Disassembler/Makefile [new file with mode: 0644]
lib/Target/ARM/Makefile
utils/TableGen/ARMDecoderEmitter.cpp

diff --git a/lib/Target/ARM/Disassembler/Makefile b/lib/Target/ARM/Disassembler/Makefile
new file mode 100644 (file)
index 0000000..031b6ac
--- /dev/null
@@ -0,0 +1,16 @@
+##===- lib/Target/ARM/Disassembler/Makefile ----------------*- Makefile -*-===##
+#
+#                     The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../../../..
+LIBRARYNAME = LLVMARMDisassembler
+
+# Hack: we need to include 'main' arm target directory to grab private headers
+CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/..
+
+include $(LEVEL)/Makefile.common
index a8dd38cb362e2d001ef4efe28a38bb9e7e5dcf3d..47922436f5354d9ab87689456d8ecd3688658be1 100644 (file)
@@ -16,8 +16,9 @@ BUILT_SOURCES = ARMGenRegisterInfo.h.inc ARMGenRegisterNames.inc \
                 ARMGenRegisterInfo.inc ARMGenInstrNames.inc \
                 ARMGenInstrInfo.inc ARMGenAsmWriter.inc \
                 ARMGenDAGISel.inc ARMGenSubtarget.inc \
-                ARMGenCodeEmitter.inc ARMGenCallingConv.inc
+                ARMGenCodeEmitter.inc ARMGenCallingConv.inc \
+                ARMGenDecoderTables.inc
 
-DIRS = AsmPrinter AsmParser TargetInfo
+DIRS = AsmPrinter AsmParser Disassembler TargetInfo
 
 include $(LEVEL)/Makefile.common
index 5fb8b6bfb232658da9ae862ab30f9d3ef60232ee..230152195ed505f5293ed3787e775f9bdb68fe4f 100644 (file)
@@ -596,7 +596,11 @@ void Filter::recurse() {
 
   bit_value_t BitValueArray[BIT_WIDTH];
   // Starts by inheriting our parent filter chooser's filter bit values.
-  memcpy(BitValueArray, Owner->FilterBitValues, sizeof(BitValueArray));
+  bit_value_t *BitVals = Owner->FilterBitValues;
+  for (unsigned i = 0; i < BIT_WIDTH; ++i)
+    BitValueArray[i] = BitVals[i];
+  // FIXME: memcpy() is optmized out with self-hosting llvm-gcc (-O1 and -O2).
+  //memcpy(BitValueArray, Owner->FilterBitValues, sizeof(BitValueArray));
 
   unsigned bitIndex;
 
@@ -623,7 +627,7 @@ void Filter::recurse() {
     assert(FilterChooserMap.size() == 1);
     return;
   }
-        
+
   // Otherwise, create sub choosers.
   for (mapIterator = FilteredInstructions.begin();
        mapIterator != FilteredInstructions.end();