[llvm] r253767 - [llvm-rtdyld] Fail early if we can't load dynamic libraries.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 21 18:01:46 PST 2015
On Sat, Nov 21, 2015 at 10:17 AM, David Blaikie <dblaikie at gmail.com> wrote:
> I assume report_fatal_error is noreturn? So we could reorder this to reduce
> indentation:
>
> if (not normal file)
> Report
> If (load library)
> Report
>
r253808. Thanks.
> On Nov 20, 2015 10:00 PM, "Davide Italiano via llvm-commits"
> <llvm-commits at lists.llvm.org> wrote:
>>
>> Author: davide
>> Date: Fri Nov 20 23:58:19 2015
>> New Revision: 253767
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=253767&view=rev
>> Log:
>> [llvm-rtdyld] Fail early if we can't load dynamic libraries.
>>
>> Modified:
>> llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
>>
>> Modified: llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp?rev=253767&r1=253766&r2=253767&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp (original)
>> +++ llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp Fri Nov 20 23:58:19 2015
>> @@ -250,10 +250,9 @@ static void loadDylibs() {
>> if (sys::fs::is_regular_file(Dylib)) {
>> std::string ErrMsg;
>> if (sys::DynamicLibrary::LoadLibraryPermanently(Dylib.c_str(),
>> &ErrMsg))
>> - llvm::errs() << "Error loading '" << Dylib << "': "
>> - << ErrMsg << "\n";
>> + report_fatal_error("Error loading '" + Dylib + "': " + ErrMsg);
>> } else
>> - llvm::errs() << "Dylib not found: '" << Dylib << "'.\n";
>> + report_fatal_error("Dylib not found: '" + Dylib + "'.");
>> }
>> }
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
--
Davide
"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare
More information about the llvm-commits
mailing list