Skip to content

Commit

Permalink
NFC: Get rid of an unused parameter to CGObjCMac::EmitSelectorAddr.
Browse files Browse the repository at this point in the history
  • Loading branch information
epilk committed Dec 11, 2019
1 parent 8434fbb commit d5e66f0
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions clang/lib/CodeGen/CGObjCMac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ class CGObjCMac : public CGObjCCommonMac {
/// EmitSelector - Return a Value*, of type ObjCTypes.SelectorPtrTy,
/// for the given selector.
llvm::Value *EmitSelector(CodeGenFunction &CGF, Selector Sel);
Address EmitSelectorAddr(CodeGenFunction &CGF, Selector Sel);
Address EmitSelectorAddr(Selector Sel);

public:
CGObjCMac(CodeGen::CodeGenModule &cgm);
Expand Down Expand Up @@ -1543,7 +1543,7 @@ class CGObjCNonFragileABIMac : public CGObjCCommonMac {
/// EmitSelector - Return a Value*, of type ObjCTypes.SelectorPtrTy,
/// for the given selector.
llvm::Value *EmitSelector(CodeGenFunction &CGF, Selector Sel);
Address EmitSelectorAddr(CodeGenFunction &CGF, Selector Sel);
Address EmitSelectorAddr(Selector Sel);

/// GetInterfaceEHType - Get the cached ehtype for the given Objective-C
/// interface. The return value has type EHTypePtrTy.
Expand Down Expand Up @@ -1635,7 +1635,7 @@ class CGObjCNonFragileABIMac : public CGObjCCommonMac {
llvm::Value *GetSelector(CodeGenFunction &CGF, Selector Sel) override
{ return EmitSelector(CGF, Sel); }
Address GetAddrOfSelector(CodeGenFunction &CGF, Selector Sel) override
{ return EmitSelectorAddr(CGF, Sel); }
{ return EmitSelectorAddr(Sel); }

/// The NeXT/Apple runtimes do not support typed selectors; just emit an
/// untyped one.
Expand Down Expand Up @@ -1903,7 +1903,7 @@ llvm::Value *CGObjCMac::GetSelector(CodeGenFunction &CGF, Selector Sel) {
return EmitSelector(CGF, Sel);
}
Address CGObjCMac::GetAddrOfSelector(CodeGenFunction &CGF, Selector Sel) {
return EmitSelectorAddr(CGF, Sel);
return EmitSelectorAddr(Sel);
}
llvm::Value *CGObjCMac::GetSelector(CodeGenFunction &CGF, const ObjCMethodDecl
*Method) {
Expand Down Expand Up @@ -5263,11 +5263,11 @@ llvm::Value *CGObjCMac::EmitNSAutoreleasePoolClassRef(CodeGenFunction &CGF) {
}

llvm::Value *CGObjCMac::EmitSelector(CodeGenFunction &CGF, Selector Sel) {
return CGF.Builder.CreateLoad(EmitSelectorAddr(CGF, Sel));
return CGF.Builder.CreateLoad(EmitSelectorAddr(Sel));
}

Address CGObjCMac::EmitSelectorAddr(CodeGenFunction &CGF, Selector Sel) {
CharUnits Align = CGF.getPointerAlign();
Address CGObjCMac::EmitSelectorAddr(Selector Sel) {
CharUnits Align = CGM.getPointerAlign();

llvm::GlobalVariable *&Entry = SelectorReferences[Sel];
if (!Entry) {
Expand Down Expand Up @@ -7607,19 +7607,17 @@ CGObjCNonFragileABIMac::GenerateMessageSendSuper(CodeGen::CodeGenFunction &CGF,

llvm::Value *CGObjCNonFragileABIMac::EmitSelector(CodeGenFunction &CGF,
Selector Sel) {
Address Addr = EmitSelectorAddr(CGF, Sel);
Address Addr = EmitSelectorAddr(Sel);

llvm::LoadInst* LI = CGF.Builder.CreateLoad(Addr);
LI->setMetadata(CGM.getModule().getMDKindID("invariant.load"),
llvm::MDNode::get(VMContext, None));
return LI;
}

Address CGObjCNonFragileABIMac::EmitSelectorAddr(CodeGenFunction &CGF,
Selector Sel) {
Address CGObjCNonFragileABIMac::EmitSelectorAddr(Selector Sel) {
llvm::GlobalVariable *&Entry = SelectorReferences[Sel];

CharUnits Align = CGF.getPointerAlign();
CharUnits Align = CGM.getPointerAlign();
if (!Entry) {
llvm::Constant *Casted =
llvm::ConstantExpr::getBitCast(GetMethodVarName(Sel),
Expand Down

0 comments on commit d5e66f0

Please sign in to comment.