Improve LSR's dead-phi detection to handle use-def cycles
[oota-llvm.git] / utils / TableGen / TableGen.cpp
index b174ff89031a65677c8791db3f9a80079286bc77..64b2f97dc30622d9caa7c844bf51f70ce602cfec 100644 (file)
@@ -31,6 +31,7 @@
 #include "DAGISelEmitter.h"
 #include "SubtargetEmitter.h"
 #include "IntrinsicEmitter.h"
+#include "LLVMCConfigurationEmitter.h"
 #include <algorithm>
 #include <cstdio>
 #include <fstream>
@@ -41,11 +42,12 @@ enum ActionType {
   PrintRecords,
   GenEmitter,
   GenRegisterEnums, GenRegister, GenRegisterHeader,
-  GenInstrEnums, GenInstrs, GenAsmWriter, 
+  GenInstrEnums, GenInstrs, GenAsmWriter,
   GenCallingConv,
   GenDAGISel,
   GenSubtarget,
   GenIntrinsic,
+  GenLLVMCConf,
   PrintEnums
 };
 
@@ -76,6 +78,8 @@ namespace {
                                "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));
@@ -100,22 +104,21 @@ RecordKeeper llvm::Records;
 
 /// 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();
 }
 
@@ -180,6 +183,9 @@ int main(int argc, char **argv) {
     case GenIntrinsic:
       IntrinsicEmitter(Records).run(*Out);
       break;
+    case GenLLVMCConf:
+      LLVMCConfigurationEmitter(Records).run(*Out);
+      break;
     case PrintEnums:
     {
       std::vector<Record*> Recs = Records.getAllDerivedDefinitions(Class);