[llvm-commits] [llvm] r129317 - /llvm/trunk/utils/TableGen/ClangASTNodesEmitter.cpp

NAKAMURA Takumi geek4civic at gmail.com
Mon Apr 11 16:20:28 PDT 2011


Author: chapuni
Date: Mon Apr 11 18:20:28 2011
New Revision: 129317

URL: http://llvm.org/viewvc/llvm-project?rev=129317&view=rev
Log:
TableGen: Keep the order of DECL_CONTEXT() for DeclNodes.td. RecordVector may be used instead of RecordSet.

The result of DeclNodes.inc was unstable on msys, Windows 7 x64.

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

Modified: llvm/trunk/utils/TableGen/ClangASTNodesEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ClangASTNodesEmitter.cpp?rev=129317&r1=129316&r2=129317&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/ClangASTNodesEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/ClangASTNodesEmitter.cpp Mon Apr 11 18:20:28 2011
@@ -155,10 +155,13 @@
     }
   }
 
-  for (RecordSet::iterator i = DeclContexts.begin(), e = DeclContexts.end();
-       i != e; ++i) {
-    OS << "DECL_CONTEXT(" << (*i)->getName() << ")\n";
-  }
+  // To keep identical order, RecordVector may be used
+  // instead of RecordSet.
+  for (RecordVector::iterator
+         i = DeclContextsVector.begin(), e = DeclContextsVector.end();
+       i != e; ++i)
+    if (DeclContexts.find(*i) != DeclContexts.end())
+      OS << "DECL_CONTEXT(" << (*i)->getName() << ")\n";
 
   OS << "#undef DECL_CONTEXT\n";
   OS << "#undef DECL_CONTEXT_BASE\n";





More information about the llvm-commits mailing list