[cfe-commits] r131323 - /cfe/trunk/lib/CodeGen/CGObjCMac.cpp
jahanian
fjahanian at apple.com
Fri May 13 16:45:40 PDT 2011
On May 13, 2011, at 4:16 PM, John McCall wrote:
> Author: rjmccall
> Date: Fri May 13 18:16:18 2011
> New Revision: 131323
>
> URL: http://llvm.org/viewvc/llvm-project?rev=131323&view=rev
> Log:
> Reorganize this method to avoid multiple calls for computing CGFunctionInfo
> and to decrease the amount of effort in appending strings.
>
>
> Modified:
> cfe/trunk/lib/CodeGen/CGObjCMac.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=131323&r1=131322&r2=131323&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Fri May 13 18:16:18 2011
> @@ -5527,90 +5527,122 @@
> return CGF.Builder.CreateLoad(ObjCIvarOffsetVariable(Interface, Ivar),"ivar");
> }
>
> -CodeGen::RValue CGObjCNonFragileABIMac::EmitMessageSend(
> - CodeGen::CodeGenFunction &CGF,
> - ReturnValueSlot Return,
> - QualType ResultType,
> - Selector Sel,
> - llvm::Value *Receiver,
> - QualType Arg0Ty,
> - bool IsSuper,
> - const CallArgList &CallArgs,
> - const ObjCMethodDecl *Method) {
> - // FIXME. Even though IsSuper is passes. This function doese not handle calls
> - // to 'super' receivers.
> - CodeGenTypes &Types = CGM.getTypes();
> - llvm::Value *Arg0 = Receiver;
> - if (!IsSuper)
> - Arg0 = CGF.Builder.CreateBitCast(Arg0, ObjCTypes.ObjectPtrTy, "tmp");
> -
> - // Find the message function name.
> - // FIXME. This is too much work to get the ABI-specific result type needed to
> - // find the message name.
> - const CGFunctionInfo &FnInfo
> - = Types.getFunctionInfo(ResultType, CallArgList(),
> - FunctionType::ExtInfo());
> - llvm::Constant *Fn = 0;
> - std::string Name("\01l_");
> - if (CGM.ReturnTypeUsesSRet(FnInfo)) {
> - EmitNullReturnInitialization(CGF, Return, ResultType);
> - if (IsSuper) {
> - Fn = ObjCTypes.getMessageSendSuper2StretFixupFn();
> - Name += "objc_msgSendSuper2_stret_fixup";
> +static void appendSelectorForMessageRefTable(std::string &buffer,
> + Selector selector) {
> + if (selector.isUnarySelector()) {
> + buffer += selector.getNameForSlot(0);
> + return;
> + }
> +
> + for (unsigned i = 0, e = selector.getNumArgs(); i != e; ++i) {
> + buffer += selector.getNameForSlot(i);
> + buffer += '_';
> + }
> +}
> +
> +/// Emit a message send for the non-fragile ABI.
> +///
> +/// Note that we intentionally don't emit a call to objc_msgSend*
> +/// directly because doing so will require the call to go through a
> +/// lazy call stub. In general, that overhead is considered
> +/// worthwhile because it
Unfinished sentence.
- fariborz
More information about the cfe-commits
mailing list