We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec81084 commit b6b9d31Copy full SHA for b6b9d31
clang/lib/CIR/CodeGen/CIRGenBuilder.h
@@ -31,7 +31,7 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
31
/// mlir::Builder::getStringAttr() which is an mlir::StringAttr.
32
mlir::Attribute getString(llvm::StringRef str, mlir::Type eltTy,
33
std::optional<size_t> size) {
34
- size_t finalSize = size ? *size : str.size();
+ size_t finalSize = size.value_or(str.size());
35
36
size_t lastNonZeroPos = str.find_last_not_of('\0');
37
// If the string is full of null bytes, emit a #cir.zero rather than
0 commit comments