diff options
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel')
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/EmptyFile.cpp | 24 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/GlobalISel.cpp | 29 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 3 |
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) { |

