[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp

Chris Lattner sabre at nondot.org
Mon Nov 20 10:54:48 PST 2006



Changes in directory llvm/utils/TableGen:

DAGISelEmitter.cpp updated: 1.287 -> 1.288
---
Log message:

Fix PR1001: http://llvm.org/PR1001 , patch by Nikhil Patil!


---
Diffs of the changes:  (+11 -1)

 DAGISelEmitter.cpp |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletion(-)


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.287 llvm/utils/TableGen/DAGISelEmitter.cpp:1.288
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.287	Tue Nov 14 16:17:10 2006
+++ llvm/utils/TableGen/DAGISelEmitter.cpp	Mon Nov 20 12:54:33 2006
@@ -3408,7 +3408,17 @@
 }
 
 void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
-  std::string InstNS = Target.inst_begin()->second.Namespace;
+  // Get the namespace to insert instructions into.  Make sure not to pick up
+  // "TargetInstrInfo" by accidentally getting the namespace off the PHI
+  // instruction or something.
+  std::string InstNS;
+  for (CodeGenTarget::inst_iterator i = Target.inst_begin(),
+       e = Target.inst_end(); i != e; ++i) {
+    InstNS = i->second.Namespace;
+    if (InstNS != "TargetInstrInfo")
+      break;
+  }
+  
   if (!InstNS.empty()) InstNS += "::";
   
   // Group the patterns by their top-level opcodes.






More information about the llvm-commits mailing list