diff options
author | Jay Foad <jay.foad@gmail.com> | 2012-05-12 08:30:16 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2012-05-12 08:30:16 +0000 |
commit | b7454fd9df0b477e3daf2fce6e1d5e1b241562df (patch) | |
tree | bb926d40337ccaa32dd4cc1e7318545ec34add08 /lib/Transforms/IPO/GlobalOpt.cpp | |
parent | 2b38c12643236825a6a49c31ef49da8e62b094c2 (diff) | |
download | llvm-b7454fd9df0b477e3daf2fce6e1d5e1b241562df.tar.gz llvm-b7454fd9df0b477e3daf2fce6e1d5e1b241562df.tar.bz2 llvm-b7454fd9df0b477e3daf2fce6e1d5e1b241562df.tar.xz |
Teach Function::hasAddressTaken that BlockAddress doesn't really take
the address of a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156703 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 1522aa408b..d316d52678 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -1870,6 +1870,8 @@ bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV, /// function, changing them to FastCC. static void ChangeCalleesToFastCall(Function *F) { for (Value::use_iterator UI = F->use_begin(), E = F->use_end(); UI != E;++UI){ + if (isa<BlockAddress>(*UI)) + continue; CallSite User(cast<Instruction>(*UI)); User.setCallingConv(CallingConv::Fast); } @@ -1890,6 +1892,8 @@ static AttrListPtr StripNest(const AttrListPtr &Attrs) { static void RemoveNestAttribute(Function *F) { F->setAttributes(StripNest(F->getAttributes())); for (Value::use_iterator UI = F->use_begin(), E = F->use_end(); UI != E;++UI){ + if (isa<BlockAddress>(*UI)) + continue; CallSite User(cast<Instruction>(*UI)); User.setAttributes(StripNest(User.getAttributes())); } |