mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Privatize LLCOptions. It had no business being visible to the entire
program. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -12,29 +12,17 @@
|
||||
#ifndef LLVM_CODEGEN_INSTR_SELECTION_H
|
||||
#define LLVM_CODEGEN_INSTR_SELECTION_H
|
||||
|
||||
//************************** System Include Files **************************/
|
||||
|
||||
//*************************** User Include Files ***************************/
|
||||
|
||||
#include "llvm/Instruction.h"
|
||||
|
||||
//************************* Opaque Declarations ****************************/
|
||||
|
||||
#include <vector>
|
||||
class CompileContext;
|
||||
class Instruction;
|
||||
class Method;
|
||||
class InstrForest;
|
||||
class MachineInstruction;
|
||||
class MachineInstr;
|
||||
class InstructionNode;
|
||||
class TmpInstruction;
|
||||
class ConstPoolVal;
|
||||
|
||||
|
||||
//************************ Exported Constants ******************************/
|
||||
|
||||
const int DEBUG_INSTR_TREES = 2;
|
||||
const int DEBUG_BURG_TREES = 5;
|
||||
|
||||
|
||||
//****************** External Function Prototypes **************************/
|
||||
enum { DEBUG_TREES_NONE = 0, DEBUG_INSTR_TREES = 1, DEBUG_BURG_TREES = 5 };
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// GLOBAL data and an external function that must be implemented
|
||||
@@ -65,12 +53,12 @@ extern bool ThisIsAChainRule (int eruleno);
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
bool SelectInstructionsForMethod (Method* method,
|
||||
CompileContext& ccontext);
|
||||
CompileContext& ccontext,
|
||||
int DebugLevel);
|
||||
|
||||
|
||||
// Debugging function to print the generated instructions
|
||||
void PrintMachineInstructions (Method* method,
|
||||
CompileContext& ccontext);
|
||||
void PrintMachineInstructions (Method* method);
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
@@ -13,57 +13,23 @@
|
||||
#ifndef LLVM_LLC_COMPILECONTEXT_H
|
||||
#define LLVM_LLC_COMPILECONTEXT_H
|
||||
|
||||
//************************** System Include Files **************************/
|
||||
|
||||
#include <string>
|
||||
|
||||
//*************************** User Include Files ***************************/
|
||||
|
||||
#include "llvm/CodeGen/Sparc.h"
|
||||
#include "llvm/LLC/LLCOptions.h"
|
||||
|
||||
//************************** Forward Declarations **************************/
|
||||
|
||||
class ProgramOptions;
|
||||
#include "llvm/Support/Unique.h"
|
||||
class TargetMachine;
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// class CompileContext
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class CompileContext: public Unique
|
||||
{
|
||||
class CompileContext: public Unique {
|
||||
private:
|
||||
LLCOptions* options;
|
||||
TargetMachine* targetMachine;
|
||||
|
||||
public:
|
||||
/*ctor*/ CompileContext (int argc, const char **argv, const char** envp);
|
||||
/*dtor*/ virtual ~CompileContext ();
|
||||
|
||||
const LLCOptions& getOptions () const { return *options; }
|
||||
CompileContext(TargetMachine *Target) : targetMachine(Target) {}
|
||||
~CompileContext();
|
||||
|
||||
const TargetMachine& getTarget () const { return *targetMachine; }
|
||||
TargetMachine& getTarget () { return *targetMachine; }
|
||||
};
|
||||
|
||||
|
||||
inline
|
||||
CompileContext::CompileContext(int argc, const char **argv, const char** envp)
|
||||
{
|
||||
options = new LLCOptions(argc, argv, envp);
|
||||
targetMachine = new UltraSparc;
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
CompileContext::~CompileContext()
|
||||
{
|
||||
delete options;
|
||||
delete targetMachine;
|
||||
}
|
||||
|
||||
//**************************************************************************/
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user