コード例 #1
0
ファイル: SmackOptions.cpp プロジェクト: cschreiner/smack
namespace smack {

// Enable memory model to be specified on the command line
const llvm::cl::opt<MemMod> SmackOptions::MemoryModel(
  "mem-mod", 
  llvm::cl::desc("Set the memory model:"),
  llvm::cl::values(
    clEnumVal(flat, "flat memory model"),
    clEnumVal(twodim, "two dimensional memory model"),
    clEnumValEnd));

const llvm::cl::opt<bool> SmackOptions::MemoryModelDebug(
  "mem-mod-dbg", llvm::cl::desc("Enable memory model debugging.")
);

const llvm::cl::opt<bool> SmackOptions::IgnoreMemoryModelAsserts(
  "no-mem-mod-asserts", llvm::cl::desc("Ignore memory model assertions.")
);

const llvm::cl::opt<bool> SmackOptions::MemoryModelImpls(
  "mem-mod-impls", llvm::cl::desc("Provide implementations for memory model procedures.")
);

const llvm::cl::opt<bool> SmackOptions::SourceLocSymbols(
  "source-loc-syms", llvm::cl::desc("Include source locations in generated code.")
);

}
コード例 #2
0
namespace llvm {
  bool EnableExperimentalFeatures;

  cl::opt<bool,true> 
  EnableExperimental("enable-experimental",
    cl::desc("Enable experimental features"),
    cl::location(EnableExperimentalFeatures),
    cl::init(getenv("HSA_ENABLE_EXPERIMENTAL_FEATURES") && std::string(getenv("HSA_ENABLE_EXPERIMENTAL_FEATURES")) == std::string("1")));


  bool EnableUniformOperations;

  cl::opt<bool, true> EnableUniformOps("hsail-enable-uniform-ops", cl::Hidden,
    cl::desc("Enable width modifier for uniform operation"),
    cl::location(EnableUniformOperations),
    cl::init(true));

  enum OptimizeForTargetArch OptimizeFor;

  cl::opt<enum OptimizeForTargetArch, true> HsailOptimizeFor("hsail-optimize-for", cl::Hidden,
    cl::desc("Tune backend optimizations for specific target architecture"),
    cl::values(
      clEnumVal(GENERIC, "No target specific flavor"),
      clEnumVal(SI,      "Sea Islands family"),
    clEnumValEnd),
    cl::location(OptimizeFor),
    cl::init(SI));

  bool EnableGCNMinMax;

  cl::opt<bool, true> OptEnableGCNMinMax("hsail-enable-gcnminmax", cl::Hidden,
    cl::desc("Enable GCN min/max ops in tablegen Fusion"),
    cl::location(EnableGCNMinMax),
    cl::init(true));

}
コード例 #3
0
namespace cll = llvm::cl;

const char* name = "Spanning Tree Algorithm";
const char* desc = "Compute the spanning forest of a graph";
const char* url = NULL;

enum Algo {
  demo,
  asynchronous
};

static cll::opt<std::string> inputFilename(cll::Positional, cll::desc("<input file>"), cll::Required);
static cll::opt<Algo> algo("algo", cll::desc("Choose an algorithm:"),
    cll::values(
      clEnumVal(demo, "Demonstration algorithm"),
      clEnumVal(asynchronous, "Asynchronous"),
      clEnumValEnd), cll::init(asynchronous));

struct Node: public Galois::UnionFindNode<Node> {
  Node* component;
};

#ifdef GALOIS_USE_NUMA
typedef Galois::Graph::LC_Numa_Graph<Node,void> Graph;
#else
typedef Galois::Graph::LC_CSR_Graph<Node,void> Graph;
#endif

typedef Graph::GraphNode GNode;
コード例 #4
0
enum ConvertMode {
  dimacs2gr,
  rmat2gr,
  pbbs2vgr,
  pbbs2gr,
  gr2bsml,
  vgr2bsml,
  gr2dimacs,
  gr2pbbs
};

static cll::opt<std::string> inputfilename(cll::Positional, cll::desc("<input file>"), cll::Required);
static cll::opt<std::string> outputfilename(cll::Positional, cll::desc("<output file>"), cll::Required);
static cll::opt<ConvertMode> convertMode(cll::desc("Choose a conversion mode:"),
    cll::values(
      clEnumVal(dimacs2gr, "Convert dimacs to binary gr (default)"),
      clEnumVal(rmat2gr, "Convert rmat to binary gr"),
      clEnumVal(pbbs2vgr, "Convert pbbs graph to binary void gr"),
      clEnumVal(pbbs2gr, "Convert pbbs graph to binary gr"),
      clEnumVal(gr2bsml, "Convert binary gr to binary sparse MATLAB matrix"),
      clEnumVal(vgr2bsml, "Convert binary void gr to binary sparse MATLAB matrix"),
      clEnumVal(gr2dimacs, "Convert binary gr to dimacs"),
      clEnumVal(gr2pbbs, "Convert binary gr to pbbs"),
      clEnumValEnd), cll::init(dimacs2gr));

