bendjones created this revision.
bendjones added reviewers: erik.pilkington, ahatanak.
bendjones created this object with edit policy "Administrators".
bendjones added a project: clang.
Herald added subscribers: cfe-commits, dexonsmith.
Part of rdar://56643852 that makes all possible constant string code paths emit
without `no_dead_strip` so that dead stripping is allowed.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D70284
Files:
clang/lib/CodeGen/CGObjCMac.cpp
Index: clang/lib/CodeGen/CGObjCMac.cpp
===================================================================
--- clang/lib/CodeGen/CGObjCMac.cpp
+++ clang/lib/CodeGen/CGObjCMac.cpp
@@ -1978,6 +1978,7 @@
return V;
}
+// This is only used when `-fno-constant-cfstrings` is given
ConstantAddress
CGObjCCommonMac::GenerateConstantNSString(const StringLiteral *Literal) {
unsigned StringLength = 0;
@@ -2029,10 +2030,8 @@
GV = Fields.finishAndCreateGlobal("_unnamed_nsstring_", Alignment,
/*constant*/ true,
llvm::GlobalVariable::PrivateLinkage);
- const char *NSStringSection =
"__OBJC,__cstring_object,regular,no_dead_strip";
- const char *NSStringNonFragileABISection =
- "__DATA,__objc_stringobj,regular,no_dead_strip";
- // FIXME. Fix section.
+ const char *NSStringSection = "__OBJC,__cstring_object,regular";
+ const char *NSStringNonFragileABISection = "__DATA,__objc_stringobj,regular";
GV->setSection(CGM.getLangOpts().ObjCRuntime.isNonFragile()
? NSStringNonFragileABISection
: NSStringSection);
Index: clang/lib/CodeGen/CGObjCMac.cpp
===================================================================
--- clang/lib/CodeGen/CGObjCMac.cpp
+++ clang/lib/CodeGen/CGObjCMac.cpp
@@ -1978,6 +1978,7 @@
return V;
}
+// This is only used when `-fno-constant-cfstrings` is given
ConstantAddress
CGObjCCommonMac::GenerateConstantNSString(const StringLiteral *Literal) {
unsigned StringLength = 0;
@@ -2029,10 +2030,8 @@
GV = Fields.finishAndCreateGlobal("_unnamed_nsstring_", Alignment,
/*constant*/ true,
llvm::GlobalVariable::PrivateLinkage);
- const char *NSStringSection = "__OBJC,__cstring_object,regular,no_dead_strip";
- const char *NSStringNonFragileABISection =
- "__DATA,__objc_stringobj,regular,no_dead_strip";
- // FIXME. Fix section.
+ const char *NSStringSection = "__OBJC,__cstring_object,regular";
+ const char *NSStringNonFragileABISection = "__DATA,__objc_stringobj,regular";
GV->setSection(CGM.getLangOpts().ObjCRuntime.isNonFragile()
? NSStringNonFragileABISection
: NSStringSection);
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits