[llvm-commits] [dragonegg] r90803 - /dragonegg/trunk/llvm-backend.cpp
Duncan Sands
baldrick at free.fr
Mon Dec 7 13:16:50 PST 2009
Author: baldrick
Date: Mon Dec 7 15:16:50 2009
New Revision: 90803
URL: http://llvm.org/viewvc/llvm-project?rev=90803&view=rev
Log:
Output aliases and thunks in the order they were created, which
means the reverse of the order they occur in the list.
Modified:
dragonegg/trunk/llvm-backend.cpp
Modified: dragonegg/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-backend.cpp?rev=90803&r1=90802&r2=90803&view=diff
==============================================================================
--- dragonegg/trunk/llvm-backend.cpp (original)
+++ dragonegg/trunk/llvm-backend.cpp Mon Dec 7 15:16:50 2009
@@ -1734,15 +1734,19 @@
struct cgraph_node *node = csi_node(csi);
if (node->analyzed && Visited.insert(node->decl))
emit_function(node);
- // Output any same-body aliases or thunks.
- for (struct cgraph_node *alias = node->same_body; alias;
- alias = alias->next)
+
+ // Output any same-body aliases or thunks in the order they were created.
+ struct cgraph_node *alias, *next;
+ for (alias = node->same_body; alias && alias->next; alias = alias->next);
+ for (; alias; alias = next) {
+ next = alias->previous;
if (alias->thunk.thunk_p) {
emit_thunk_to_llvm(alias);
} else {
assert(alias->thunk.alias == node->decl && "Unexpected alias target!");
emit_alias_to_llvm(alias->decl, node->decl);
}
+ }
}
}
More information about the llvm-commits
mailing list