From: Daniel Dunbar Date: Thu, 7 May 2009 21:58:26 +0000 (+0000) Subject: Remove -fobjc-tight-layout, seems to work! X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=913af35741b55fe854bc26c9dddc312cd991e24d;p=clang Remove -fobjc-tight-layout, seems to work! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71184 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h index fa5b689490..fba474b2f5 100644 --- a/include/clang/Basic/LangOptions.h +++ b/include/clang/Basic/LangOptions.h @@ -37,9 +37,6 @@ public: unsigned ObjC1 : 1; // Objective-C 1 support enabled. unsigned ObjC2 : 1; // Objective-C 2 support enabled. unsigned ObjCNonFragileABI : 1; // Objective-C modern abi enabled - unsigned ObjCTightLayout : 1; // Use tight interface layout, in - // which subclass ivars can be - // placed inside the superclass. unsigned PascalStrings : 1; // Allow Pascal strings unsigned WritableStrings : 1; // Allow writable strings @@ -103,7 +100,7 @@ public: Trigraphs = BCPLComment = DollarIdents = AsmPreprocessor = 0; GNUMode = ImplicitInt = Digraphs = 0; HexFloats = 0; - GC = ObjC1 = ObjC2 = ObjCNonFragileABI = ObjCTightLayout = 0; + GC = ObjC1 = ObjC2 = ObjCNonFragileABI = 0; C99 = Microsoft = CPlusPlus = CPlusPlus0x = 0; CXXOperatorNames = PascalStrings = WritableStrings = 0; Exceptions = NeXTRuntime = Freestanding = NoBuiltin = 0; diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 3b1a11cb79..4aed59f37e 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -715,13 +715,10 @@ ASTContext::getObjCLayout(const ObjCInterfaceDecl *D, if (ObjCInterfaceDecl *SD = D->getSuperClass()) { const ASTRecordLayout &SL = getASTObjCInterfaceLayout(SD); unsigned Alignment = SL.getAlignment(); - uint64_t Size = SL.getSize(); - // If we are using tight interface packing, then we start laying - // out ivars not at the end of the superclass structure, but at - // the next byte following the last field. - if (getLangOptions().ObjCTightLayout) - Size = llvm::RoundUpToAlignment(SL.NextOffset, 8); + // We start laying out ivars not at the end of the superclass + // structure, but at the next byte following the last field. + uint64_t Size = llvm::RoundUpToAlignment(SL.NextOffset, 8); ObjCLayouts[Key] = NewEntry = new ASTRecordLayout(Size, Alignment); NewEntry->InitializeLayout(FieldCount); diff --git a/test/CodeGenObjC/interface-layout-64.m b/test/CodeGenObjC/interface-layout-64.m index db860e8518..13d6a8770f 100644 --- a/test/CodeGenObjC/interface-layout-64.m +++ b/test/CodeGenObjC/interface-layout-64.m @@ -1,4 +1,4 @@ -// RUN: clang-cc -fobjc-tight-layout -triple x86_64-apple-darwin9 -emit-llvm -o %t %s && +// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s && // RUNX: llvm-gcc -m64 -emit-llvm -S -o %t %s && // RUN: grep '@"OBJC_IVAR_$_I3._iv2" = global i64 8, section "__DATA, __objc_const", align 8' %t && diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp index f71be5d5ea..23230b3bc1 100644 --- a/tools/clang-cc/clang-cc.cpp +++ b/tools/clang-cc/clang-cc.cpp @@ -631,10 +631,6 @@ ObjCNonFragileABI("fobjc-nonfragile-abi", llvm::cl::desc("enable objective-c's nonfragile abi")); -static llvm::cl::opt -ObjCTightLayout("fobjc-tight-layout", - llvm::cl::desc("enable tight objective-c interface layout")); - static llvm::cl::opt EmitAllDecls("femit-all-decls", llvm::cl::desc("Emit all declarations, even if unused")); @@ -824,8 +820,6 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK, if (ObjCNonFragileABI) Options.ObjCNonFragileABI = 1; - Options.ObjCTightLayout = 1; - if (EmitAllDecls) Options.EmitAllDecls = 1;