Skip to content

Commit

Permalink
Makefile: DEBUG -> JL_DEBUG_BUILD to avoid LLVM conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
ihnorton committed May 18, 2014
1 parent e8148dc commit b8de421
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ CXX = $(CROSS_COMPILE)g++
JCFLAGS = -std=gnu99 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
JCPPFLAGS =
JCXXFLAGS = -pipe $(fPIC) -fno-rtti
DEBUGFLAGS = -O0 -ggdb3 -DDEBUG -fstack-protector-all
DEBUGFLAGS = -O0 -ggdb3 -DJL_DEBUG_BUILD -fstack-protector-all
SHIPFLAGS = -O3 -falign-functions
endif

Expand All @@ -228,7 +228,7 @@ CXX = $(CROSS_COMPILE)clang++
JCFLAGS = -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
JCPPFLAGS =
JCXXFLAGS = -pipe $(fPIC) -fno-rtti
DEBUGFLAGS = -O0 -g -DDEBUG -fstack-protector-all
DEBUGFLAGS = -O0 -g -DJL_DEBUG_BUILD -fstack-protector-all
SHIPFLAGS = -O3
ifeq ($(OS), Darwin)
ifeq ($(USE_LIBCPP), 1)
Expand Down
2 changes: 1 addition & 1 deletion Windows.inc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CFLAGS = $(CFLAGS) /D_X86_=1
CFLAGS = $(CFLAGS) /D_AMD64_=1 /DWIN64 /D_WIN64
!endif

!ifdef DEBUG
!ifdef JL_DEBUG_BUILD
CFLAGS = $(CFLAGS) /Zi /Od /DDEBUG /MDd
LFLAGS = $(LFLAGS) /DEBUG
!else
Expand Down
2 changes: 1 addition & 1 deletion src/Windows.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ LIBUV = ..\deps\libuv\libuv.lib
FLISP = flisp\flisp.exe

INCLUDE = $(INCLUDE);$(MAKEDIR)\..\deps\libuv\include;$(MAKEDIR)\flisp;$(MAKEDIR)\support;C:\Program Files\llvm\include
!ifdef DEBUG
!ifdef JL_DEBUG_BUILD
LIB = $(LIB);C:\Program Files\llvm\lib\Debug
!else
LIB = $(LIB);C:\Program Files\llvm\lib\Release
Expand Down
12 changes: 6 additions & 6 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Config/llvm-config.h"
#ifdef DEBUG
#ifdef JL_DEBUG_BUILD
#include "llvm/Support/CommandLine.h"
#endif
#include "llvm/Transforms/Utils/Cloning.h"
Expand Down Expand Up @@ -507,7 +507,7 @@ static Function *to_function(jl_lambda_info_t *li, bool cstyle)
}
assert(f != NULL);
nested_compile = last_n_c;
#ifdef DEBUG
#ifdef JL_DEBUG_BUILD
#ifdef LLVM35
llvm::raw_fd_ostream out(1,false);
#endif
Expand Down Expand Up @@ -3246,7 +3246,7 @@ static Function *emit_function(jl_lambda_info_t *lam, bool cstyle)
AttributeSet::FunctionIndex,*attr));
#endif
#endif
#ifdef DEBUG
#ifdef JL_DEBUG_BUILD
#if LLVM32 && !LLVM33
f->addFnAttr(Attributes::StackProtectReq);
#else
Expand Down Expand Up @@ -4208,7 +4208,7 @@ static void init_julia_llvm_env(Module *m)

extern "C" void jl_init_codegen(void)
{
#ifdef DEBUG
#ifdef JL_DEBUG_BUILD
cl::ParseEnvironmentOptions("Julia", "JULIA_LLVM_ARGS");
#endif
imaging_mode = jl_compileropts.build_path != NULL;
Expand Down Expand Up @@ -4237,7 +4237,7 @@ extern "C" void jl_init_codegen(void)

#if !defined(LLVM_VERSION_MAJOR) || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 0)
jl_ExecutionEngine = EngineBuilder(m).setEngineKind(EngineKind::JIT).create();
#ifdef DEBUG
#ifdef JL_DEBUG_BUILD
llvm::JITEmitDebugInfo = true;
#endif
//llvm::JITEmitDebugInfoToDisk = true;
Expand All @@ -4249,7 +4249,7 @@ extern "C" void jl_init_codegen(void)
#elif LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 1
TargetOptions options = TargetOptions();
//options.PrintMachineCode = true; //Print machine code produced during JIT compiling
#ifdef DEBUG
#ifdef JL_DEBUG_BUILD
options.JITEmitDebugInfo = true;
#endif
options.NoFramePointerElim = true;
Expand Down
2 changes: 1 addition & 1 deletion src/jlapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ DLLEXPORT void jl_sigatomic_end(void)

DLLEXPORT int jl_is_debugbuild(void)
{
#ifdef DEBUG
#ifdef JL_DEBUG_BUILD
return 1;
#else
return 0;
Expand Down

0 comments on commit b8de421

Please sign in to comment.