Daniel Dunbar | 2b88e03 | 2011-11-16 01:19:19 +0000 | [diff] [blame^] | 1 | /* ===-- int_util.c - Implement internal utilities --------------------------=== |
| 2 | * |
| 3 | * The LLVM Compiler Infrastructure |
| 4 | * |
| 5 | * This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | * Source Licenses. See LICENSE.TXT for details. |
| 7 | * |
| 8 | * ===----------------------------------------------------------------------=== |
| 9 | */ |
| 10 | |
| 11 | #include "int_util.h" |
| 12 | #include "int_lib.h" |
| 13 | |
| 14 | #ifdef KERNEL_USE |
| 15 | |
| 16 | extern void panic(const char *, ...) __attribute__((noreturn)); |
| 17 | __attribute__((visibility("hidden"))) |
| 18 | void compilerrt_abort_impl(const char *file, int line, const char *function) { |
| 19 | panic("%s:%d: abort in %s", file, line, function); |
| 20 | } |
| 21 | |
| 22 | #else |
| 23 | |
| 24 | /* Get the system definition of abort() */ |
| 25 | #include <stdlib.h> |
| 26 | |
| 27 | __attribute__((visibility("hidden"))) |
| 28 | void compilerrt_abort_impl(const char *file, int line, const char *function) { |
| 29 | abort(); |
| 30 | } |
| 31 | |
| 32 | #endif |