summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShih-wei Liao <sliao@google.com>2010-06-04 12:34:56 -0700
committerShih-wei Liao <sliao@google.com>2010-06-04 12:34:56 -0700
commit8a54f3e1f79c1e57e76a1cc53c6c5697374ea7b5 (patch)
tree9a9ff3c18a33cf3838b1e37813f7ef9fe64d2e78
parentee9f5c0a63197e6e3148f09b401f0056cdf1a179 (diff)
downloadexternal_llvm-8a54f3e1f79c1e57e76a1cc53c6c5697374ea7b5.zip
external_llvm-8a54f3e1f79c1e57e76a1cc53c6c5697374ea7b5.tar.gz
external_llvm-8a54f3e1f79c1e57e76a1cc53c6c5697374ea7b5.tar.bz2
Initial slang.
Change-Id: I4f84a741e5fbc440cd4c251406d2b611a237f713
-rw-r--r--Android.mk11
-rw-r--r--MODULE_LICENSE_BSD_LIKE0
-rw-r--r--NOTICE69
-rw-r--r--device/include/llvm/Config/config.h6
-rw-r--r--host/include/llvm/Config/AsmPrinters.def2
-rw-r--r--host/include/llvm/Config/Targets.def2
-rw-r--r--host/include/llvm/Config/config.h3
-rw-r--r--lib/Bitcode/Writer/Android.mk17
-rw-r--r--lib/Target/ARM/Android.mk34
-rw-r--r--lib/Target/ARM/AsmPrinter/Android.mk42
-rw-r--r--lib/Target/ARM/TargetInfo/Android.mk38
-rw-r--r--llvm-tblgen-rules.mk116
-rw-r--r--llvm.mk20
13 files changed, 328 insertions, 32 deletions
diff --git a/Android.mk b/Android.mk
index cf684a8..3044936 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,6 +1,7 @@
LOCAL_PATH := $(call my-dir)
LLVM_ROOT_PATH := $(LOCAL_PATH)
LLVM_ENABLE_ASSERTION := true
+
include $(CLEAR_VARS)
# Only use this on the device or emulator.
@@ -12,6 +13,7 @@ subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
utils/TableGen \
lib/VMCore \
lib/Bitcode/Reader \
+ lib/Bitcode/Writer \
lib/Analysis \
lib/Analysis/IPA \
lib/Transforms/IPO \
@@ -33,15 +35,10 @@ subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
lib/ExecutionEngine/JIT \
lib/MC \
lib/MC/MCParser \
+ tools/clang \
))
-TBLGEN := $(HOST_OUT_EXECUTABLES)/tblgen$(HOST_EXECUTABLE_SUFFIX)
-
-CLEAR_TBLGEN_VARS := $(LOCAL_PATH)/clear_tblgen_vars.mk
-LLVM_HOST_BUILD_MK := $(LOCAL_PATH)/llvm-host-build.mk
-LLVM_DEVICE_BUILD_MK := $(LOCAL_PATH)/llvm-device-build.mk
-LLVM_GEN_INTRINSICS_MK := $(LOCAL_PATH)/llvm-gen-intrinsics.mk
-LLVM_TBLGEN_RULES_MK := $(LOCAL_PATH)/tblgen-rules.mk
+include $(LOCAL_PATH)/llvm.mk
include $(subdirs)
diff --git a/MODULE_LICENSE_BSD_LIKE b/MODULE_LICENSE_BSD_LIKE
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_BSD_LIKE
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..b8d2c74
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,69 @@
+==============================================================================
+LLVM Release License
+==============================================================================
+University of Illinois/NCSA
+Open Source License
+
+Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign.
+All rights reserved.
+
+Developed by:
+
+ LLVM Team
+
+ University of Illinois at Urbana-Champaign
+
+ http://llvm.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal with
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimers.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimers in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the names of the LLVM Team, University of Illinois at
+ Urbana-Champaign, nor the names of its contributors may be used to
+ endorse or promote products derived from this Software without specific
+ prior written permission.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+SOFTWARE.
+
+==============================================================================
+Copyrights and Licenses for Third Party Software Distributed with LLVM:
+==============================================================================
+The LLVM software contains code written by third parties. Such software will
+have its own individual LICENSE.TXT file in the directory in which it appears.
+This file will describe the copyrights, license, and restrictions which apply
+to that code.
+
+The disclaimer of warranty in the University of Illinois Open Source License
+applies to all code in the LLVM Distribution, and nothing in any of the
+other licenses gives permission to use the names of the LLVM Team or the
+University of Illinois to endorse or promote products derived from this
+Software.
+
+The following pieces of software have additional or alternate copyrights,
+licenses, and/or restrictions:
+
+Program Directory
+------- ---------
+Autoconf llvm/autoconf
+ llvm/projects/ModuleMaker/autoconf
+ llvm/projects/sample/autoconf
+CellSPU backend llvm/lib/Target/CellSPU/README.txt
+Google Test llvm/utils/unittest/googletest
+OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex}
diff --git a/device/include/llvm/Config/config.h b/device/include/llvm/Config/config.h
index 3dbc737..6a5d0ea 100644
--- a/device/include/llvm/Config/config.h
+++ b/device/include/llvm/Config/config.h
@@ -262,6 +262,9 @@
/* Define to 1 if you have the `opendir' function. */
#define HAVE_OPENDIR 1
+/* Define to 1 if you have the `posix_spawn' function. */
+/* #undef HAVE_POSIX_SPAWN */
+
/* Define to 1 if you have the `powf' function. */
#define HAVE_POWF 1
@@ -438,6 +441,9 @@
/* Define to 1 if the system has the type `u_int64_t'. */
/* #undef HAVE_U_INT64_T */
+/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
+/* #undef HAVE_VALGRIND_VALGRIND_H */
+
/* Define to 1 if you have the <windows.h> header file. */
/* #undef HAVE_WINDOWS_H */
diff --git a/host/include/llvm/Config/AsmPrinters.def b/host/include/llvm/Config/AsmPrinters.def
index 3cec2c5..cefdfeb 100644
--- a/host/include/llvm/Config/AsmPrinters.def
+++ b/host/include/llvm/Config/AsmPrinters.def
@@ -24,6 +24,6 @@
# error Please define the macro LLVM_ASM_PRINTER(TargetName)
#endif
-LLVM_ASM_PRINTER(X86) LLVM_ASM_PRINTER(X86)
+LLVM_ASM_PRINTER(ARM) LLVM_ASM_PRINTER(X86) LLVM_ASM_PRINTER(X86)
#undef LLVM_ASM_PRINTER
diff --git a/host/include/llvm/Config/Targets.def b/host/include/llvm/Config/Targets.def
index dbc8dd6..32f469d 100644
--- a/host/include/llvm/Config/Targets.def
+++ b/host/include/llvm/Config/Targets.def
@@ -23,6 +23,6 @@
# error Please define the macro LLVM_TARGET(TargetName)
#endif
-LLVM_TARGET(X86) LLVM_TARGET(X86)
+LLVM_TARGET(ARM) LLVM_TARGET(X86) LLVM_TARGET(X86)
#undef LLVM_TARGET
diff --git a/host/include/llvm/Config/config.h b/host/include/llvm/Config/config.h
index 7aa5fc1..85b4cca 100644
--- a/host/include/llvm/Config/config.h
+++ b/host/include/llvm/Config/config.h
@@ -259,6 +259,9 @@
/* Define to 1 if you have the `opendir' function. */
#define HAVE_OPENDIR 1
+/* Define to 1 if you have the `posix_spawn' function. */
+/*#define HAVE_POSIX_SPAWN 1*/
+
/* Define to 1 if you have the `powf' function. */
#define HAVE_POWF 1
diff --git a/lib/Bitcode/Writer/Android.mk b/lib/Bitcode/Writer/Android.mk
new file mode 100644
index 0000000..5147c46
--- /dev/null
+++ b/lib/Bitcode/Writer/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH:= $(call my-dir)
+
+# For the host only
+# =====================================================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ BitWriter.cpp \
+ BitcodeWriter.cpp \
+ BitcodeWriterPass.cpp \
+ ValueEnumerator.cpp
+
+LOCAL_MODULE:= libLLVMBitWriter
+
+include $(LLVM_HOST_BUILD_MK)
+include $(LLVM_GEN_INTRINSICS_MK)
+include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/lib/Target/ARM/Android.mk b/lib/Target/ARM/Android.mk
index d91bd38..e4d2f68 100644
--- a/lib/Target/ARM/Android.mk
+++ b/lib/Target/ARM/Android.mk
@@ -1,11 +1,6 @@
LOCAL_PATH := $(call my-dir)
-# For the device only
-# =====================================================
-include $(CLEAR_VARS)
-include $(CLEAR_TBLGEN_VARS)
-
-TBLGEN_TABLES := \
+arm_codegen_TBLGEN_TABLES := \
ARMGenRegisterInfo.h.inc \
ARMGenRegisterNames.inc \
ARMGenRegisterInfo.inc \
@@ -16,7 +11,7 @@ TBLGEN_TABLES := \
ARMGenCodeEmitter.inc \
ARMGenCallingConv.inc
-LOCAL_SRC_FILES := \
+arm_codegen_SRC_FILES := \
ARMBaseInstrInfo.cpp \
ARMBaseRegisterInfo.cpp \
ARMCodeEmitter.cpp \
@@ -42,6 +37,31 @@ LOCAL_SRC_FILES := \
Thumb2RegisterInfo.cpp \
Thumb2SizeReduction.cpp
+# For the host
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+TBLGEN_TABLES := $(arm_codegen_TBLGEN_TABLES)
+
+LOCAL_SRC_FILES := $(arm_codegen_SRC_FILES)
+
+LOCAL_MODULE:= libLLVMARMCodeGen
+
+include $(LLVM_HOST_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(LLVM_GEN_INTRINSICS_MK)
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+# For the device only
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+TBLGEN_TABLES := $(arm_codegen_TBLGEN_TABLES)
+
+LOCAL_SRC_FILES := $(arm_codegen_SRC_FILES)
+
LOCAL_MODULE:= libLLVMARMCodeGen
include $(LLVM_DEVICE_BUILD_MK)
diff --git a/lib/Target/ARM/AsmPrinter/Android.mk b/lib/Target/ARM/AsmPrinter/Android.mk
index b906904..727ab1d 100644
--- a/lib/Target/ARM/AsmPrinter/Android.mk
+++ b/lib/Target/ARM/AsmPrinter/Android.mk
@@ -1,23 +1,47 @@
LOCAL_PATH := $(call my-dir)
-# For the device only
-# =====================================================
-include $(CLEAR_VARS)
-include $(CLEAR_TBLGEN_VARS)
-
-TBLGEN_TABLES := \
+arm_asm_printer_TBLGEN_TABLES := \
ARMGenAsmWriter.inc \
ARMGenInstrNames.inc \
ARMGenRegisterNames.inc \
ARMGenRegisterInfo.h.inc
-TBLGEN_TD_DIR := $(LOCAL_PATH)/..
-
-LOCAL_SRC_FILES := \
+arm_asm_printer_SRC_FILES := \
ARMAsmPrinter.cpp \
ARMInstPrinter.cpp \
ARMMCInstLower.cpp
+# For the host
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+TBLGEN_TABLES := $(arm_asm_printer_TBLGEN_TABLES)
+
+TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+
+LOCAL_SRC_FILES := $(arm_asm_printer_SRC_FILES)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/..
+
+LOCAL_MODULE:= libLLVMARMAsmPrinter
+
+include $(LLVM_HOST_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+# For the device
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+TBLGEN_TABLES := $(arm_asm_printer_TBLGEN_TABLES)
+
+TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+
+LOCAL_SRC_FILES := $(arm_asm_printer_SRC_FILES)
+
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/..
diff --git a/lib/Target/ARM/TargetInfo/Android.mk b/lib/Target/ARM/TargetInfo/Android.mk
index c1998a1..9297d36 100644
--- a/lib/Target/ARM/TargetInfo/Android.mk
+++ b/lib/Target/ARM/TargetInfo/Android.mk
@@ -1,19 +1,43 @@
LOCAL_PATH := $(call my-dir)
-# For the device only
+arm_target_info_TBLGEN_TABLES := \
+ ARMGenRegisterNames.inc \
+ ARMGenInstrNames.inc
+
+arm_target_info_SRC_FILES := \
+ ARMTargetInfo.cpp
+
+# For the host
# =====================================================
include $(CLEAR_VARS)
include $(CLEAR_TBLGEN_VARS)
-TBLGEN_TABLES := \
- ARMGenRegisterNames.inc \
- ARMGenInstrNames.inc
+TBLGEN_TABLES := $(arm_target_info_TBLGEN_TABLES)
TBLGEN_TD_DIR := $(LOCAL_PATH)/..
-LOCAL_SRC_FILES := \
- ARMTargetInfo.cpp
-
+LOCAL_SRC_FILES := $(arm_target_info_SRC_FILES)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/..
+
+LOCAL_MODULE:= libLLVMARMInfo
+
+include $(LLVM_HOST_BUILD_MK)
+include $(LLVM_TBLGEN_RULES_MK)
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+# For the device
+# =====================================================
+include $(CLEAR_VARS)
+include $(CLEAR_TBLGEN_VARS)
+
+TBLGEN_TABLES := $(arm_target_info_TBLGEN_TABLES)
+
+TBLGEN_TD_DIR := $(LOCAL_PATH)/..
+
+LOCAL_SRC_FILES := $(arm_target_info_SRC_FILES)
+
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/..
diff --git a/llvm-tblgen-rules.mk b/llvm-tblgen-rules.mk
new file mode 100644
index 0000000..a3d71cb
--- /dev/null
+++ b/llvm-tblgen-rules.mk
@@ -0,0 +1,116 @@
+###########################################################
+## Commands for running tblgen to compile a td file
+##########################################################
+define transform-td-to-out
+$(if $(LOCAL_IS_HOST_MODULE), \
+ $(call transform-host-td-to-out,$(1)), \
+ $(call transform-device-td-to-out,$(1)))
+endef
+
+###########################################################
+## TableGen: Compile .td files to .inc.
+###########################################################
+
+# Set LOCAL_MODULE_CLASS to STATIC_LIBRARIES default (require
+# for macro local-intermediates-dir)
+ifeq ($(LOCAL_MODULE_CLASS),)
+ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+endif
+
+ifneq ($(strip $(TBLGEN_TABLES)),)
+
+intermediates := $(call local-intermediates-dir)
+tblgen_gen_tables := $(addprefix $(intermediates)/,$(TBLGEN_TABLES))
+LOCAL_GENERATED_SOURCES += $(tblgen_gen_tables)
+
+tblgen_source_dir := $(LOCAL_PATH)
+ifneq ($(TBLGEN_TD_DIR),)
+tblgen_source_dir := $(TBLGEN_TD_DIR)
+endif
+
+ifneq ($(filter %GenRegisterNames.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenRegisterNames.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,register-enums)
+endif
+
+ifneq ($(filter %GenRegisterInfo.h.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenRegisterInfo.h.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,register-desc-header)
+endif
+
+ifneq ($(filter %GenRegisterInfo.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenRegisterInfo.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,register-desc)
+endif
+
+ifneq ($(filter %GenInstrNames.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenInstrNames.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,instr-enums)
+endif
+
+ifneq ($(filter %GenInstrInfo.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenInstrInfo.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,instr-desc)
+endif
+
+ifneq ($(filter %GenAsmWriter.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenAsmWriter.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,asm-writer)
+endif
+
+ifneq ($(filter %GenAsmWriter1.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenAsmWriter1.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,asm-writer -asmwriternum=1)
+endif
+
+ifneq ($(filter %GenAsmMatcher.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenAsmMatcher.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,asm-matcher)
+endif
+
+ifneq ($(filter %GenCodeEmitter.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenCodeEmitter.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,emitter)
+endif
+
+ifneq ($(filter %GenDAGISel.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenDAGISel.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,dag-isel)
+endif
+
+ifneq ($(filter %GenDisassemblerTables.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenDisassemblerTables.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,disassembler)
+endif
+
+ifneq ($(filter %GenEDInfo.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenEDInfo.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,enhanced-disassembly-info)
+endif
+
+ifneq ($(filter %GenFastISel.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenFastISel.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,fast-isel)
+endif
+
+ifneq ($(filter %GenSubtarget.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenSubtarget.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,subtarget)
+endif
+
+ifneq ($(filter %GenCallingConv.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenCallingConv.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,callingconv)
+endif
+
+ifneq ($(filter %GenIntrinsics.inc,$(tblgen_gen_tables)),)
+$(intermediates)/%GenIntrinsics.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
+ $(call transform-td-to-out,tgt_intrinsics)
+endif
+
+ifneq ($(findstring ARMGenDecoderTables.inc,$(tblgen_gen_tables)),)
+$(intermediates)/ARMGenDecoderTables.inc: $(tblgen_source_dir)/ARM.td $(TBLGEN)
+ $(call transform-td-to-out,arm-decoder)
+endif
+
+endif
diff --git a/llvm.mk b/llvm.mk
new file mode 100644
index 0000000..33e1175
--- /dev/null
+++ b/llvm.mk
@@ -0,0 +1,20 @@
+# Only use this on the device or emulator.
+ifeq ($(TARGET_SIMULATOR),true)
+$(error LLVM not suitable for the simulator! $(LOCAL_PATH))
+endif
+
+ifeq ($(LLVM_ROOT_PATH),)
+$(error Must set variable LLVM_ROOT_PATH before including this! $(LOCAL_PATH))
+endif
+
+TBLGEN := $(HOST_OUT_EXECUTABLES)/tblgen$(HOST_EXECUTABLE_SUFFIX)
+
+CLEAR_TBLGEN_VARS := $(LLVM_ROOT_PATH)/clear_tblgen_vars.mk
+LLVM_HOST_BUILD_MK := $(LLVM_ROOT_PATH)/llvm-host-build.mk
+LLVM_DEVICE_BUILD_MK := $(LLVM_ROOT_PATH)/llvm-device-build.mk
+LLVM_GEN_INTRINSICS_MK := $(LLVM_ROOT_PATH)/llvm-gen-intrinsics.mk
+LLVM_TBLGEN_RULES_MK := $(LLVM_ROOT_PATH)/llvm-tblgen-rules.mk
+
+CLANG_ROOT_PATH := $(LLVM_ROOT_PATH)/tools/clang
+
+include $(CLANG_ROOT_PATH)/clang.mk