Skip to content

Commit b65e986

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:997e5e870337e4a25b82be5b01e8f7675c350070 into amd-gfx:47ff60c4c995
Local branch amd-gfx 47ff60c Merged main:a9183b8899f2c02ba3710b27c0cbdde6831a627b into amd-gfx:54b8c4105b11 Remote branch main 997e5e8 [CodeGen] Add a flag to disable emitting block signature strings (llvm#96944)
2 parents 47ff60c + 997e5e8 commit b65e986

File tree

32 files changed

+413
-67
lines changed

32 files changed

+413
-67
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,11 @@ New Compiler Flags
445445
- ``-Wc++2c-compat`` group was added to help migrating existing codebases
446446
to upcoming C++26.
447447

448+
- ``-fdisable-block-signature-string`` instructs clang not to emit the signature
449+
string for blocks. Disabling the string can potentially break existing code
450+
that relies on it. Users should carefully consider this possibiilty when using
451+
the flag.
452+
448453
Deprecated Compiler Flags
449454
-------------------------
450455

@@ -549,6 +554,10 @@ Attribute Changes in Clang
549554
size_t count;
550555
};
551556
557+
- The ``guarded_by``, ``pt_guarded_by``, ``acquired_after``, ``acquired_before``
558+
attributes now support referencing struct members in C. The arguments are also
559+
now late parsed when ``-fexperimental-late-parse-attributes`` is passed like
560+
for ``counted_by``.
552561

553562
- Introduced new function type attributes ``[[clang::nonblocking]]``, ``[[clang::nonallocating]]``,
554563
``[[clang::blocking]]``, and ``[[clang::allocating]]``, with GNU-style variants as well.

clang/docs/ThreadSafetyAnalysis.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,10 +764,11 @@ doesn't know that munl.mu == mutex. The SCOPED_CAPABILITY attribute handles
764764
aliasing for MutexLocker, but does so only for that particular pattern.
765765

766766

767-
ACQUIRED_BEFORE(...) and ACQUIRED_AFTER(...) are currently unimplemented.
768-
-------------------------------------------------------------------------
767+
ACQUIRED_BEFORE(...) and ACQUIRED_AFTER(...) support is still experimental.
768+
---------------------------------------------------------------------------
769769

770-
To be fixed in a future update.
770+
ACQUIRED_BEFORE(...) and ACQUIRED_AFTER(...) are currently being developed under
771+
the ``-Wthread-safety-beta`` flag.
771772

772773

773774
.. _mutexheader:

clang/docs/UsersManual.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,12 @@ Clang options that don't fit neatly into other categories.
913913
binary compatibility issues on older x86_64 targets, however, so use it with
914914
caution.
915915

916+
.. option:: -fdisable-block-signature-string
917+
918+
Instruct clang not to emit the signature string for blocks. Disabling the
919+
string can potentially break existing code that relies on it. Users should
920+
carefully consider this possibiilty when using the flag.
921+
916922
.. _configuration-files:
917923

918924
Configuration files

