Skip to content

Commit f54af62

Browse files
author
Zaara Syeda
committed
Address review
1 parent 0e248e2 commit f54af62

File tree

4 files changed

+19
-26
lines changed

4 files changed

+19
-26
lines changed

clang/lib/CodeGen/Targets/PPC.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,26 +302,25 @@ void AIXTargetCodeGenInfo::setTargetAttributes(
302302
M.getDiags().Report(D->getLocation(), diag::warn_toc_unsupported_type)
303303
<< GVId << Msg;
304304
};
305-
if (!Ty || Ty->isIncompleteType()) {
305+
if (!Ty || Ty->isIncompleteType())
306306
reportUnsupportedWarning(EmitDiagnostic, "of incomplete type");
307-
} else if (RDecl && RDecl->hasFlexibleArrayMember()) {
307+
else if (RDecl && RDecl->hasFlexibleArrayMember())
308308
reportUnsupportedWarning(EmitDiagnostic,
309309
"it contains a flexible array member");
310-
} else if (VarD->getTLSKind() != VarDecl::TLS_None) {
310+
else if (VarD->getTLSKind() != VarDecl::TLS_None)
311311
reportUnsupportedWarning(EmitDiagnostic, "of thread local storage");
312-
} else if (PointerSize < Context.getTypeInfo(VarD->getType()).Width / 8) {
312+
else if (PointerSize < Context.getTypeInfo(VarD->getType()).Width / 8)
313313
reportUnsupportedWarning(EmitDiagnostic,
314314
"variable is larger than a pointer");
315-
} else if (PointerSize < Alignment) {
315+
else if (PointerSize < Alignment)
316316
reportUnsupportedWarning(EmitDiagnostic,
317317
"variable is aligned wider than a pointer");
318-
} else if (D->hasAttr<SectionAttr>()) {
318+
else if (D->hasAttr<SectionAttr>())
319319
reportUnsupportedWarning(EmitDiagnostic,
320320
"variable has a section attribute");
321-
} else if (GV->hasExternalLinkage() ||
322-
(M.getCodeGenOpts().AllTocData && !GV->hasLocalLinkage())) {
321+
else if (GV->hasExternalLinkage() ||
322+
(M.getCodeGenOpts().AllTocData && !GV->hasLocalLinkage()))
323323
GVar->addAttribute("toc-data");
324-
}
325324
}
326325
}
327326

llvm/lib/MC/MCSectionXCOFF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void MCSectionXCOFF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
8787
if (getKind().isCommon() && !getKind().isBSSLocal())
8888
return;
8989

90-
assert(getKind().isBSS() && "Unexepected section kind for toc-data");
90+
assert(getKind().isBSS() && "Unexpected section kind for toc-data");
9191
printCsectDirective(OS);
9292
return;
9393
}

