summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-09-16 19:09:12 +0000
committerZachary Turner <zturner@google.com>2016-09-16 19:09:12 +0000
commit7b2e5a36e40eca504905aad3e36ba2c07e6e8ac0 (patch)
treea15891f0849e122469d603cda043d9a93562d565 /lldb/source/API
parenteb2246365b7a84b1f829ce2c65cef423ea0a01d8 (diff)
downloadbcm5719-llvm-7b2e5a36e40eca504905aad3e36ba2c07e6e8ac0.tar.gz
bcm5719-llvm-7b2e5a36e40eca504905aad3e36ba2c07e6e8ac0.zip
Add unit tests for a few string conversion functions in Args.
Also provided a StringRef overload for these functions and have the const char* overloads delegate to the StringRef overload. llvm-svn: 281764
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/SBDebugger.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index f7811f2e7b5..7641d7807aa 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -48,6 +48,7 @@
#include "lldb/Target/TargetList.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/ManagedStatic.h"
@@ -474,7 +475,8 @@ bool SBDebugger::SetDefaultArchitecture(const char *arch_name) {
ScriptLanguage
SBDebugger::GetScriptingLanguage(const char *script_language_name) {
- return Args::StringToScriptLanguage(script_language_name,
+ if (!script_language_name) return eScriptLanguageDefault;
+ return Args::StringToScriptLanguage(llvm::StringRef(script_language_name),
eScriptLanguageDefault, nullptr);
}
OpenPOWER on IntegriCloud