[llvm] r338975 - [ORC] Remove an incorrect use of 'cantFail'.
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 6 20:46:49 PDT 2018
Test case?
On Sun, Aug 5, 2018 at 4:55 PM Lang Hames via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: lhames
> Date: Sun Aug 5 16:55:35 2018
> New Revision: 338975
>
> URL: http://llvm.org/viewvc/llvm-project?rev=338975&view=rev
> Log:
> [ORC] Remove an incorrect use of 'cantFail'.
>
> This code was moved out from BasicObjectLayerMaterializationUnit, which
> required
> the supplied object to be well formed. The getObjectSymbolFlags function
> does
> not require a well-formed object, so we have to propagate the error here.
>
> Modified:
> llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp
>
> Modified: llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp?rev=338975&r1=338974&r2=338975&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/Orc/Layer.cpp Sun Aug 5 16:55:35 2018
> @@ -116,8 +116,10 @@ Expected<SymbolFlagsMap> getObjectSymbol
> for (auto &Sym : (*Obj)->symbols()) {
> if (!(Sym.getFlags() & object::BasicSymbolRef::SF_Undefined) &&
> (Sym.getFlags() & object::BasicSymbolRef::SF_Exported)) {
> - auto InternedName =
> - ES.getSymbolStringPool().intern(cantFail(Sym.getName()));
> + auto Name = Sym.getName();
> + if (!Name)
> + return Name.takeError();
> + auto InternedName = ES.getSymbolStringPool().intern(*Name);
> auto SymFlags = JITSymbolFlags::fromObjectSymbol(Sym);
> if (!SymFlags)
> return SymFlags.takeError();
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180806/f9fdeb4c/attachment.html>
More information about the llvm-commits
mailing list