about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-11-24 16:00:57 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-11-29 12:08:57 +1100
commitc9ae38c71e2838f1ac282803ddde47f21f4ca76e (patch)
treeb958e56a3adccd7d12f831c73691306ed4860904 /compiler/rustc_codegen_llvm/src
parent2585bcea0bc2a9c42a4be2c1eba5c61137f2b167 (diff)
downloadrust-c9ae38c71e2838f1ac282803ddde47f21f4ca76e.tar.gz
rust-c9ae38c71e2838f1ac282803ddde47f21f4ca76e.zip
Avoid unnecessary `MetaItem`/`Attribute` conversions.
`check_builtin_attribute` calls `parse_meta` to convert an `Attribute`
to a `MetaItem`, which it then checks. However, many callers of
`check_builtin_attribute` start with a `MetaItem`, and then convert it
to an `Attribute` by calling `cx.attribute(meta_item)`. This `MetaItem`
to `Attribute` to `MetaItem` conversion is silly.

This commit adds a new function `check_builtin_meta_item`, which can be
called instead from these call sites. `check_builtin_attribute` also now
calls it. The commit also renames `check_meta` as `check_attr` to better
match its arguments.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions