llvm-project/lldb/source/Core
Adrian Prantl d963a7c398 Make CompilerType::getBitSize() / getByteSize() return an optional result. NFC
The code in LLDB assumes that CompilerType and friends use the size 0
as a sentinel value to signal an error. This works for C++, where no
zero-sized type exists, but in many other programming languages
(including I believe C) types of size zero are possible and even
common. This is a particular pain point in swift-lldb, where extra
code exists to double-check that a type is *really* of size zero and
not an error at various locations.

To remedy this situation, this patch starts by converting
CompilerType::getBitSize() and getByteSize() to return an optional
result. To avoid wasting space, I hand-rolled my own optional data
type assuming that no type is larger than what fits into 63
bits. Follow-up patches would make similar changes to the ValueObject
hierarchy.

rdar://problem/47178964

Differential Revision: https://reviews.llvm.org/D56688

llvm-svn: 351214
2019-01-15 18:07:52 +00:00
..
Address.cpp [Symbol] Search symbols with name and type in a symbol file 2018-11-30 06:56:37 +00:00
AddressRange.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
AddressResolver.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
AddressResolverFileLine.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
AddressResolverName.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
CMakeLists.txt Move Broadcaster+Listener+Event combo from Core into Utility 2018-12-14 15:59:49 +00:00
Communication.cpp Move Broadcaster+Listener+Event combo from Core into Utility 2018-12-14 15:59:49 +00:00
Debugger.cpp Move Broadcaster+Listener+Event combo from Core into Utility 2018-12-14 15:59:49 +00:00
Disassembler.cpp Simplify Boolean expressions 2018-12-15 00:15:33 +00:00
DumpDataExtractor.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
DumpRegisterValue.cpp Move RegisterValue,Scalar,State from Core to Utility 2018-08-07 11:07:21 +00:00
DynamicLoader.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
EmulateInstruction.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
FileLineResolver.cpp Remove header grouping comments. 2018-11-11 23:17:06 +00:00
FileSpecList.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
FormatEntity.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
Highlighter.cpp Move the column marking functionality to the Highlighter framework 2018-08-30 00:09:21 +00:00
IOHandler.cpp [NFC] Replace `compare` with (in)equality operator where applicable. 2018-12-21 22:46:10 +00:00
Mangled.cpp Simplify Boolean expressions 2018-12-15 00:15:33 +00:00
Module.cpp [SymbolFile] Remove SymbolContext parameter from FindTypes. 2019-01-14 22:41:21 +00:00
ModuleChild.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
ModuleList.cpp [SymbolFile] Remove SymbolContext parameter from FindTypes. 2019-01-14 22:41:21 +00:00
Opcode.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
PluginManager.cpp [lldb] Fix "code requires global destructor" warning in g_architecture_mutex 2018-11-12 16:52:58 +00:00
RichManglingContext.cpp Silence some "control reaches end of non-void function" warnings with gcc 2018-08-31 05:18:11 +00:00
SearchFilter.cpp [SymbolFile] Make ParseCompileUnitXXX accept a CompileUnit&. 2019-01-11 18:03:20 +00:00
Section.cpp [LLDB] - Recommit r346848 "[LLDB] - Support the single file split DWARF.". 2018-11-14 13:01:15 +00:00
SourceManager.cpp Simplify Boolean expressions 2018-12-15 00:15:33 +00:00
StreamAsynchronousIO.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
StreamFile.cpp [FileSystem] Open File instances through the FileSystem. 2018-11-02 22:34:51 +00:00
UserSettingsController.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
Value.cpp Make CompilerType::getBitSize() / getByteSize() return an optional result. NFC 2019-01-15 18:07:52 +00:00
ValueObject.cpp Make CompilerType::getBitSize() / getByteSize() return an optional result. NFC 2019-01-15 18:07:52 +00:00
ValueObjectCast.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
ValueObjectChild.cpp Simplify code for readability. (NFC) 2018-12-19 23:48:40 +00:00
ValueObjectConstResult.cpp Make CompilerType::getBitSize() / getByteSize() return an optional result. NFC 2019-01-15 18:07:52 +00:00
ValueObjectConstResultCast.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
ValueObjectConstResultChild.cpp [Core] Use the implementation method GetAddressOf in ValueObjectConstResultChild 2019-01-14 13:08:13 +00:00
ValueObjectConstResultImpl.cpp Simplify Boolean expressions 2018-12-15 00:15:33 +00:00
ValueObjectDynamicValue.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
ValueObjectList.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
ValueObjectMemory.cpp Make CompilerType::getBitSize() / getByteSize() return an optional result. NFC 2019-01-15 18:07:52 +00:00
ValueObjectRegister.cpp Remove comments after header includes. 2018-11-11 23:16:43 +00:00
ValueObjectSyntheticFilter.cpp Simplify Boolean expressions 2018-12-15 00:15:33 +00:00
ValueObjectVariable.cpp Make CompilerType::getBitSize() / getByteSize() return an optional result. NFC 2019-01-15 18:07:52 +00:00