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 };
25 cl::desc("Register allocator to use: (default = simple)"),
27 cl::values(clEnumVal(simple, " simple register allocator"),
28 clEnumVal(local, " local register allocator"),
29 clEnumVal(linearscan, " linear scan register allocator"),
30 clEnumVal(iterativescan," iterative scan register allocator"),
35 FunctionPass *llvm::createRegisterAllocator() {
38 std::cerr << "no register allocator selected";
41 return createSimpleRegisterAllocator();
43 return createLocalRegisterAllocator();
45 return createLinearScanRegisterAllocator();
47 return createIterativeScanRegisterAllocator();