clang/include/clang/Basic/Attr.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3660,7 +3660,7 @@ def NoThreadSafetyAnalysis : InheritableAttr {
36603660
def GuardedBy : InheritableAttr {
36613661
let Spellings = [GNU<"guarded_by">];
36623662
let Args = [ExprArgument<"Arg">];
3663-
let LateParsed = LateAttrParseStandard;
3663+
let LateParsed = LateAttrParseExperimentalExt;
36643664
let TemplateDependent = 1;
36653665
let ParseArgumentsAsUnevaluated = 1;
36663666
let InheritEvenIfAlreadyPresent = 1;
@@ -3671,7 +3671,7 @@ def GuardedBy : InheritableAttr {
36713671
def PtGuardedBy : InheritableAttr {
36723672
let Spellings = [GNU<"pt_guarded_by">];
36733673
let Args = [ExprArgument<"Arg">];
3674-
let LateParsed = LateAttrParseStandard;
3674+
let LateParsed = LateAttrParseExperimentalExt;
36753675
let TemplateDependent = 1;
36763676
let ParseArgumentsAsUnevaluated = 1;
36773677
let InheritEvenIfAlreadyPresent = 1;
@@ -3682,7 +3682,7 @@ def PtGuardedBy : InheritableAttr {
36823682
def AcquiredAfter : InheritableAttr {
36833683
let Spellings = [GNU<"acquired_after">];
36843684
let Args = [VariadicExprArgument<"Args">];
3685-
let LateParsed = LateAttrParseStandard;
3685+
let LateParsed = LateAttrParseExperimentalExt;
36863686
let TemplateDependent = 1;
36873687
let ParseArgumentsAsUnevaluated = 1;
36883688
let InheritEvenIfAlreadyPresent = 1;
@@ -3693,7 +3693,7 @@ def AcquiredAfter : InheritableAttr {
36933693
def AcquiredBefore : InheritableAttr {
36943694
let Spellings = [GNU<"acquired_before">];
36953695
let Args = [VariadicExprArgument<"Args">];
3696-
let LateParsed = LateAttrParseStandard;
3696+
let LateParsed = LateAttrParseExperimentalExt;
36973697
let TemplateDependent = 1;
36983698
let ParseArgumentsAsUnevaluated = 1;
36993699
let InheritEvenIfAlreadyPresent = 1;

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ CODEGENOPT(NoImplicitFloat , 1, 0) ///< Set when -mno-implicit-float is enable
188188
CODEGENOPT(NullPointerIsValid , 1, 0) ///< Assume Null pointer deference is defined.
189189
CODEGENOPT(OpenCLCorrectlyRoundedDivSqrt, 1, 0) ///< -cl-fp32-correctly-rounded-divide-sqrt
190190
CODEGENOPT(HIPCorrectlyRoundedDivSqrt, 1, 1) ///< -fno-hip-fp32-correctly-rounded-divide-sqrt
191+
CODEGENOPT(DisableBlockSignatureString, 1, 0) ///< Set when -fdisable-block-signature-string is enabled.
191192
CODEGENOPT(HIPSaveKernelArgName, 1, 0) ///< Set when -fhip-kernel-arg-name is enabled.
192193
CODEGENOPT(UniqueInternalLinkageNames, 1, 0) ///< Internal Linkage symbols get unique names.
193194
CODEGENOPT(SplitMachineFunctions, 1, 0) ///< Split machine functions using profile information.

clang/include/clang/Driver/Options.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3477,6 +3477,11 @@ defm objc_avoid_heapify_local_blocks : BoolFOption<"objc-avoid-heapify-local-blo
34773477
PosFlag<SetTrue, [], [ClangOption], "Try">,
34783478
NegFlag<SetFalse, [], [ClangOption], "Don't try">,
34793479
BothFlags<[], [CC1Option], " to avoid heapifying local blocks">>;
3480+
defm disable_block_signature_string : BoolFOption<"disable-block-signature-string",
3481+
CodeGenOpts<"DisableBlockSignatureString">, DefaultFalse,
3482+
PosFlag<SetTrue, [], [ClangOption], "Disable">,
3483+
NegFlag<SetFalse, [], [ClangOption], "Don't disable">,
3484+
BothFlags<[], [CC1Option], " block signature string)">>;
34803485

34813486
def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group<f_Group>,
34823487
Visibility<[ClangOption, FlangOption]>,

clang/include/clang/Sema/Sema.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6341,7 +6341,7 @@ class Sema final : public SemaBase {
63416341
enum ExpressionKind {
63426342
EK_Decltype,
63436343
EK_TemplateArgument,
6344-
EK_BoundsAttrArgument,
6344+
EK_AttrArgument,
63456345
EK_Other
63466346
} ExprContext;
63476347

@@ -6454,10 +6454,9 @@ class Sema final : public SemaBase {
64546454
return const_cast<Sema *>(this)->parentEvaluationContext();
64556455
};
64566456

6457-
bool isBoundsAttrContext() const {
6457+
bool isAttrContext() const {
64586458
return ExprEvalContexts.back().ExprContext ==
6459-
ExpressionEvaluationContextRecord::ExpressionKind::
6460-
EK_BoundsAttrArgument;
6459+
ExpressionEvaluationContextRecord::ExpressionKind::EK_AttrArgument;
64616460
}
64626461

64636462
/// Increment when we find a reference; decrement when we find an ignored

clang/lib/CodeGen/CGBlocks.cpp

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,15 @@ static std::string getBlockDescriptorName(const CGBlockInfo &BlockInfo,
121121
Name += "_";
122122
}
123123

124-
std::string TypeAtEncoding =
125-
CGM.getContext().getObjCEncodingForBlock(BlockInfo.getBlockExpr());
126-
/// Replace occurrences of '@' with '\1'. '@' is reserved on ELF platforms as
127-
/// a separator between symbol name and symbol version.
128-
std::replace(TypeAtEncoding.begin(), TypeAtEncoding.end(), '@', '\1');
124+
std::string TypeAtEncoding;
125+
126+
if (!CGM.getCodeGenOpts().DisableBlockSignatureString) {
127+
TypeAtEncoding =
128+
CGM.getContext().getObjCEncodingForBlock(BlockInfo.getBlockExpr());
129+
/// Replace occurrences of '@' with '\1'. '@' is reserved on ELF platforms
130+
/// as a separator between symbol name and symbol version.
131+
std::replace(TypeAtEncoding.begin(), TypeAtEncoding.end(), '@', '\1');
132+
}
129133
Name += "e" + llvm::to_string(TypeAtEncoding.size()) + "_" + TypeAtEncoding;
130134
Name += "l" + CGM.getObjCRuntime().getRCBlockLayoutStr(CGM, BlockInfo);
131135
return Name;
@@ -201,9 +205,13 @@ static llvm::Constant *buildBlockDescriptor(CodeGenModule &CGM,
201205
}
202206

203207
// Signature. Mandatory ObjC-style method descriptor @encode sequence.
204-
std::string typeAtEncoding =
205-
CGM.getContext().getObjCEncodingForBlock(blockInfo.getBlockExpr());
206-
elements.add(CGM.GetAddrOfConstantCString(typeAtEncoding).getPointer());
208+
if (CGM.getCodeGenOpts().DisableBlockSignatureString) {
209+
elements.addNullPointer(i8p);
210+
} else {
211+
std::string typeAtEncoding =
212+
CGM.getContext().getObjCEncodingForBlock(blockInfo.getBlockExpr());
213+
elements.add(CGM.GetAddrOfConstantCString(typeAtEncoding).getPointer());
214+
}
207215

208216
// GC layout.
209217
if (C.getLangOpts().ObjC) {
@@ -814,7 +822,8 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const CGBlockInfo &blockInfo) {
814822
descriptor = buildBlockDescriptor(CGM, blockInfo);
815823

816824
// Compute the initial on-stack block flags.
817-
flags = BLOCK_HAS_SIGNATURE;
825+
if (!CGM.getCodeGenOpts().DisableBlockSignatureString)
826+
flags = BLOCK_HAS_SIGNATURE;
818827
if (blockInfo.HasCapturedVariableLayout)
819828
flags |= BLOCK_HAS_EXTENDED_LAYOUT;
820829
if (blockInfo.NeedsCopyDispose)
@@ -1300,7 +1309,9 @@ static llvm::Constant *buildGlobalBlock(CodeGenModule &CGM,
13001309
fields.add(CGM.getNSConcreteGlobalBlock());
13011310

13021311
// __flags
1303-
BlockFlags flags = BLOCK_IS_GLOBAL | BLOCK_HAS_SIGNATURE;
1312+
BlockFlags flags = BLOCK_IS_GLOBAL;
1313+
if (!CGM.getCodeGenOpts().DisableBlockSignatureString)
1314+
flags |= BLOCK_HAS_SIGNATURE;
13041315
if (blockInfo.UsesStret)
13051316
flags |= BLOCK_USE_STRET;
13061317

clang/lib/CodeGen/CodeGenPGO.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ static llvm::cl::opt<bool>
3232
llvm::cl::desc("Enable value profiling"),
3333
llvm::cl::Hidden, llvm::cl::init(false));
3434

35-
extern llvm::cl::opt<bool> SystemHeadersCoverage;
36-
3735
using namespace clang;
3836
using namespace CodeGen;
3937

@@ -1118,7 +1116,7 @@ bool CodeGenPGO::skipRegionMappingForDecl(const Decl *D) {
11181116
// Don't map the functions in system headers.
11191117
const auto &SM = CGM.getContext().getSourceManager();
11201118
auto Loc = D->getBody()->getBeginLoc();
1121-
return !SystemHeadersCoverage && SM.isInSystemHeader(Loc);
1119+
return !llvm::coverage::SystemHeadersCoverage && SM.isInSystemHeader(Loc);
11221120
}
11231121

11241122
void CodeGenPGO::emitCounterRegionMapping(const Decl *D) {

clang/lib/CodeGen/CoverageMappingGen.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ static llvm::cl::opt<bool> EmptyLineCommentCoverage(
4646
"disable it on test)"),
4747
llvm::cl::init(true), llvm::cl::Hidden);
4848

49-
llvm::cl::opt<bool> SystemHeadersCoverage(
49+
namespace llvm::coverage {
50+
cl::opt<bool> SystemHeadersCoverage(
5051
"system-headers-coverage",
51-
llvm::cl::desc("Enable collecting coverage from system headers"),
52-
llvm::cl::init(false), llvm::cl::Hidden);
52+
cl::desc("Enable collecting coverage from system headers"), cl::init(false),
53+
cl::Hidden);
54+
}
5355

5456
using namespace clang;
5557
using namespace CodeGen;

clang/lib/CodeGen/CoverageMappingGen.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@
1919
#include "clang/Lex/Preprocessor.h"
2020
#include "llvm/ADT/DenseMap.h"
2121
#include "llvm/IR/GlobalValue.h"
22+
#include "llvm/Support/CommandLine.h"
2223
#include "llvm/Support/raw_ostream.h"
2324

25+
namespace llvm::coverage {
26+
extern cl::opt<bool> SystemHeadersCoverage;
27+
}
28+
2429
namespace clang {
2530

2631
class LangOptions;

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5751,6 +5751,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
57515751
Args.AddLastArg(CmdArgs, options::OPT_fexperimental_omit_vtable_rtti,
57525752
options::OPT_fno_experimental_omit_vtable_rtti);
57535753

5754+
Args.AddLastArg(CmdArgs, options::OPT_fdisable_block_signature_string,
5755+
options::OPT_fno_disable_block_signature_string);
5756+
57545757
// Handle segmented stacks.
57555758
Args.addOptInFlag(CmdArgs, options::OPT_fsplit_stack,
57565759
options::OPT_fno_split_stack);

clang/lib/Parse/ParseDecl.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,9 @@ unsigned Parser::ParseAttributeArgsCommon(
593593
EnterExpressionEvaluationContext Unevaluated(
594594
Actions,
595595
Uneval ? Sema::ExpressionEvaluationContext::Unevaluated
596-
: Sema::ExpressionEvaluationContext::ConstantEvaluated);
596+
: Sema::ExpressionEvaluationContext::ConstantEvaluated,
597+
nullptr,
598+
Sema::ExpressionEvaluationContextRecord::EK_AttrArgument);
597599

598600
ExprResult ArgExpr(
599601
Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression()));
@@ -610,9 +612,12 @@ unsigned Parser::ParseAttributeArgsCommon(
610612
// General case. Parse all available expressions.
611613
bool Uneval = attributeParsedArgsUnevaluated(*AttrName);
612614
EnterExpressionEvaluationContext Unevaluated(
613-
Actions, Uneval
614-
? Sema::ExpressionEvaluationContext::Unevaluated
615-
: Sema::ExpressionEvaluationContext::ConstantEvaluated);
615+
Actions,
616+
Uneval ? Sema::ExpressionEvaluationContext::Unevaluated
617+
: Sema::ExpressionEvaluationContext::ConstantEvaluated,
618+
nullptr,
619+
Sema::ExpressionEvaluationContextRecord::ExpressionKind::
620+
EK_AttrArgument);
616621

617622
ExprVector ParsedExprs;
618623
ParsedAttributeArgumentsProperties ArgProperties =
@@ -3383,7 +3388,7 @@ void Parser::ParseBoundsAttribute(IdentifierInfo &AttrName,
33833388
Sema::ExpressionEvaluationContextRecord::ExpressionKind;
33843389
EnterExpressionEvaluationContext EC(
33853390
Actions, Sema::ExpressionEvaluationContext::PotentiallyEvaluated, nullptr,
3386-
ExpressionKind::EK_BoundsAttrArgument);
3391+
ExpressionKind::EK_AttrArgument);
33873392

33883393
ExprResult ArgExpr(
33893394
Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression()));

clang/lib/Sema/SemaExpr.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,11 +2666,10 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS,
26662666
return ExprError();
26672667
}
26682668

2669-
// BoundsSafety: This specially handles arguments of bounds attributes
2670-
// appertains to a type of C struct field such that the name lookup
2671-
// within a struct finds the member name, which is not the case for other
2672-
// contexts in C.
2673-
if (isBoundsAttrContext() && !getLangOpts().CPlusPlus && S->isClassScope()) {
2669+
// This specially handles arguments of attributes appertains to a type of C
2670+
// struct field such that the name lookup within a struct finds the member
2671+
// name, which is not the case for other contexts in C.
2672+
if (isAttrContext() && !getLangOpts().CPlusPlus && S->isClassScope()) {
26742673
// See if this is reference to a field of struct.
26752674
LookupResult R(*this, NameInfo, LookupMemberName);
26762675
// LookupName handles a name lookup from within anonymous struct.
@@ -3279,7 +3278,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
32793278
case Decl::Field:
32803279
case Decl::IndirectField:
32813280
case Decl::ObjCIvar:
3282-
assert((getLangOpts().CPlusPlus || isBoundsAttrContext()) &&
3281+
assert((getLangOpts().CPlusPlus || isAttrContext()) &&
32833282
"building reference to field in C?");
32843283

32853284
// These can't have reference type in well-formed programs, but

clang/test/CodeGen/blocks.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -Wno-strict-prototypes -o - -fblocks | FileCheck %s
1+
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -Wno-strict-prototypes -o - -fblocks | FileCheck --check-prefix=CHECK --check-prefix=SIG_STR %s
2+
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -Wno-strict-prototypes -o - -fblocks -fdisable-block-signature-string | FileCheck --check-prefix=CHECK --check-prefix=NO_SIG_STR %s
23

3-
// CHECK: @{{.*}} = internal constant { i32, i32, ptr, ptr, ptr, ptr } { i32 0, i32 24, ptr @__copy_helper_block_4_20r, ptr @__destroy_helper_block_4_20r, ptr @{{.*}}, ptr null }, align 4
4-
// CHECK: @[[BLOCK_DESCRIPTOR_TMP21:.*]] = internal constant { i32, i32, ptr, ptr, ptr, ptr } { i32 0, i32 24, ptr @__copy_helper_block_4_20r, ptr @__destroy_helper_block_4_20r, ptr @{{.*}}, ptr null }, align 4
4+
// SIG_STR: @[[STR:.*]] = private unnamed_addr constant [6 x i8] c"v4@?0\00", align 1
5+
// SIG_STR: @{{.*}} = internal constant { ptr, i32, i32, ptr, ptr } { ptr @_NSConcreteGlobalBlock, i32 1342177280, i32 0, ptr @f_block_invoke, ptr @{{.*}} }, align 4
6+
// NO_SIG_STR: @{{.*}} = internal constant { ptr, i32, i32, ptr, ptr } { ptr @_NSConcreteGlobalBlock, i32 268435456, i32 0, ptr @f_block_invoke, ptr @{{.*}} }, align 4
7+
8+
// SIG_STR: @{{.*}} = internal constant { i32, i32, ptr, ptr, ptr, ptr } { i32 0, i32 24, ptr @__copy_helper_block_4_20r, ptr @__destroy_helper_block_4_20r, ptr @[[STR]], ptr null }, align 4
9+
// SIG_STR: @[[BLOCK_DESCRIPTOR_TMP21:.*]] = internal constant { i32, i32, ptr, ptr, ptr, ptr } { i32 0, i32 24, ptr @__copy_helper_block_4_20r, ptr @__destroy_helper_block_4_20r, ptr @[[STR]], ptr null }, align 4
10+
// NO_SIG_STR: @{{.*}} = internal constant { i32, i32, ptr, ptr, ptr, ptr } { i32 0, i32 24, ptr @__copy_helper_block_4_20r, ptr @__destroy_helper_block_4_20r, ptr null, ptr null }, align 4
11+
// NO_SIG_STR: @[[BLOCK_DESCRIPTOR_TMP21:.*]] = internal constant { i32, i32, ptr, ptr, ptr, ptr } { i32 0, i32 24, ptr @__copy_helper_block_4_20r, ptr @__destroy_helper_block_4_20r, ptr null, ptr null }, align 4
512

613
void (^f)(void) = ^{};
714

clang/test/CodeGenObjC/blocks.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fblocks -Wno-strict-prototypes -o - %s | FileCheck %s
1+
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fblocks -Wno-strict-prototypes -o - %s | FileCheck --check-prefix=CHECK --check-prefix=SIG_STR %s
2+
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fblocks -Wno-strict-prototypes -fdisable-block-signature-string -o - %s | FileCheck --check-prefix=CHECK --check-prefix=NO_SIG_STR %s
23

34
// Check that there is only one capture (20o) in the copy/dispose function
45
// names.
56

6-
// CHECK: @[[BLOCK_DESCRIPTOR0:.*]] = linkonce_odr hidden unnamed_addr constant { i32, i32, ptr, ptr, ptr, i32 } { i32 0, i32 28, ptr @__copy_helper_block_4_20o, ptr @__destroy_helper_block_4_20o, ptr @{{.*}}, i32 512 },
7+
// SIG_STR: @[[STR3:.*]] = private unnamed_addr constant [6 x i8] c"v4@?0\00", align 1
8+
// SIG_STR: @[[BLOCK_DESCRIPTOR0:"__block_descriptor_28_4_20o_e5_v4\\01\?0l"]] = linkonce_odr hidden unnamed_addr constant { i32, i32, ptr, ptr, ptr, i32 } { i32 0, i32 28, ptr @__copy_helper_block_4_20o, ptr @__destroy_helper_block_4_20o, ptr @[[STR3]], i32 512 },
9+
// NO_SIG_STR: @[[BLOCK_DESCRIPTOR0:__block_descriptor_28_4_20o_e0_l]] = linkonce_odr hidden unnamed_addr constant { i32, i32, ptr, ptr, ptr, i32 } { i32 0, i32 28, ptr @__copy_helper_block_4_20o, ptr @__destroy_helper_block_4_20o, ptr null, i32 512 },
10+
711

812
void (^gb0)(void);
913

@@ -132,6 +136,9 @@ void test5(A *a) {
132136
}
133137

134138
// CHECK-LABEL: define void @test5(
139+
// CHECK: %[[FLAGS:.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr }>, ptr %{{.*}}, i32 0, i32 1
140+
// SIG_STR: store i32 -1040187392, ptr %[[FLAGS]], align 4
141+
// NO_SIG_STR: store i32 -2113929216, ptr %[[FLAGS]], align 4
135142
// CHECK: %[[V0:.*]] = getelementptr inbounds <{ ptr, i32, i32, ptr, ptr, ptr, ptr }>, ptr %{{.*}}, i32 0, i32 4
136143
// CHECK: store ptr @[[BLOCK_DESCRIPTOR0]], ptr %[[V0]],
137144

0 commit comments

Comments
 (0)