[llvm-commits] [llvm] r60590 - /llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp

Cedric Venet cedric.venet at laposte.net
Fri Dec 5 05:37:32 PST 2008


Author: venet
Date: Fri Dec  5 07:37:30 2008
New Revision: 60590

URL: http://llvm.org/viewvc/llvm-project?rev=60590&view=rev
Log:
The use of the construct:
  for(Type1 B = ...;;) { Type2 B ; ... }
is bad: code is hard to read and VS VS don't like it (it ignore the second declaration of B).
This patch fix the problem in tablegen. Please don't write code like this. 

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

Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp?rev=60590&r1=60589&r2=60590&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Fri Dec  5 07:37:30 2008
@@ -1548,9 +1548,9 @@
   StringMap<std::string>::iterator IAE = ToolToOutLang.end();
   StringMap<StringSet<> >::iterator IBE = ToolToInLang.end();
 
-  for (RecordVector::const_iterator B = EdgeVector.begin(),
-         E = EdgeVector.end(); B != E; ++B) {
-    const Record* Edge = *B;
+  for (RecordVector::const_iterator Beg = EdgeVector.begin(),
+         E = EdgeVector.end(); Beg != E; ++Beg) {
+    const Record* Edge = *Beg;
     const std::string& A = Edge->getValueAsString("a");
     const std::string& B = Edge->getValueAsString("b");
     StringMap<std::string>::iterator IA = ToolToOutLang.find(A);
@@ -1615,9 +1615,9 @@
                       const GlobalOptionDescriptions& OptDescs,
                       std::ostream& O) {
   int i = 0;
-  for (RecordVector::const_iterator B = EdgeVector.begin(),
-         E = EdgeVector.end(); B != E; ++B) {
-    const Record* Edge = *B;
+  for (RecordVector::const_iterator Beg = EdgeVector.begin(),
+         E = EdgeVector.end(); Beg != E; ++Beg) {
+    const Record* Edge = *Beg;
     const std::string& B = Edge->getValueAsString("b");
     DagInit* Weight = Edge->getValueAsDag("weight");
 
@@ -1645,9 +1645,9 @@
   // Insert edges.
 
   int i = 0;
-  for (RecordVector::const_iterator B = EdgeVector.begin(),
-         E = EdgeVector.end(); B != E; ++B) {
-    const Record* Edge = *B;
+  for (RecordVector::const_iterator Beg = EdgeVector.begin(),
+         E = EdgeVector.end(); Beg != E; ++Beg) {
+    const Record* Edge = *Beg;
     const std::string& A = Edge->getValueAsString("a");
     const std::string& B = Edge->getValueAsString("b");
     DagInit* Weight = Edge->getValueAsDag("weight");
@@ -1800,10 +1800,10 @@
   // List all tools mentioned in the graph.
   llvm::StringSet<> ToolsInGraph;
 
-  for (RecordVector::const_iterator B = EdgeVector.begin(),
-         E = EdgeVector.end(); B != E; ++B) {
+  for (RecordVector::const_iterator Beg = EdgeVector.begin(),
+         E = EdgeVector.end(); Beg != E; ++Beg) {
 
-    const Record* Edge = *B;
+    const Record* Edge = *Beg;
     const std::string& A = Edge->getValueAsString("a");
     const std::string& B = Edge->getValueAsString("b");
 





More information about the llvm-commits mailing list