LLVM  mainline
MCCodeGenInfo.h
Go to the documentation of this file.
00001 //===-- llvm/MC/MCCodeGenInfo.h - Target CodeGen Info -----------*- C++ -*-===//
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 tracks information about the target which can affect codegen,
00011 // asm parsing, and asm printing. For example, relocation model.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_MC_MCCODEGENINFO_H
00016 #define LLVM_MC_MCCODEGENINFO_H
00017 
00018 #include "llvm/Support/CodeGen.h"
00019 
00020 namespace llvm {
00021 
00022   class MCCodeGenInfo {
00023     /// RelocationModel - Relocation model: static, pic, etc.
00024     ///
00025     Reloc::Model RelocationModel;
00026 
00027     /// CMModel - Code model.
00028     ///
00029     CodeModel::Model CMModel;
00030 
00031     /// OptLevel - Optimization level.
00032     ///
00033     CodeGenOpt::Level OptLevel;
00034 
00035   public:
00036     void InitMCCodeGenInfo(Reloc::Model RM = Reloc::Default,
00037                            CodeModel::Model CM = CodeModel::Default,
00038                            CodeGenOpt::Level OL = CodeGenOpt::Default);
00039 
00040     Reloc::Model getRelocationModel() const { return RelocationModel; }
00041 
00042     CodeModel::Model getCodeModel() const { return CMModel; }
00043 
00044     CodeGenOpt::Level getOptLevel() const { return OptLevel; }
00045 
00046     // Allow overriding OptLevel on a per-function basis.
00047     void setOptLevel(CodeGenOpt::Level Level) { OptLevel = Level; }
00048   };
00049 } // namespace llvm
00050 
00051 #endif