]> granicus.if.org Git - clang/commitdiff
revert the gnu objc patches, they regress codegen-gnu.m
authorChris Lattner <sabre@nondot.org>
Wed, 21 Jan 2009 19:37:47 +0000 (19:37 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 21 Jan 2009 19:37:47 +0000 (19:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62708 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCGNU.cpp

index ae9d86137c827ccade93c06a86a73447284c436f..2621a8491406e4c39178add515f9326a522f2f90 100644 (file)
@@ -40,8 +40,8 @@ class CGObjCGNU : public CodeGen::CGObjCRuntime {
 private:
   CodeGen::CodeGenModule &CGM;
   llvm::Module &TheModule;
-  const llvm::PointerType *SelectorTy;
-  const llvm::Type *ExpectedSelTy;
+  const llvm::StructType *SelStructTy;
+  const llvm::Type *SelectorTy;
   const llvm::Type *PtrToInt8Ty;
   const llvm::Type *IMPTy;
   const llvm::Type *IdTy;
@@ -168,12 +168,11 @@ CGObjCGNU::CGObjCGNU(CodeGen::CodeGenModule &cgm)
   PtrToInt8Ty = 
     llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
   // Get the selector Type.
-  SelectorTy = cast<llvm::PointerType>(
-         CGM.getTypes().ConvertType(CGM.getContext().getObjCSelType()));
-
-  ExpectedSelTy = 
-    CGM.getTypes().ConvertType(CGM.getContext().getObjCSelType());
-
+  SelStructTy = llvm::StructType::get(
+      PtrToInt8Ty,
+      PtrToInt8Ty,
+      NULL);
+  SelectorTy = llvm::PointerType::getUnqual(SelStructTy);
   PtrToIntTy = llvm::PointerType::getUnqual(IntTy);
   PtrTy = PtrToInt8Ty;
  
@@ -798,9 +797,6 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
       UntypedSelectors.empty())
     return NULL;
 
-  const llvm::StructType *SelStructTy = 
-    cast<llvm::StructType>(SelectorTy->getElementType());
-
   // Name the ObjC types to make the IR a bit easier to read
   TheModule.addTypeName(".objc_selector", SelectorTy);
   TheModule.addTypeName(".objc_id", IdTy);