[cfe-commits] r69495 - /cfe/trunk/lib/CodeGen/CGObjCMac.cpp
Daniel Dunbar
daniel at zuster.org
Sat Apr 18 17:31:17 PDT 2009
Author: ddunbar
Date: Sat Apr 18 19:31:15 2009
New Revision: 69495
URL: http://llvm.org/viewvc/llvm-project?rev=69495&view=rev
Log:
Remove some unnecessary complexity.
- No functionality change.
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=69495&r1=69494&r2=69495&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Sat Apr 18 19:31:15 2009
@@ -798,7 +798,7 @@
/// ObjCIvarOffsetVariable - Returns the ivar offset variable for
/// the given ivar.
///
- llvm::GlobalVariable * ObjCIvarOffsetVariable(std::string &Name,
+ llvm::GlobalVariable * ObjCIvarOffsetVariable(
const ObjCInterfaceDecl *ID,
const ObjCIvarDecl *Ivar);
@@ -4497,10 +4497,9 @@
/// the given ivar.
///
llvm::GlobalVariable * CGObjCNonFragileABIMac::ObjCIvarOffsetVariable(
- std::string &Name,
const ObjCInterfaceDecl *ID,
const ObjCIvarDecl *Ivar) {
- Name += "OBJC_IVAR_$_" +
+ std::string Name = "OBJC_IVAR_$_" +
getInterfaceDeclForIvar(ID, Ivar, CGM.getContext())->getNameAsString() +
'.' + Ivar->getNameAsString();
llvm::GlobalVariable *IvarOffsetGV =
@@ -4874,9 +4873,7 @@
assert(ObjectTy->isObjCInterfaceType() &&
"CGObjCNonFragileABIMac::EmitObjCValueForIvar");
ObjCInterfaceDecl *ID = ObjectTy->getAsObjCInterfaceType()->getDecl();
- std::string ExternalName;
- llvm::GlobalVariable *IvarOffsetGV =
- ObjCIvarOffsetVariable(ExternalName, ID, Ivar);
+ llvm::GlobalVariable *IvarOffsetGV = ObjCIvarOffsetVariable(ID, Ivar);
// (char *) BaseValue
llvm::Value *V = CGF.Builder.CreateBitCast(BaseValue, ObjCTypes.Int8PtrTy);
@@ -4909,11 +4906,8 @@
CodeGen::CodeGenFunction &CGF,
ObjCInterfaceDecl *Interface,
const ObjCIvarDecl *Ivar) {
- std::string ExternalName;
- llvm::GlobalVariable *IvarOffsetGV =
- ObjCIvarOffsetVariable(ExternalName, Interface, Ivar);
-
- return CGF.Builder.CreateLoad(IvarOffsetGV, false, "ivar");
+ return CGF.Builder.CreateLoad(ObjCIvarOffsetVariable(Interface, Ivar),
+ false, "ivar");
}
CodeGen::RValue CGObjCNonFragileABIMac::EmitMessageSend(
More information about the cfe-commits
mailing list