]> granicus.if.org Git - clang/commit
reimplement codegen for indirect goto with the following advantages:
authorChris Lattner <sabre@nondot.org>
Tue, 13 Oct 2009 06:55:33 +0000 (06:55 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 13 Oct 2009 06:55:33 +0000 (06:55 +0000)
commit3d00fdc82fd550ae4bfbb2e700a1fc85bbd6d6fd
tree621cadaf1ac1d5c7d897b11197d8259b2e0ae1da
parentf3b18623a359681adf0d397d4767d3a5920441c7
reimplement codegen for indirect goto with the following advantages:

1. CGF now has fewer bytes of state (one pointer instead of a vector).
2. The generated code is determinstic, instead of getting labels in
   'map order' based on pointer addresses.
3. Clang now emits one 'indirect goto switch' for each function, instead
   of one for each indirect goto.  This fixes an M*N = N^2 IR size issue
   when there are lots of address-taken labels and lots of indirect gotos.
4. This also makes the default cause do something useful, reducing the
   size of the jump table needed (by one).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83952 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGStmt.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenFunction.h