summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2012-05-12 08:30:16 +0000
committerJay Foad <jay.foad@gmail.com>2012-05-12 08:30:16 +0000
commitca0c4996098068828c7688103cd0a80edf8cba09 (patch)
treeafe6b592c40bc62c7e552b6ebd9cb1b1cc5b8e16 /llvm/lib/Transforms
parent8bb9745a5e8fda4a0142bfcde3a61efd9160b8c6 (diff)
downloadbcm5719-llvm-ca0c4996098068828c7688103cd0a80edf8cba09.tar.gz
bcm5719-llvm-ca0c4996098068828c7688103cd0a80edf8cba09.zip
Teach Function::hasAddressTaken that BlockAddress doesn't really take
the address of a function. llvm-svn: 156703
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 1522aa408b6..d316d526785 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/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()));
}
OpenPOWER on IntegriCloud