]> granicus.if.org Git - clang/commitdiff
Added -print-ivar-layout option. No change in functionality
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 17 Apr 2009 03:04:15 +0000 (03:04 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 17 Apr 2009 03:04:15 +0000 (03:04 +0000)
yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69346 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/LangOptions.h
include/clang/Driver/Options.def
lib/Driver/Tools.cpp
tools/clang-cc/clang-cc.cpp

index 1198c6f20f280269df8a2c163549d2e0fea37d1d..40b2e5372ac9778679710894caf463c09b7587d5 100644 (file)
@@ -76,6 +76,9 @@ public:
                                   // used (instead of C99 semantics).
   unsigned NoInline          : 1; // Should __NO_INLINE__ be defined.
 
+  unsigned ObjCGCBitmapPrint : 1; // Enable printing of gc's bitmap layout
+                                  // for __weak/__strong ivars.
+
 private:
   unsigned GC : 2; // Objective-C Garbage Collection modes.  We declare
                    // this enum as unsigned because MSVC insists on making enums
@@ -117,6 +120,7 @@ public:
     MathErrno = 1;
 
     OverflowChecking = 0;
+    ObjCGCBitmapPrint = 0;
 
     InstantiationDepth = 99;
     
index bbc5901a038d1eaeeb48c58e6c861478cbb74b7d..33446212e53f40c67d96a549f9a28fc0b890c802 100644 (file)
@@ -537,6 +537,7 @@ OPTION("-prebind", prebind, Flag, INVALID, INVALID, "", 0, 0, 0)
 OPTION("-preload", preload, Flag, INVALID, INVALID, "", 0, 0, 0)
 OPTION("-print-file-name=", print_file_name_EQ, Joined, INVALID, INVALID, "", 0,
        "Print the full library path of <file>", "<file>")
+OPTION("-print-ivar-layout", print_ivar_layout, Flag, INVALID, INVALID, "", 0, 0, 0)
 OPTION("-print-libgcc-file-name", print_libgcc_file_name, Flag, INVALID, INVALID, "", 0, 
        "Print the library path for \"libgcc.a\"", 0)
 OPTION("-print-multi-directory", print_multi_directory, Flag, INVALID, INVALID, "u", 0, 0, 0)
index 8e4abb11571c4b8b9fe8728dcbe6aedb20acf51e..ad83fe7e8e285efa801674c3a7b3f99702c08fe9 100644 (file)
@@ -363,6 +363,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   Args.AddLastArg(CmdArgs, options::OPT_P);
   Args.AddLastArg(CmdArgs, options::OPT_mmacosx_version_min_EQ);
   Args.AddLastArg(CmdArgs, options::OPT_miphoneos_version_min_EQ);
+  Args.AddLastArg(CmdArgs, options::OPT_print_ivar_layout);  
 
   // Special case debug options to only pass -g to clang. This is
   // wrong.
index 7d1ce40135246cfdb7b9de90ca9063bc1f19f6bf..e9e5c3744a9c74a411396cbd89af2d9a7d0e6ab1 100644 (file)
@@ -399,6 +399,10 @@ static llvm::cl::opt<bool>
 ObjCEnableGC("fobjc-gc",
              llvm::cl::desc("Enable Objective-C garbage collection"));
 
+static llvm::cl::opt<bool>
+ObjCEnableGCBitmapPrint("print-ivar-layout",
+             llvm::cl::desc("Enable Objective-C Ivar layout bitmap print trace"));
+
 static llvm::cl::opt<LangOptions::VisibilityMode>
 SymbolVisibility("fvisibility",
                  llvm::cl::desc("Set the default symbol visibility:"),
@@ -517,6 +521,9 @@ static void InitializeLangOptions(LangOptions &Options, LangKind LK){
   else if (ObjCEnableGC)
     Options.setGCMode(LangOptions::HybridGC);
   
+  if (ObjCEnableGCBitmapPrint)
+    Options.ObjCGCBitmapPrint = 1;
+  
   Options.setVisibilityMode(SymbolVisibility);
   Options.OverflowChecking = OverflowChecking;
 }