Revert "Revert "[OpaquePointers][BitcodeReader] Enable -opaque-pointers if we see an opaque pointer type""

This reverts commit 80ec0ebfdc.

Issues were already fixed at head.
This commit is contained in:
Arthur Eubanks
2022-03-21 17:11:14 -07:00
parent 46bdacaa31
commit 10ffe80a24
2 changed files with 4 additions and 1 deletions

View File

@@ -1883,7 +1883,9 @@ Error BitcodeReader::parseTypeTableBody() {
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];