[cfe-commits] r71184 - in /cfe/trunk: include/clang/Basic/LangOptions.h lib/AST/ASTContext.cpp test/CodeGenObjC/interface-layout-64.m tools/clang-cc/clang-cc.cpp

Daniel Dunbar daniel at zuster.org
Thu May 7 14:58:26 PDT 2009


Author: ddunbar
Date: Thu May  7 16:58:26 2009
New Revision: 71184

URL: http://llvm.org/viewvc/llvm-project?rev=71184&view=rev
Log:
Remove -fobjc-tight-layout, seems to work!

Modified:
    cfe/trunk/include/clang/Basic/LangOptions.h
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/test/CodeGenObjC/interface-layout-64.m
    cfe/trunk/tools/clang-cc/clang-cc.cpp

Modified: cfe/trunk/include/clang/Basic/LangOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.h?rev=71184&r1=71183&r2=71184&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/LangOptions.h (original)
+++ cfe/trunk/include/clang/Basic/LangOptions.h Thu May  7 16:58:26 2009
@@ -37,9 +37,6 @@
   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 @@
     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;

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=71184&r1=71183&r2=71184&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu May  7 16:58:26 2009
@@ -715,13 +715,10 @@
   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);

Modified: cfe/trunk/test/CodeGenObjC/interface-layout-64.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/interface-layout-64.m?rev=71184&r1=71183&r2=71184&view=diff

==============================================================================
--- cfe/trunk/test/CodeGenObjC/interface-layout-64.m (original)
+++ cfe/trunk/test/CodeGenObjC/interface-layout-64.m Thu May  7 16:58:26 2009
@@ -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 &&

Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=71184&r1=71183&r2=71184&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Thu May  7 16:58:26 2009
@@ -632,10 +632,6 @@
 
 
 static llvm::cl::opt<bool>
-ObjCTightLayout("fobjc-tight-layout",
-                  llvm::cl::desc("enable tight objective-c interface layout"));
-
-static llvm::cl::opt<bool>
 EmitAllDecls("femit-all-decls",
               llvm::cl::desc("Emit all declarations, even if unused"));
 
@@ -824,8 +820,6 @@
   if (ObjCNonFragileABI)
     Options.ObjCNonFragileABI = 1;
   
-  Options.ObjCTightLayout = 1;
-
   if (EmitAllDecls)
     Options.EmitAllDecls = 1;
 





More information about the cfe-commits mailing list