[llvm-commits] [llvm] r111032 - in /llvm/trunk/utils/TableGen: LLVMCConfigurationEmitter.cpp TableGen.cpp

Mikhail Glushenkov foldr at codedgers.com
Fri Aug 13 13:08:53 PDT 2010


Author: foldr
Date: Fri Aug 13 15:08:53 2010
New Revision: 111032

URL: http://llvm.org/viewvc/llvm-project?rev=111032&view=rev
Log:
Revert r111007.

Apparently, this is now fixed in Clang.

Modified:
    llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp
    llvm/trunk/utils/TableGen/TableGen.cpp

Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp?rev=111032&r1=111031&r2=111032&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Fri Aug 13 15:08:53 2010
@@ -17,8 +17,6 @@
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringSet.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/System/Path.h"
 
 #include <algorithm>
 #include <cassert>
@@ -29,8 +27,6 @@
 
 using namespace llvm;
 
-extern cl::opt<std::string> InputFilename;
-
 namespace {
 
 //===----------------------------------------------------------------------===//
@@ -2978,18 +2974,9 @@
   O << "}\n\n";
 }
 
-std::string GetPluginName() {
-  if (!InputFilename.empty()) {
-    return sys::Path(InputFilename).getBasename();
-  }
-
-  return "";
-}
-
 /// EmitRegisterPlugin - Emit code to register this plugin.
 void EmitRegisterPlugin(int Priority, raw_ostream& O) {
-  O << "struct Plugin" << GetPluginName()
-    << " : public llvmc::BasePlugin {\n\n";
+  O << "struct Plugin : public llvmc::BasePlugin {\n\n";
   O.indent(Indent1) << "int Priority() const { return "
                     << Priority << "; }\n\n";
   O.indent(Indent1) << "int PreprocessOptions() const\n";
@@ -3000,8 +2987,7 @@
     << "int PopulateCompilationGraph(CompilationGraph& graph) const\n";
   O.indent(Indent1) << "{ return PopulateCompilationGraphLocal(graph); }\n"
                     << "};\n\n"
-                    << "static llvmc::RegisterPlugin<Plugin"
-                    << GetPluginName()<< "> RP;\n\n";
+                    << "static llvmc::RegisterPlugin<Plugin> RP;\n\n";
 }
 
 /// EmitIncludes - Emit necessary #include directives and some

Modified: llvm/trunk/utils/TableGen/TableGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TableGen.cpp?rev=111032&r1=111031&r2=111032&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/TableGen.cpp (original)
+++ llvm/trunk/utils/TableGen/TableGen.cpp Fri Aug 13 15:08:53 2010
@@ -146,6 +146,9 @@
   OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"),
                  cl::init("-"));
 
+  cl::opt<std::string>
+  InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"));
+
   cl::list<std::string>
   IncludeDirs("I", cl::desc("Directory of include files"),
               cl::value_desc("directory"), cl::Prefix);
@@ -158,9 +161,6 @@
 
 
 // FIXME: Eliminate globals from tblgen.
-cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"));
-
 RecordKeeper llvm::Records;
 
 static SourceMgr SrcMgr;





More information about the llvm-commits mailing list