mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-01 00:17:01 +00:00 
			
		
		
		
	[WinCOFF] Add support for the .safeseh directive
.safeseh adds an entry to the .sxdata section to register all the appropriate functions which may handle an exception. This entry is not a relocation to the symbol but instead the symbol table index of the function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238641 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -57,6 +57,7 @@ class COFFAsmParser : public MCAsmParserExtension { | ||||
|     addDirectiveHandler<&COFFAsmParser::ParseDirectiveEndef>(".endef"); | ||||
|     addDirectiveHandler<&COFFAsmParser::ParseDirectiveSecRel32>(".secrel32"); | ||||
|     addDirectiveHandler<&COFFAsmParser::ParseDirectiveSecIdx>(".secidx"); | ||||
|     addDirectiveHandler<&COFFAsmParser::ParseDirectiveSafeSEH>(".safeseh"); | ||||
|     addDirectiveHandler<&COFFAsmParser::ParseDirectiveLinkOnce>(".linkonce"); | ||||
|  | ||||
|     // Win64 EH directives. | ||||
| @@ -118,6 +119,7 @@ class COFFAsmParser : public MCAsmParserExtension { | ||||
|   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); | ||||
|  | ||||
| @@ -453,6 +455,21 @@ bool COFFAsmParser::ParseDirectiveSecRel32(StringRef, SMLoc) { | ||||
|   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)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user