[llvm-branch-commits] [cfe-branch] r168419 - in /cfe/branches/release_32: ./ include/clang/Basic/LangOptions.def include/clang/Driver/CC1Options.td include/clang/Driver/ToolChain.h lib/AST/ASTContext.cpp lib/Driver/ToolChains.h lib/Frontend/CompilerInvocation.cpp test/Driver/rewrite-legacy-objc.m test/Driver/rewrite-objc.m
Pawel Wodnicki
pawel at 32bitmicro.com
Wed Nov 21 00:33:40 PST 2012
Author: pawel
Date: Wed Nov 21 02:33:40 2012
New Revision: 168419
URL: http://llvm.org/viewvc/llvm-project?rev=168419&view=rev
Log:
Merging r168063 into 3.2 release branch
block extended signatur option. Change previous option
to a cc1 -fencode-extended-block-signature and pass it
to cc1 and recognize this option to produce extended block
type signature. // rdar://12109031
Modified:
cfe/branches/release_32/ (props changed)
cfe/branches/release_32/include/clang/Basic/LangOptions.def
cfe/branches/release_32/include/clang/Driver/CC1Options.td
cfe/branches/release_32/include/clang/Driver/ToolChain.h
cfe/branches/release_32/lib/AST/ASTContext.cpp
cfe/branches/release_32/lib/Driver/ToolChains.h
cfe/branches/release_32/lib/Frontend/CompilerInvocation.cpp
cfe/branches/release_32/test/Driver/rewrite-legacy-objc.m
cfe/branches/release_32/test/Driver/rewrite-objc.m
Propchange: cfe/branches/release_32/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 21 02:33:40 2012
@@ -1,3 +1,3 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:167749,167762,167780,167788,167790,167813-167814,167868,167884,167920,168024,168124,168297
+/cfe/trunk:167749,167762,167780,167788,167790,167813-167814,167868,167884,167920,168024,168063,168124,168297
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_32/include/clang/Basic/LangOptions.def
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_32/include/clang/Basic/LangOptions.def?rev=168419&r1=168418&r2=168419&view=diff
==============================================================================
--- cfe/branches/release_32/include/clang/Basic/LangOptions.def (original)
+++ cfe/branches/release_32/include/clang/Basic/LangOptions.def Wed Nov 21 02:33:40 2012
@@ -53,6 +53,8 @@
LANGOPT(ObjC2 , 1, 0, "Objective-C 2")
BENIGN_LANGOPT(ObjCDefaultSynthProperties , 1, 0,
"Objective-C auto-synthesized properties")
+BENIGN_LANGOPT(EncodeExtendedBlockSig , 1, 0,
+ "Encoding extended block type signature")
BENIGN_LANGOPT(ObjCInferRelatedResultType , 1, 1,
"Objective-C related result type inference")
LANGOPT(Trigraphs , 1, 0,"trigraphs")
Modified: cfe/branches/release_32/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_32/include/clang/Driver/CC1Options.td?rev=168419&r1=168418&r2=168419&view=diff
==============================================================================
--- cfe/branches/release_32/include/clang/Driver/CC1Options.td (original)
+++ cfe/branches/release_32/include/clang/Driver/CC1Options.td Wed Nov 21 02:33:40 2012
@@ -404,6 +404,8 @@
HelpText<"Objective-C dispatch method to use">;
def fobjc_default_synthesize_properties : Flag<["-"], "fobjc-default-synthesize-properties">,
HelpText<"enable the default synthesis of Objective-C properties">;
+def fencode_extended_block_signature : Flag<["-"], "fencode-extended-block-signature">,
+ HelpText<"enable extended encoding of block type signature">;
def pic_level : Separate<["-"], "pic-level">,
HelpText<"Value for __PIC__">;
def pie_level : Separate<["-"], "pie-level">,
Modified: cfe/branches/release_32/include/clang/Driver/ToolChain.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_32/include/clang/Driver/ToolChain.h?rev=168419&r1=168418&r2=168419&view=diff
==============================================================================
--- cfe/branches/release_32/include/clang/Driver/ToolChain.h (original)
+++ cfe/branches/release_32/include/clang/Driver/ToolChain.h Wed Nov 21 02:33:40 2012
@@ -148,6 +148,10 @@
/// IsObjCDefaultSynthPropertiesDefault - Does this tool chain enable
/// -fobjc-default-synthesize-properties by default.
virtual bool IsObjCDefaultSynthPropertiesDefault() const { return false; }
+
+ /// IsEncodeExtendedBlockSignatureDefault - Does this tool chain enable
+ /// -fencode-extended-block-signature by default.
+ virtual bool IsEncodeExtendedBlockSignatureDefault() const { return false; }
/// IsObjCNonFragileABIDefault - Does this tool chain set
/// -fobjc-nonfragile-abi by default.
Modified: cfe/branches/release_32/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_32/lib/AST/ASTContext.cpp?rev=168419&r1=168418&r2=168419&view=diff
==============================================================================
--- cfe/branches/release_32/lib/AST/ASTContext.cpp (original)
+++ cfe/branches/release_32/lib/AST/ASTContext.cpp Wed Nov 21 02:33:40 2012
@@ -4481,7 +4481,13 @@
QualType BlockTy =
Expr->getType()->getAs<BlockPointerType>()->getPointeeType();
// Encode result type.
- getObjCEncodingForType(BlockTy->getAs<FunctionType>()->getResultType(), S);
+ if (getLangOpts().EncodeExtendedBlockSig)
+ getObjCEncodingForMethodParameter(Decl::OBJC_TQ_None,
+ BlockTy->getAs<FunctionType>()->getResultType(),
+ S, true /*Extended*/);
+ else
+ getObjCEncodingForType(BlockTy->getAs<FunctionType>()->getResultType(),
+ S);
// Compute size of all parameters.
// Start with computing size of a pointer in number of bytes.
// FIXME: There might(should) be a better way of doing this computation!
@@ -4516,7 +4522,11 @@
PType = PVDecl->getType();
} else if (PType->isFunctionType())
PType = PVDecl->getType();
- getObjCEncodingForType(PType, S);
+ if (getLangOpts().EncodeExtendedBlockSig)
+ getObjCEncodingForMethodParameter(Decl::OBJC_TQ_None, PType,
+ S, true /*Extended*/);
+ else
+ getObjCEncodingForType(PType, S);
S += charUnitsToString(ParmOffset);
ParmOffset += getObjCEncodingTypeSize(PType);
}
Modified: cfe/branches/release_32/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_32/lib/Driver/ToolChains.h?rev=168419&r1=168418&r2=168419&view=diff
==============================================================================
--- cfe/branches/release_32/lib/Driver/ToolChains.h (original)
+++ cfe/branches/release_32/lib/Driver/ToolChains.h Wed Nov 21 02:33:40 2012
@@ -318,6 +318,10 @@
return true;
}
+ virtual bool IsEncodeExtendedBlockSignatureDefault() const {
+ return true;
+ }
+
virtual bool IsObjCNonFragileABIDefault() const {
// Non-fragile ABI is default for everything but i386.
return getTriple().getArch() != llvm::Triple::x86;
Modified: cfe/branches/release_32/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_32/lib/Frontend/CompilerInvocation.cpp?rev=168419&r1=168418&r2=168419&view=diff
==============================================================================
--- cfe/branches/release_32/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/branches/release_32/lib/Frontend/CompilerInvocation.cpp Wed Nov 21 02:33:40 2012
@@ -1213,6 +1213,8 @@
Args.getLastArgValue(OPT_fconstant_string_class);
Opts.ObjCDefaultSynthProperties =
Args.hasArg(OPT_fobjc_default_synthesize_properties);
+ Opts.EncodeExtendedBlockSig =
+ Args.hasArg(OPT_fencode_extended_block_signature);
Opts.EmitAllDecls = Args.hasArg(OPT_femit_all_decls);
Opts.PackStruct = Args.getLastArgIntValue(OPT_fpack_struct_EQ, 0, Diags);
Opts.PICLevel = Args.getLastArgIntValue(OPT_pic_level, 0, Diags);
Modified: cfe/branches/release_32/test/Driver/rewrite-legacy-objc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_32/test/Driver/rewrite-legacy-objc.m?rev=168419&r1=168418&r2=168419&view=diff
==============================================================================
--- cfe/branches/release_32/test/Driver/rewrite-legacy-objc.m (original)
+++ cfe/branches/release_32/test/Driver/rewrite-legacy-objc.m Wed Nov 21 02:33:40 2012
@@ -3,5 +3,5 @@
// TEST0: clang{{.*}}" "-cc1"
// TEST0: "-rewrite-objc"
// FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead.
-// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fobjc-default-synthesize-properties" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
+// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fobjc-default-synthesize-properties" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
// TEST0: rewrite-legacy-objc.m"
Modified: cfe/branches/release_32/test/Driver/rewrite-objc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_32/test/Driver/rewrite-objc.m?rev=168419&r1=168418&r2=168419&view=diff
==============================================================================
--- cfe/branches/release_32/test/Driver/rewrite-objc.m (original)
+++ cfe/branches/release_32/test/Driver/rewrite-objc.m Wed Nov 21 02:33:40 2012
@@ -3,4 +3,4 @@
// TEST0: clang{{.*}}" "-cc1"
// TEST0: "-rewrite-objc"
// FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead.
-// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx" "-fobjc-dispatch-method=mixed" "-fobjc-default-synthesize-properties" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
+// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx" "-fobjc-dispatch-method=mixed" "-fobjc-default-synthesize-properties" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
More information about the llvm-branch-commits
mailing list