TargetLoweringObjectFileXCOFF() = default;
~TargetLoweringObjectFileXCOFF() override = default;
- MCSection *getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind,
- const TargetMachine &TM) const override;
-
- MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
- const TargetMachine &TM) const override;
+ void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference,
const Function &F) const override;
- void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
+ MCSection *getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind,
+ const TargetMachine &TM) const override;
MCSection *getStaticCtorSection(unsigned Priority,
const MCSymbol *KeySym) const override;
const MCExpr *lowerRelativeReference(const GlobalValue *LHS,
const GlobalValue *RHS,
const TargetMachine &TM) const override;
+
+ MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
+ const TargetMachine &TM) const override;
};
} // end namespace llvm
// will have a label definition representing their offset within the csect.
// 2) Uninitialized: The Type will be XTY_CM, it will contain a single symbol,
// and may not contain label definitions.
+// 3) An external reference providing a symbol table entry for a symbol
+// contained in another XCOFF object file. External reference csects are not
+// implemented yet.
class MCSectionXCOFF final : public MCSection {
friend class MCContext;
: MCSection(SV_XCOFF, K, Begin), Name(Section), MappingClass(SMC),
Type(ST) {
assert((ST == XCOFF::XTY_SD || ST == XCOFF::XTY_CM) &&
- "Unexpected type for csect.");
+ "Invalid or unhandled type for csect.");
}
public:
//===----------------------------------------------------------------------===//
MCSection *TargetLoweringObjectFileXCOFF::getExplicitSectionGlobal(
const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
- llvm_unreachable("XCOFF explicit sections not yet implemented.");
+ report_fatal_error("XCOFF explicit sections not yet implemented.");
}
MCSection *TargetLoweringObjectFileXCOFF::SelectSectionForGlobal(
bool TargetLoweringObjectFileXCOFF::shouldPutJumpTableInFunctionSection(
bool UsesLabelDifference, const Function &F) const {
- llvm_unreachable("TLOF XCOFF not yet implemented.");
+ report_fatal_error("TLOF XCOFF not yet implemented.");
}
void TargetLoweringObjectFileXCOFF::Initialize(MCContext &Ctx,
MCSection *TargetLoweringObjectFileXCOFF::getStaticCtorSection(
unsigned Priority, const MCSymbol *KeySym) const {
- llvm_unreachable("XCOFF ctor section not yet implemented.");
+ report_fatal_error("XCOFF ctor section not yet implemented.");
}
MCSection *TargetLoweringObjectFileXCOFF::getStaticDtorSection(
unsigned Priority, const MCSymbol *KeySym) const {
- llvm_unreachable("XCOFF dtor section not yet implemented.");
+ report_fatal_error("XCOFF dtor section not yet implemented.");
}
const MCExpr *TargetLoweringObjectFileXCOFF::lowerRelativeReference(
const GlobalValue *LHS, const GlobalValue *RHS,
const TargetMachine &TM) const {
- llvm_unreachable("XCOFF not yet implemented.");
+ report_fatal_error("XCOFF not yet implemented.");
}
if (getMappingClass() != XCOFF::XMC_RW)
llvm_unreachable("Unsupported storage-mapping class for common csect");
if (getCSectType() != XCOFF::XTY_CM)
- llvm_unreachable("wrong csect type for common csect");
+ llvm_unreachable("wrong csect type for .bss csect");
// Don't have to print a directive for switching to section for commons.
// '.comm' and '.lcomm' directives for the variable will create the needed
// csect.
report_fatal_error("Custom section for Data not yet supported.");
if (GV->hasComdat())
- report_fatal_error("COMDAT not yet supported on AIX.");
+ report_fatal_error("COMDAT not yet supported by AIX.");
SectionKind GVKind = getObjFileLowering().getKindForGlobal(GV, TM);
if (!GVKind.isCommon())
- report_fatal_error("Only common variables are supported on AIX.");
+ report_fatal_error("Only common variables are supported on AIX for now.");
// Create the containing csect and switch to it.
- MCSectionXCOFF *CSect = dyn_cast<MCSectionXCOFF>(
+ MCSectionXCOFF *CSect = cast<MCSectionXCOFF>(
getObjFileLowering().SectionForGlobal(GV, GVKind, TM));
OutStreamer->SwitchSection(CSect);
// Create the symbol and emit it.
- MCSymbolXCOFF *XSym = dyn_cast<MCSymbolXCOFF>(getSymbol(GV));
- auto DL = GV->getParent()->getDataLayout();
+ MCSymbolXCOFF *XSym = cast<MCSymbolXCOFF>(getSymbol(GV));
+ const DataLayout &DL = GV->getParent()->getDataLayout();
unsigned Align =
GV->getAlignment() ? GV->getAlignment() : DL.getPreferredAlignment(GV);
uint64_t Size = DL.getTypeAllocSize(GV->getType()->getElementType());
@d = common local_unnamed_addr global double 0.000000e+00, align 8
@f = common local_unnamed_addr global float 0.000000e+00, align 4
-@comm = common local_unnamed_addr global double 0.000000e+00, align 8
@over_aligned = common local_unnamed_addr global double 0.000000e+00, align 32
; CHECK-NEXT: .comm c,2,1
; CHECK-NEXT: .comm d,8,3
; CHECK-NEXT: .comm f,4,2
-; CHECK-NEXT: .comm comm,8,3
; CHECK-NEXT: .comm over_aligned,8,5
; CHECK-NEXT: .comm array,32,0