[cfe-commits] r128156 - /cfe/trunk/lib/CodeGen/CGObjCGNU.cpp

Andrew Trick atrick at apple.com
Wed Mar 23 12:17:39 PDT 2011


Hi David,

After your checkin, a couple of tests are hitting this assertion on
clang-x86_64-darwin10-gcc42-RA:

Assertion failed: ((i >= FTy->getNumParams() || FTy->getParamType(i) == Params[i]->getType()) && "Calling a function with a bad signature!"), function init, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-gcc42-RA/llvm/lib/VMCore/Instructions.cpp, line 196.

Failing Tests (2):
    Clang :: CodeGenObjC/messages.m
    Clang :: Coverage/codegen-gnu.m

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110323/4ab547d9/attachment.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110323/4ab547d9/attachment-0001.html>
-------------- next part --------------


-Andy

On Mar 23, 2011, at 11:39 AM, David Chisnall wrote:

> Author: theraven
> Date: Wed Mar 23 13:39:12 2011
> New Revision: 128156
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=128156&view=rev
> Log:
> Remove the redundant loads / stores to globals that we were generating for selectors (GNU runtimes).
> 
> 
> Modified:
>    cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=128156&r1=128155&r2=128156&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Wed Mar 23 13:39:12 2011
> @@ -521,9 +521,12 @@
>     Types.push_back(TypedSelector(TypeEncoding, SelValue));
>   }
> 
> -  if (lval)
> -    return SelValue;
> -  return Builder.CreateLoad(SelValue);
> +  if (lval) {
> +    llvm::Value *tmp = Builder.CreateAlloca(SelValue->getType());
> +    Builder.CreateStore(SelValue, tmp);
> +    return tmp;
> +  }
> +  return SelValue;
> }
> 
> llvm::Value *CGObjCGNU::GetSelector(CGBuilderTy &Builder, Selector Sel,
> @@ -1906,16 +1909,12 @@
>     llvm::Constant *Idxs[] = {Zeros[0],
>       llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext), i), Zeros[0]};
>     // FIXME: We're generating redundant loads and stores here!
> -    llvm::Constant *SelPtr = new llvm::GlobalVariable(TheModule, SelStructPtrTy,
> -      true, llvm::GlobalValue::InternalLinkage,
> -      llvm::ConstantExpr::getGetElementPtr(SelectorList, Idxs, 2),
> -      ".objc_sel_ptr");
> +    llvm::Constant *SelPtr = llvm::ConstantExpr::getGetElementPtr(SelectorList,
> +        Idxs, 2);
>     // If selectors are defined as an opaque type, cast the pointer to this
>     // type.
> -    if (isSelOpaque) {
> -      SelPtr = llvm::ConstantExpr::getBitCast(SelPtr,
> +    SelPtr = llvm::ConstantExpr::getBitCast(SelPtr,
>         llvm::PointerType::getUnqual(SelectorTy));
> -    }
>     SelectorAliases[i]->replaceAllUsesWith(SelPtr);
>     SelectorAliases[i]->eraseFromParent();
>   }
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list