brintos

brintos / llvm-project-archived public Read only

0
0
Text · 741 B · 906a4c1 Raw
27 lines · cpp
1//===-- lib/Support/idioms.cpp ----------------------------------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "flang/Common/idioms.h"10#include <cstdarg>11#include <cstdio>12#include <cstdlib>13 14namespace Fortran::common {15 16[[noreturn]] void die(const char *msg, ...) {17  va_list ap;18  va_start(ap, msg);19  std::fputs("\nfatal internal error: ", stderr);20  std::vfprintf(stderr, msg, ap);21  va_end(ap);22  fputc('\n', stderr);23  std::abort();24}25 26} // namespace Fortran::common27