[all-commits] [llvm/llvm-project] ac2bec: OpaquePtr: Support i32** with --force-opaque-pointers

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Tue Jun 29 14:11:06 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ac2bec5addd2f96e976242bc8e0d93725fe3d2fd
      https://github.com/llvm/llvm-project/commit/ac2bec5addd2f96e976242bc8e0d93725fe3d2fd
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M llvm/lib/AsmParser/LLParser.cpp
    A llvm/test/Assembler/invalid-opaque-ptr-double-addrspace.ll
    M llvm/test/Assembler/opaque-ptr.ll
    M llvm/test/Other/force-opaque-ptrs.ll

  Log Message:
  -----------
  OpaquePtr: Support i32** with --force-opaque-pointers

4506f614cb6983a16d117cf77a968608e66d7a5c fixed parsing of textual IR to
reject `ptr*`, but broke the auto-conversion of `i32**` to `ptr` with
`--force-opaque-pointers`.

Get that working again by refactoring LLParser::parseType to only send
`ptr`-spelled pointers into the type suffix logic when it's the return
of a function type. This also rejects `ptr addrspace(3) addrspace(2)`,
which 1e6303e60ca5af4fbe7ca728572fd65666a98271 invadvertently started
accepting. Just the default top-level error message for the
double-addrspace since I had trouble thinking of something nice;
probably it's fine as is (it doesn't look valid the way that `ptr*`
does).

Differential Revision: https://reviews.llvm.org/D105146




More information about the All-commits mailing list