Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
columns.cpp
Go to the documentation of this file.
2
3#include <string>
4#include <vector>
5
7
8namespace bb::avm2 {
9
10// Column names are used for
11// (1) The debugger.
12// (2) Tracegen stats.
13// (3) The manifest through the transcript (only for debugging).
14// We don't want to leak column names for release builds.
15#ifdef AVM_INCLUDE_COLUMN_INFORMATION
16
17// Two layers are needed to properly expand the macro. Don't ask why.
18#define VARARGS_TO_STRING(...) #__VA_ARGS__
19#define UNPACK_TO_STRING(...) VARARGS_TO_STRING(__VA_ARGS__)
20
21const std::vector<std::string>& COLUMN_NAMES = []() {
22 static auto vec = detail::split_and_trim(UNPACK_TO_STRING(AVM2_ALL_ENTITIES), ',');
23 return vec;
24}();
25#else
26const std::vector<std::string>& COLUMN_NAMES = []() {
27 // Generate a dummy vector of column names.
28 static std::vector<std::string> vec;
29 for (size_t i = 0; i < NUM_ALL_ENTITIES; i++) {
30 vec.push_back("column_" + std::to_string(i));
31 }
32 return vec;
33}();
34#endif
35
36} // namespace bb::avm2
const std::vector< std::string > & COLUMN_NAMES
Definition columns.cpp:26
constexpr auto NUM_ALL_ENTITIES
Definition columns.hpp:49
std::vector< std::string > split_and_trim(const std::string &str, char delimiter)
std::string to_string(bb::avm2::ValueTag tag)