cad1d4f93532f25f001c47a668cb144cdef356d6
[oota-llvm.git] / tools / llc / LLCOptions.h
1 // $Id$ -*-c++-*-
2 //**************************************************************************/
3 // File:
4 //      LLCOptions.h
5 // 
6 // Purpose:
7 //      Options for the llc compiler.
8 // 
9 // History:
10 //      7/15/01  -  Vikram Adve  -  Created
11 // 
12 //**************************************************************************/
13
14 #ifndef LLVM_LLC_LLCOPTIONS_H
15 #define LLVM_LLC_LLCOPTIONS_H
16
17 #include "llvm/Support/ProgramOptions.h"
18 #include "llvm/Support/ProgramOption.h"
19
20 const char* const HELP_OPT              = "help";
21 const char* const DEBUG_OPT             = "d";
22 const char* const QUIET_OPT             = "q";
23 const char* const DEBUG_INSTR_SELECT_OPT= "debug_select";
24 const char* const OUTFILENAME_OPT       = "o";
25
26
27 //---------------------------------------------------------------------------
28 // class LLCOptions
29 //---------------------------------------------------------------------------
30
31 class LLCOptions : public ProgramOptions {
32 public:
33   /*ctor*/              LLCOptions      (int _argc,
34                                          const char* _argv[],
35                                          const char* _envp[]); 
36   /*dtor*/ virtual      ~LLCOptions     ();
37
38   const string&         getInputFileName() const  { return inputFileName; }
39   
40   const string&         getOutputFileName() const { return outputFileName; }
41   
42 protected:
43
44   //--------------------------------------------------------------------
45   // Initialize for all our compiler options (called by constructors).
46   //--------------------------------------------------------------------
47   void InitializeOptions();
48   
49   //--------------------------------------------------------------------
50   // Make sure the parse went ok.
51   //--------------------------------------------------------------------
52   void CheckParse();
53
54   //--------------------------------------------------------------------
55   // Parse arguments after all options are consumed.
56   // This is called after a successful ParseArgs.
57   //--------------------------------------------------------------------
58   virtual void ParseExtraArgs(); 
59   
60   //--------------------------------------------------------------------
61   // Print message describing which arguments and options are 
62   // required, optional, mutually exclusive, ...
63   // called in ProgramOptions::Usage() method
64   //--------------------------------------------------------------------
65   virtual void PrintUsage(ostream& stream) const;
66
67 private:
68   string          inputFileName;
69   string          outputFileName;
70 };
71
72 //**************************************************************************/
73
74 #endif