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 "llvm/Support/CommandLine.h"
21 enum RegAllocName { simple, local, linearscan };
26 cl::desc("Register allocator to use: (default = linearscan)"),
29 clEnumVal(simple, " simple register allocator"),
30 clEnumVal(local, " local register allocator"),
31 clEnumVal(linearscan, " linear scan register allocator"),
33 cl::init(linearscan));
36 FunctionPass *llvm::createRegisterAllocator() {
39 std::cerr << "no register allocator selected";
42 return createSimpleRegisterAllocator();
44 return createLocalRegisterAllocator();
46 return createLinearScanRegisterAllocator();