[libc-commits] [PATCH] D147795: [libc] Add baremetal abort

Alex Brachet via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Apr 7 12:26:53 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd159c37235b1: [libc] Add baremetal abort (authored by abrachet).
Herald added a project: libc-project.
Herald added a subscriber: libc-commits.

Changed prior to commit:
  https://reviews.llvm.org/D147795?vs=511720&id=511769#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147795/new/

https://reviews.llvm.org/D147795

Files:
  libc/src/stdlib/baremetal/CMakeLists.txt
  libc/src/stdlib/baremetal/abort.cpp


Index: libc/src/stdlib/baremetal/abort.cpp
===================================================================
--- /dev/null
+++ libc/src/stdlib/baremetal/abort.cpp
@@ -0,0 +1,17 @@
+//===-- Implementation of abort -------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/__support/common.h"
+
+#include "src/stdlib/abort.h"
+
+namespace __llvm_libc {
+
+LLVM_LIBC_FUNCTION(void, abort, ()) { __builtin_trap(); }
+
+} // namespace __llvm_libc
Index: libc/src/stdlib/baremetal/CMakeLists.txt
===================================================================
--- /dev/null
+++ libc/src/stdlib/baremetal/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_entrypoint_object(
+  abort
+  SRCS
+    abort.cpp
+  HDRS
+    ../abort.h
+)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147795.511769.patch
Type: text/x-patch
Size: 1020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230407/5a960108/attachment.bin>


More information about the libc-commits mailing list