[llvm] r212308 - Sink undesirable LTO functions into the old C API

Alp Toker alp at nuanti.com
Thu Jul 3 19:11:02 PDT 2014


On 04/07/2014 05:01, Peter Collingbourne wrote:
> On Fri, Jul 04, 2014 at 12:58:42AM -0000, Alp Toker wrote:
>> -/// Returns 'true' if the bitcode BC is for the specified target triple.
>> -bool LTOModule::isTargetMatch(StringRef BC, const char *TriplePrefix) {
>> -  std::unique_ptr<MemoryBuffer> Buffer(
>> -      MemoryBuffer::getMemBuffer(BC, "", false));
>> -  std::string Triple = getBitcodeTargetTriple(Buffer.get(), getGlobalContext());
>> -  return strncmp(Triple.c_str(), TriplePrefix, strlen(TriplePrefix)) == 0;
>> +bool LTOModule::isBitcodeForTarget(MemoryBuffer *buffer,
>> +                                   StringRef triplePrefix) {
>> +  return getBitcodeTargetTriple(buffer, getGlobalContext()) == triplePrefix;
> This isn't doing the same thing as the original code. You need to check for
> a prefix here.

Well-spotted! r212310

>
> Thanks,

-- 
http://www.nuanti.com
the browser experts




More information about the llvm-commits mailing list