utils: Add Lookup()

A find or return-default utility.
Rename `find_or_replace.h` to `map.h` which contains both these utilties that operate on maps.

Change-Id: Iaa76ea3f5c5a1210e413c131dd0556c126ee5d0a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/70521
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-11-23 18:37:37 +00:00
committed by Tint LUCI CQ
parent 5af571bcbc
commit 1185d61648
24 changed files with 52 additions and 27 deletions

View File

@@ -74,7 +74,7 @@
#include "src/sem/type_conversion.h"
#include "src/sem/variable.h"
#include "src/utils/defer.h"
#include "src/utils/get_or_create.h"
#include "src/utils/map.h"
#include "src/utils/math.h"
#include "src/utils/reverse.h"
#include "src/utils/scoped_assignment.h"

View File

@@ -16,7 +16,7 @@
#include "src/sem/constant.h"
#include "src/sem/type_constructor.h"
#include "src/utils/get_or_create.h"
#include "src/utils/map.h"
namespace tint {
namespace resolver {

View File

@@ -74,7 +74,7 @@
#include "src/sem/type_conversion.h"
#include "src/sem/variable.h"
#include "src/utils/defer.h"
#include "src/utils/get_or_create.h"
#include "src/utils/map.h"
#include "src/utils/math.h"
#include "src/utils/reverse.h"
#include "src/utils/scoped_assignment.h"