[PATCH] D122048: [OpaquePointers][BitcodeReader] Enable -opaque-pointers if we see an opaque pointer type
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 21 09:19:41 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG46216aa97729: [OpaquePointers][BitcodeReader] Enable -opaque-pointers if we see an opaque… (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122048/new/
https://reviews.llvm.org/D122048
Files:
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/test/Other/force-opaque-ptrs.ll
Index: llvm/test/Other/force-opaque-ptrs.ll
===================================================================
--- llvm/test/Other/force-opaque-ptrs.ll
+++ llvm/test/Other/force-opaque-ptrs.ll
@@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
; RUN: llvm-as --opaque-pointers < %s | llvm-dis --opaque-pointers | FileCheck %s
; RUN: llvm-as < %s | llvm-dis --opaque-pointers | FileCheck %s
+; RUN: llvm-as --opaque-pointers < %s | llvm-dis | FileCheck %s
; RUN: opt --opaque-pointers < %s -S | FileCheck %s
; RUN: verify-uselistorder --opaque-pointers < %s
Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp
===================================================================
--- llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1883,7 +1883,9 @@
case bitc::TYPE_CODE_OPAQUE_POINTER: { // OPAQUE_POINTER: [addrspace]
if (Record.size() != 1)
return error("Invalid opaque pointer record");
- if (Context.supportsTypedPointers())
+ if (LLVM_UNLIKELY(!Context.hasSetOpaquePointersValue())) {
+ Context.enableOpaquePointers();
+ } else if (Context.supportsTypedPointers())
return error(
"Opaque pointers are only supported in -opaque-pointers mode");
unsigned AddressSpace = Record[0];
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122048.416983.patch
Type: text/x-patch
Size: 1372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220321/ed0c74e2/attachment.bin>
More information about the llvm-commits
mailing list