Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optimizations for dead code removal #1444

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ all: build
.PHONY: build doc

build:
@if [ -e build/Makefile ]; then $(MAKE) -C build; else true; fi
@if [ -e build/build.ninja ]; then ninja -C build; else true; fi
cmake --build build/

install:
@if [ -e build/Makefile ]; then $(MAKE) -C build install; else true; fi
@if [ -e build/build.ninja ]; then ninja -C build install; else true; fi
cmake --build build/ --target install

doc:
$(MAKE) -C doc
Expand Down
6 changes: 3 additions & 3 deletions hilti/lib/hilti.hlt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ declare public void debug(string dbg_stream, any obj) &cxxname="hilti::rt::debug
declare public void debugIndent(string dbg_stream) &cxxname="hilti::rt::debug::indent" &have_prototype;
declare public void debugDedent(string dbg_stream) &cxxname="hilti::rt::debug::dedent" &have_prototype;

declare public time current_time() &cxxname="hilti::rt::time::current_time" &have_prototype;
declare public time mktime(uint<64> y, uint<64> m, uint<64> d, uint<64> H, uint<64> M, uint<64> S) &cxxname="hilti::rt::time::mktime" &have_prototype;
declare public time current_time() &cxxname="hilti::rt::time::current_time" &have_prototype &pure;
declare public time mktime(uint<64> y, uint<64> m, uint<64> d, uint<64> H, uint<64> M, uint<64> S) &cxxname="hilti::rt::time::mktime" &have_prototype &pure;

declare public void abort() &cxxname="hilti::rt::abort_with_backtrace" &have_prototype;

Expand All @@ -49,5 +49,5 @@ public type RecoverableFailure = exception &cxxname="hilti::rt::RecoverableFailu
public type MissingData = exception &cxxname="hilti::rt::MissingData";

# Returns the message associated with an exception.
declare public string exception_what(SystemException excpt) &cxxname="hilti::rt::exception::what" &have_prototype;
declare public string exception_what(SystemException excpt) &cxxname="hilti::rt::exception::what" &have_prototype &pure;
}
1 change: 1 addition & 0 deletions hilti/toolchain/include/ast/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Function : public NodeBase {
attributes() == other.attributes() && callingConvention() == other.callingConvention();
}

void setAttributes(const std::optional<AttributeSet>& attributes) { children()[3] = attributes; }
void setBody(const Statement& b) { children()[2] = b; }
void setID(const ID& id) { children()[0] = id; }
void setFunctionType(const type::Function& ftype) { children()[1] = ftype; }
Expand Down
Loading