Commit b97f89e5 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

disassembly inspection functions for FOLLY_SAFE_CHECK

Summary: Add some functions that can be used to inspect the generated code for `FOLLY_SAFE_CHECK` and `FOLLY_SAFE_PCHECK`.

Reviewed By: swolchok

Differential Revision: D26996102

fbshipit-source-id: 257f59d5904c319ed01e55cfd75939b41e55c53d
parent c09fadd4
......@@ -20,8 +20,21 @@
#include <folly/Benchmark.h>
#include <folly/Conv.h>
#include <folly/lang/Keep.h>
#include <folly/portability/GTest.h>
extern "C" FOLLY_ATTR_WEAK void sink();
extern "C" FOLLY_KEEP void check_folly_safe_check(bool cond) {
FOLLY_SAFE_CHECK(cond, "the condition failed");
sink();
}
extern "C" FOLLY_KEEP void check_folly_safe_pcheck(bool cond) {
FOLLY_SAFE_PCHECK(cond, "the condition failed");
sink();
}
// clang-format off
[[noreturn]] void fail() {
FOLLY_SAFE_CHECK(0 + 0, "hello");
......
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