Go to the documentation of this file.
45 #ifndef __STDC_LIMIT_MACROS
46 #define __STDC_LIMIT_MACROS
48 #include <llvm/Support/CommandLine.h>
65 main(
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");
196 bytecodeFile, emulationCode, *mach, optLevel, debug, ipData);
212 std::cerr <<
"Error compiling '" << bytecodeFile <<
"':" << std::endl
virtual void printHelp() const
void setSourceFile(const std::string &fileName)
static std::string outputFileName(const std::string &adfFile)
virtual int numberOfArguments() const
TTAProgram::Program * compile(const std::string &bytecodeFile, const std::string &emulationBytecodeFile, TTAMachine::Machine &target, int optLevel, bool debug=false, InterPassData *ipData=NULL)
static void setVerboseLevel(const int level=VERBOSE_LEVEL_DEFAULT)
static void setCmdLineOptions(CmdLineOptions *options_)
static bool fileIsCreatable(const std::string fileName)
static bool fileIsDirectory(const std::string fileName)
static bool fileIsWritable(const std::string fileName)
std::string errorMessageStack(bool messagesOnly=false) const
int main(int argc, char *argv[])
virtual bool isVerboseSwitchDefined() const
static const int VERBOSE_LEVEL_INCREASED
Increased verbose level - print information about modules etc.
std::string errorMessage() const
void parse(char *argv[], int argc)
static MachInfoCmdLineOptions options
const int DEFAULT_OPT_LEVEL
static bool isInstalled()
#define IGNORE_COMPILER_WARNING(X)
static std::ostream & errorStream()
static bool fileExists(const std::string fileName)
static void writeToTPEF(const TTAProgram::Program &program, const std::string &tpefFileName)
#define POP_COMPILER_DIAGS
TTAMachine::Machine * readMachine()
static bool fileIsReadable(const std::string fileName)
virtual std::string argument(int index) const
const POP_COMPILER_DIAGS std::string DEFAULT_OUTPUT_FILENAME
virtual bool isVerboseSpamSwitchDefined() const