[rfc][gold plugin] Fix pr19901

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Aug 12 17:01:09 PDT 2014


>
>> +void runLTOPasses(Module &M, TargetMachine &TM, bool DisableOpt,
>> +                  bool DisableInline, bool DisableGVNLoadPRE);
>>
>> This should go away and become an interface to PassManagerBuilder instead.
>> (PMB doesn't actually run the passes, but that's simple for the caller.)
>
> I will see if I can move these (except the call to run) into
> populateLTOPassManager?
>

That seems to work. The first patch in this email does just that. What
do you think?

> +  ErrorOr<object::IRObjectFile *> ObjOrErr =
>> +      object::IRObjectFile::createIRObjectFile(std::move(buffer), Context);
>> +  std::error_code EC = ObjOrErr.getError();
>> +  if (EC == BitcodeError::InvalidBitcodeSignature)
>>
>> What about BitcodeError::InvalidBitcodeHeaderWrapper? Come to think of it,
>> do we even have any tools in mainline that wrap bitcode?
>
> Good catch. I will try to remove merge InvalidBitcodeWrapperHeader so
> as to have a single error to check.

Actually, I now think it is correct to print an error in that case. It
is produced when the file has already been identified as bitcode but
an invalid offset is found. That is, it is a broken bitcode file and
we should report an error.

The second attached patch is the change to tools/gold proper. I think
it includes every change asked for in the code review that was not
otherwise explained.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 10383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140812/f694c8b4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t2.patch
Type: text/x-patch
Size: 26665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140812/f694c8b4/attachment-0001.bin>


More information about the llvm-commits mailing list