Commit Graph
4 Commits
Author SHA1 Message Date
Chandler Carruth 8c64f0bfdd Add -Wmissing-prototypes and fix issues it finds. (#4019)
Most of these are places where we failed to include a header file and
simply never got an error about this. The fix is to include the header
file.

Most other cases are functions that should have been marked `static` but
were not. Finding all of these was a main motivation for me enabling the
warning despite how much work it is.

One complicating factor was that we weren't including the `handle.h` for
all the state-based handler functions. While this isn't a tiny amount of
code, it is just declarations and doesn't add any extra dependencies. It
also lets us have the checking for which functions need to be `static`
and which don't. For the `parse` library I had to add the `handle.h`
header as well, I tried to match the design of it in `check`.

I have also had to work around a bug in the warning, but given the value
it seems to be providing, that seems reasonable. I've filed the bug
upstream: https://github.com/llvm/llvm-project/issues/94138

I also had to use some hacks to work around limitations of Bazel rules
that wrap `cc_library` rules and don't expose `copts`. I filed a bug for
`cc_proto_library` specifically:
~https://github.com/bazelbuild/bazel/issues/22610~ 
https://github.com/bazelbuild/bazel/issues/4446
2024-06-04 20:04:45 +00:00
Jon Ross-Perkins 5fa6f04d83 Update the LLVM library version in use. (#2633)
This also fixes a couple issues with the newer version; makeArrayRef is deprecated, and ErrorHandling is now needed for llvm_unreachable.
2023-02-24 13:24:31 -08:00
Jon Ross-Perkins 10647b70a4 IWYU pass on toolchain (#2624)
Just opening files in vscode and seeing what clangd flags.

Some edits to ostream.h to stop it from getting flagged (the usage pattern means it's not always obviously used).
2023-02-23 10:39:18 -08:00
Jon Ross-Perkins 8c354ca232 Switch to PrettyStackTrace for CHECK/FATAL (#2373)
At present, CHECK/FATAL print their own stack trace. This switches to just using std::abort for the stack trace, as well as the CHECK printing more completely.

This has a few consequences:

1) I'm now buffering the FATAL strings in order to print it later.
2) We now print the bug report message and program arguments on failure. This is part of pretty printing and was elided before.
3) We can now have pretty printing on FATAL, e.g. to show the stacks we're building in the parser.
2022-11-04 14:59:39 -07:00