Skip to content

Commit 657d834

Browse files
committed
Update: Propagate error instead of using ExitOnErr
1 parent db380cd commit 657d834

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clang/lib/Interpreter/RemoteJITUtils.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
using namespace llvm;
3030
using namespace llvm::orc;
3131

32-
static ExitOnError ExitOnErr;
33-
3432
Expected<uint64_t> getSlabAllocSize(StringRef SizeString) {
3533
SizeString = SizeString.trim();
3634

@@ -76,8 +74,12 @@ createSharedMemoryManager(SimpleRemoteEPC &SREPC,
7674
size_t SlabSize = 1024 * 1024 * 1024;
7775
#endif
7876

79-
if (!SlabAllocateSizeString.empty())
80-
SlabSize = ExitOnErr(getSlabAllocSize(SlabAllocateSizeString));
77+
if (!SlabAllocateSizeString.empty()) {
78+
if (auto S = getSlabAllocSize(SlabAllocateSizeString))
79+
SlabSize = *S;
80+
else
81+
return S.takeError();
82+
}
8183

8284
return MapperJITLinkMemoryManager::CreateWithMapper<SharedMemoryMapper>(
8385
SlabSize, SREPC, SAs);

0 commit comments

Comments
 (0)