diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-05-30 13:08:26 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-05-30 13:08:26 -0700 |
commit | f72e0b53e25548d6db9220a03a303e589c9773a4 (patch) | |
tree | aaff14bd8167571353c50289b005bd0fe5c98925 /lib/Transforms/NaCl/PNaClABISimplify.cpp | |
parent | 663c1c948321264aceb07b86cfadcd06b3386e1e (diff) |
PNaCl: Add a pass to expand out Clang's use of registers of struct type
Clang's implementation of C++ method pointers generates IR that uses
LLVM registers with struct type -- specifically, loads and stores of
struct values, and extractvalue instructions. See
lib/CodeGen/ItaniumCXXABI.cpp in Clang. Add a pass, ExpandStructRegs,
which expands out those uses.
Factor out a function from ExpandArithWithOverflow so that the two
passes can share some code.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343
TEST=*.ll tests + trybots + GCC torture tests
Review URL: https://codereview.chromium.org/15692014
Diffstat (limited to 'lib/Transforms/NaCl/PNaClABISimplify.cpp')
-rw-r--r-- | lib/Transforms/NaCl/PNaClABISimplify.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp index 848d340e22..8c945800af 100644 --- a/lib/Transforms/NaCl/PNaClABISimplify.cpp +++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp @@ -28,7 +28,10 @@ void llvm::PNaClABISimplifyAddPreOptPasses(PassManager &PM) { // Remove landingpad blocks made unreachable by LowerInvoke. PM.add(createCFGSimplificationPass()); + // Expand out some uses of struct types. PM.add(createExpandArithWithOverflowPass()); + PM.add(createExpandStructRegsPass()); + PM.add(createExpandVarArgsPass()); PM.add(createExpandCtorsPass()); PM.add(createResolveAliasesPass()); |