1 //===-- Passes.cpp - Target independent code generation passes ------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines interfaces to access the target independent code
11 // generation passes provided by the LLVM backend.
13 //===---------------------------------------------------------------------===//
15 #include "llvm/CodeGen/RegAllocRegistry.h"
16 #include "llvm/CodeGen/Passes.h"
20 //===---------------------------------------------------------------------===//
22 /// RegisterRegAlloc class - Track the registration of register allocators.
24 //===---------------------------------------------------------------------===//
25 MachinePassRegistry RegisterRegAlloc::Registry;
28 //===---------------------------------------------------------------------===//
30 /// RegAlloc command line options.
32 //===---------------------------------------------------------------------===//
35 cl::opt<RegisterRegAlloc::FunctionPassCtor, false,
36 RegisterPassParser<RegisterRegAlloc> >
38 cl::init(&createLinearScanRegisterAllocator),
39 cl::desc("Register allocator to use: (default = linearscan)"));
43 //===---------------------------------------------------------------------===//
45 /// createRegisterAllocator - choose the appropriate register allocator.
47 //===---------------------------------------------------------------------===//
48 FunctionPass *llvm::createRegisterAllocator() {
49 RegisterRegAlloc::FunctionPassCtor Ctor = RegisterRegAlloc::getDefault();
53 RegisterRegAlloc::setDefault(RegAlloc);