From 150d6d1f56aa394d53510399a1feb7388fd21471 Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Fri, 15 Feb 2013 06:50:26 -0800 Subject: [PATCH 1/3] Adding Address Sanitizer build --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 07f43581..ebfe22d3 100644 --- a/Makefile +++ b/Makefile @@ -104,7 +104,7 @@ default: ispc depend: llvm_check $(CXX_SRC) $(HEADERS) @echo Updating dependencies - @gcc -MM $(CXXFLAGS) $(CXX_SRC) | sed 's_^\([a-z]\)_objs/\1_g' > depend + @$(CXX) -MM $(CXXFLAGS) $(CXX_SRC) | sed 's_^\([a-z]\)_objs/\1_g' > depend -include depend @@ -134,6 +134,13 @@ ispc: print_llvm_src dirs $(OBJS) @echo Creating ispc executable @$(CXX) $(OPT) $(LDFLAGS) -o $@ $(OBJS) $(ISPC_LIBS) +# Build ispc with address sanitizer instrumentation using clang compiler +# Note that this is not portable build +asan: ispc +asan: CXX=clang++ +asan: OPT+=-fsanitize=address + + objs/%.o: %.cpp @echo Compiling $< @$(CXX) $(CXXFLAGS) -o $@ -c $< From bee30297640f43808d41c801bebf782789731983 Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Thu, 21 Feb 2013 17:26:21 +0400 Subject: [PATCH 2/3] Adding debug and clang targets, changing asan target --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ebfe22d3..1b13d2e0 100644 --- a/Makefile +++ b/Makefile @@ -134,12 +134,18 @@ ispc: print_llvm_src dirs $(OBJS) @echo Creating ispc executable @$(CXX) $(OPT) $(LDFLAGS) -o $@ $(OBJS) $(ISPC_LIBS) +# Use clang as a default compiler, instead of gcc +clang: ispc +clang: CXX=clang++ + # Build ispc with address sanitizer instrumentation using clang compiler # Note that this is not portable build -asan: ispc -asan: CXX=clang++ +asan: clang asan: OPT+=-fsanitize=address +# Do debug build, i.e. -O0 -g +debug: ispc +debug: OPT=-O0 -g objs/%.o: %.cpp @echo Compiling $< From 88f21b5c574bee7c36c3284c7bcb8d3125d9ea07 Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Thu, 21 Feb 2013 18:13:22 +0400 Subject: [PATCH 3/3] Update for doxygen.cfg: adding ast.* and func.* and fixing builtins-c.c => builtins/builtins.c --- doxygen.cfg | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doxygen.cfg b/doxygen.cfg index 6f9c99ef..5601e986 100644 --- a/doxygen.cfg +++ b/doxygen.cfg @@ -581,10 +581,12 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = builtins.h \ +INPUT = ast.h \ + builtins.h \ ctx.h \ decl.h \ expr.h \ + func.h \ ispc.h \ llvmutil.h \ module.h \ @@ -593,10 +595,12 @@ INPUT = builtins.h \ sym.h \ type.h \ util.h \ + ast.cpp \ builtins.cpp \ ctx.cpp \ decl.cpp \ expr.cpp \ + func.cpp \ ispc.cpp \ llvmutil.cpp \ main.cpp \ @@ -608,7 +612,7 @@ INPUT = builtins.h \ util.cpp \ parse.yy \ lex.ll \ - builtins-c.c + builtins/builtins.c # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is