[PATCH] D27074: Object: Add IRObjectFile::getTargetTriple().

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 16:42:09 PST 2016


mehdi_amini accepted this revision.
mehdi_amini added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: llvm/tools/llvm-nm/llvm-nm.cpp:273
+    Triple T(IRobj->getTargetTriple());
     return T.isArch64Bit();
   }
----------------
A bit more concise:

```
auto TripleStr = IRobj->getTargetTriple()
if (TripleStr.empty)
  return false;
return Triple(TripleStr).isArch64Bit();
```

Or even:

```
auto TripleStr = IRobj->getTargetTriple()
return !TripleStr.empty() && Triple(TripleStr).isArch64Bit();
```




https://reviews.llvm.org/D27074





More information about the llvm-commits mailing list