From ca4af13e480e856f8f889c1e145308fc4eb69816 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 20 Jun 2022 22:59:26 -0700 Subject: [clang] Don't use Optional::getValue (NFC) --- clang/lib/CodeGen/CodeGenModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 05738c03796b..ff3480a9ac84 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -4461,7 +4461,7 @@ LangAS CodeGenModule::GetGlobalConstantAddressSpace() const { // casted to Generic pointers which are used to model HIP's "flat" pointers. return LangAS::cuda_device; if (auto AS = getTarget().getConstantAddressSpace()) - return AS.getValue(); + return *AS; return LangAS::Default; } @@ -4736,7 +4736,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D, // Check for alignment specifed in an 'omp allocate' directive. if (llvm::Optional AlignValFromAllocate = getOMPAllocateAlignment(D)) - AlignVal = AlignValFromAllocate.getValue(); + AlignVal = *AlignValFromAllocate; GV->setAlignment(AlignVal.getAsAlign()); // On Darwin, unlike other Itanium C++ ABI platforms, the thread-wrapper -- cgit v1.2.3