Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4da0ac5

Browse files
committed
Merging IR2Vec Categories
1 parent 87eed21 commit 4da0ac5

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

llvm/include/llvm/Analysis/IR2Vec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ enum class IR2VecKind { Symbolic, FlowAware };
6363

6464
namespace ir2vec {
6565

66+
extern llvm::cl::OptionCategory IR2VecCategory;
6667
LLVM_ABI extern cl::opt<float> OpcWeight;
6768
LLVM_ABI extern cl::opt<float> TypeWeight;
6869
LLVM_ABI extern cl::opt<float> ArgWeight;

llvm/lib/Analysis/IR2Vec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ STATISTIC(VocabMissCounter,
3636

3737
namespace llvm {
3838
namespace ir2vec {
39-
static cl::OptionCategory IR2VecCategory("IR2Vec Options");
39+
cl::OptionCategory IR2VecCategory("IR2Vec Options");
4040

4141
// FIXME: Use a default vocab when not specified
4242
static cl::opt<std::string>

llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@
5555
namespace llvm {
5656
namespace ir2vec {
5757

58-
static cl::OptionCategory IR2VecToolCategory("IR2Vec Tool Options");
59-
6058
// Subcommands
6159
static cl::SubCommand
6260
TripletsSubCmd("triplets", "Generate triplets for vocabulary training");
@@ -72,18 +70,18 @@ static cl::opt<std::string>
7270
InputFilename(cl::Positional,
7371
cl::desc("<input bitcode file or '-' for stdin>"),
7472
cl::init("-"), cl::sub(TripletsSubCmd),
75-
cl::sub(EmbeddingsSubCmd), cl::cat(IR2VecToolCategory));
73+
cl::sub(EmbeddingsSubCmd), cl::cat(ir2vec::IR2VecCategory));
7674

7775
static cl::opt<std::string> OutputFilename("o", cl::desc("Output filename"),
7876
cl::value_desc("filename"),
7977
cl::init("-"),
80-
cl::cat(IR2VecToolCategory));
78+
cl::cat(ir2vec::IR2VecCategory));
8179

8280
// Embedding-specific options
8381
static cl::opt<std::string>
8482
FunctionName("function", cl::desc("Process specific function only"),
8583
cl::value_desc("name"), cl::Optional, cl::init(""),
86-
cl::sub(EmbeddingsSubCmd), cl::cat(IR2VecToolCategory));
84+
cl::sub(EmbeddingsSubCmd), cl::cat(ir2vec::IR2VecCategory));
8785

8886
enum EmbeddingLevel {
8987
InstructionLevel, // Generate instruction-level embeddings
@@ -100,7 +98,7 @@ static cl::opt<EmbeddingLevel>
10098
clEnumValN(FunctionLevel, "func",
10199
"Generate function-level embeddings")),
102100
cl::init(FunctionLevel), cl::sub(EmbeddingsSubCmd),
103-
cl::cat(IR2VecToolCategory));
101+
cl::cat(ir2vec::IR2VecCategory));
104102

105103
namespace {
106104

@@ -325,7 +323,7 @@ int main(int argc, char **argv) {
325323
using namespace llvm::ir2vec;
326324

327325
InitLLVM X(argc, argv);
328-
cl::HideUnrelatedOptions(IR2VecToolCategory);
326+
cl::HideUnrelatedOptions(ir2vec::IR2VecCategory);
329327
cl::ParseCommandLineOptions(
330328
argc, argv,
331329
"IR2Vec - Embedding Generation Tool\n"

0 commit comments

Comments
 (0)