addDirectiveHandler<&COFFAsmParser::ParseDirectiveEndef>(".endef");
addDirectiveHandler<&COFFAsmParser::ParseDirectiveSecRel32>(".secrel32");
addDirectiveHandler<&COFFAsmParser::ParseDirectiveSecIdx>(".secidx");
+ addDirectiveHandler<&COFFAsmParser::ParseDirectiveSafeSEH>(".safeseh");
addDirectiveHandler<&COFFAsmParser::ParseDirectiveLinkOnce>(".linkonce");
// Win64 EH directives.
SectionKind::getText());
}
bool ParseSectionDirectiveData(StringRef, SMLoc) {
- return ParseSectionSwitch(".data",
- COFF::IMAGE_SCN_CNT_INITIALIZED_DATA
- | COFF::IMAGE_SCN_MEM_READ
- | COFF::IMAGE_SCN_MEM_WRITE,
- SectionKind::getDataRel());
+ return ParseSectionSwitch(".data", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
+ COFF::IMAGE_SCN_MEM_READ |
+ COFF::IMAGE_SCN_MEM_WRITE,
+ SectionKind::getData());
}
bool ParseSectionDirectiveBSS(StringRef, SMLoc) {
return ParseSectionSwitch(".bss",
bool ParseDirectiveEndef(StringRef, SMLoc);
bool ParseDirectiveSecRel32(StringRef, SMLoc);
bool ParseDirectiveSecIdx(StringRef, SMLoc);
+ bool ParseDirectiveSafeSEH(StringRef, SMLoc);
bool parseCOMDATType(COFF::COMDATType &Type);
bool ParseDirectiveLinkOnce(StringRef, SMLoc);
if (Flags & COFF::IMAGE_SCN_MEM_READ &&
(Flags & COFF::IMAGE_SCN_MEM_WRITE) == 0)
return SectionKind::getReadOnly();
- return SectionKind::getDataRel();
+ return SectionKind::getData();
}
bool COFFAsmParser::ParseSectionFlags(StringRef FlagsString, unsigned* Flags) {
if (getParser().parseIdentifier(Name))
return TokError("expected identifier in directive");
- MCSymbol *Sym = getContext().GetOrCreateSymbol(Name);
+ MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
getStreamer().EmitSymbolAttribute(Sym, Attr);
COFF::COMDATType Type = (COFF::COMDATType)0;
StringRef COMDATSymName;
if (getLexer().is(AsmToken::Comma)) {
- Type = COFF::IMAGE_COMDAT_SELECT_ANY;;
+ Type = COFF::IMAGE_COMDAT_SELECT_ANY;
Lex();
Flags |= COFF::IMAGE_SCN_LNK_COMDAT;
if (getParser().parseIdentifier(SymbolName))
return TokError("expected identifier in directive");
- MCSymbol *Sym = getContext().GetOrCreateSymbol(SymbolName);
+ MCSymbol *Sym = getContext().getOrCreateSymbol(SymbolName);
getStreamer().BeginCOFFSymbolDef(Sym);
if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in directive");
- MCSymbol *Symbol = getContext().GetOrCreateSymbol(SymbolID);
+ MCSymbol *Symbol = getContext().getOrCreateSymbol(SymbolID);
Lex();
getStreamer().EmitCOFFSecRel32(Symbol);
return false;
}
+bool COFFAsmParser::ParseDirectiveSafeSEH(StringRef, SMLoc) {
+ StringRef SymbolID;
+ if (getParser().parseIdentifier(SymbolID))
+ return TokError("expected identifier in directive");
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in directive");
+
+ MCSymbol *Symbol = getContext().getOrCreateSymbol(SymbolID);
+
+ Lex();
+ getStreamer().EmitCOFFSafeSEH(Symbol);
+ return false;
+}
+
bool COFFAsmParser::ParseDirectiveSecIdx(StringRef, SMLoc) {
StringRef SymbolID;
if (getParser().parseIdentifier(SymbolID))
if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in directive");
- MCSymbol *Symbol = getContext().GetOrCreateSymbol(SymbolID);
+ MCSymbol *Symbol = getContext().getOrCreateSymbol(SymbolID);
Lex();
getStreamer().EmitCOFFSectionIndex(Symbol);
if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in directive");
- MCSymbol *Symbol = getContext().GetOrCreateSymbol(SymbolID);
+ MCSymbol *Symbol = getContext().getOrCreateSymbol(SymbolID);
Lex();
getStreamer().EmitWinCFIStartProc(Symbol);
if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in directive");
- MCSymbol *handler = getContext().GetOrCreateSymbol(SymbolID);
+ MCSymbol *handler = getContext().getOrCreateSymbol(SymbolID);
Lex();
getStreamer().EmitWinEHHandler(handler, unwind, except);
}
bool COFFAsmParser::ParseSEHDirectivePushReg(StringRef, SMLoc L) {
- unsigned Reg;
+ unsigned Reg = 0;
if (ParseSEHRegisterNumber(Reg))
return true;
}
bool COFFAsmParser::ParseSEHDirectiveSetFrame(StringRef, SMLoc L) {
- unsigned Reg;
+ unsigned Reg = 0;
int64_t Off;
if (ParseSEHRegisterNumber(Reg))
return true;
}
bool COFFAsmParser::ParseSEHDirectiveSaveReg(StringRef, SMLoc L) {
- unsigned Reg;
+ unsigned Reg = 0;
int64_t Off;
if (ParseSEHRegisterNumber(Reg))
return true;
// FIXME: This method is inherently x86-specific. It should really be in the
// x86 backend.
bool COFFAsmParser::ParseSEHDirectiveSaveXMM(StringRef, SMLoc L) {
- unsigned Reg;
+ unsigned Reg = 0;
int64_t Off;
if (ParseSEHRegisterNumber(Reg))
return true;