From 295172ef51c6b9a73bc0fdcfd25f8c41ead9034a Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Thu, 10 Feb 2022 11:56:14 -0800 Subject: [OpaquePtr][LLParser] Automatically detect opaque pointers in .ll files This allows us to not have to specify -opaque-pointers when updating IR tests from typed pointers to opaque pointers. We detect opaque pointers in .ll files by looking for relevant tokens, either "ptr" or "*". Reviewed By: #opaque-pointers, nikic Differential Revision: https://reviews.llvm.org/D119482 --- llvm/lib/IR/LLVMContext.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/IR/LLVMContext.cpp') diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp index 4b39599..f4e917c 100644 --- a/llvm/lib/IR/LLVMContext.cpp +++ b/llvm/lib/IR/LLVMContext.cpp @@ -351,6 +351,10 @@ std::unique_ptr LLVMContext::getDiagnosticHandler() { return std::move(pImpl->DiagHandler); } +bool LLVMContext::hasSetOpaquePointersValue() const { + return pImpl->hasOpaquePointersValue(); +} + void LLVMContext::enableOpaquePointers() const { assert(pImpl->PointerTypes.empty() && pImpl->ASPointerTypes.empty() && "Must be called before creating any pointer types"); -- cgit v1.1