[llvm] r234957 - uselistorder: Pull the bit through WriteToBitcodFile()

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Apr 15 08:56:09 PDT 2015


>> -static void saveBCFile(StringRef Path, Module &M) {
>> +static void saveBCFile(StringRef Path, Module &M,
>> +                       bool ShouldPreserveUseListOrder) {
>
> (This was fixed by r234958; apparently I don't build this.)

You need to define LLVM_BINUTILS_INCDIR for it to build.

>>   std::error_code EC;
>>   raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None);
>>   if (EC)
>>     message(LDPL_FATAL, "Failed to write the output file.");
>> -  WriteBitcodeToFile(&M, OS);
>> +  WriteBitcodeToFile(&M, OS, /* ShouldPreserveUseListOrder */ true);
>
> @Rafael and Nick, `saveBCFile()` is only used for `OT_SAVE_TEMPS`, so
> I took the liberty of turning this on.
>
> Let me know if you disagree and I'll revert that part of the commit.

I think it is reasonable.

Thanks,
Rafael



More information about the llvm-commits mailing list