Add track_caller to type lookups (#599)

This commit is contained in:
XAMPPRocky 2021-04-22 10:02:26 +02:00 committed by GitHub
parent a42a9f20e1
commit d04039efda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -124,6 +124,7 @@ impl<'tcx> CodegenCx<'tcx> {
self.builder.builder(cursor) self.builder.builder(cursor)
} }
#[track_caller]
pub fn lookup_type(&self, ty: Word) -> SpirvType { pub fn lookup_type(&self, ty: Word) -> SpirvType {
self.type_cache.lookup(ty) self.type_cache.lookup(ty)
} }

View File

@ -705,6 +705,7 @@ impl TypeCache<'_> {
self.type_defs.borrow().get_by_right(ty).copied() self.type_defs.borrow().get_by_right(ty).copied()
} }
#[track_caller]
pub fn lookup(&self, word: Word) -> SpirvType { pub fn lookup(&self, word: Word) -> SpirvType {
self.type_defs self.type_defs
.borrow() .borrow()