45#ifndef __STDC_LIMIT_MACROS 
   46#define __STDC_LIMIT_MACROS 
   48#include <llvm/Support/CommandLine.h> 
   65main(
int argc, 
char* argv[]) {
 
   88            << 
"Temporary directory required." << std::endl;
 
  100    if (!
options->isMachineFileDefined()) {
 
  101        std::cerr << 
"ERROR: No target architecture (.adf) defined." 
  108    std::string targetADF = 
options->machineFile();
 
  114        std::cerr << 
"ERROR: Target architecture file '" 
  115                  << targetADF << 
"' doesn't exist or isn't readable." 
  126        std::cerr << 
"Error loading target architecture file '" 
  127                  << targetADF << 
"':" << std::endl
 
  135    if (
options->isOutputFileDefined()) {
 
  141        std::cerr << 
"Output file '" 
  149    if (
options->isOptLevelDefined()) {
 
  150        optLevel = 
options->optLevel();
 
  155    bool debug = 
options->debugFlag();
 
  158    std::string runPath = std::string(argv[0]);
 
  165    std::string emulationCode;    
 
  166    if (
options->isStandardEmulationLibDefined()) {
 
  167        emulationCode = 
options->standardEmulationLib();
 
  174        std::string argv = 
options->getLLVMargv();
 
  176            std::cout << 
"llvm args = " << argv << std::endl;
 
  179        std::vector<char*> argv_array;
 
  180        std::istringstream iss(argv);
 
  182        while (iss >> token) {
 
  183            char* arg = 
new char[token.size() + 1];
 
  184            copy(token.begin(), token.end(), arg);
 
  185            arg[token.size()] = 
'\0';
 
  186            argv_array.push_back(arg);
 
  189        argv_array.push_back(0);
 
  190        llvm::cl::ParseCommandLineOptions(
 
  191            argc, argv_array.data(), 
"llvm flags\n");
 
  197                bytecodeFile, emulationCode, optLevel, debug, ipData);
 
  213        std::cerr << 
"Error compiling '" << bytecodeFile << 
"':" << std::endl
 
 
#define IGNORE_COMPILER_WARNING(X)
#define POP_COMPILER_DIAGS
static std::string outputFileName(const std::string &adfFile)
int main(int argc, char *argv[])
const int DEFAULT_OPT_LEVEL
POP_COMPILER_DIAGS const std::string DEFAULT_OUTPUT_FILENAME
static MachInfoCmdLineOptions options
TTAMachine::Machine * readMachine()
static void setCmdLineOptions(CmdLineOptions *options_)
static bool isInstalled()
static const int VERBOSE_LEVEL_INCREASED
Increased verbose level - print information about modules etc.
static void setVerboseLevel(const int level=VERBOSE_LEVEL_DEFAULT)
static std::ostream & errorStream()
void parse(char *argv[], int argc)
virtual bool isVerboseSwitchDefined() const
virtual bool isVerboseSpamSwitchDefined() const
virtual std::string argument(int index) const
virtual int numberOfArguments() const
std::string errorMessageStack(bool messagesOnly=false) const
std::string errorMessage() const
static bool fileIsReadable(const std::string fileName)
static bool fileIsDirectory(const std::string fileName)
static bool fileIsWritable(const std::string fileName)
static bool fileIsCreatable(const std::string fileName)
static bool fileExists(const std::string fileName)
TTAProgram::Program * compile(const std::string &bytecodeFile, const std::string &emulationBytecodeFile, int optLevel, bool debug=false, InterPassData *ipData=NULL)
void setMachine(TTAMachine::Machine &target)
virtual void printHelp() const
static void writeToTPEF(const TTAProgram::Program &program, const std::string &tpefFileName)
void setSourceFile(const std::string &fileName)