Commit Graph
7 Commits
Author SHA1 Message Date
Jon Ross-Perkins 357baaeef8 Rename //explorer/common to base (#3103)
Renaming per #3100
2023-08-15 19:23:23 +00:00
Richard SmithandJon Ross-Perkins ea60e4f491 Track the file kind on SourceLocation rather than computing it from the file name. (#2999)
This will be more correct if a user file is named prelude.carbon, and
reduces the explorer runtime by about 10% by removing a string
comparison from the check for whether trace output is enabled.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2023-07-19 23:07:53 +00:00
Chandler Carruth dd26ea6a15 Update Bazel & protobufs, then narrow warnings to Carbon. (#2500)
Protobufs code hits a warning with the latest system headers on macOS.
I figured this may have been fixed so I updated protobufs and Bazel to
the latest releases. This generally cleaned things up.

However, it actually added *more* warnings. This clearly isn't a really
well tested path. In fact, we already have a disabled warning that we'd
like for Carbon code because LLVM isn't clean for that warning.

So I've switched our warning strategy to a more durable approach of
suppressing all warnings for external repository headers and source
files. This lets us re-enable the missing warning and should fix the
protobuf warning that started me down this twisty path.

Sadly, we *have* to update to Bazel 6 in order to have the necessary
flag to use this approach to suppressing warnings, so I couldn't do this
as two PRs cleanly. =/ That's why I've bundled both the Bazel (and
protobuf) updates with the warning strategy change.

Last but not least, I've fixed several unused parameters in Carbon's
code that our warnings now catch.
2022-12-28 16:58:01 -08:00
Richard Smith 7a67715ac5 Error: track message and prefix/location separately. (#1529)
This allows us to combine multiple Errors together without repeating the prefix
information. Also fixes several cases where two "COMPILATION ERROR" prefixes
would be prepended to the same message when errors with prefixes and locations
were produced by the lexer and parser.
2022-07-26 15:08:19 -07:00
Jon Meow 20728dbd3a CARBON_ header guards (#1261)
This modifies scripts/check_header_guards.py to add the CARBON_ prefix; everything else is pre-commit.
2022-05-12 17:25:43 -07:00
Jon Meow 3825f97e43 Add automatic header guard checks/fixes (#1260)
My intent is to add CARBON_ bas a prefix, and this makes that easier by creating a tool for auto-fixing guards in general.

string_literal is a manual fix -- it had no guard and I didn't automate that (technically I think I could, especially by enforcing the file header/footer, but it didn't feel quite worth it to me).
2022-05-12 15:54:45 -07:00
Jon Meow 309ec35f95 Rename executable_semantics to explorer (#1188)
Change generated with:

```
#!/usr/bin/bash -eux

# Helper script for renaming pending work.
# Run from the repo root.

# Rename executable_semantics in code.
sed -i 's/executable_semantics/explorer/g' \
  $(git grep -l 'executable_semantics' . | grep -v proposals)
sed -i 's/executable semantics/explorer/g' \
  $(git grep -l 'executable semantics' . | grep -v proposals)
sed -i 's/Executable semantics/Explorer/g' \
  $(git grep -l 'Executable semantics' . |  grep -v proposals)
sed -i 's/Executable Semantics/Explorer/g' \
  $(git grep -l 'Executable Semantics' . |  grep -v proposals)
sed -i 's/EXECUTABLE_SEMANTICS/EXPLORER/g' \
  $(git grep -l 'EXECUTABLE_SEMANTICS' . | grep -v proposals)
sed -i 's/ExecutableSemantics/Explorer/g' \
  $(git grep -l 'ExecutableSemantics' . | grep -v proposals)
sed -i 's/executable-semantics/explorer/g' \
  $(git grep -l 'executable-semantics' . | grep -v proposals)

# This is only needed for the initial move.
mv executable_semantics explorer
mv explorer/fuzzing/executable_semantics_fuzzer.cpp explorer/fuzzing/explorer_fuzzer.cpp
```

Verified with `bazel test ...`
2022-04-29 13:20:25 -07:00