2001-07-21 12:39:30 +00:00
|
|
|
// $Id$ -*-c++-*-
|
|
|
|
//***************************************************************************
|
|
|
|
// class CompileContext
|
|
|
|
//
|
|
|
|
// Purpose:
|
|
|
|
// Holds the common option and target information for a compilation run.
|
|
|
|
//
|
|
|
|
// History:
|
|
|
|
// 07/15/01 - vadve - Created
|
|
|
|
//
|
|
|
|
//**************************************************************************/
|
|
|
|
|
|
|
|
#ifndef LLVM_LLC_COMPILECONTEXT_H
|
|
|
|
#define LLVM_LLC_COMPILECONTEXT_H
|
|
|
|
|
|
|
|
//************************** System Include Files **************************/
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
//*************************** User Include Files ***************************/
|
|
|
|
|
2001-07-21 20:58:30 +00:00
|
|
|
#include "llvm/CodeGen/Sparc.h"
|
2001-07-21 12:39:30 +00:00
|
|
|
#include "llvm/LLC/LLCOptions.h"
|
|
|
|
|
|
|
|
//************************** Forward Declarations **************************/
|
|
|
|
|
|
|
|
class ProgramOptions;
|
|
|
|
class TargetMachine;
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// class CompileContext
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
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; }
|
|
|
|
|
|
|
|
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
|