1 //===- OutputFormatOptions.h ----------------------------------------------===// 2 // 3 // The MCLinker Project 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 #ifndef MCLD_LDLITE_OUTPUT_FORMAT_OPTIONS_H 10 #define MCLD_LDLITE_OUTPUT_FORMAT_OPTIONS_H 11 #include <llvm/Support/CommandLine.h> 12 #include <mcld/Support/CommandLine.h> 13 #include <mcld/LinkerConfig.h> 14 #include <mcld/GeneralOptions.h> 15 #include <mcld/Support/Path.h> 16 #include <mcld/MC/Input.h> 17 #include <string> 18 19 namespace mcld { 20 21 class Module; 22 23 class OutputFormatOptions 24 { 25 public: 26 OutputFormatOptions(); 27 28 bool parse(Module& pModule, LinkerConfig& pConfig); 29 30 bool parseOutput(Module& pModule, LinkerConfig& pConfig); 31 32 private: 33 llvm::cl::opt<mcld::sys::fs::Path, 34 false, 35 llvm::cl::parser<mcld::sys::fs::Path> >& m_OutputFilename; 36 llvm::cl::opt<mcld::LinkerConfig::CodeGenType>& m_FileType; 37 llvm::cl::opt<mcld::LinkerConfig::CodeGenType>& m_OFormat; 38 llvm::cl::opt<bool>& m_Shared; 39 llvm::cl::opt<bool>& m_PIE; 40 llvm::cl::opt<bool>& m_Relocatable; 41 llvm::cl::opt<mcld::Input::Type>& m_Format; 42 llvm::cl::opt<bool>& m_StripDebug; 43 llvm::cl::opt<bool>& m_StripAll; 44 llvm::cl::opt<bool>& m_DiscardAll; 45 llvm::cl::opt<bool>& m_DiscardLocals; 46 llvm::cl::opt<bool>& m_EhFrameHdr; 47 llvm::cl::opt<bool>& m_NMagic; 48 llvm::cl::opt<bool>& m_OMagic; 49 llvm::cl::opt<mcld::GeneralOptions::HashStyle>& m_HashStyle; 50 51 llvm::cl::opt<bool>& m_ExportDynamic; 52 llvm::cl::opt<std::string>& m_BuildID; 53 llvm::cl::list<std::string>& m_ExcludeLIBS; 54 55 llvm::cl::opt<bool>& m_NoWarnMismatch; 56 }; 57 58 } // namespace of mcld 59 60 #endif 61 62