Optimize Source by removing a std::string

The `std::string file_path` carried around by every Source was very expensive for heap allocations.
Push this into the Source::File.

Bug: tint:1383
Change-Id: Id9e3bdef1cf24aea5f3c83f348c05f5cf8ef4bbb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78321
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2022-01-27 17:36:27 +00:00
committed by Tint LUCI CQ
parent 792897422d
commit df9900c43e
13 changed files with 260 additions and 172 deletions

View File

@@ -215,6 +215,7 @@ tint_unittests_source_set("tint_unittests_ast_src") {
tint_unittests_source_set("tint_unittests_diagnostic_src") {
sources = [
"../src/diagnostic/diagnostic_test.cc",
"../src/diagnostic/formatter_test.cc",
"../src/diagnostic/printer_test.cc",
]