//
// The LLVM Compiler Infrastructure
//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
#include "CodeEmitterGen.h"
#include "RegisterInfoEmitter.h"
#include "InstrInfoEmitter.h"
+#include "InstrEnumEmitter.h"
#include "AsmWriterEmitter.h"
#include "DAGISelEmitter.h"
#include "SubtargetEmitter.h"
#include "IntrinsicEmitter.h"
+#include "LLVMCConfigurationEmitter.h"
#include <algorithm>
#include <cstdio>
#include <fstream>
PrintRecords,
GenEmitter,
GenRegisterEnums, GenRegister, GenRegisterHeader,
- GenInstrEnums, GenInstrs, GenAsmWriter,
+ GenInstrEnums, GenInstrs, GenAsmWriter,
GenCallingConv,
GenDAGISel,
GenSubtarget,
GenIntrinsic,
+ GenLLVMCConf,
PrintEnums
};
"Generate subtarget enumerations"),
clEnumValN(GenIntrinsic, "gen-intrinsic",
"Generate intrinsic information"),
+ clEnumValN(GenLLVMCConf, "gen-llvmc",
+ "Generate LLVMC configuration library"),
clEnumValN(PrintEnums, "print-enums",
"Print enum values for a class"),
clEnumValEnd));
/// ParseFile - this function begins the parsing of the specified tablegen
/// file.
-static bool ParseFile(const std::string &Filename,
+static bool ParseFile(const std::string &Filename,
const std::vector<std::string> &IncludeDirs) {
std::string ErrorStr;
- MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(&Filename[0], Filename.size(),
- &ErrorStr);
+ MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrorStr);
if (F == 0) {
cerr << "Could not open input file '" + Filename + "': " << ErrorStr <<"\n";
return true;
}
-
+
TGParser Parser(F);
-
+
// Record the location of the include directory so that the lexer can find
// it later.
Parser.setIncludeDirs(IncludeDirs);
-
+
return Parser.ParseFile();
}
break;
case GenInstrEnums:
- InstrInfoEmitter(Records).runEnums(*Out);
+ InstrEnumEmitter(Records).run(*Out);
break;
case GenInstrs:
InstrInfoEmitter(Records).run(*Out);
case GenIntrinsic:
IntrinsicEmitter(Records).run(*Out);
break;
+ case GenLLVMCConf:
+ LLVMCConfigurationEmitter(Records).run(*Out);
+ break;
case PrintEnums:
{
std::vector<Record*> Recs = Records.getAllDerivedDefinitions(Class);