Verifier: accept enums as scopes
authorAugie Fackler <augie@google.com>
Fri, 10 Dec 2021 20:17:18 +0000 (12:17 -0800)
committerYuanfang Chen <yuanfang.chen@sony.com>
Fri, 10 Dec 2021 20:19:56 +0000 (12:19 -0800)
commitb575405cc3a53112c487fd2dab2d3ed75c3944ab
tree48d7cdf8d8ddc138bc89f03b08c43036447f3ff6
parentbebfbfd4a82573e27171b4adf239c9804fa6d656
Verifier: accept enums as scopes

Rust allows enums to be scopes, as shown by the previous change. Sadly,
D111770 disallowed enums-as-scopes in the LLVM Verifier, which means
that LLVM HEAD stopped working for Rust compiles.  As a result, we back
out the verifier part of D111770 with a modification to the testcase so
we don't break this in the future.

The testcase is now actual IR from rustc at commit 8f8092cc3, which is
the nightly as of 2021-09-28. I would expect rustc 1.57 to produce
similar or identical IR if someone wants to reproduce this IR in the
future with minimal changes. A recipe for reproducing the IR using rustc
is included in the test file.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D115353
llvm/lib/IR/Verifier.cpp
llvm/test/DebugInfo/dbg-rust-valid-enum-as-scope.ll [new file with mode: 0644]
llvm/test/Verifier/dbg-invalid-enum-as-scope.ll [deleted file]