[PATCH] D27074: Object: Add IRObjectFile::getTargetTriple().
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 23 17:22:51 PST 2016
pcc added inline comments.
================
Comment at: llvm/tools/llvm-nm/llvm-nm.cpp:273
+ Triple T(IRobj->getTargetTriple());
return T.isArch64Bit();
}
----------------
mehdi_amini wrote:
> 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();
> ```
>
>
In fact we don't need to test `TripleStr` for emptiness because `isArch64Bit` will return false given an empty triple. So I committed an even shorter version.
https://reviews.llvm.org/D27074
More information about the llvm-commits
mailing list