summaryrefslogtreecommitdiff
path: root/llvm/lib/IR/LLVMContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/LLVMContext.cpp')
-rw-r--r--llvm/lib/IR/LLVMContext.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index c4a713db455b..90716d9c81a6 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -348,6 +348,12 @@ std::unique_ptr<DiagnosticHandler> LLVMContext::getDiagnosticHandler() {
return std::move(pImpl->DiagHandler);
}
+void LLVMContext::enableOpaquePointers() const {
+ assert(pImpl->PointerTypes.empty() && pImpl->ASPointerTypes.empty() &&
+ "Must be called before creating any pointer types");
+ pImpl->setOpaquePointers(true);
+}
+
bool LLVMContext::supportsTypedPointers() const {
- return !pImpl->ForceOpaquePointers;
+ return !pImpl->getOpaquePointers();
}