Add support for MSVC

This commit is contained in:
Jonathan Marler
2017-09-10 14:05:18 -06:00
committed by Jonathan Marler
parent 373785ae8d
commit 7c81cd30de
17 changed files with 238 additions and 60 deletions

View File

@@ -24,8 +24,8 @@ struct ParseContext {
Buf *void_buf;
};
__attribute__ ((format (printf, 4, 5)))
__attribute__ ((noreturn))
ATTRIBUTE_FORMAT(printf, 4, 5)
LLVM_ATTRIBUTE_NORETURN
static void ast_asm_error(ParseContext *pc, AstNode *node, size_t offset, const char *format, ...) {
assert(node->type == NodeTypeAsmExpr);
@@ -46,8 +46,8 @@ static void ast_asm_error(ParseContext *pc, AstNode *node, size_t offset, const
exit(EXIT_FAILURE);
}
__attribute__ ((format (printf, 3, 4)))
__attribute__ ((noreturn))
ATTRIBUTE_FORMAT(printf, 3, 4)
LLVM_ATTRIBUTE_NORETURN
static void ast_error(ParseContext *pc, Token *token, const char *format, ...) {
va_list ap;
va_start(ap, format);
@@ -205,7 +205,7 @@ static void ast_buf_from_token(ParseContext *pc, Token *token, Buf *buf) {
}
}
__attribute__ ((noreturn))
LLVM_ATTRIBUTE_NORETURN
static void ast_invalid_token_error(ParseContext *pc, Token *token) {
Buf token_value = BUF_INIT;
ast_buf_from_token(pc, token, &token_value);