LLVM API Documentation
00001 //===-- MCTargetOptionsCommandFlags.h --------------------------*- 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 contains machine code-specific flags that are shared between 00011 // different command line tools. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H 00016 #define LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H 00017 00018 #include "llvm/Support/CommandLine.h" 00019 #include "llvm/MC/MCTargetOptions.h" 00020 using namespace llvm; 00021 00022 cl::opt<MCTargetOptions::AsmInstrumentation> AsmInstrumentation( 00023 "asm-instrumentation", cl::desc("Instrumentation of inline assembly and " 00024 "assembly source files"), 00025 cl::init(MCTargetOptions::AsmInstrumentationNone), 00026 cl::values(clEnumValN(MCTargetOptions::AsmInstrumentationNone, "none", 00027 "no instrumentation at all"), 00028 clEnumValN(MCTargetOptions::AsmInstrumentationAddress, "address", 00029 "instrument instructions with memory arguments"), 00030 clEnumValEnd)); 00031 00032 cl::opt<bool> RelaxAll("mc-relax-all", 00033 cl::desc("When used with filetype=obj, " 00034 "relax all fixups in the emitted object file")); 00035 00036 cl::opt<int> DwarfVersion("dwarf-version", cl::desc("Dwarf version"), 00037 cl::init(0)); 00038 00039 cl::opt<bool> ShowMCInst("asm-show-inst", 00040 cl::desc("Emit internal instruction representation to " 00041 "assembly file")); 00042 00043 static inline MCTargetOptions InitMCTargetOptionsFromFlags() { 00044 MCTargetOptions Options; 00045 Options.SanitizeAddress = 00046 (AsmInstrumentation == MCTargetOptions::AsmInstrumentationAddress); 00047 Options.MCRelaxAll = RelaxAll; 00048 Options.DwarfVersion = DwarfVersion; 00049 Options.ShowMCInst = ShowMCInst; 00050 return Options; 00051 } 00052 00053 #endif