[Symbol] GetTypeBitAlign() should return None in case of failure.
Summary:
And not `zero`. This is the last API needed to be converted to
an Optional<T>.
Reviewers: xiaobai, compnerd
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D66093
llvm-svn: 368614
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 8c9cbe0..edc8acf 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -5087,10 +5087,11 @@
return None;
}
-size_t ClangASTContext::GetTypeBitAlign(lldb::opaque_compiler_type_t type) {
+llvm::Optional<size_t>
+ClangASTContext::GetTypeBitAlign(lldb::opaque_compiler_type_t type) {
if (GetCompleteType(type))
return getASTContext()->getTypeAlign(GetQualType(type));
- return 0;
+ return {};
}
lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,