void convert_rmat2gr(const std::string& infilename, const std::string& outfilename) {
  typedef Galois::Graph::FirstGraph<uint32_t,int32_t,true> Graph;
  typedef Graph::GraphNode GNode;
  Graph graph;

  std::ifstream infile(infilename.c_str());
コード例 #5
0
ファイル: llvm-readobj.cpp プロジェクト: jamboree/llvm
namespace opts {
  cl::list<std::string> InputFilenames(cl::Positional,
    cl::desc("<input object files>"),
    cl::ZeroOrMore);

  // -all, -a
  cl::opt<bool>
      All("all",
          cl::desc("Equivalent to setting: --file-headers, --program-headers, "
                   "--section-headers, --symbols, --relocations, "
                   "--dynamic-table, --notes, --version-info, --unwind, "
                   "--section-groups and --elf-hash-histogram."));
  cl::alias AllShort("a", cl::desc("Alias for --all"), cl::aliasopt(All));

  // --headers -e
  cl::opt<bool>
      Headers("headers",
          cl::desc("Equivalent to setting: --file-headers, --program-headers, "
                   "--section-headers"));
  cl::alias HeadersShort("e", cl::desc("Alias for --headers"),
     cl::aliasopt(Headers));

  // -wide, -W
  cl::opt<bool>
      WideOutput("wide", cl::desc("Ignored for compatibility with GNU readelf"),
                 cl::Hidden);
  cl::alias WideOutputShort("W",
    cl::desc("Alias for --wide"),
    cl::aliasopt(WideOutput));

  // -file-headers, -file-header, -h
  cl::opt<bool> FileHeaders("file-headers",
    cl::desc("Display file headers "));
  cl::alias FileHeadersShort("h", cl::desc("Alias for --file-headers"),
                             cl::aliasopt(FileHeaders), cl::NotHidden);
  cl::alias FileHeadersSingular("file-header",
                                cl::desc("Alias for --file-headers"),
                                cl::aliasopt(FileHeaders));

  // -section-headers, -sections, -S
  // Also -s in llvm-readobj mode.
  cl::opt<bool> SectionHeaders("section-headers",
                               cl::desc("Display all section headers."));
  cl::alias SectionsShortUpper("S", cl::desc("Alias for --section-headers"),
                               cl::aliasopt(SectionHeaders), cl::NotHidden);
  cl::alias SectionHeadersAlias("sections",
                                cl::desc("Alias for --section-headers"),
                                cl::aliasopt(SectionHeaders), cl::NotHidden);

  // -section-relocations
  // Also -sr in llvm-readobj mode.
  cl::opt<bool> SectionRelocations("section-relocations",
    cl::desc("Display relocations for each section shown."));

  // -section-symbols
  // Also -st in llvm-readobj mode.
  cl::opt<bool> SectionSymbols("section-symbols",
    cl::desc("Display symbols for each section shown."));

  // -section-data
  // Also -sd in llvm-readobj mode.
  cl::opt<bool> SectionData("section-data",
    cl::desc("Display section data for each section shown."));

  // -section-mapping
  cl::opt<cl::boolOrDefault>
      SectionMapping("section-mapping",
                     cl::desc("Display the section to segment mapping."));

  // -relocations, -relocs, -r
  cl::opt<bool> Relocations("relocations",
    cl::desc("Display the relocation entries in the file"));
  cl::alias RelocationsShort("r", cl::desc("Alias for --relocations"),
                             cl::aliasopt(Relocations), cl::NotHidden);
  cl::alias RelocationsGNU("relocs", cl::desc("Alias for --relocations"),
                           cl::aliasopt(Relocations));

  // -notes, -n
  cl::opt<bool> Notes("notes", cl::desc("Display the ELF notes in the file"));
  cl::alias NotesShort("n", cl::desc("Alias for --notes"), cl::aliasopt(Notes));

  // -dyn-relocations
  cl::opt<bool> DynRelocs("dyn-relocations",
    cl::desc("Display the dynamic relocation entries in the file"));

  // -symbols
  // Also -s in llvm-readelf mode, or -t in llvm-readobj mode.
  cl::opt<bool>
      Symbols("symbols",
              cl::desc("Display the symbol table. Also display the dynamic "
                       "symbol table when using GNU output style for ELF"));
  cl::alias SymbolsGNU("syms", cl::desc("Alias for --symbols"),
                       cl::aliasopt(Symbols));

  // -dyn-symbols, -dyn-syms
  // Also -dt in llvm-readobj mode.
  cl::opt<bool> DynamicSymbols("dyn-symbols",
    cl::desc("Display the dynamic symbol table"));
  cl::alias DynSymsGNU("dyn-syms", cl::desc("Alias for --dyn-symbols"),
                       cl::aliasopt(DynamicSymbols));

  // -hash-symbols
  cl::opt<bool> HashSymbols(
      "hash-symbols",
      cl::desc("Display the dynamic symbols derived from the hash section"));

  // -unwind, -u
  cl::opt<bool> UnwindInfo("unwind",
    cl::desc("Display unwind information"));
  cl::alias UnwindInfoShort("u",
    cl::desc("Alias for --unwind"),
    cl::aliasopt(UnwindInfo));

  // -dynamic-table, -dynamic, -d
  cl::opt<bool> DynamicTable("dynamic-table",
    cl::desc("Display the ELF .dynamic section table"));
  cl::alias DynamicTableShort("d", cl::desc("Alias for --dynamic-table"),
                              cl::aliasopt(DynamicTable), cl::NotHidden);
  cl::alias DynamicTableAlias("dynamic", cl::desc("Alias for --dynamic-table"),
                              cl::aliasopt(DynamicTable));

  // -needed-libs
  cl::opt<bool> NeededLibraries("needed-libs",
    cl::desc("Display the needed libraries"));

  // -program-headers, -segments, -l
  cl::opt<bool> ProgramHeaders("program-headers",
    cl::desc("Display ELF program headers"));
  cl::alias ProgramHeadersShort("l", cl::desc("Alias for --program-headers"),
                                cl::aliasopt(ProgramHeaders), cl::NotHidden);
  cl::alias SegmentsAlias("segments", cl::desc("Alias for --program-headers"),
                          cl::aliasopt(ProgramHeaders));

  // -string-dump, -p
  cl::list<std::string> StringDump("string-dump", cl::desc("<number|name>"),
                                   cl::ZeroOrMore);
  cl::alias StringDumpShort("p", cl::desc("Alias for --string-dump"),
                            cl::aliasopt(StringDump));

  // -hex-dump, -x
  cl::list<std::string> HexDump("hex-dump", cl::desc("<number|name>"),
                                cl::ZeroOrMore);
  cl::alias HexDumpShort("x", cl::desc("Alias for --hex-dump"),
                         cl::aliasopt(HexDump));

  // -demangle, -C
  cl::opt<bool> Demangle("demangle",
                         cl::desc("Demangle symbol names in output"));
  cl::alias DemangleShort("C", cl::desc("Alias for --demangle"),
                          cl::aliasopt(Demangle), cl::NotHidden);

  // -hash-table
  cl::opt<bool> HashTable("hash-table",
    cl::desc("Display ELF hash table"));

  // -gnu-hash-table
  cl::opt<bool> GnuHashTable("gnu-hash-table",
    cl::desc("Display ELF .gnu.hash section"));

  // -expand-relocs
  cl::opt<bool> ExpandRelocs("expand-relocs",
    cl::desc("Expand each shown relocation to multiple lines"));

  // -raw-relr
  cl::opt<bool> RawRelr("raw-relr",
    cl::desc("Do not decode relocations in SHT_RELR section, display raw contents"));

  // -codeview
  cl::opt<bool> CodeView("codeview",
                         cl::desc("Display CodeView debug information"));

  // -codeview-merged-types
  cl::opt<bool>
      CodeViewMergedTypes("codeview-merged-types",
                          cl::desc("Display the merged CodeView type stream"));

  // -codeview-ghash
  cl::opt<bool> CodeViewEnableGHash(
      "codeview-ghash",
      cl::desc(
          "Enable global hashing for CodeView type stream de-duplication"));

  // -codeview-subsection-bytes
  cl::opt<bool> CodeViewSubsectionBytes(
      "codeview-subsection-bytes",
      cl::desc("Dump raw contents of codeview debug sections and records"));

  // -arm-attributes
  cl::opt<bool> ARMAttributes("arm-attributes",
                              cl::desc("Display the ARM attributes section"));

  // -mips-plt-got
  cl::opt<bool>
  MipsPLTGOT("mips-plt-got",
             cl::desc("Display the MIPS GOT and PLT GOT sections"));

  // -mips-abi-flags
  cl::opt<bool> MipsABIFlags("mips-abi-flags",
                             cl::desc("Display the MIPS.abiflags section"));

  // -mips-reginfo
  cl::opt<bool> MipsReginfo("mips-reginfo",
                            cl::desc("Display the MIPS .reginfo section"));

  // -mips-options
  cl::opt<bool> MipsOptions("mips-options",
                            cl::desc("Display the MIPS .MIPS.options section"));

  // -coff-imports
  cl::opt<bool>
  COFFImports("coff-imports", cl::desc("Display the PE/COFF import table"));

  // -coff-exports
  cl::opt<bool>
  COFFExports("coff-exports", cl::desc("Display the PE/COFF export table"));

  // -coff-directives
  cl::opt<bool>
  COFFDirectives("coff-directives",
                 cl::desc("Display the PE/COFF .drectve section"));

  // -coff-basereloc
  cl::opt<bool>
  COFFBaseRelocs("coff-basereloc",
                 cl::desc("Display the PE/COFF .reloc section"));

  // -coff-debug-directory
  cl::opt<bool>
  COFFDebugDirectory("coff-debug-directory",
                     cl::desc("Display the PE/COFF debug directory"));

  // -coff-resources
  cl::opt<bool> COFFResources("coff-resources",
                              cl::desc("Display the PE/COFF .rsrc section"));

  // -coff-load-config
  cl::opt<bool>
  COFFLoadConfig("coff-load-config",
                 cl::desc("Display the PE/COFF load config"));

  // -elf-linker-options
  cl::opt<bool>
  ELFLinkerOptions("elf-linker-options",
                   cl::desc("Display the ELF .linker-options section"));

  // -macho-data-in-code
  cl::opt<bool>
  MachODataInCode("macho-data-in-code",
                  cl::desc("Display MachO Data in Code command"));

  // -macho-indirect-symbols
  cl::opt<bool>
  MachOIndirectSymbols("macho-indirect-symbols",
                  cl::desc("Display MachO indirect symbols"));

  // -macho-linker-options
  cl::opt<bool>
  MachOLinkerOptions("macho-linker-options",
                  cl::desc("Display MachO linker options"));

  // -macho-segment
  cl::opt<bool>
  MachOSegment("macho-segment",
                  cl::desc("Display MachO Segment command"));

  // -macho-version-min
  cl::opt<bool>
  MachOVersionMin("macho-version-min",
                  cl::desc("Display MachO version min command"));

  // -macho-dysymtab
  cl::opt<bool>
  MachODysymtab("macho-dysymtab",
                  cl::desc("Display MachO Dysymtab command"));

  // -stackmap
  cl::opt<bool>
  PrintStackMap("stackmap",
                cl::desc("Display contents of stackmap section"));

  // -version-info, -V
  cl::opt<bool>
      VersionInfo("version-info",
                  cl::desc("Display ELF version sections (if present)"));
  cl::alias VersionInfoShort("V", cl::desc("Alias for -version-info"),
                             cl::aliasopt(VersionInfo));

  // -elf-section-groups, -section-groups, -g
  cl::opt<bool> SectionGroups("elf-section-groups",
                              cl::desc("Display ELF section group contents"));
  cl::alias SectionGroupsAlias("section-groups",
                               cl::desc("Alias for -elf-sections-groups"),
                               cl::aliasopt(SectionGroups));
  cl::alias SectionGroupsShort("g", cl::desc("Alias for -elf-sections-groups"),
                               cl::aliasopt(SectionGroups));

  // -elf-hash-histogram, -histogram, -I
  cl::opt<bool> HashHistogram(
      "elf-hash-histogram",
      cl::desc("Display bucket list histogram for hash sections"));
  cl::alias HashHistogramShort("I", cl::desc("Alias for -elf-hash-histogram"),
                               cl::aliasopt(HashHistogram));
  cl::alias HistogramAlias("histogram",
                           cl::desc("Alias for --elf-hash-histogram"),
                           cl::aliasopt(HashHistogram));

  // -elf-cg-profile
  cl::opt<bool> CGProfile("elf-cg-profile", cl::desc("Display callgraph profile section"));

  // -addrsig
  cl::opt<bool> Addrsig("addrsig",
                        cl::desc("Display address-significance table"));

  // -elf-output-style
  cl::opt<OutputStyleTy>
      Output("elf-output-style", cl::desc("Specify ELF dump style"),
             cl::values(clEnumVal(LLVM, "LLVM default style"),
                        clEnumVal(GNU, "GNU readelf style")),
             cl::init(LLVM));
} // namespace opts
コード例 #6
0
ファイル: llvm-readobj.cpp プロジェクト: zhmz90/llvm
namespace opts {
cl::list<std::string> InputFilenames(cl::Positional,
                                     cl::desc("<input object files>"),
                                     cl::ZeroOrMore);

// -file-headers, -h
cl::opt<bool> FileHeaders("file-headers",
                          cl::desc("Display file headers "));
cl::alias FileHeadersShort("h",
                           cl::desc("Alias for --file-headers"),
                           cl::aliasopt(FileHeaders));

// -sections, -s
cl::opt<bool> Sections("sections",
                       cl::desc("Display all sections."));
cl::alias SectionsShort("s",
                        cl::desc("Alias for --sections"),
                        cl::aliasopt(Sections));

// -section-relocations, -sr
cl::opt<bool> SectionRelocations("section-relocations",
                                 cl::desc("Display relocations for each section shown."));
cl::alias SectionRelocationsShort("sr",
                                  cl::desc("Alias for --section-relocations"),
                                  cl::aliasopt(SectionRelocations));

// -section-symbols, -st
cl::opt<bool> SectionSymbols("section-symbols",
                             cl::desc("Display symbols for each section shown."));
cl::alias SectionSymbolsShort("st",
                              cl::desc("Alias for --section-symbols"),
                              cl::aliasopt(SectionSymbols));

// -section-data, -sd
cl::opt<bool> SectionData("section-data",
                          cl::desc("Display section data for each section shown."));
cl::alias SectionDataShort("sd",
                           cl::desc("Alias for --section-data"),
                           cl::aliasopt(SectionData));

// -relocations, -r
cl::opt<bool> Relocations("relocations",
                          cl::desc("Display the relocation entries in the file"));
cl::alias RelocationsShort("r",
                           cl::desc("Alias for --relocations"),
                           cl::aliasopt(Relocations));

// -dyn-relocations
cl::opt<bool> DynRelocs("dyn-relocations",
                        cl::desc("Display the dynamic relocation entries in the file"));

// -symbols, -t
cl::opt<bool> Symbols("symbols",
                      cl::desc("Display the symbol table"));
cl::alias SymbolsShort("t",
                       cl::desc("Alias for --symbols"),
                       cl::aliasopt(Symbols));

// -dyn-symbols, -dt
cl::opt<bool> DynamicSymbols("dyn-symbols",
                             cl::desc("Display the dynamic symbol table"));
cl::alias DynamicSymbolsShort("dt",
                              cl::desc("Alias for --dyn-symbols"),
                              cl::aliasopt(DynamicSymbols));

// -unwind, -u
cl::opt<bool> UnwindInfo("unwind",
                         cl::desc("Display unwind information"));
cl::alias UnwindInfoShort("u",
                          cl::desc("Alias for --unwind"),
                          cl::aliasopt(UnwindInfo));

// -dynamic-table
cl::opt<bool> DynamicTable("dynamic-table",
                           cl::desc("Display the ELF .dynamic section table"));

// -needed-libs
cl::opt<bool> NeededLibraries("needed-libs",
                              cl::desc("Display the needed libraries"));

// -program-headers
cl::opt<bool> ProgramHeaders("program-headers",
                             cl::desc("Display ELF program headers"));

// -hash-table
cl::opt<bool> HashTable("hash-table",
                        cl::desc("Display ELF hash table"));

// -gnu-hash-table
cl::opt<bool> GnuHashTable("gnu-hash-table",
                           cl::desc("Display ELF .gnu.hash section"));

// -expand-relocs
cl::opt<bool> ExpandRelocs("expand-relocs",
                           cl::desc("Expand each shown relocation to multiple lines"));

// -codeview
cl::opt<bool> CodeView("codeview",
                       cl::desc("Display CodeView debug information"));

// -codeview-subsection-bytes
cl::opt<bool> CodeViewSubsectionBytes(
    "codeview-subsection-bytes",
    cl::desc("Dump raw contents of codeview debug sections and records"));

// -arm-attributes, -a
cl::opt<bool> ARMAttributes("arm-attributes",
                            cl::desc("Display the ARM attributes section"));
cl::alias ARMAttributesShort("-a", cl::desc("Alias for --arm-attributes"),
                             cl::aliasopt(ARMAttributes));

// -mips-plt-got
cl::opt<bool>
MipsPLTGOT("mips-plt-got",
           cl::desc("Display the MIPS GOT and PLT GOT sections"));

// -mips-abi-flags
cl::opt<bool> MipsABIFlags("mips-abi-flags",
                           cl::desc("Display the MIPS.abiflags section"));

// -mips-reginfo
cl::opt<bool> MipsReginfo("mips-reginfo",
                          cl::desc("Display the MIPS .reginfo section"));

// -mips-options
cl::opt<bool> MipsOptions("mips-options",
                          cl::desc("Display the MIPS .MIPS.options section"));

// -coff-imports
cl::opt<bool>
COFFImports("coff-imports", cl::desc("Display the PE/COFF import table"));

// -coff-exports
cl::opt<bool>
COFFExports("coff-exports", cl::desc("Display the PE/COFF export table"));

// -coff-directives
cl::opt<bool>
COFFDirectives("coff-directives",
               cl::desc("Display the PE/COFF .drectve section"));

// -coff-basereloc
cl::opt<bool>
COFFBaseRelocs("coff-basereloc",
               cl::desc("Display the PE/COFF .reloc section"));

// -macho-data-in-code
cl::opt<bool>
MachODataInCode("macho-data-in-code",
                cl::desc("Display MachO Data in Code command"));

// -macho-indirect-symbols
cl::opt<bool>
MachOIndirectSymbols("macho-indirect-symbols",
                     cl::desc("Display MachO indirect symbols"));

// -macho-linker-options
cl::opt<bool>
MachOLinkerOptions("macho-linker-options",
                   cl::desc("Display MachO linker options"));

// -macho-segment
cl::opt<bool>
MachOSegment("macho-segment",
             cl::desc("Display MachO Segment command"));

// -macho-version-min
cl::opt<bool>
MachOVersionMin("macho-version-min",
                cl::desc("Display MachO version min command"));

// -macho-dysymtab
cl::opt<bool>
MachODysymtab("macho-dysymtab",
              cl::desc("Display MachO Dysymtab command"));

// -stackmap
cl::opt<bool>
PrintStackMap("stackmap",
              cl::desc("Display contents of stackmap section"));

// -version-info
cl::opt<bool>
VersionInfo("version-info",
            cl::desc("Display ELF version sections (if present)"));
cl::alias VersionInfoShort("V", cl::desc("Alias for -version-info"),
                           cl::aliasopt(VersionInfo));

cl::opt<bool> SectionGroups("elf-section-groups",
                            cl::desc("Display ELF section group contents"));
cl::alias SectionGroupsShort("g", cl::desc("Alias for -elf-sections-groups"),
                             cl::aliasopt(SectionGroups));
cl::opt<bool> HashHistogram(
    "elf-hash-histogram",
    cl::desc("Display bucket list histogram for hash sections"));
cl::alias HashHistogramShort("I", cl::desc("Alias for -elf-hash-histogram"),
                             cl::aliasopt(HashHistogram));

cl::opt<OutputStyleTy>
Output("elf-output-style", cl::desc("Specify ELF dump style"),
       cl::values(clEnumVal(LLVM, "LLVM default style"),
                  clEnumVal(GNU, "GNU readelf style"), clEnumValEnd),
       cl::init(LLVM));
} // namespace opts
コード例 #7
0
ファイル: Preflowpush.cpp プロジェクト: nikunjy/parallelStuff
const char* url = "preflow_push";

enum DetAlgo {
  nondet,
  detBase,
  detDisjoint
};

static cll::opt<std::string> filename(cll::Positional, cll::desc("<input file>"), cll::Required);
static cll::opt<uint32_t> sourceId(cll::Positional, cll::desc("sourceID"), cll::Required);
static cll::opt<uint32_t> sinkId(cll::Positional, cll::desc("sinkID"), cll::Required);
static cll::opt<bool> useHLOrder("useHLOrder", cll::desc("Use HL ordering heuristic"), cll::init(false));
static cll::opt<int> relabelInt("relabel", cll::desc("relabel interval: < 0 no relabeling, 0 use default interval, > 0 relabel every X iterations"), cll::init(0));
static cll::opt<DetAlgo> detAlgo(cll::desc("Deterministic algorithm:"),
    cll::values(
      clEnumVal(nondet, "Non-deterministic"),
      clEnumVal(detBase, "Base execution"),
      clEnumVal(detDisjoint, "Disjoint execution"),
      clEnumValEnd), cll::init(nondet));

/**
 * Alpha parameter the original Goldberg algorithm to control when global
 * relabeling occurs. For comparison purposes, we keep them the same as
 * before, but it is possible to achieve much better performance by adjusting
 * the global relabel frequency.
 */
const int ALPHA = 6;

/**
 * Beta parameter the original Goldberg algorithm to control when global
 * relabeling occurs. For comparison purposes, we keep them the same as
コード例 #8
0
ファイル: main.cpp プロジェクト: harlanhaskins/Letter
//  Copyright © 2015 Harlan Haskins. All rights reserved.
//

#include <stdio.h>
#include <iostream>
#include <fstream>
#include <vector>
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/CommandLine.h"
#include "Driver.hpp"

cl::opt<std::string> filename(cl::Positional, cl::desc("<input file>"), cl::Required);
cl::opt<bool> emitAST("emit-ast", cl::desc("Emit the AST to stdout"));
cl::opt<OptimizationLevel> optimizationLevel(cl::desc("Choose optimization level:"),
                                    cl::values(
                                               clEnumVal(None , "No optimizations, enable debugging"),
                                               clEnumVal(O1, "Enable trivial optimizations"),
                                               clEnumVal(O2, "Enable default optimizations"),
                                               clEnumVal(O3, "Enable expensive optimizations"),
                                               clEnumValEnd));
cl::opt<bool> emitIR("emit-llvm", cl::desc("Emit the generated LLVM IR to stdout"));

int main(int argc, const char * argv[]) {
    cl::ParseCommandLineOptions(argc, argv);
    
    std::ifstream file(filename, std::iostream::binary | std::iostream::ate);
    if (!file) {
        std::cerr << "Could not open file \"" + filename + "\"" << std::endl;
        return EXIT_FAILURE;
    }
    std::streamsize size = file.tellg();
コード例 #9
0
ファイル: Cholesky.cpp プロジェクト: Surtr04/UT_Internship
const char* name = "Cholesky Factorization";
const char* desc = "Compute the Cholesky factorization of a graph";
const char* url = NULL;

enum Ordering {
  sequential,
  leastdegree,
  pointless
};

static cll::opt<std::string> inputFilename(cll::Positional, cll::desc("<graph file>"), cll::Required);
static cll::opt<Ordering> ordering("ordering",
                                   cll::desc("Graph traversal order:"),
    cll::values(
      clEnumVal(sequential, "Sequential ordering"),
      clEnumVal(leastdegree, "Least-degree ordering"),
      clEnumVal(pointless, "1,6,4,5,0,3,7,2;9,... ordering"),
      clEnumValEnd), cll::init(leastdegree));

struct Node {
  unsigned id;
  bool seen;
  Node(): seen(false) { };
};

// WARNING: Will silently behave oddly when given wrong data type
typedef double edgedata;
//typedef float edgedata;

// LC_Linear_Graph cannot have structure modified; not suitable for
コード例 #10
0
ファイル: llvm-pdbdump.cpp プロジェクト: OpenKimono/llvm
namespace opts {

enum class PDB_DumpType { ByType, ByObjFile, Both };

cl::list<std::string> InputFilenames(cl::Positional,
                                     cl::desc("<input PDB files>"),
                                     cl::OneOrMore);

cl::OptionCategory TypeCategory("Symbol Type Options");
cl::OptionCategory FilterCategory("Filtering Options");
cl::OptionCategory OtherOptions("Other Options");
cl::OptionCategory NativeOptions("Native Options");

cl::opt<bool> Compilands("compilands", cl::desc("Display compilands"),
                         cl::cat(TypeCategory));
cl::opt<bool> Symbols("symbols", cl::desc("Display symbols for each compiland"),
                      cl::cat(TypeCategory));
cl::opt<bool> Globals("globals", cl::desc("Dump global symbols"),
                      cl::cat(TypeCategory));
cl::opt<bool> Externals("externals", cl::desc("Dump external symbols"),
                        cl::cat(TypeCategory));
cl::opt<bool> Types("types", cl::desc("Display types"), cl::cat(TypeCategory));
cl::opt<bool> Lines("lines", cl::desc("Line tables"), cl::cat(TypeCategory));
cl::opt<bool>
    All("all", cl::desc("Implies all other options in 'Symbol Types' category"),
        cl::cat(TypeCategory));

cl::opt<uint64_t> LoadAddress(
    "load-address",
    cl::desc("Assume the module is loaded at the specified address"),
    cl::cat(OtherOptions));

cl::opt<OutputStyleTy>
    RawOutputStyle("raw-output-style", cl::desc("Specify dump outpout style"),
                   cl::values(clEnumVal(LLVM, "LLVM default style"),
                              clEnumVal(YAML, "YAML style"), clEnumValEnd),
                   cl::init(LLVM), cl::cat(NativeOptions));

cl::opt<bool> DumpHeaders("raw-headers", cl::desc("dump PDB headers"),
                          cl::cat(NativeOptions));
cl::opt<bool> DumpStreamBlocks("raw-stream-blocks",
                               cl::desc("dump PDB stream blocks"),
                               cl::cat(NativeOptions));
cl::opt<bool> DumpStreamSummary("raw-stream-summary",
                                cl::desc("dump summary of the PDB streams"),
                                cl::cat(NativeOptions));
cl::opt<bool>
    DumpTpiRecords("raw-tpi-records",
                   cl::desc("dump CodeView type records from TPI stream"),
                   cl::cat(NativeOptions));
cl::opt<bool> DumpTpiRecordBytes(
    "raw-tpi-record-bytes",
    cl::desc("dump CodeView type record raw bytes from TPI stream"),
    cl::cat(NativeOptions));
cl::opt<bool> DumpTpiHash("raw-tpi-hash",
                          cl::desc("dump CodeView TPI hash stream"),
                          cl::cat(NativeOptions));
cl::opt<bool>
    DumpIpiRecords("raw-ipi-records",
                   cl::desc("dump CodeView type records from IPI stream"),
                   cl::cat(NativeOptions));
cl::opt<bool> DumpIpiRecordBytes(
    "raw-ipi-record-bytes",
    cl::desc("dump CodeView type record raw bytes from IPI stream"),
    cl::cat(NativeOptions));
cl::opt<std::string> DumpStreamDataIdx("raw-stream",
                                       cl::desc("dump stream data"),
                                       cl::cat(NativeOptions));
cl::opt<std::string> DumpStreamDataName("raw-stream-name",
                                        cl::desc("dump stream data"),
                                        cl::cat(NativeOptions));
cl::opt<bool> DumpModules("raw-modules", cl::desc("dump compiland information"),
                          cl::cat(NativeOptions));
cl::opt<bool> DumpModuleFiles("raw-module-files",
                              cl::desc("dump file information"),
                              cl::cat(NativeOptions));
cl::opt<bool> DumpModuleSyms("raw-module-syms", cl::desc("dump module symbols"),
                             cl::cat(NativeOptions));
cl::opt<bool> DumpPublics("raw-publics", cl::desc("dump Publics stream data"),
                          cl::cat(NativeOptions));
cl::opt<bool> DumpSectionContribs("raw-section-contribs",
                                  cl::desc("dump section contributions"),
                                  cl::cat(NativeOptions));
cl::opt<bool> DumpLineInfo("raw-line-info",
                           cl::desc("dump file and line information"),
                           cl::cat(NativeOptions));
cl::opt<bool> DumpSectionMap("raw-section-map", cl::desc("dump section map"),
                             cl::cat(NativeOptions));
cl::opt<bool>
    DumpSymRecordBytes("raw-sym-record-bytes",
                       cl::desc("dump CodeView symbol record raw bytes"),
                       cl::cat(NativeOptions));
cl::opt<bool> DumpSectionHeaders("raw-section-headers",
                                 cl::desc("dump section headers"),
                                 cl::cat(NativeOptions));
cl::opt<bool> DumpFpo("raw-fpo", cl::desc("dump FPO records"),
                      cl::cat(NativeOptions));

cl::opt<bool>
    RawAll("raw-all",
           cl::desc("Implies most other options in 'Native Options' category"),
           cl::cat(NativeOptions));

cl::list<std::string>
    ExcludeTypes("exclude-types",
                 cl::desc("Exclude types by regular expression"),
                 cl::ZeroOrMore, cl::cat(FilterCategory));
cl::list<std::string>
    ExcludeSymbols("exclude-symbols",
                   cl::desc("Exclude symbols by regular expression"),
                   cl::ZeroOrMore, cl::cat(FilterCategory));
cl::list<std::string>
    ExcludeCompilands("exclude-compilands",
                      cl::desc("Exclude compilands by regular expression"),
                      cl::ZeroOrMore, cl::cat(FilterCategory));

cl::list<std::string> IncludeTypes(
    "include-types",
    cl::desc("Include only types which match a regular expression"),
    cl::ZeroOrMore, cl::cat(FilterCategory));
cl::list<std::string> IncludeSymbols(
    "include-symbols",
    cl::desc("Include only symbols which match a regular expression"),
    cl::ZeroOrMore, cl::cat(FilterCategory));
cl::list<std::string> IncludeCompilands(
    "include-compilands",
    cl::desc("Include only compilands those which match a regular expression"),
    cl::ZeroOrMore, cl::cat(FilterCategory));

cl::opt<bool> ExcludeCompilerGenerated(
    "no-compiler-generated",
    cl::desc("Don't show compiler generated types and symbols"),
    cl::cat(FilterCategory));
cl::opt<bool>
    ExcludeSystemLibraries("no-system-libs",
                           cl::desc("Don't show symbols from system libraries"),
                           cl::cat(FilterCategory));
cl::opt<bool> NoClassDefs("no-class-definitions",
                          cl::desc("Don't display full class definitions"),
                          cl::cat(FilterCategory));
cl::opt<bool> NoEnumDefs("no-enum-definitions",
                         cl::desc("Don't display full enum definitions"),
                         cl::cat(FilterCategory));
}
コード例 #11
0
ファイル: graph-stats.cpp プロジェクト: nikunjy/parallelStuff
#include "llvm/Support/CommandLine.h"

#include <iostream>
#include <vector>

namespace cll = llvm::cl;

enum StatMode {
  summary,
  degrees
};

static cll::opt<std::string> inputfilename(cll::Positional, cll::desc("<graph file>"), cll::Required);
static cll::list<StatMode> statModeList(cll::desc("Available stats:"),
    cll::values(
      clEnumVal(summary, "Graph summary"),
      clEnumVal(degrees, "Node degrees"),
      clEnumValEnd));

typedef Galois::Graph::FileGraph Graph;
typedef Graph::GraphNode GNode;
Graph graph;

void do_summary() {
  std::cout << "NumNodes: " << graph.size() << "\n";
  std::cout << "NumEdges: " << graph.sizeEdges() << "\n";
}

void do_degrees() {
  for (Graph::iterator ii = graph.begin(), ei = graph.end(); ii != ei; ++ii) {
    std::cout << std::distance(graph.neighbor_begin(*ii), graph.neighbor_end(*ii)) << "\n";
コード例 #12
0
namespace cll = llvm::cl;

const char* name = "Numeric Cholesky Factorization";
const char* desc = "Compute the numeric cholesky factorization of a filled graph";
const char* url = NULL;

enum Algo {
  demo//,
  //asynchronous
};

static cll::opt<std::string> inputFilename(cll::Positional, cll::desc("<filled graph file>"), cll::Required);
static cll::opt<std::string> depFilename(cll::Positional, cll::desc("<dependency graph file>"), cll::Required);
static cll::opt<Algo> algo("algo", cll::desc("Choose an algorithm:"),
    cll::values(
      clEnumVal(demo, "Demonstration algorithm"),
      //clEnumVal(asynchronous, "Asynchronous"),
      clEnumValEnd), cll::init(demo));

struct Node {
  unsigned id;
  int seen;
  Node(): seen(0) { };
};

// WARNING: Will silently behave oddly when given wrong data type
typedef double edgedata;
//typedef float edgedata;

typedef Galois::Graph::LC_Linear_Graph<Node,edgedata>::with_numa_alloc<true>::type Graph;