MachODump.cpp: fix MSVC build
authorHans Wennborg <hans@hanshq.net>
Thu, 23 Oct 2014 21:59:17 +0000 (21:59 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 23 Oct 2014 21:59:17 +0000 (21:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220518 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-objdump/MachODump.cpp

index 805f5064b4398c0ee37cecee2411f776c8e18576..9c3dfec92e4606f167c96da4152815025efa23d4 100644 (file)
@@ -821,7 +821,7 @@ const char *get_objc2_64bit_class_name(uint64_t pointer_value,
     const char *symbol_name = get_symbol_64(offset, S, info, n_value);
     if (symbol_name == nullptr)
       return nullptr;
     const char *symbol_name = get_symbol_64(offset, S, info, n_value);
     if (symbol_name == nullptr)
       return nullptr;
-    const char *class_name = rindex(symbol_name, '$');
+    const char *class_name = strrchr(symbol_name, '$');
     if (class_name != nullptr && class_name[1] == '_' && class_name[2] != '\0')
       return class_name + 2;
     else
     if (class_name != nullptr && class_name[1] == '_' && class_name[2] != '\0')
       return class_name + 2;
     else
@@ -978,7 +978,7 @@ const char *GuessLiteralPointer(uint64_t ReferenceValue, uint64_t ReferencePC,
     const char *name = get_dyld_bind_info_symbolname(ReferenceValue, info);
     if (name != nullptr) {
       *ReferenceType = LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref;
     const char *name = get_dyld_bind_info_symbolname(ReferenceValue, info);
     if (name != nullptr) {
       *ReferenceType = LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref;
-      const char *class_name = rindex(name, '$');
+      const char *class_name = strrchr(name, '$');
       if (class_name != nullptr && class_name[1] == '_' &&
           class_name[2] != '\0') {
         info->class_name = class_name + 2;
       if (class_name != nullptr && class_name[1] == '_' &&
           class_name[2] != '\0') {
         info->class_name = class_name + 2;
@@ -1074,8 +1074,8 @@ const char *SymbolizerSymbolLookUp(void *DisInfo, uint64_t ReferenceValue,
   }
 
   const char *SymbolName = nullptr;
   }
 
   const char *SymbolName = nullptr;
-  if (ReferenceValue != 0xffffffffffffffffLLU &&
-      ReferenceValue != 0xfffffffffffffffeLLU) {
+  if (ReferenceValue != 0xffffffffffffffffULL &&
+      ReferenceValue != 0xfffffffffffffffeULL) {
     StringRef name = info->AddrMap->lookup(ReferenceValue);
     if (!name.empty())
       SymbolName = name.data();
     StringRef name = info->AddrMap->lookup(ReferenceValue);
     if (!name.empty())
       SymbolName = name.data();