Skip to content

Commit

Permalink
common: Replace std::regex with RE2C state machines.
Browse files Browse the repository at this point in the history
To avoid GCC 4.9 dependency.

Fixes #370.
  • Loading branch information
jrfonseca committed Aug 14, 2015
1 parent 2392d3c commit de9621f
Show file tree
Hide file tree
Showing 7 changed files with 5,744 additions and 151 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,6 @@ else ()
message (FATAL_ERROR "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} compiler does not support C++11")
endif ()

# std::regex is broken before GCC 4.9
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
message (FATAL_ERROR "GCC 4.9 or later required for C++11 std::regex support -- https://github.com/apitrace/apitrace/issues/370")
endif ()

# Adjust warnings
add_compiler_flags (-Wall)
# XXX: it's safer to use ssize_t everywhere instead of disabling warning
Expand Down
3 changes: 3 additions & 0 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ if (ANDROID)
log
)
endif ()

add_gtest (trace_parser_flags_test trace_parser_flags_test.cpp)
target_link_libraries (trace_parser_flags_test common)
2 changes: 2 additions & 0 deletions common/trace_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ class Parser
EnumSig *parse_enum_sig();
BitmaskSig *parse_bitmask_sig();

public:
static CallFlags
lookupCallFlags(const char *name);

protected:
Call *parse_Call(Mode mode);

void parse_enter(Mode mode);
Expand Down
4,666 changes: 4,522 additions & 144 deletions common/trace_parser_flags.cpp

Large diffs are not rendered by default.

565 changes: 565 additions & 0 deletions common/trace_parser_flags.cpp.re

Large diffs are not rendered by default.

652 changes: 652 additions & 0 deletions common/trace_parser_flags_test.cpp

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion guids/guids_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**************************************************************************
*
* Copyright 2015 VMware, Inc.
Expand Down

0 comments on commit de9621f

Please sign in to comment.