summaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorAnders Waldenborg <anders@0x63.nu>2013-10-09 19:02:09 +0000
committerAnders Waldenborg <anders@0x63.nu>2013-10-09 19:02:09 +0000
commit9360e64e60f600bff98dbff96fabaab536947f86 (patch)
treecf0b470ea2b966757766107717c4f02073b7a44d /lib/Target
parent5e5d494ce00741858d5a2f8c305bcd0b341988d2 (diff)
downloadllvm-9360e64e60f600bff98dbff96fabaab536947f86.tar.gz
llvm-9360e64e60f600bff98dbff96fabaab536947f86.tar.bz2
llvm-9360e64e60f600bff98dbff96fabaab536947f86.tar.xz
llvm-c: Make target initializer functions external functions in lib.
Making them proper functions defined in the (shared)lib instead of static inlines defined in the header files makes it possible to actually distribute a binary compiled against the shared library without having to worry about getting undefined symbol errors when calling e.g LLVMInitializeAllTargetInfos because the shared library on the other system was compiled with different targets. Differential Revision: http://llvm-reviews.chandlerc.com/D1714 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/AllTargets.cpp43
-rw-r--r--lib/Target/CMakeLists.txt1
2 files changed, 44 insertions, 0 deletions
diff --git a/lib/Target/AllTargets.cpp b/lib/Target/AllTargets.cpp
new file mode 100644
index 0000000000..a265e8878a
--- /dev/null
+++ b/lib/Target/AllTargets.cpp
@@ -0,0 +1,43 @@
+//===-- AllTargets.cpp ----------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements functions for initialization of different
+// aspects of all configured targets. When calling any of these
+// functions all configured targets must be linked in.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm-c/Target.h"
+#include "llvm/Support/TargetSelect.h"
+
+using namespace llvm;
+
+void LLVMInitializeAllTargetInfos(void) {
+ InitializeAllTargetInfos();
+}
+
+void LLVMInitializeAllTargets(void) {
+ InitializeAllTargets();
+}
+
+void LLVMInitializeAllTargetMCs(void) {
+ InitializeAllTargetMCs();
+}
+
+void LLVMInitializeAllAsmPrinters(void) {
+ InitializeAllAsmPrinters();
+}
+
+void LLVMInitializeAllAsmParsers(void) {
+ InitializeAllAsmParsers();
+}
+
+void LLVMInitializeAllDisassemblers(void) {
+ InitializeAllDisassemblers();
+}
diff --git a/lib/Target/CMakeLists.txt b/lib/Target/CMakeLists.txt
index 02ac493b42..75b65cfffa 100644
--- a/lib/Target/CMakeLists.txt
+++ b/lib/Target/CMakeLists.txt
@@ -1,4 +1,5 @@
add_llvm_library(LLVMTarget
+ AllTargets.cpp
Mangler.cpp
Target.cpp
TargetIntrinsicInfo.cpp