LLVM API Documentation
00001 //===-- Passes.cpp - Target independent code generation passes ------------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines interfaces to access the target independent code 00011 // generation passes provided by the LLVM backend. 00012 // 00013 //===---------------------------------------------------------------------===// 00014 00015 #include "llvm/CodeGen/RegAllocRegistry.h" 00016 #include "llvm/CodeGen/Passes.h" 00017 00018 using namespace llvm; 00019 00020 //===---------------------------------------------------------------------===// 00021 /// 00022 /// RegisterRegAlloc class - Track the registration of register allocators. 00023 /// 00024 //===---------------------------------------------------------------------===// 00025 MachinePassRegistry RegisterRegAlloc::Registry; 00026 00027 00028 //===---------------------------------------------------------------------===// 00029 /// 00030 /// RegAlloc command line options. 00031 /// 00032 //===---------------------------------------------------------------------===// 00033 static cl::opt<RegisterRegAlloc::FunctionPassCtor, false, 00034 RegisterPassParser<RegisterRegAlloc> > 00035 RegAlloc("regalloc", 00036 cl::init(&createLinearScanRegisterAllocator), 00037 cl::desc("Register allocator to use: (default = linearscan)")); 00038 00039 00040 //===---------------------------------------------------------------------===// 00041 /// 00042 /// createRegisterAllocator - choose the appropriate register allocator. 00043 /// 00044 //===---------------------------------------------------------------------===// 00045 FunctionPass *llvm::createRegisterAllocator() { 00046 RegisterRegAlloc::FunctionPassCtor Ctor = RegisterRegAlloc::getDefault(); 00047 00048 if (!Ctor) { 00049 Ctor = RegAlloc; 00050 RegisterRegAlloc::setDefault(RegAlloc); 00051 } 00052 00053 return Ctor(); 00054 }
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.