forked from OSchip/llvm-project
OpaquePtr: Reject 'ptr*' again when parsing textual IR
Bring back the testcase dropped in1e6303e60c
and get it passing by checking explicitly for `ptr*` in LLParser. Uses `Type::isOpaquePointerTy()` fromad4bb82809
. Differential Revision: https://reviews.llvm.org/D104938
This commit is contained in:
parent
557b101ce7
commit
4506f614cb
|
@ -2597,6 +2597,8 @@ bool LLParser::parseType(Type *&Result, const Twine &Msg, bool AllowVoid) {
|
||||||
return tokError("basic block pointers are invalid");
|
return tokError("basic block pointers are invalid");
|
||||||
if (Result->isVoidTy())
|
if (Result->isVoidTy())
|
||||||
return tokError("pointers to void are invalid - use i8* instead");
|
return tokError("pointers to void are invalid - use i8* instead");
|
||||||
|
if (Result->isOpaquePointerTy())
|
||||||
|
return tokError("ptr* is invalid - use ptr instead");
|
||||||
if (!PointerType::isValidElementType(Result))
|
if (!PointerType::isValidElementType(Result))
|
||||||
return tokError("pointer to this type is invalid");
|
return tokError("pointer to this type is invalid");
|
||||||
Result = PointerType::getUnqual(Result);
|
Result = PointerType::getUnqual(Result);
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
; CHECK: ptr* is invalid - use ptr instead
|
||||||
|
define void @f(ptr addrspace(3) %a) {
|
||||||
|
%b = bitcast ptr addrspace(3) %a to ptr addrspace(3)*
|
||||||
|
ret void
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
; CHECK: ptr* is invalid - use ptr instead
|
||||||
|
define void @f(ptr %a) {
|
||||||
|
%b = bitcast ptr %a to ptr*
|
||||||
|
ret void
|
||||||
|
}
|
Loading…
Reference in New Issue