aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-06-20 22:59:26 -0700
committerKazu Hirata <kazu@google.com>2022-06-20 22:59:26 -0700
commitca4af13e480e856f8f889c1e145308fc4eb69816 (patch)
treeb5372eb07d3ff696b42b5803dc28bceec68f5c78 /clang/lib/CodeGen/CodeGenModule.cpp
parent7a47ee51a145a40332311330ef45b5d62d8ae023 (diff)
downloadllvm-ca4af13e480e856f8f889c1e145308fc4eb69816.zip
llvm-ca4af13e480e856f8f889c1e145308fc4eb69816.tar.gz
llvm-ca4af13e480e856f8f889c1e145308fc4eb69816.tar.bz2
[clang] Don't use Optional::getValue (NFC)
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 05738c0..ff3480a 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<CharUnits> AlignValFromAllocate =
getOMPAllocateAlignment(D))
- AlignVal = AlignValFromAllocate.getValue();
+ AlignVal = *AlignValFromAllocate;
GV->setAlignment(AlignVal.getAsAlign());
// On Darwin, unlike other Itanium C++ ABI platforms, the thread-wrapper