Bring back the testcase dropped in
1e6303e60ca5af4fbe7ca728572fd65666a98271 and get it passing by checking
explicitly for ptr* in LLParser. Added Type::isOpaquePointerTy() for
convenience.
Details
- Reviewers
aeubanks nikic - Group Reviewers
Restricted Project - Commits
- rG4506f614cb69: OpaquePtr: Reject 'ptr*' again when parsing textual IR
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM -- looks like we had a bit of race condition, I just committed ad4bb8280952c2cacf497e30560ee94c119b36e0 in preparation for doing the same change...
lgtm but with a comment on the newly added method
llvm/include/llvm/IR/Type.h | ||
---|---|---|
231 ↗ | (On Diff #354567) | I have a mild preference to not add these one off sort of methods when we already have lots of code that does isa<PointerType> && cast<PointerType>(Ty)->isOpaque() |
Thanks for both reviews! Landed in 4506f614cb6983a16d117cf77a968608e66d7a5c.
Yeah, sorry about that / thanks; after I left the other review I realized it was easy enough for me to pitch in here :).
llvm/include/llvm/IR/Type.h | ||
---|---|---|
231 ↗ | (On Diff #354567) | Agreed it shouldn't be a one off, was surprised it hadn't been added yet though... I'll see if I can find time to clean up the existing boilerplate instances to use this helper (note that @nikic already added it). |
llvm/lib/AsmParser/LLParser.cpp | ||
---|---|---|
2601 | This breaks pointer to pointer types in -force-opaque-pointers mode: define void @test(i32** %x) {} Results in: build/bin/opt: test303.ll:1:23: error: ptr* is invalid - use ptr instead |
llvm/lib/AsmParser/LLParser.cpp | ||
---|---|---|
2601 | Looking. |
llvm/lib/AsmParser/LLParser.cpp | ||
---|---|---|
2601 | Fixed by https://reviews.llvm.org/D105146. |
This breaks pointer to pointer types in -force-opaque-pointers mode:
Results in: