aboutsummaryrefslogtreecommitdiff
path: root/tools/clang-cc/clang-cc.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-04 05:16:21 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-04 05:16:21 +0000
commitd6884a0b90091a063478ec7fa31f6d76c94e4917 (patch)
tree6638e80cf7d1854019f41ff90d08c6ac8fad91ba /tools/clang-cc/clang-cc.cpp
parent7faca821633c9521030127bf7f42f032c73b24e2 (diff)
Add -fobjc-tight-layout.
- This implements gcc style Objective-C interface layout (I think). Currently it is always off, there is no functionality change unless this is passed. For the curious, the deal is that gcc lays out the fields of a subclass as if they were part of the superclass. That is, the subclass fields immediately follow the super class fields instead of being padded to the alignment of the superclass structure. - Currently gcc uses the tight layout in 32-bit and 64-bit modes, and llvm-gcc uses it in 32-bit only, for reasons which aren't clear yet. We probably want to switch to matching gcc, once this makes it through testing... my hope is that we can also fix llvm-gcc in order to maintain compatibility between the compilers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70827 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/clang-cc/clang-cc.cpp')
-rw-r--r--tools/clang-cc/clang-cc.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index a8836887a7..5ef2bf6c34 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/tools/clang-cc/clang-cc.cpp
@@ -628,6 +628,11 @@ static llvm::cl::opt<bool>
ObjCNonFragileABI("fobjc-nonfragile-abi",
llvm::cl::desc("enable objective-c's nonfragile abi"));
+
+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"));
@@ -843,6 +848,9 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
if (ObjCNonFragileABI)
Options.ObjCNonFragileABI = 1;
+
+ if (ObjCTightLayout)
+ Options.ObjCTightLayout = 1;
if (EmitAllDecls)
Options.EmitAllDecls = 1;