aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/LLVMContext.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2022-02-10 11:56:14 -0800
committerArthur Eubanks <aeubanks@google.com>2022-03-17 08:37:18 -0700
commit295172ef51c6b9a73bc0fdcfd25f8c41ead9034a (patch)
treef8e3668194cedda013fe43c89d2da0c4ab74bd0f /llvm/lib/IR/LLVMContext.cpp
parent6c0af92612d0730a039226d67cfa08f4d6db5be9 (diff)
downloadllvm-295172ef51c6b9a73bc0fdcfd25f8c41ead9034a.zip
llvm-295172ef51c6b9a73bc0fdcfd25f8c41ead9034a.tar.gz
llvm-295172ef51c6b9a73bc0fdcfd25f8c41ead9034a.tar.bz2
[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
Diffstat (limited to 'llvm/lib/IR/LLVMContext.cpp')
-rw-r--r--llvm/lib/IR/LLVMContext.cpp4
1 files changed, 4 insertions, 0 deletions
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<DiagnosticHandler> 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");