-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from jberlin/master
support for type checking and compiling expressions using LLVM
- Loading branch information
Showing
260 changed files
with
29,856 additions
and
14,903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
BasedOnStyle: "Google" | ||
AccessModifierOffset: -2 | ||
AlignEscapedNewlinesLeft: true | ||
AlignTrailingComments: true | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortIfStatementsOnASingleLine: true | ||
ConstructorInitializerIndentWidth: 4 | ||
AllowShortLoopsOnASingleLine: true | ||
AlwaysBreakBeforeMultilineStrings: true | ||
AlwaysBreakTemplateDeclarations: true | ||
BinPackParameters: false | ||
BreakBeforeBraces: Attach | ||
BreakConstructorInitializersBeforeComma: false | ||
ColumnLimit: 120 | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
Cpp11BracedListStyle: true | ||
IndentCaseLabels: true | ||
IndentFunctionDeclarationAfterType: true | ||
IndentWidth: 4 | ||
MaxEmptyLinesToKeep: 1 | ||
SpaceAfterControlStatementKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 2 | ||
SpacesInAngles: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInParentheses: false | ||
UseTab: Never | ||
PointerBindsToType: true | ||
#DerivePointerAlignment: false | ||
#AllowShortCaseLabelsOnASingleLine: true | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
*~ | ||
.DS_Store | ||
/build | ||
/Linux-* | ||
/Darwin-* | ||
*#*# | ||
*~ | ||
CMakeCache.txt | ||
src/SeExpr/parser | ||
src/SeExpr/generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
SeExpr | ||
seexpr2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,46 @@ | ||
#!/usr/bin/env make | ||
SH ?= sh | ||
uname_S := $(shell $(SH) -c 'uname -s || echo system') | ||
uname_R := $(shell $(SH) -c 'uname -r | cut -d- -f1 || echo release') | ||
uname_M := $(shell $(SH) -c 'uname -m || echo cpu') | ||
-include Makefile.config | ||
|
||
FLAVOR ?= optimize | ||
prefix ?= $(shell pf-makevar --absolute root) | ||
libdir ?= $(shell pf-makevar lib) | ||
|
||
# TODO: when RHEL6 is fully retired remove th | ||
# Don't set CXX when native GCC version is 4.8. | ||
#SETCXX := $(shell expr `gcc -dumpversion` \< 4.8) | ||
#ifeq "$(SETCXX)" "1" | ||
# CXX=/opt/rh/devtoolset-2/root/usr/bin/g++ | ||
#endif | ||
|
||
|
||
platformdir ?= $(uname_S)-$(uname_R)-$(uname_M)-$(FLAVOR) | ||
builddir ?= $(CURDIR)/build/$(platformdir) | ||
## Temporary staging directory | ||
# DESTDIR = | ||
|
||
prefix ?= $(CURDIR)/$(platformdir) | ||
#DESTDIR = | ||
# Specified by `git make-pkg` when building .pkg files | ||
# mac_pkg = | ||
|
||
CMAKE_FLAGS ?= -DCMAKE_INSTALL_PREFIX=$(prefix) | ||
export prefix DESTDIR | ||
|
||
# The default target in this Makefile is... | ||
all:: | ||
all: | ||
mkdir -p build/${FLAVOR} | ||
export CXX=${CXX} | ||
cd build/${FLAVOR} && CXX=${CXX} cmake -DCMAKE_INSTALL_PREFIX=$(prefix) -DCMAKE_INSTALL_LIBDIR=$(libdir) ${EXTRA_CMAKE_ARGS} ../../ | ||
$(MAKE) -C build/${FLAVOR} all | ||
clean: | ||
rm -rf build/${FLAVOR} Linux-* | ||
|
||
install: all | ||
$(MAKE) -C $(builddir) DESTDIR=$(DESTDIR) install | ||
$(MAKE) -C build/${FLAVOR} install | ||
pkgconfig-gen --name seexpr2 --desc 'SeExpr v2 Library' \ | ||
--generate --destdir '$(DESTDIR)' --prefix $(prefix) --libdir $(libdir) | ||
|
||
$(builddir)/stamp: $(CMAKE_FILES) | ||
mkdir -p $(builddir) | ||
cd $(builddir) && cmake $(CMAKE_FLAGS) ../.. | ||
touch $@ | ||
test: install | ||
python src/tests/imageTestsReportNew.py runall | ||
|
||
all:: $(builddir)/stamp | ||
$(MAKE) -C $(builddir) $(MAKEARGS) all | ||
format: | ||
find $(CURDIR)/src -name '*.cpp' | xargs clang-format -i | ||
find $(CURDIR)/src -name '*.h' | xargs clang-format -i | ||
|
||
clean: $(builddir)/stamp | ||
$(MAKE) -C $(builddir) $(MAKEARGS) clean | ||
basictest: install | ||
$(prefix)/share/test/SeExpr2/testmain2 -- --gtest_filter="BasicTests.*" | ||
|
||
.PHONY: all | ||
.PHONY: clean | ||
.PHONY: install | ||
precommit: format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
EXTRA_CMAKE_ARGS= -DBOOST_DIR=${RP_boost_disney} -DGTEST_DIR=/usr/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
BOOST=/usr/local | ||
LLVM=~/code/llvm-inst/share/llvm/cmake | ||
GTEST=~/code/gtest-inst/ | ||
CUSTOM_PYTHON_FRAMEWORK="-m64 -I/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -L/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -ldl" | ||
EXTRA_CMAKE_ARGS= -DENABLE_LLVM_BACKEND=ON -DLLVM_DIR=${LLVM} -DGTEST_DIR=${GTEST} -DBOOST_DIR=${BOOST} -DCUSTOM_PYTHON_FRAMEWORK=${CUSTOM_PYTHON_FRAMEWORK} -DUSE_PYTHON=OFF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
asciiCalc evalStr() should not ignore return | ||
|
||
SeExprNode | ||
getStrArg() does not belong on base SeExprNode. We use this in SeExprPlugins, but there should be a better way of looking for that | ||
// Do we need to check the value of string arg of custom function? Shouldn't | ||
// it be done at runtime and fail in eval stage? | ||
|
||
SeExprPlugins | ||
Arguments for in tangent and out tangent don't check they are constant string. Also, do we want ot make this work | ||
foo="constant"; animCurve(foo,"fds"); (i.e. the first argument is not a SeExprStr as your current code assumes) | ||
// in tangent and out tangent are checked as varying string before. now changed to checked as constant string. | ||
|
||
The trim function seems unused. Can we delete it? | ||
// deleted. | ||
|
||
PromoteBinaryOperands should perhaps return a std::pair of value*'s instead of mutating the incoming ones | ||
// done | ||
|
||
The prmoting of values for binary operands compares its arguments like 3 times. Maybe there is a way to clean that up | ||
// isLegaltoPromote are now removed. It is simplified to check if destType is vector. | ||
|
||
Is resolveLocalVar correct. What if it needs to look in a different basic block. What are the variable resolution rules? | ||
// Are local var are alloca'd in entry basic block. Only when codegen assignment, local var may be alloca'd. | ||
// case like $m = 1.0; $m=$m * [1,2,3] cause a new vector version of m to be alloca'd. No other cases incur local var alloca | ||
|
||
Select does not work on SeExprCond needs to be fixed | ||
// fixed. | ||
|
||
|
||
--- testing | ||
make a script that runs all of our tests and returns exit code 0 if pass, | ||
this should probably be python | ||
exit code 1 if fails | ||
make a script that runs all imageSynth tests with the interprett and with llvm | ||
add all of your basic tests to your test suite and also a type checking test | ||
suite TypeTester.cpp. | ||
|
||
--- ensure that the output is clean when evaluating, no debugging on by default | ||
|
||
--- write documentation and add it to the documentation folder in the repo in | ||
docs/summer_documentation2 | ||
|
||
--- Fix time frame stuff use voodoo $frame in expression | ||
|
||
--- SeExprPlugins should be integrated into the existing SeExprPlugins... |
Oops, something went wrong.