8000 Make main compilation chunks into .cpp files · JavaScriptExpert/simdjson@7ad4020 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7ad4020

Browse files
committed
Make main compilation chunks into .cpp files
1 parent 72ab0d1 commit 7ad4020

File tree

14 files changed

+26
-75
lines changed

14 files changed

+26
-75
lines changed

include/simdjson/inline/error.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#ifndef SIMDJSON_INLINE_ERROR_H
22
#define SIMDJSON_INLINE_ERROR_H
33

4-
#include "simdjson/error.h"
4+
#include <cstring>
55
#include <string>
6+
#include "simdjson/error.h"
67

78
namespace simdjson {
89
namespace internal {

src/arm64/stage1_find_marks.h renamed to src/arm64/stage1.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#ifndef SIMDJSON_ARM64_STAGE1_H
2-
#define SIMDJSON_ARM64_STAGE1_H
3-
41
#include "simdjson.h"
52
#include "arm64/bitmask.h"
63
#include "arm64/simd.h"
@@ -88,5 +85,3 @@ WARN_UNUSED error_code implementation::stage1(const uint8_t *buf, size_t len, pa
8885

8986
} // namespace arm64
9087
} // namespace simdjson
91-
92-
#endif // SIMDJSON_ARM64_STAGE1_H
File renamed without changes.

src/error.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "simdjson/error.h"
1+
#include "simdjson.h"
22

33
namespace simdjson {
44
namespace internal {

src/fallback/stage1.h renamed to src/fallback/stage1.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#ifndef SIMDJSON_FALLBACK_STAGE1_H
2-
#define SIMDJSON_FALLBACK_STAGE1_H
3-
41
#include "simdjson.h"
52
#include "fallback/implementation.h"
63

@@ -210,5 +207,3 @@ WARN_UNUSED error_code implementation::minify(const uint8_t *buf, size_t len, ui
210207

211208
} // namespace fallback
212209
} // namespace simdjson
213-
214-
#endif // SIMDJSON_FALLBACK_STAGE1_H

src/fallback/stage2.h renamed to src/fallback/stage2.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#ifndef SIMDJSON_FALLBACK_STAGE2_H
2-
#define SIMDJSON_FALLBACK_STAGE2_H
3-
41
#include "simdjson.h"
52

63
#include "fallback/implementation.h"
@@ -17,5 +14,3 @@ namespace fallback {
1714

1815
} // namespace fallback
1916
} // namespace simdjson
20-
21-
#endif // SIMDJSON_FALLBACK_STAGE2_H

src/haswell/stage1.h renamed to src/haswell/stage1.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#ifndef SIMDJSON_HASWELL_STAGE1_H
2-
#define SIMDJSON_HASWELL_STAGE1_H
3-
41
#include "simdjson.h"
52

63
#include "haswell/bitmask.h"
@@ -79,5 +76,3 @@ WARN_UNUSED error_code implementation::stage1(const uint8_t *buf, size_t len, pa
7976

8077
} // namespace simdjson
8178
UNTARGET_REGION
82-
83-
#endif // SIMDJSON_HASWELL_STAGE1_H

src/haswell/stage2.h renamed to src/haswell/stage2.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#ifndef SIMDJSON_HASWELL_STAGE2_H
2-
#define SIMDJSON_HASWELL_STAGE2_H
3-
41
#include "simdjson.h"
52
#include "haswell/implementation.h"
63
#include "haswell/stringparsing.h"
@@ -18,5 +15,3 @@ namespace haswell {
1815
} // namespace haswell
1916
} // namespace simdjson
2017
UNTARGET_REGION
21-
22-
#endif // SIMDJSON_HASWELL_STAGE2_H

src/jsoncharutils.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
#include "simdjson.h"
55

6+
#ifdef JSON_TEST_STRINGS
7+
void found_string(const uint8_t *buf, const uint8_t *parsed_begin,
8+
const uint8_t *parsed_end);
9+
void found_bad_string(const uint8_t *buf);
10+
#endif
11+
612
namespace simdjson {
713
// structural chars here are
814
// they are { 0x7b } 0x7d : 0x3a [ 0x5b ] 0x5d , 0x2c (and NULL)

src/simdjson.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@ SIMDJSON_DISABLE_UNDESIRED_WARNINGS
55

66
#include "error.cpp"
77
#include "implementation.cpp"
8-
#include "stage1_find_marks.cpp"
9-
#include "stage2_build_tape.cpp"
8+
9+
#if SIMDJSON_IMPLEMENTATION_ARM64
10+
#include "arm64/stage1.cpp"
11+
#include "arm64/stage2.cpp"
12+
#endif
13+
#if SIMDJSON_IMPLEMENTATION_FALLBACK
14+
#include "fallback/stage1.cpp"
15+
#include "fallback/stage2.cpp"
16+
#endif
17+
#if SIMDJSON_IMPLEMENTATION_HASWELL
18+
#include "haswell/stage1.cpp"
19+
#include "haswell/stage2.cpp"
20+
#endif
21+
#if SIMDJSON_IMPLEMENTATION_WESTMERE
22+
#include "westmere/stage1.cpp"
23+
#include "westmere/stage2.cpp"
24+
#endif
1025

1126
SIMDJSON_POP_DISABLE_WARNINGS

src/stage1_find_marks.cpp

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/stage2_build_tape.cpp

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/westmere/stage1.h renamed to src/westmere/stage1.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#ifndef SIMDJSON_WESTMERE_STAGE1_H
2-
#define SIMDJSON_WESTMERE_STAGE1_H
3-
41
#include "simdjson.h"
52
#include "westmere/bitmask.h"
63
#include "westmere/simd.h"
@@ -78,5 +75,3 @@ WARN_UNUSED error_code implementation::stage1(const uint8_t *buf, size_t len, pa
7875

7976
} // namespace simdjson
8077
UNTARGET_REGION
81-
82-
#endif // SIMDJSON_WESTMERE_STAGE1_H

src/westmere/stage2.h renamed to src/westmere/stage2.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#ifndef SIMDJSON_WESTMERE_STAGE2_H
2-
#define SIMDJSON_WESTMERE_STAGE2_H
3-
41
#include "simdjson.h"
52
#include "westmere/implementation.h"
63
#include "westmere/stringparsing.h"
@@ -18,4 +15,3 @@ namespace westmere {
1815
} // namespace westmere
1916
} // namespace simdjson
2017
UNTARGET_REGION
21-
#endif // SIMDJSON_WESTMERE_STAGE2_H

0 commit comments

Comments
 (0)
0