[Lldb-commits] [PATCH] D44055: [lldb] Fix "requires global constructor" warning in g_range_specifiers

Kuba (Brecka) Mracek via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 2 16:39:29 PST 2018


kubamracek created this revision.
kubamracek added reviewers: jingham, davide, jasonmolenda, aprantl.

https://reviews.llvm.org/D44055

Files:
  source/Breakpoint/BreakpointID.cpp


Index: source/Breakpoint/BreakpointID.cpp
===================================================================
--- source/Breakpoint/BreakpointID.cpp
+++ source/Breakpoint/BreakpointID.cpp
@@ -26,16 +26,14 @@
 
 BreakpointID::~BreakpointID() = default;
 
-static llvm::StringRef g_range_specifiers[] = {"-", "to", "To", "TO"};
-
 // Tells whether or not STR is valid to use between two strings representing
 // breakpoint IDs, to
 // indicate a range of breakpoint IDs.  This is broken out into a separate
 // function so that we can
 // easily change or add to the format for specifying ID ranges at a later date.
 
 bool BreakpointID::IsRangeIdentifier(llvm::StringRef str) {
-  for (auto spec : g_range_specifiers) {
+  for (auto spec : GetRangeSpecifiers()) {
     if (spec == str)
       return true;
   }
@@ -48,6 +46,7 @@
 }
 
 llvm::ArrayRef<llvm::StringRef> BreakpointID::GetRangeSpecifiers() {
+  static llvm::StringRef g_range_specifiers[] = {"-", "to", "To", "TO"};
   return llvm::makeArrayRef(g_range_specifiers);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44055.136880.patch
Type: text/x-patch
Size: 1032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180303/83474eff/attachment.bin>


More information about the lldb-commits mailing list