Commit 9f739b38 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Rename FB_STRINGIZE

Summary: [Folly] Rename `FB_STRINGIZE` to `FOLLY_PP_STRINGIZE`.

Reviewed By: Orvid

Differential Revision: D19229502

fbshipit-source-id: 8dfdb3d9d576ce6b08d35747136c93a37a31d882
parent 01288455
......@@ -79,7 +79,7 @@ vector<detail::BenchmarkRegistration>& benchmarks() {
}
#define FB_FOLLY_GLOBAL_BENCHMARK_BASELINE fbFollyGlobalBenchmarkBaseline
#define FB_STRINGIZE_X2(x) FB_STRINGIZE(x)
#define FB_STRINGIZE_X2(x) FOLLY_PP_STRINGIZE(x)
// Add the global baseline
BENCHMARK(FB_FOLLY_GLOBAL_BENCHMARK_BASELINE) {
......
......@@ -439,7 +439,7 @@ void printResultComparison(
#define BENCHMARK(name, ...) \
BENCHMARK_IMPL( \
name, \
FB_STRINGIZE(name), \
FOLLY_PP_STRINGIZE(name), \
FB_ARG_2_OR_1(1, ##__VA_ARGS__), \
FB_ONE_OR_NONE(unsigned, ##__VA_ARGS__), \
__VA_ARGS__)
......@@ -461,7 +461,7 @@ void printResultComparison(
#define BENCHMARK_COUNTERS(name, counters, ...) \
BENCHMARK_IMPL_COUNTERS( \
name, \
FB_STRINGIZE(name), \
FOLLY_PP_STRINGIZE(name), \
counters, \
FB_ARG_2_OR_1(1, ##__VA_ARGS__), \
FB_ONE_OR_NONE(unsigned, ##__VA_ARGS__), \
......@@ -484,7 +484,7 @@ void printResultComparison(
#define BENCHMARK_MULTI(name, ...) \
BENCHMARK_MULTI_IMPL( \
name, \
FB_STRINGIZE(name), \
FOLLY_PP_STRINGIZE(name), \
FB_ONE_OR_NONE(unsigned, ##__VA_ARGS__), \
__VA_ARGS__)
......@@ -542,27 +542,27 @@ void printResultComparison(
* BENCHMARK_NAMED_PARAM(addValue, 0_to_1000, 10, 0, 1000)
* BENCHMARK_NAMED_PARAM(addValue, 5k_to_20k, 250, 5000, 20000)
*/
#define BENCHMARK_NAMED_PARAM(name, param_name, ...) \
BENCHMARK_IMPL( \
FB_CONCATENATE(name, FB_CONCATENATE(_, param_name)), \
FB_STRINGIZE(name) "(" FB_STRINGIZE(param_name) ")", \
iters, \
unsigned, \
iters) { \
name(iters, ##__VA_ARGS__); \
#define BENCHMARK_NAMED_PARAM(name, param_name, ...) \
BENCHMARK_IMPL( \
FB_CONCATENATE(name, FB_CONCATENATE(_, param_name)), \
FOLLY_PP_STRINGIZE(name) "(" FOLLY_PP_STRINGIZE(param_name) ")", \
iters, \
unsigned, \
iters) { \
name(iters, ##__VA_ARGS__); \
}
/**
* Same as BENCHMARK_NAMED_PARAM, but allows one to return the actual number
* of iterations that have been run.
*/
#define BENCHMARK_NAMED_PARAM_MULTI(name, param_name, ...) \
BENCHMARK_MULTI_IMPL( \
FB_CONCATENATE(name, FB_CONCATENATE(_, param_name)), \
FB_STRINGIZE(name) "(" FB_STRINGIZE(param_name) ")", \
unsigned, \
iters) { \
return name(iters, ##__VA_ARGS__); \
#define BENCHMARK_NAMED_PARAM_MULTI(name, param_name, ...) \
BENCHMARK_MULTI_IMPL( \
FB_CONCATENATE(name, FB_CONCATENATE(_, param_name)), \
FOLLY_PP_STRINGIZE(name) "(" FOLLY_PP_STRINGIZE(param_name) ")", \
unsigned, \
iters) { \
return name(iters, ##__VA_ARGS__); \
}
/**
......@@ -592,7 +592,7 @@ void printResultComparison(
#define BENCHMARK_RELATIVE(name, ...) \
BENCHMARK_IMPL( \
name, \
"%" FB_STRINGIZE(name), \
"%" FOLLY_PP_STRINGIZE(name), \
FB_ARG_2_OR_1(1, ##__VA_ARGS__), \
FB_ONE_OR_NONE(unsigned, ##__VA_ARGS__), \
__VA_ARGS__)
......@@ -600,7 +600,7 @@ void printResultComparison(
#define BENCHMARK_COUNTERS_RELATIVE(name, counters, ...) \
BENCHMARK_IMPL_COUNTERS( \
name, \
"%" FB_STRINGIZE(name), \
"%" FOLLY_PP_STRINGIZE(name), \
counters, \
FB_ARG_2_OR_1(1, ##__VA_ARGS__), \
FB_ONE_OR_NONE(unsigned, ##__VA_ARGS__), \
......@@ -612,7 +612,7 @@ void printResultComparison(
#define BENCHMARK_RELATIVE_MULTI(name, ...) \
BENCHMARK_MULTI_IMPL( \
name, \
"%" FB_STRINGIZE(name), \
"%" FOLLY_PP_STRINGIZE(name), \
FB_ONE_OR_NONE(unsigned, ##__VA_ARGS__), \
__VA_ARGS__)
......@@ -632,27 +632,27 @@ void printResultComparison(
/**
* A combination of BENCHMARK_RELATIVE and BENCHMARK_NAMED_PARAM.
*/
#define BENCHMARK_RELATIVE_NAMED_PARAM(name, param_name, ...) \
BENCHMARK_IMPL( \
FB_CONCATENATE(name, FB_CONCATENATE(_, param_name)), \
"%" FB_STRINGIZE(name) "(" FB_STRINGIZE(param_name) ")", \
iters, \
unsigned, \
iters) { \
name(iters, ##__VA_ARGS__); \
#define BENCHMARK_RELATIVE_NAMED_PARAM(name, param_name, ...) \
BENCHMARK_IMPL( \
FB_CONCATENATE(name, FB_CONCATENATE(_, param_name)), \
"%" FOLLY_PP_STRINGIZE(name) "(" FOLLY_PP_STRINGIZE(param_name) ")", \
iters, \
unsigned, \
iters) { \
name(iters, ##__VA_ARGS__); \
}
/**
* Same as BENCHMARK_RELATIVE_NAMED_PARAM, but allows one to return the
* actual number of iterations that have been run.
*/
#define BENCHMARK_RELATIVE_NAMED_PARAM_MULTI(name, param_name, ...) \
BENCHMARK_MULTI_IMPL( \
FB_CONCATENATE(name, FB_CONCATENATE(_, param_name)), \
"%" FB_STRINGIZE(name) "(" FB_STRINGIZE(param_name) ")", \
unsigned, \
iters) { \
return name(iters, ##__VA_ARGS__); \
#define BENCHMARK_RELATIVE_NAMED_PARAM_MULTI(name, param_name, ...) \
BENCHMARK_MULTI_IMPL( \
FB_CONCATENATE(name, FB_CONCATENATE(_, param_name)), \
"%" FOLLY_PP_STRINGIZE(name) "(" FOLLY_PP_STRINGIZE(param_name) ")", \
unsigned, \
iters) { \
return name(iters, ##__VA_ARGS__); \
}
/**
......
......@@ -105,10 +105,10 @@
#endif
/**
* Use FB_STRINGIZE(x) when you'd want to do what #x does inside
* Use FOLLY_PP_STRINGIZE(x) when you'd want to do what #x does inside
* another macro expansion.
*/
#define FB_STRINGIZE(x) #x
#define FOLLY_PP_STRINGIZE(x) #x
#define FOLLY_PP_DETAIL_NARGS_1(dummy, _7, _6, _5, _4, _3, _2, _1, _0, ...) _0
#define FOLLY_PP_DETAIL_NARGS(...) \
......
......@@ -22,7 +22,7 @@
static bool FB_ANONYMOUS_VARIABLE(benchGen) = \
(::folly::addBenchmark( \
__FILE__, \
prefix FB_STRINGIZE(gen), \
prefix FOLLY_PP_STRINGIZE(gen), \
[](unsigned iters) { \
const unsigned num = iters; \
while (iters--) { \
......
......@@ -91,7 +91,7 @@ int main(int argc, char** argv) {
std::deque<std::string> names; // Backing for benchmark names.
#define BENCHMARK_HASH(HASHER) \
detail::addHashBenchmark<detail::HASHER>(FB_STRINGIZE(HASHER));
detail::addHashBenchmark<detail::HASHER>(FOLLY_PP_STRINGIZE(HASHER));
BENCHMARK_HASH(SpookyHashV2);
BENCHMARK_HASH(FNV64);
......
......@@ -24,7 +24,7 @@
#define FOLLY_SAFE_CHECK_IMPL(expr, expr_s, msg, error) \
((expr) ? static_cast<void>(0) \
: ::folly::detail::assertionFailure( \
FB_STRINGIZE(expr_s), \
FOLLY_PP_STRINGIZE(expr_s), \
(msg), \
__FILE__, \
__LINE__, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment