aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/LLVMContextImpl.h
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2021-11-04 19:26:25 -0700
committerVitaly Buka <vitalybuka@google.com>2021-11-04 19:29:06 -0700
commit1caabbef8e8e73b3dd0cf1f15cf7417d75b7621c (patch)
tree0488211c845ed7383c5adb7f88234ea47a197d9b /llvm/lib/IR/LLVMContextImpl.h
parent3f6c0fb2ff750c9246aee41eb8ad086518752edf (diff)
downloadllvm-1caabbef8e8e73b3dd0cf1f15cf7417d75b7621c.zip
llvm-1caabbef8e8e73b3dd0cf1f15cf7417d75b7621c.tar.gz
llvm-1caabbef8e8e73b3dd0cf1f15cf7417d75b7621c.tar.bz2
[OpaquePtr] Fix initialization-order-fiasco
Asan detects it after D112732.
Diffstat (limited to 'llvm/lib/IR/LLVMContextImpl.h')
-rw-r--r--llvm/lib/IR/LLVMContextImpl.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h
index b17f581..d84714d 100644
--- a/llvm/lib/IR/LLVMContextImpl.h
+++ b/llvm/lib/IR/LLVMContextImpl.h
@@ -1461,10 +1461,7 @@ public:
unsigned NamedStructTypesUniqueID = 0;
DenseMap<std::pair<Type *, uint64_t>, ArrayType*> ArrayTypes;
- DenseMap<std::pair<Type *, ElementCount>, VectorType*> VectorTypes;
- // TODO: clean up the following after we no longer support non-opaque pointer
- // types.
- bool OpaquePointers;
+ DenseMap<std::pair<Type *, ElementCount>, VectorType *> VectorTypes;
DenseMap<Type*, PointerType*> PointerTypes; // Pointers in AddrSpace = 0
DenseMap<std::pair<Type*, unsigned>, PointerType*> ASPointerTypes;
@@ -1544,6 +1541,14 @@ public:
/// The lifetime of the object must be guaranteed to extend as long as the
/// LLVMContext is used by compilation.
void setOptPassGate(OptPassGate&);
+
+ // TODO: clean up the following after we no longer support non-opaque pointer
+ // types.
+ bool getOpaquePointers();
+ void setOpaquePointers(bool OP);
+
+private:
+ Optional<bool> OpaquePointers;
};
} // end namespace llvm