Skip to content

Commit

Permalink
fixup! [Make] remove BINARYBUILDER_LLVM_ASSERTS and use LLVM_ASSERTIO…
Browse files Browse the repository at this point in the history
…NS 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.
  • Loading branch information
vtjnash committed Dec 10, 2020
1 parent 001b64d commit bea5ff9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 0 additions & 4 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,6 @@ CXX_DISABLE_ASSERTION := -DJL_NDEBUG
DISABLE_ASSERTIONS := -DNDEBUG -DJL_NDEBUG
endif

ifeq ($(LLVM_ASSERTIONS),0)
CXX_DISABLE_ASSERTION += -DNDEBUG
endif

# Compiler specific stuff

ifeq ($(USEMSVC), 1)
Expand Down
5 changes: 2 additions & 3 deletions src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,10 +973,10 @@ static objfileentry_t &find_object_file(uint64_t fbase, StringRef fname) JL_NOTS
DebugInfo(errorCodeToError(std::make_error_code(std::errc::no_such_file_or_directory)));
// Can't find a way to construct an empty Expected object
// that can be ignored.
ignoreError(DebugInfo);
if (fname.substr(sep + 1) != info.filename) {
debuginfopath = fname.substr(0, sep + 1).str();
debuginfopath += info.filename;
ignoreError(DebugInfo);
DebugInfo = openDebugInfo(debuginfopath, info);
}
if (!DebugInfo) {
Expand All @@ -994,9 +994,8 @@ static objfileentry_t &find_object_file(uint64_t fbase, StringRef fname) JL_NOTS
DebugInfo = openDebugInfo(debuginfopath, info);
}
if (DebugInfo) {
errorobj = std::move(DebugInfo);
errorobj = cantFail(std::move(DebugInfo));
// Yes, we've checked, and yes LLVM want us to check again.
assert(errorobj);
debugobj = errorobj->getBinary();
}
else {
Expand Down
4 changes: 1 addition & 3 deletions src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,7 @@ void JuliaOJIT::DebugObjectRegistrar::registerObject(RTDyldObjHandleT H, const O
continue;
if (!(Flags & object::BasicSymbolRef::SF_Exported))
continue;
auto NameOrError = Symbol.getName();
assert(NameOrError);
auto Name = NameOrError.get();
auto Name = cantFail(Symbol.getName());
auto Sym = JIT.CompileLayer.findSymbolIn(H, Name.str(), true);
assert(Sym);
// note: calling getAddress here eagerly finalizes H
Expand Down

0 comments on commit bea5ff9

Please sign in to comment.