本文整理汇总了C++中AsmToken::getIdentifier方法的典型用法代码示例。如果您正苦于以下问题:C++ AsmToken::getIdentifier方法的具体用法?C++ AsmToken::getIdentifier怎么用?C++ AsmToken::getIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AsmToken
的用法示例。
在下文中一共展示了AsmToken::getIdentifier方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseDirective
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;
}
示例2: ParseDirective
bool SystemZAsmParser::ParseDirective(AsmToken DirectiveID) {
StringRef IDVal = DirectiveID.getIdentifier();
if (IDVal == ".insn")
return ParseDirectiveInsn(DirectiveID.getLoc());
return true;
}
示例3: ParseDirective
/// 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;
}
示例4: ParseDirectiveRefSym
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;
}
示例5: ParseDirective
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;
}