-void MCStreamer::EmitLabel(MCSymbol *Symbol) {
- assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
- assert(getCurrentSection() && "Cannot emit before setting section!");
- Symbol->setSection(*getCurrentSection());
- LastSymbol = Symbol;
-}
-
-void MCStreamer::EmitDataRegion() {
- if (RegionIndicator == Data) return;
-
- MCContext &Context = getContext();
- const MCAsmInfo &MAI = Context.getAsmInfo();
- if (!MAI.getSupportsDataRegions()) return;
-
- // Generate a unique symbol name.
- MCSymbol *NewSym = Context.GetOrCreateSymbol(MAI.getDataBeginLabelName() +
- Twine(UniqueDataBeginSuffix++));
- EmitLabel(NewSym);
-
- RegionIndicator = Data;
-}
-
-void MCStreamer::EmitCodeRegion() {
- if (RegionIndicator == Code) return;
-
- MCContext &Context = getContext();
- const MCAsmInfo &MAI = Context.getAsmInfo();
- if (!MAI.getSupportsDataRegions()) return;
-
- // Generate a unique symbol name.
- MCSymbol *NewSym = Context.GetOrCreateSymbol(MAI.getCodeBeginLabelName() +
- Twine(UniqueCodeBeginSuffix++));
- EmitLabel(NewSym);
-
- RegionIndicator = Code;
-}
-
-void MCStreamer::EmitJumpTable8Region() {
- if (RegionIndicator == JumpTable8) return;
-
- MCContext &Context = getContext();
- const MCAsmInfo &MAI = Context.getAsmInfo();
- if (!MAI.getSupportsDataRegions()) return;
-
- // Generate a unique symbol name.
- MCSymbol *NewSym =
- Context.GetOrCreateSymbol(MAI.getJumpTable8BeginLabelName() +
- Twine(UniqueDataBeginSuffix++));
- EmitLabel(NewSym);