summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-03-08 01:38:55 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-03-08 01:38:55 +0000
commit39293d3aaaf7b069b3415c06677782747a1f4bab (patch)
tree676faf1afba927624036a06d6a9f590de32ccc8e /llvm/lib/CodeGen
parentc8976d58fe6d04fa991d68fb6013b08facc471aa (diff)
downloadbcm5719-llvm-39293d3aaaf7b069b3415c06677782747a1f4bab.tar.gz
bcm5719-llvm-39293d3aaaf7b069b3415c06677782747a1f4bab.zip
[GlobalISel] Introduce initializer method to support start/stop-after features.
llvm-svn: 262896
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/CMakeLists.txt2
-rw-r--r--llvm/lib/CodeGen/GlobalISel/EmptyFile.cpp24
-rw-r--r--llvm/lib/CodeGen/GlobalISel/GlobalISel.cpp29
-rw-r--r--llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp3
4 files changed, 33 insertions, 25 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
index a226dcc479d..8b4bf8d830e 100644
--- a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
+++ b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
@@ -18,7 +18,7 @@ endif()
# not ask for it.
add_llvm_library(LLVMGlobalISel
${GLOBAL_ISEL_BUILD_FILES}
- EmptyFile.cpp
+ GlobalISel.cpp
)
add_dependencies(LLVMGlobalISel intrinsics_gen)
diff --git a/llvm/lib/CodeGen/GlobalISel/EmptyFile.cpp b/llvm/lib/CodeGen/GlobalISel/EmptyFile.cpp
deleted file mode 100644
index cc509ff1e87..00000000000
--- a/llvm/lib/CodeGen/GlobalISel/EmptyFile.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===-- llvm/CodeGen/GlobalISel/EmptyFile.cpp ------ EmptyFile ---*- C++ -*-==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-/// \file
-/// The purpose of this file is to please cmake by not creating an
-/// empty library when we do not build GlobalISel.
-/// \todo This file should be removed when GlobalISel is not optional anymore.
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/Compiler.h"
-
-
-namespace llvm {
-// Export a global symbol so that ranlib does not complain
-// about the TOC being empty for the global-isel library when
-// we do not build global-isel.
-LLVM_ATTRIBUTE_UNUSED void DummyFunctionToSilenceRanlib(void) {
-}
-}
diff --git a/llvm/lib/CodeGen/GlobalISel/GlobalISel.cpp b/llvm/lib/CodeGen/GlobalISel/GlobalISel.cpp
new file mode 100644
index 00000000000..f6857f1bd40
--- /dev/null
+++ b/llvm/lib/CodeGen/GlobalISel/GlobalISel.cpp
@@ -0,0 +1,29 @@
+//===-- llvm/CodeGen/GlobalISel/GlobalIsel.cpp --- GlobalISel ----*- C++ -*-==//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+/// \file
+// This file implements the common initialization routines for the
+// GlobalISel library.
+//===----------------------------------------------------------------------===//
+
+#include "llvm/InitializePasses.h"
+#include "llvm/PassRegistry.h"
+
+using namespace llvm;
+
+#ifndef LLVM_BUILD_GLOBAL_ISEL
+
+void llvm::initializeGlobalISel(PassRegistry &Registry) {
+}
+
+#else
+
+void llvm::initializeGlobalISel(PassRegistry &Registry) {
+ initializeIRTranslatorPass(Registry);
+}
+#endif // LLVM_BUILD_GLOBAL_ISEL
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index 8b9a5b5bf04..4ba21e7ec1d 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -27,8 +27,11 @@
using namespace llvm;
char IRTranslator::ID = 0;
+INITIALIZE_PASS(IRTranslator, "irtranslator", "IRTranslator LLVM IR -> MI",
+ false, false);
IRTranslator::IRTranslator() : MachineFunctionPass(ID), MRI(nullptr) {
+ initializeIRTranslatorPass(*PassRegistry::getPassRegistry());
}
unsigned IRTranslator::getOrCreateVReg(const Value *Val) {
OpenPOWER on IntegriCloud