bool MachOAsmParser::ParseDirective(AsmToken DirectiveID) {
  StringRef IDVal = DirectiveID.getIdentifier();
  SMLoc IDLoc = DirectiveID.getLoc();

  // FIXME: This should be driven based on a hash lookup and callback.
  if (IDVal == ".section")
    return ParseDirectiveDarwinSection();

  if (IDVal == ".zerofill")
    return ParseDirectiveDarwinZerofill();
  if (IDVal == ".desc")
    return ParseDirectiveDarwinSymbolDesc();
  if (IDVal == ".lsym")
    return ParseDirectiveDarwinLsym();
  if (IDVal == ".tbss")
    return ParseDirectiveDarwinTBSS();

  if (IDVal == ".comm")
    return ParseDirectiveComm(/*IsLocal=*/false);
  if (IDVal == ".lcomm")
    return ParseDirectiveComm(/*IsLocal=*/true);

  if (IDVal == ".subsections_via_symbols")
    return ParseDirectiveDarwinSubsectionsViaSymbols();
  if (IDVal == ".dump")
    return ParseDirectiveDarwinDumpOrLoad(IDLoc, /*IsDump=*/true);
  if (IDVal == ".load")
    return ParseDirectiveDarwinDumpOrLoad(IDLoc, /*IsLoad=*/false);

  if (!ParseDirectiveSectionSwitch(IDVal))
    return false;

  // Don't understand directive.
  return true;
}
bool SystemZAsmParser::ParseDirective(AsmToken DirectiveID) {
  StringRef IDVal = DirectiveID.getIdentifier();

  if (IDVal == ".insn")
    return ParseDirectiveInsn(DirectiveID.getLoc());

  return true;
}
Beispiel #3
0
/// ParseDirective parses the PPC specific directives
bool PPCAsmParser::ParseDirective(AsmToken DirectiveID) {
  StringRef IDVal = DirectiveID.getIdentifier();
  if (IDVal == ".word")
    return ParseDirectiveWord(4, DirectiveID.getLoc());
  if (IDVal == ".tc")
    return ParseDirectiveTC(isPPC64()? 8 : 4, DirectiveID.getLoc());
  return true;
}
Beispiel #4
0
bool MSP430AsmParser::ParseDirective(AsmToken DirectiveID) {
  StringRef IDVal = DirectiveID.getIdentifier();
  if (IDVal.lower() == ".long") {
    ParseLiteralValues(4, DirectiveID.getLoc());
  } else if (IDVal.lower() == ".word" || IDVal.lower() == ".short") {
    ParseLiteralValues(2, DirectiveID.getLoc());
  } else if (IDVal.lower() == ".byte") {
    ParseLiteralValues(1, DirectiveID.getLoc());
  } else if (IDVal.lower() == ".refsym") {
    return ParseDirectiveRefSym(DirectiveID);
  }
  return true;
}
Beispiel #5
0
bool ELFAsmParser::ParseDirective(AsmToken DirectiveID) {
  StringRef IDVal = DirectiveID.getIdentifier();
  SMLoc IDLoc = DirectiveID.getLoc();

  if (IDVal == ".local")
    return ParseDirectiveLocal();
  if (IDVal == ".lcomm")
    return ParseDirectiveComm(/*IsLocal=*/true);
  if (IDVal == ".comm")
    return ParseDirectiveComm(/*IsLocal=*/false);

  if (IDVal == ".size")
    return ParseDirectiveSize();

  if (!ParseDirectiveSectionSwitch(IDVal))
    return false;

  // Don't understand directive.
  return true;
}
Beispiel #6
0
/// ParseDirective parses the arm specific directives
bool MBlazeAsmParser::ParseDirective(AsmToken DirectiveID) {
  StringRef IDVal = DirectiveID.getIdentifier();
  if (IDVal == ".word")
    return ParseDirectiveWord(2, DirectiveID.getLoc());
  return true;
}