summaryrefslogtreecommitdiffstats
path: root/lldb/source/lldb.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-03-18 21:31:45 +0000
committerZachary Turner <zturner@google.com>2015-03-18 21:31:45 +0000
commit5023257f2359d16357721635a22db8ecd7213343 (patch)
tree00a0614090a6113db25735521f32f6361a452d7f /lldb/source/lldb.cpp
parenteba5227ccd4ab2e31e62fe1cdaa811b2da665e90 (diff)
downloadbcm5719-llvm-5023257f2359d16357721635a22db8ecd7213343.tar.gz
bcm5719-llvm-5023257f2359d16357721635a22db8ecd7213343.zip
Move some functions from source/lldb.cpp to Utility.
Specifically, there were some functions for converting enums to strings and a function for matching a string using a specific matching algorithm. This moves those functions to more appropriate headers in lldb/Utility and updates references to include the new headers. llvm-svn: 232673
Diffstat (limited to 'lldb/source/lldb.cpp')
-rw-r--r--lldb/source/lldb.cpp94
1 files changed, 0 insertions, 94 deletions
diff --git a/lldb/source/lldb.cpp b/lldb/source/lldb.cpp
index 80330442201..75b270ff3a7 100644
--- a/lldb/source/lldb.cpp
+++ b/lldb/source/lldb.cpp
@@ -466,97 +466,3 @@ lldb_private::GetVersion ()
return g_version_str.c_str();
#endif
}
-
-const char *
-lldb_private::GetVoteAsCString (Vote vote)
-{
- switch (vote)
- {
- case eVoteNo: return "no";
- case eVoteNoOpinion: return "no opinion";
- case eVoteYes: return "yes";
- }
- return "invalid";
-}
-
-
-const char *
-lldb_private::GetSectionTypeAsCString (SectionType sect_type)
-{
- switch (sect_type)
- {
- case eSectionTypeInvalid: return "invalid";
- case eSectionTypeCode: return "code";
- case eSectionTypeContainer: return "container";
- case eSectionTypeData: return "data";
- case eSectionTypeDataCString: return "data-cstr";
- case eSectionTypeDataCStringPointers: return "data-cstr-ptr";
- case eSectionTypeDataSymbolAddress: return "data-symbol-addr";
- case eSectionTypeData4: return "data-4-byte";
- case eSectionTypeData8: return "data-8-byte";
- case eSectionTypeData16: return "data-16-byte";
- case eSectionTypeDataPointers: return "data-ptrs";
- case eSectionTypeDebug: return "debug";
- case eSectionTypeZeroFill: return "zero-fill";
- case eSectionTypeDataObjCMessageRefs: return "objc-message-refs";
- case eSectionTypeDataObjCCFStrings: return "objc-cfstrings";
- case eSectionTypeDWARFDebugAbbrev: return "dwarf-abbrev";
- case eSectionTypeDWARFDebugAranges: return "dwarf-aranges";
- case eSectionTypeDWARFDebugFrame: return "dwarf-frame";
- case eSectionTypeDWARFDebugInfo: return "dwarf-info";
- case eSectionTypeDWARFDebugLine: return "dwarf-line";
- case eSectionTypeDWARFDebugLoc: return "dwarf-loc";
- case eSectionTypeDWARFDebugMacInfo: return "dwarf-macinfo";
- case eSectionTypeDWARFDebugPubNames: return "dwarf-pubnames";
- case eSectionTypeDWARFDebugPubTypes: return "dwarf-pubtypes";
- case eSectionTypeDWARFDebugRanges: return "dwarf-ranges";
- case eSectionTypeDWARFDebugStr: return "dwarf-str";
- case eSectionTypeELFSymbolTable: return "elf-symbol-table";
- case eSectionTypeELFDynamicSymbols: return "elf-dynamic-symbols";
- case eSectionTypeELFRelocationEntries: return "elf-relocation-entries";
- case eSectionTypeELFDynamicLinkInfo: return "elf-dynamic-link-info";
- case eSectionTypeDWARFAppleNames: return "apple-names";
- case eSectionTypeDWARFAppleTypes: return "apple-types";
- case eSectionTypeDWARFAppleNamespaces: return "apple-namespaces";
- case eSectionTypeDWARFAppleObjC: return "apple-objc";
- case eSectionTypeEHFrame: return "eh-frame";
- case eSectionTypeCompactUnwind: return "compact-unwind";
- case eSectionTypeOther: return "regular";
- }
- return "unknown";
-
-}
-
-bool
-lldb_private::NameMatches (const char *name,
- NameMatchType match_type,
- const char *match)
-{
- if (match_type == eNameMatchIgnore)
- return true;
-
- if (name == match)
- return true;
-
- if (name && match)
- {
- llvm::StringRef name_sref(name);
- llvm::StringRef match_sref(match);
- switch (match_type)
- {
- case eNameMatchIgnore: // This case cannot occur: tested before
- return true;
- case eNameMatchEquals: return name_sref == match_sref;
- case eNameMatchContains: return name_sref.find (match_sref) != llvm::StringRef::npos;
- case eNameMatchStartsWith: return name_sref.startswith (match_sref);
- case eNameMatchEndsWith: return name_sref.endswith (match_sref);
- case eNameMatchRegularExpression:
- {
- RegularExpression regex (match);
- return regex.Execute (name);
- }
- break;
- }
- }
- return false;
-}
OpenPOWER on IntegriCloud