aboutsummaryrefslogtreecommitdiff
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.cpp37
1 files changed, 30 insertions, 7 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index e19ead98a616..4a1d5d3dcdf6 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -82,6 +82,11 @@ LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) {
"clang.arc.attachedcall operand bundle id drifted!");
(void)ClangAttachedCall;
+ auto *PtrauthEntry = pImpl->getOrInsertBundleTag("ptrauth");
+ assert(PtrauthEntry->second == LLVMContext::OB_ptrauth &&
+ "ptrauth operand bundle id drifted!");
+ (void)PtrauthEntry;
+
SyncScope::ID SingleThreadSSID =
pImpl->getOrInsertSyncScopeID("singlethread");
assert(SingleThreadSSID == SyncScope::SingleThread &&
@@ -133,13 +138,25 @@ bool LLVMContext::getDiagnosticsHotnessRequested() const {
void LLVMContext::setDiagnosticsHotnessThreshold(Optional<uint64_t> Threshold) {
pImpl->DiagnosticsHotnessThreshold = Threshold;
}
-
+void LLVMContext::setMisExpectWarningRequested(bool Requested) {
+ pImpl->MisExpectWarningRequested = Requested;
+}
+bool LLVMContext::getMisExpectWarningRequested() const {
+ return pImpl->MisExpectWarningRequested;
+}
uint64_t LLVMContext::getDiagnosticsHotnessThreshold() const {
- return pImpl->DiagnosticsHotnessThreshold.getValueOr(UINT64_MAX);
+ return pImpl->DiagnosticsHotnessThreshold.value_or(UINT64_MAX);
+}
+void LLVMContext::setDiagnosticsMisExpectTolerance(
+ Optional<uint64_t> Tolerance) {
+ pImpl->DiagnosticsMisExpectTolerance = Tolerance;
+}
+uint64_t LLVMContext::getDiagnosticsMisExpectTolerance() const {
+ return pImpl->DiagnosticsMisExpectTolerance.value_or(0);
}
bool LLVMContext::isDiagnosticsHotnessThresholdSetFromPSI() const {
- return !pImpl->DiagnosticsHotnessThreshold.hasValue();
+ return !pImpl->DiagnosticsHotnessThreshold.has_value();
}
remarks::RemarkStreamer *LLVMContext::getMainRemarkStreamer() {
@@ -346,12 +363,18 @@ 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::hasSetOpaquePointersValue() const {
+ return pImpl->hasOpaquePointersValue();
+}
+
+void LLVMContext::setOpaquePointers(bool Enable) const {
+ pImpl->setOpaquePointers(Enable);
}
bool LLVMContext::supportsTypedPointers() const {
return !pImpl->getOpaquePointers();
}
+
+Any &LLVMContext::getTargetData() const {
+ return pImpl->TargetDataStorage;
+}