[all-commits] [llvm/llvm-project] b47c9f: [libc] Add initial assert definition

Alex Brachet via All-commits all-commits at lists.llvm.org
Wed Mar 11 20:47:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b47c9f535c8a0fffeb7634a82e3901d416915938
      https://github.com/llvm/llvm-project/commit/b47c9f535c8a0fffeb7634a82e3901d416915938
  Author: Alex Brachet <alexbrachetmialot at gmail.com>
  Date:   2020-03-11 (Wed, 11 Mar 2020)

  Changed paths:
    M libc/config/linux/api.td
    M libc/include/CMakeLists.txt
    A libc/include/assert.h.def
    M libc/lib/CMakeLists.txt
    M libc/spec/stdc.td
    M libc/src/CMakeLists.txt
    A libc/src/assert/CMakeLists.txt
    A libc/src/assert/__assert_fail.cpp
    A libc/src/assert/assert.h
    M libc/test/src/CMakeLists.txt
    A libc/test/src/assert/CMakeLists.txt
    A libc/test/src/assert/assert_test.cpp

  Log Message:
  -----------
  [libc] Add initial assert definition

Summary: This patch adds a temporary `__assert_fail` and `assert` definition to make it available to internal llvm libc code. `__assert_fail` writes to fd 2 directly instead of `stderr`, using SYS_write. I have not put it in its own linux directory because this is temporary and it should be using stdio's api in the future. It does not currently print out the line number (although we could do that by stringifying `__LINE__` if reviewers wish).

Reviewers: sivachandra, gchatelet, PaulkaToast

Reviewed By: sivachandra

Subscribers: mgorny, MaskRay, tschuett, libc-commits

Differential Revision: https://reviews.llvm.org/D75420




More information about the All-commits mailing list