Commit 8fd05c4a authored by nagayama15's avatar nagayama15

Separete global option definitions.

parent 38ac18ef
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <llvm/Support/raw_ostream.h> #include <llvm/Support/raw_ostream.h>
#include "../PermutationTable.hpp" #include "../PermutationTable.hpp"
#include "Opts.hpp"
namespace namespace
{ {
...@@ -49,14 +50,6 @@ namespace ...@@ -49,14 +50,6 @@ namespace
llvm::cl::init(RangeOptValue<std::size_t> {7}), llvm::cl::init(RangeOptValue<std::size_t> {7}),
}; };
const llvm::cl::opt<int> watermark_opt
{
"watermark",
llvm::cl::desc("Watermark (32bit)"),
llvm::cl::value_desc("watermark"),
llvm::cl::Required,
};
/** /**
* @brief Watermarking pass by code layout methods. * @brief Watermarking pass by code layout methods.
*/ */
...@@ -156,7 +149,7 @@ namespace ...@@ -156,7 +149,7 @@ namespace
for (; block_index + partition <= blocks.size(); block_index += partition) for (; block_index + partition <= blocks.size(); block_index += partition)
{ {
// Part of watermark to embed. // Part of watermark to embed.
const auto data = (watermark_opt >> bit_pos_) & bit_mask; const auto data = (nykk::pass::watermark_opt >> bit_pos_) & bit_mask;
// Shuffles each `partition` blocks. // Shuffles each `partition` blocks.
for (std::size_t i = 0; i < partition; i++) for (std::size_t i = 0; i < partition; i++)
......
#ifndef INCLUDE_NYKK_PASS_OPTS_HPP
#define INCLUDE_NYKK_PASS_OPTS_HPP
#include <llvm/Support/CommandLine.h>
namespace nykk::pass
{
const llvm::cl::opt<int> watermark_opt
{
"watermark",
llvm::cl::desc("Watermark (32bit)"),
llvm::cl::value_desc("watermark"),
llvm::cl::Required,
};
}
#endif
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