llvm/lib/Target/PowerPC/PPCSubtarget.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,9 @@ void PPCSubtarget::tocDataChecks(unsigned PointerSize,
202202
report_fatal_error(
203203
"A GlobalVariable with size larger than a TOC entry is not currently "
204204
"supported by the toc data transformation.");
205-
if (GV->hasLocalLinkage() || GV->hasPrivateLinkage())
206-
report_fatal_error("A GlobalVariable with private or local linkage is not "
205+
if (GV->hasPrivateLinkage())
206+
report_fatal_error("A GlobalVariable with private linkage is not "
207207
"currently supported by the toc data transformation.");
208-
assert(!GV->hasCommonLinkage() &&
209-
"Tentative definitions cannot have the mapping class XMC_TD.");
210208
}
211209

212210
bool PPCSubtarget::isGVIndirectSymbol(const GlobalValue *GV) const {

llvm/test/CodeGen/PowerPC/toc-data-struct-array.ll

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,14 @@ attributes #1 = { noinline }
3434
; CHECK-NEXT: .space 4
3535

3636
; OBJ32: Symbol {
37-
; OBJ32: Index: 9
38-
; OBJ32-NEXT: Name: a
37+
; OBJ32: Name: a
3938
; OBJ32-NEXT: Value (RelocatableAddress): 0x3C
4039
; OBJ32-NEXT: Section: .data
4140
; OBJ32-NEXT: Type: 0x0
4241
; OBJ32-NEXT: StorageClass: C_EXT (0x2)
4342
; OBJ32-NEXT: NumberOfAuxEntries: 1
4443
; OBJ32-NEXT: CSECT Auxiliary Entry {
45-
; OBJ32-NEXT: Index: 10
44+
; OBJ32-NEXT: Index: {{[0-9]+}}
4645
; OBJ32-NEXT: SectionLen: 2
4746
; OBJ32-NEXT: ParameterHashIndex: 0x0
4847
; OBJ32-NEXT: TypeChkSectNum: 0x0
@@ -54,15 +53,14 @@ attributes #1 = { noinline }
5453
; OBJ32-NEXT: }
5554
; OBJ32-NEXT: }
5655
; OBJ32-NEXT: Symbol {
57-
; OBJ32-NEXT: Index: 11
58-
; OBJ32-NEXT: Name: b
56+
; OBJ32: Name: b
5957
; OBJ32-NEXT: Value (RelocatableAddress): 0x40
6058
; OBJ32-NEXT: Section: .data
6159
; OBJ32-NEXT: Type: 0x0
6260
; OBJ32-NEXT: StorageClass: C_EXT (0x2)
6361
; OBJ32-NEXT: NumberOfAuxEntries: 1
6462
; OBJ32-NEXT: CSECT Auxiliary Entry {
65-
; OBJ32-NEXT: Index: 12
63+
; OBJ32-NEXT: Index: {{[0-9]+}}
6664
; OBJ32-NEXT: SectionLen: 4
6765
; OBJ32-NEXT: ParameterHashIndex: 0x0
6866
; OBJ32-NEXT: TypeChkSectNum: 0x0
@@ -75,15 +73,14 @@ attributes #1 = { noinline }
7573
; OBJ32-NEXT: }
7674

7775
; OBJ64: Symbol {
78-
; OBJ64: Index: 9
79-
; OBJ64-NEXT: Name: a
76+
; OBJ64: Name: a
8077
; OBJ64-NEXT: Value (RelocatableAddress): 0x48
8178
; OBJ64-NEXT: Section: .data
8279
; OBJ64-NEXT: Type: 0x0
8380
; OBJ64-NEXT: StorageClass: C_EXT (0x2)
8481
; OBJ64-NEXT: NumberOfAuxEntries: 1
8582
; OBJ64-NEXT: CSECT Auxiliary Entry {
86-
; OBJ64-NEXT: Index: 10
83+
; OBJ64-NEXT: Index: {{[0-9]+}}
8784
; OBJ64-NEXT: SectionLen: 2
8885
; OBJ64-NEXT: ParameterHashIndex: 0x0
8986
; OBJ64-NEXT: TypeChkSectNum: 0x0
@@ -94,15 +91,14 @@ attributes #1 = { noinline }
9491
; OBJ64-NEXT: }
9592
; OBJ64-NEXT: }
9693
; OBJ64-NEXT: Symbol {
97-
; OBJ64-NEXT: Index: 11
98-
; OBJ64-NEXT: Name: b
94+
; OBJ64: Name: b
9995
; OBJ64-NEXT: Value (RelocatableAddress): 0x4C
10096
; OBJ64-NEXT: Section: .data
10197
; OBJ64-NEXT: Type: 0x0
10298
; OBJ64-NEXT: StorageClass: C_EXT (0x2)
10399
; OBJ64-NEXT: NumberOfAuxEntries: 1
104100
; OBJ64-NEXT: CSECT Auxiliary Entry {
105-
; OBJ64-NEXT: Index: 12
101+
; OBJ64-NEXT: Index: {{[0-9]+}}
106102
; OBJ64-NEXT: SectionLen: 4
107103
; OBJ64-NEXT: ParameterHashIndex: 0x0
108104
; OBJ64-NEXT: TypeChkSectNum: 0x0

0 commit comments

Comments
 (0)