// Type ::= 'float' | 'void' (etc)
Result = Lex.getTyVal();
Lex.Lex();
+
+ // Handle (explicit) opaque pointer types (not --force-opaque-pointers).
+ //
+ // Type ::= ptr ('addrspace' '(' uint32 ')')?
+ if (Result->isOpaquePointerTy()) {
+ unsigned AddrSpace;
+ if (parseOptionalAddrSpace(AddrSpace))
+ return true;
+ Result = PointerType::get(getContext(), AddrSpace);
+
+ // Give a nice error for 'ptr*'.
+ if (Lex.getKind() == lltok::star)
+ return tokError("ptr* is invalid - use ptr instead");
+
+ // Fall through to parsing the type suffixes only if this 'ptr' is a
+ // function return. Otherwise, return success, implicitly rejecting other
+ // suffixes.
+ if (Lex.getKind() != lltok::lparen)
+ return false;
+ }
break;
case lltok::lbrace:
// Type ::= StructType
}
}
- // Handle (explicit) opaque pointer types (not --force-opaque-pointers).
- //
- // Type ::= ptr ('addrspace' '(' uint32 ')')?
- if (Result->isOpaquePointerTy()) {
- unsigned AddrSpace;
- if (parseOptionalAddrSpace(AddrSpace))
- return true;
- Result = PointerType::get(getContext(), AddrSpace);
-
- // Give a nice error for 'ptr*'.
- if (Lex.getKind() == lltok::star)
- return tokError("ptr* is invalid - use ptr instead");
-
- // Fall through to parsing the type suffixes only if this 'ptr' is a
- // function return. Otherwise, return success, implicitly rejecting other
- // suffixes.
- if (Lex.getKind() != lltok::lparen)
- return false;
- }
-
// parse the type suffixes.
while (true) {
switch (Lex.getKind()) {
; RUN: llvm-as < %s | llvm-dis --force-opaque-pointers | FileCheck %s
; RUN: opt --force-opaque-pointers < %s -S | FileCheck %s
+%ty = type i32*
+
; CHECK: @g = external global i16
@g = external global i16
unreachable
}
+define void @f4(%ty* %p) {
+; CHECK-LABEL: define {{[^@]+}}@f4
+; CHECK-SAME: (ptr [[P:%.*]]) {
+; CHECK-NEXT: unreachable
+;
+ unreachable
+}
+
define void @remangle_intrinsic() {
; CHECK-LABEL: define {{[^@]+}}@remangle_intrinsic() {
; CHECK-NEXT: [[A:%.*]] = alloca ptr, align 8