Skip to content

Commit bea5ff9

Browse files
committed
fixup! [Make] remove BINARYBUILDER_LLVM_ASSERTS and use LLVM_ASSERTIONS instead
This got corrupted in 7c0cb30, though we can also update to be a bit more explicit about our cantFail expectations and often avoid the issue.
1 parent 001b64d commit bea5ff9

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

Make.inc

-4
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,6 @@ CXX_DISABLE_ASSERTION := -DJL_NDEBUG
450450
DISABLE_ASSERTIONS := -DNDEBUG -DJL_NDEBUG
451451
endif
452452

453-
ifeq ($(LLVM_ASSERTIONS),0)
454-
CXX_DISABLE_ASSERTION += -DNDEBUG
455-
endif
456-
457453
# Compiler specific stuff
458454

459455
ifeq ($(USEMSVC), 1)

src/debuginfo.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -973,10 +973,10 @@ static objfileentry_t &find_object_file(uint64_t fbase, StringRef fname) JL_NOTS
973973
DebugInfo(errorCodeToError(std::make_error_code(std::errc::no_such_file_or_directory)));
974974
// Can't find a way to construct an empty Expected object
975975
// that can be ignored.
976-
ignoreError(DebugInfo);
977976
if (fname.substr(sep + 1) != info.filename) {
978977
debuginfopath = fname.substr(0, sep + 1).str();
979978
debuginfopath += info.filename;
979+
ignoreError(DebugInfo);
980980
DebugInfo = openDebugInfo(debuginfopath, info);
981981
}
982982
if (!DebugInfo) {
@@ -994,9 +994,8 @@ static objfileentry_t &find_object_file(uint64_t fbase, StringRef fname) JL_NOTS
994994
DebugInfo = openDebugInfo(debuginfopath, info);
995995
}
996996
if (DebugInfo) {
997-
errorobj = std::move(DebugInfo);
997+
errorobj = cantFail(std::move(DebugInfo));
998998
// Yes, we've checked, and yes LLVM want us to check again.
999-
assert(errorobj);
1000999
debugobj = errorobj->getBinary();
10011000
}
10021001
else {

src/jitlayers.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,7 @@ void JuliaOJIT::DebugObjectRegistrar::registerObject(RTDyldObjHandleT H, const O
488488
continue;
489489
if (!(Flags & object::BasicSymbolRef::SF_Exported))
490490
continue;
491-
auto NameOrError = Symbol.getName();
492-
assert(NameOrError);
493-
auto Name = NameOrError.get();
491+
auto Name = cantFail(Symbol.getName());
494492
auto Sym = JIT.CompileLayer.findSymbolIn(H, Name.str(), true);
495493
assert(Sym);
496494
// note: calling getAddress here eagerly finalizes H

0 commit comments

Comments
 (0)