Skip to content

Commit ba43f96

Browse files
committed
[ObjC][Gen] Emit strs into cstrings if willBeRelativelyAddressed
1 parent a9e43a4 commit ba43f96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6026,7 +6026,8 @@ Address IRGenFunction::createAlloca(llvm::Type *type,
60266026
llvm::Constant *
60276027
IRGenModule::getAddrOfGlobalString(StringRef data, CStringSectionType type,
60286028
bool willBeRelativelyAddressed) {
6029-
if (TargetInfo.OutputObjectFormat != llvm::Triple::MachO)
6029+
if (TargetInfo.OutputObjectFormat != llvm::Triple::MachO ||
6030+
willBeRelativelyAddressed)
60306031
type = CStringSectionType::Default;
60316032
StringRef sectionName;
60326033
switch (type) {

0 commit comments

Comments
 (0)