Make main compilation chunks into .cpp files

This commit is contained in:
John Keiser 2020-05-11 23:24:00 -07:00
parent 72ab0d11ff
commit 7ad4020829
14 changed files with 26 additions and 75 deletions

View File

@ -1,8 +1,9 @@
#ifndef SIMDJSON_INLINE_ERROR_H
#define SIMDJSON_INLINE_ERROR_H
#include "simdjson/error.h"
#include <cstring>
#include <string>
#include "simdjson/error.h"
namespace simdjson {
namespace internal {

View File

@ -1,6 +1,3 @@
#ifndef SIMDJSON_ARM64_STAGE1_H
#define SIMDJSON_ARM64_STAGE1_H
#include "simdjson.h"
#include "arm64/bitmask.h"
#include "arm64/simd.h"
@ -88,5 +85,3 @@ WARN_UNUSED error_code implementation::stage1(const uint8_t *buf, size_t len, pa
} // namespace arm64
} // namespace simdjson
#endif // SIMDJSON_ARM64_STAGE1_H

View File

@ -1,4 +1,4 @@
#include "simdjson/error.h"
#include "simdjson.h"
namespace simdjson {
namespace internal {

View File

@ -1,6 +1,3 @@
#ifndef SIMDJSON_FALLBACK_STAGE1_H
#define SIMDJSON_FALLBACK_STAGE1_H
#include "simdjson.h"
#include "fallback/implementation.h"
@ -210,5 +207,3 @@ WARN_UNUSED error_code implementation::minify(const uint8_t *buf, size_t len, ui
} // namespace fallback
} // namespace simdjson
#endif // SIMDJSON_FALLBACK_STAGE1_H

View File

@ -1,6 +1,3 @@
#ifndef SIMDJSON_FALLBACK_STAGE2_H
#define SIMDJSON_FALLBACK_STAGE2_H
#include "simdjson.h"
#include "fallback/implementation.h"
@ -17,5 +14,3 @@ namespace fallback {
} // namespace fallback
} // namespace simdjson
#endif // SIMDJSON_FALLBACK_STAGE2_H

View File

@ -1,6 +1,3 @@
#ifndef SIMDJSON_HASWELL_STAGE1_H
#define SIMDJSON_HASWELL_STAGE1_H
#include "simdjson.h"
#include "haswell/bitmask.h"
@ -79,5 +76,3 @@ WARN_UNUSED error_code implementation::stage1(const uint8_t *buf, size_t len, pa
} // namespace simdjson
UNTARGET_REGION
#endif // SIMDJSON_HASWELL_STAGE1_H

View File

@ -1,6 +1,3 @@
#ifndef SIMDJSON_HASWELL_STAGE2_H
#define SIMDJSON_HASWELL_STAGE2_H
#include "simdjson.h"
#include "haswell/implementation.h"
#include "haswell/stringparsing.h"
@ -18,5 +15,3 @@ namespace haswell {
} // namespace haswell
} // namespace simdjson
UNTARGET_REGION
#endif // SIMDJSON_HASWELL_STAGE2_H

View File

@ -3,6 +3,12 @@
#include "simdjson.h"
#ifdef JSON_TEST_STRINGS
void found_string(const uint8_t *buf, const uint8_t *parsed_begin,
const uint8_t *parsed_end);
void found_bad_string(const uint8_t *buf);
#endif
namespace simdjson {
// structural chars here are
// they are { 0x7b } 0x7d : 0x3a [ 0x5b ] 0x5d , 0x2c (and NULL)

View File

@ -5,7 +5,22 @@ SIMDJSON_DISABLE_UNDESIRED_WARNINGS
#include "error.cpp"
#include "implementation.cpp"
#include "stage1_find_marks.cpp"
#include "stage2_build_tape.cpp"
#if SIMDJSON_IMPLEMENTATION_ARM64
#include "arm64/stage1.cpp"
#include "arm64/stage2.cpp"
#endif
#if SIMDJSON_IMPLEMENTATION_FALLBACK
#include "fallback/stage1.cpp"
#include "fallback/stage2.cpp"
#endif
#if SIMDJSON_IMPLEMENTATION_HASWELL
#include "haswell/stage1.cpp"
#include "haswell/stage2.cpp"
#endif
#if SIMDJSON_IMPLEMENTATION_WESTMERE
#include "westmere/stage1.cpp"
#include "westmere/stage2.cpp"
#endif
SIMDJSON_POP_DISABLE_WARNINGS

View File

@ -1,12 +0,0 @@
#if SIMDJSON_IMPLEMENTATION_ARM64
#include "arm64/stage1.h"
#endif
#if SIMDJSON_IMPLEMENTATION_FALLBACK
#include "fallback/stage1.h"
#endif
#if SIMDJSON_IMPLEMENTATION_HASWELL
#include "haswell/stage1.h"
#endif
#if SIMDJSON_IMPLEMENTATION_WESTMERE
#include "westmere/stage1.h"
#endif

View File

@ -1,25 +0,0 @@
#include "simdjson.h"
#include <cassert>
#include <cstring>
#include "jsoncharutils.h"
using namespace simdjson;
#ifdef JSON_TEST_STRINGS
void found_string(const uint8_t *buf, const uint8_t *parsed_begin,
const uint8_t *parsed_end);
void found_bad_string(const uint8_t *buf);
#endif
#if SIMDJSON_IMPLEMENTATION_ARM64
#include "arm64/stage2.h"
#endif
#if SIMDJSON_IMPLEMENTATION_FALLBACK
#include "fallback/stage2.h"
#endif
#if SIMDJSON_IMPLEMENTATION_HASWELL
#include "haswell/stage2.h"
#endif
#if SIMDJSON_IMPLEMENTATION_WESTMERE
#include "westmere/stage2.h"
#endif

View File

@ -1,6 +1,3 @@
#ifndef SIMDJSON_WESTMERE_STAGE1_H
#define SIMDJSON_WESTMERE_STAGE1_H
#include "simdjson.h"
#include "westmere/bitmask.h"
#include "westmere/simd.h"
@ -78,5 +75,3 @@ WARN_UNUSED error_code implementation::stage1(const uint8_t *buf, size_t len, pa
} // namespace simdjson
UNTARGET_REGION
#endif // SIMDJSON_WESTMERE_STAGE1_H

View File

@ -1,6 +1,3 @@
#ifndef SIMDJSON_WESTMERE_STAGE2_H
#define SIMDJSON_WESTMERE_STAGE2_H
#include "simdjson.h"
#include "westmere/implementation.h"
#include "westmere/stringparsing.h"
@ -18,4 +15,3 @@ namespace westmere {
} // namespace westmere
} // namespace simdjson
UNTARGET_REGION
#endif // SIMDJSON_WESTMERE_STAGE2_H