[Attributes] Assert correct attribute constructor is used (NFCI)
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 12 Jul 2021 18:54:58 +0000 (20:54 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 12 Jul 2021 19:11:59 +0000 (21:11 +0200)
commit3fb0621fafbb16ea157830b308c26a77ba0a04e3
treec482caf782190ca4d6aebc45ebc77f9a84f9029b
parentb4a6fa12d1fdcc9a446432218d9990a6c6797c83
[Attributes] Assert correct attribute constructor is used (NFCI)

Assert that enum/int/type attributes go through the constructor
they are supposed to use.

To make sure this can't happen via invalid bitcode, explicitly
verify that the attribute kind if correct there.
llvm/include/llvm/IR/Attributes.h
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/IR/Attributes.cpp