Skip to content

Commit 6a1e339

Browse files
authored
Merge pull request #23563 from JuliaLang/yyc/build/assert
Makes sure assertion respects JL_NDEBUG in C++ code
2 parents 9edfa55 + 45b0013 commit 6a1e339

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+104
-75
lines changed

src/APInt-C.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
#include <llvm/ADT/APFloat.h>
77
#include <llvm/Support/MathExtras.h>
88

9-
#include "fix_llvm_assert.h"
10-
119
#include "APInt-C.h"
1210
#include "julia.h"
11+
#include "julia_assert.h"
1312

1413
using namespace llvm;
1514

src/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ LLVM_LIBS := support
7575
endif
7676

7777
# headers are used for dependency tracking, while public headers will be part of the dist
78-
HEADERS := $(BUILDDIR)/julia_version.h $(wildcard $(SRCDIR)/support/*.h) $(addprefix $(SRCDIR)/,julia.h julia_threads.h tls.h locks.h atomics.h julia_internal.h options.h timing.h)
79-
PUBLIC_HEADERS := $(BUILDDIR)/julia_version.h $(wildcard $(SRCDIR)/support/*.h) $(addprefix $(SRCDIR)/,julia.h julia_threads.h tls.h locks.h atomics.h)
78+
HEADERS := $(BUILDDIR)/julia_version.h $(wildcard $(SRCDIR)/support/*.h) $(addprefix $(SRCDIR)/,julia.h julia_assert.h julia_threads.h tls.h locks.h atomics.h julia_internal.h options.h timing.h)
79+
PUBLIC_HEADERS := $(BUILDDIR)/julia_version.h $(wildcard $(SRCDIR)/support/*.h) $(addprefix $(SRCDIR)/,julia.h julia_assert.h julia_threads.h tls.h locks.h atomics.h)
8080
ifeq ($(USE_SYSTEM_LIBUV),0)
8181
ifeq ($(OS),WINNT)
8282
HEADERS += $(build_includedir)/tree.h

src/array.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
*/
66
#include <stdlib.h>
77
#include <string.h>
8-
#include <assert.h>
98
#ifdef _OS_WINDOWS_
109
#include <malloc.h>
1110
#endif
1211
#include "julia.h"
1312
#include "julia_internal.h"
13+
#include "julia_assert.h"
1414

1515
#ifdef __cplusplus
1616
extern "C" {
@@ -157,7 +157,7 @@ jl_array_t *jl_new_array_for_deserialization(jl_value_t *atype, uint32_t ndims,
157157
return _new_array_(atype, ndims, dims, isunboxed, elsz);
158158
}
159159

160-
#ifndef NDEBUG
160+
#ifndef JL_NDEBUG
161161
static inline int is_ntuple_long(jl_value_t *v)
162162
{
163163
if (!jl_is_tuple(v))

src/ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#include <stdlib.h>
88
#include <stdio.h>
99
#include <string.h>
10-
#include <assert.h>
1110
#ifdef _OS_WINDOWS_
1211
#include <malloc.h>
1312
#endif
1413
#include "julia.h"
1514
#include "julia_internal.h"
1615
#include "flisp.h"
16+
#include "julia_assert.h"
1717

1818
#ifdef __cplusplus
1919
extern "C" {

src/builtins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <string.h>
1111
#include <stdarg.h>
1212
#include <setjmp.h>
13-
#include <assert.h>
1413
#include <sys/types.h>
1514
#include <errno.h>
1615
#include <fcntl.h>
@@ -25,6 +24,7 @@
2524
#include "julia_internal.h"
2625
#include "builtin_proto.h"
2726
#include "intrinsics.h"
27+
#include "julia_assert.h"
2828

2929
#ifdef __cplusplus
3030
extern "C" {

src/cgmemmgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "options.h"
66

77
#include <llvm/ExecutionEngine/SectionMemoryManager.h>
8-
#include "fix_llvm_assert.h"
98
#include "julia.h"
109
#include "julia_internal.h"
1110

@@ -25,6 +24,7 @@
2524
#ifdef _OS_FREEBSD_
2625
# include <sys/types.h>
2726
#endif
27+
#include "julia_assert.h"
2828

2929
namespace {
3030

src/codegen.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <vector>
3232
#include <set>
3333
#include <cstdio>
34-
#include <cassert>
3534
#include <iostream>
3635
#include <functional>
3736

@@ -85,7 +84,6 @@
8584
#include <polly/ScopDetection.h>
8685
#endif
8786
#include <llvm/ExecutionEngine/ExecutionEngine.h>
88-
#include "fix_llvm_assert.h"
8987

9088
using namespace llvm;
9189
namespace llvm {
@@ -100,6 +98,7 @@ namespace llvm {
10098
#include "julia_internal.h"
10199
#include "jitlayers.h"
102100
#include "codegen_shared.h"
101+
#include "julia_assert.h"
103102

104103
// LLVM version compatibility macros
105104
legacy::PassManager *jl_globalPM;

src/datatype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#include <stdlib.h>
99
#include <string.h>
1010
#include <stdarg.h>
11-
#include <assert.h>
1211
#include "julia.h"
1312
#include "julia_internal.h"
13+
#include "julia_assert.h"
1414

1515
#ifdef __cplusplus
1616
extern "C" {

src/debuginfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <llvm/Object/MachO.h>
2323
#include <llvm/Object/COFF.h>
2424
#include <llvm/Object/ELFObjectFile.h>
25-
#include "fix_llvm_assert.h"
2625

2726
using namespace llvm;
2827

@@ -46,7 +45,7 @@ using llvm_file_magic = sys::fs::file_magic;
4645
#include <vector>
4746
#include <set>
4847
#include <cstdio>
49-
#include <cassert>
48+
#include "julia_assert.h"
5049

5150
typedef object::SymbolRef SymRef;
5251

src/disasm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@
6969
#include <llvm/IR/Module.h>
7070
#include <llvm/IR/IntrinsicInst.h>
7171
#include "llvm/IR/AssemblyAnnotationWriter.h"
72-
#include "fix_llvm_assert.h"
7372

7473
#include "julia.h"
7574
#include "julia_internal.h"
7675

7776
using namespace llvm;
7877
#include "debuginfo.h"
78+
#include "julia_assert.h"
7979

8080
// helper class for tracking inlining context while printing debug info
8181
class DILineInfoPrinter {

0 commit comments

Comments
 (0)