1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
Go to file
Fangrui Song 0f5b80de09 MCContext::reportError: don't call report_fatal_error
Errors from MCAssembler, MCObjectStreamer and *ObjectWriter typically cause a crash:

```
% cat c.c
int bar;
extern int foo __attribute__((alias("bar")));
% clang -c -fcommon c.c
fatal error: error in backend: Common symbol 'bar' cannot be used in assignment expr
PLEASE submit a bug report to ...
Stack dump:
...
```

`LLVMTargetMachine::addPassesToEmitFile` constructs `MachineModuleInfoWrapperPass`
which creates a MCContext without SourceMgr. `MCContext::reportError` calls
`report_fatal_error` which gets captured by Clang `LLVMErrorHandler` and gets translated
to the output above.

Since `MCContext::reportError` errors indicate user errors, such a crashing style error
is inappropriate. So this patch changes `report_fatal_error` to `SourceMgr().PrintMessage`.
```
% clang -c -fcommon c.c
<unknown>:0: error: Common symbol 'bar' cannot be used in assignment expr
```

Ideally we should at least recover the original filename (the line information
is generally lost).  That requires general improvement to MC diagnostics,
because currently in many cases SMLoc information is lost.
2020-12-20 23:23:12 -08:00
benchmarks
bindings [Go] Fix bindings/go/llvm/IRBindings.cpp 2020-12-16 10:09:58 -08:00
cmake [CMake] Avoid __FakeVCSRevision.h with no git repository 2020-12-16 17:33:20 +01:00
docs [FileCheck] Add a literal check directive modifier 2020-12-18 17:26:15 -08:00
examples [NFC] Reduce include files dependency and AA header cleanup (part 2). 2020-12-17 14:04:48 +03:00
include [RISCV] Define the remaining vector fixed-point arithmetic intrinsics. 2020-12-20 22:57:07 -08:00
lib MCContext::reportError: don't call report_fatal_error 2020-12-20 23:23:12 -08:00
projects llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
resources
runtimes [OpenMP] Fixed the issue that CMake variables for OpenMP were not passed through when building OpenMP with LLVM_ENABLE_RUNTIMES 2020-12-20 18:40:12 -05:00
test MCContext::reportError: don't call report_fatal_error 2020-12-20 23:23:12 -08:00
tools [libObject, llvm-readobj] - Reimplement ELFFile<ELFT>::getEntry. 2020-12-18 16:52:27 +03:00
unittests [DebugInfo] Support Fortran 'use <external module>' statement. 2020-12-18 13:10:57 -05:00
utils [TableGen][ARM][X86] Detect combining IntrReadMem and IntrWriteMem. 2020-12-19 14:56:17 -08:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt Remove Python2 fallback and only advertise Python3 in the doc 2020-12-17 15:40:16 +01:00
CODE_OWNERS.TXT [CODE_OWNERS.TXT] Update to include yours truly as the TableGen owner 2020-11-12 09:49:00 -05:00
configure
CREDITS.TXT [NFC] Add contributors names to CREDITS.TXT 2020-10-07 13:22:55 -04:00
LICENSE.TXT
llvm.spec.in
README.txt
RELEASE_TESTERS.TXT

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.