[Lldb-commits] [PATCH] D84253: OptionValue::Clear should return void not bool

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 21 11:01:33 PDT 2020


jingham created this revision.
jingham added a reviewer: JDevlieghere.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

I forgot to add a "return true" to the new OptionValueFileColonLine::Clear method which the Windows compiler caught (thanks Jonas for fixing that!)

But that made me wonder if returning true was actually doing any good.  How could clearing an OptionValue fail?  And what would you do about it.  The answer was "nothing" since all the implementations returned true, and none of the clients checked the return value.

This is just unsetting some ivars, so it should always succeed and clients shouldn't have to worry about that happening.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84253

Files:
  lldb/include/lldb/Interpreter/OptionValue.h
  lldb/include/lldb/Interpreter/OptionValueArch.h
  lldb/include/lldb/Interpreter/OptionValueArray.h
  lldb/include/lldb/Interpreter/OptionValueBoolean.h
  lldb/include/lldb/Interpreter/OptionValueChar.h
  lldb/include/lldb/Interpreter/OptionValueDictionary.h
  lldb/include/lldb/Interpreter/OptionValueEnumeration.h
  lldb/include/lldb/Interpreter/OptionValueFileColonLine.h
  lldb/include/lldb/Interpreter/OptionValueFileSpec.h
  lldb/include/lldb/Interpreter/OptionValueFileSpecList.h
  lldb/include/lldb/Interpreter/OptionValueFormat.h
  lldb/include/lldb/Interpreter/OptionValueFormatEntity.h
  lldb/include/lldb/Interpreter/OptionValueLanguage.h
  lldb/include/lldb/Interpreter/OptionValuePathMappings.h
  lldb/include/lldb/Interpreter/OptionValueProperties.h
  lldb/include/lldb/Interpreter/OptionValueRegex.h
  lldb/include/lldb/Interpreter/OptionValueSInt64.h
  lldb/include/lldb/Interpreter/OptionValueString.h
  lldb/include/lldb/Interpreter/OptionValueUInt64.h
  lldb/include/lldb/Interpreter/OptionValueUUID.h
  lldb/source/Interpreter/OptionValueFormatEntity.cpp
  lldb/source/Interpreter/OptionValueProperties.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84253.279580.patch
Type: text/x-patch
Size: 12315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200721/4592942a/attachment.bin>


More information about the lldb-commits mailing list