Deleted Added
full compact
23d22
< #include "llvm/MC/MCValue.h"
142,143c141,142
< bool AsmParser::Run() {
< // Create the initial section.
---
> bool AsmParser::Run(bool NoInitialTextSection) {
> // Create the initial section, if requested.
145d143
< // FIXME: Support -n.
147,149c145,148
< Out.SwitchSection(getMachOSection("__TEXT", "__text",
< MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
< 0, SectionKind::getText()));
---
> if (!NoInitialTextSection)
> Out.SwitchSection(getMachOSection("__TEXT", "__text",
> MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
> 0, SectionKind::getText()));
151d149
<
267c265,272
< MCSymbol *Sym = CreateSymbol(getTok().getIdentifier());
---
> std::pair<StringRef, StringRef> Split = getTok().getIdentifier().split('@');
> MCSymbol *Sym = CreateSymbol(Split.first);
>
> // Lookup the symbol variant if used.
> MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
> if (Split.first.size() != getTok().getIdentifier().size())
> Variant = MCSymbolRefExpr::getVariantKindForName(Split.second);
>
273a279,281
> if (Variant)
> return Error(EndLoc, "unexpected modified on variable reference");
>
279c287
< Res = MCSymbolRefExpr::Create(Sym, getContext());
---
> Res = MCSymbolRefExpr::Create(Sym, Variant, getContext());