diff options
author | Zachary Turner <zturner@google.com> | 2016-09-19 17:54:06 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-09-19 17:54:06 +0000 |
commit | ecbb0bb1690cd59da0224d7b906f968356b1265c (patch) | |
tree | 90951f44a7abb40b355e849a2e64cb09ec3ac900 /lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | 495b211a6c775e6fbc00a1e3a91786f6a880b82e (diff) | |
download | llvm-ecbb0bb1690cd59da0224d7b906f968356b1265c.zip llvm-ecbb0bb1690cd59da0224d7b906f968356b1265c.tar.gz llvm-ecbb0bb1690cd59da0224d7b906f968356b1265c.tar.bz2 |
Fix more functions in Args to use StringRef.
This patch also marks the const char* versions as =delete to prevent
their use. This has the potential to cause build breakages on some
platforms which I can't compile. I have tested on Windows, Linux,
and OSX. Best practices for fixing broken callsites are outlined in
Args.h in a comment above the deleted function declarations.
Eventually we can remove these =delete declarations, but for now they
are important to make sure that all implicit conversions from
const char * are manually audited to make sure that they do not invoke a
conversion from nullptr.
llvm-svn: 281919
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 682e26b..bab8ecb 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -172,7 +172,7 @@ public: case 'h': { bool success; - m_catch_bp = Args::StringToBoolean(option_arg, true, &success); + m_catch_bp = Args::StringToBoolean(option_strref, true, &success); if (!success) error.SetErrorStringWithFormat( "Invalid boolean value for on-catch option: '%s'", option_arg); @@ -192,7 +192,7 @@ public: case 'K': { bool success; bool value; - value = Args::StringToBoolean(option_arg, true, &success); + value = Args::StringToBoolean(option_strref, true, &success); if (value) m_skip_prologue = eLazyBoolYes; else @@ -223,7 +223,7 @@ public: case 'm': { bool success; bool value; - value = Args::StringToBoolean(option_arg, true, &success); + value = Args::StringToBoolean(option_strref, true, &success); if (value) m_move_to_nearest_code = eLazyBoolYes; else @@ -265,8 +265,8 @@ public: break; case 'O': - m_exception_extra_args.AppendArgument("-O"); - m_exception_extra_args.AppendArgument(option_arg); + m_exception_extra_args.AppendArgument(llvm::StringRef("-O")); + m_exception_extra_args.AppendArgument(option_strref); break; case 'p': @@ -304,7 +304,7 @@ public: case 'w': { bool success; - m_throw_bp = Args::StringToBoolean(option_arg, true, &success); + m_throw_bp = Args::StringToBoolean(option_strref, true, &success); if (!success) error.SetErrorStringWithFormat( "Invalid boolean value for on-throw option: '%s'", option_arg); @@ -861,7 +861,8 @@ public: break; case 'o': { bool value, success; - value = Args::StringToBoolean(option_arg, false, &success); + value = Args::StringToBoolean( + llvm::StringRef::withNullAsEmpty(option_arg), false, &success); if (success) { m_one_shot_passed = true; m_one_shot = value; |