diff options
author | Anders Carlsson <andersca@mac.com> | 2011-03-20 20:21:33 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-03-20 20:21:33 +0000 |
commit | 4f735ca1855bb66974f3b1c4ee493534d5037eda (patch) | |
tree | 485e13dbf33815d2fc14227e62b1be63494b0899 | |
parent | 372ec6aa915534f3b11c252dbc9e6c63814bcab3 (diff) | |
download | external_llvm-4f735ca1855bb66974f3b1c4ee493534d5037eda.zip external_llvm-4f735ca1855bb66974f3b1c4ee493534d5037eda.tar.gz external_llvm-4f735ca1855bb66974f3b1c4ee493534d5037eda.tar.bz2 |
Don't try to eliminate invokes to __cxa_atexit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127976 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 1a8b944..2b9b7f2 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -2780,6 +2780,12 @@ bool GlobalOpt::OptimizeEmptyGlobalCXXDtors(Function *CXAAtExitFn) { if (!CS) continue; + // We're only interested in calls. Theoretically, we could handle invoke + // instructions as well, but neither llvm-gcc nor clang generate invokes + // to __cxa_atexit. + if (!CS.isCall()) + continue; + Function *DtorFn = dyn_cast<Function>(CS.getArgument(0)->stripPointerCasts()); if (!DtorFn) |