1 //===-- Passes.cpp - Target independent code generation passes ------------===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source 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/Passes.h"
16 #include "Support/CommandLine.h"
21 enum RegAllocName { simple, local, linearscan, iterativescan };
26 cl::desc("Register allocator to use: (default = simple)"),
29 clEnumVal(simple, " simple register allocator"),
30 clEnumVal(local, " local register allocator"),
31 clEnumVal(linearscan, " linear scan register allocator"),
32 clEnumVal(iterativescan, " iterative scan register allocator"),
37 FunctionPass *llvm::createRegisterAllocator() {
40 std::cerr << "no register allocator selected";
43 return createSimpleRegisterAllocator();
45 return createLocalRegisterAllocator();
47 return createLinearScanRegisterAllocator();
49 return createIterativeScanRegisterAllocator();