diff options
author | Zachary Turner <zturner@google.com> | 2016-09-21 16:01:28 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-09-21 16:01:28 +0000 |
commit | 95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5 (patch) | |
tree | 0e9d2a42e76e13cf5ed5d6a8f0b935a83e40ea69 /lldb/source/Host/common/FileSpec.cpp | |
parent | 07171f21d148d340115ec634be6a7f296799517d (diff) | |
download | llvm-95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5.zip llvm-95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5.tar.gz llvm-95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5.tar.bz2 |
Make lldb::Regex use StringRef.
This updates getters and setters to use StringRef instead of
const char *. I tested the build on Linux, Windows, and OSX
and saw no build or test failures. I cannot test any BSD
or Android variants, however I expect the required changes
to be minimal or non-existant.
llvm-svn: 282079
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r-- | lldb/source/Host/common/FileSpec.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index 0f2a664..509f2f8 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -1422,15 +1422,15 @@ void FileSpec::RemoveLastPathComponent() { //------------------------------------------------------------------ bool FileSpec::IsSourceImplementationFile() const { ConstString extension(GetFileNameExtension()); - if (extension) { - static RegularExpression g_source_file_regex( - "^([cC]|[mM]|[mM][mM]|[cC][pP][pP]|[cC]\\+\\+|[cC][xX][xX]|[cC][cC]|[" - "cC][pP]|[sS]|[aA][sS][mM]|[fF]|[fF]77|[fF]90|[fF]95|[fF]03|[fF][oO][" - "rR]|[fF][tT][nN]|[fF][pP][pP]|[aA][dD][aA]|[aA][dD][bB]|[aA][dD][sS])" - "$"); - return g_source_file_regex.Execute(extension.GetCString()); - } - return false; + if (!extension) + return false; + + static RegularExpression g_source_file_regex(llvm::StringRef( + "^([cC]|[mM]|[mM][mM]|[cC][pP][pP]|[cC]\\+\\+|[cC][xX][xX]|[cC][cC]|[" + "cC][pP]|[sS]|[aA][sS][mM]|[fF]|[fF]77|[fF]90|[fF]95|[fF]03|[fF][oO][" + "rR]|[fF][tT][nN]|[fF][pP][pP]|[aA][dD][aA]|[aA][dD][bB]|[aA][dD][sS])" + "$")); + return g_source_file_regex.Execute(extension.GetStringRef()); } bool FileSpec::IsRelative() const { |