Changeset 6030


Ignore:
Timestamp:
May 11, 2018, 9:40:16 PM (3 months ago)
Author:
cameron
Message:

Eliminate dependency on llvm/CodeGen/CommandFlags.h

Location:
icGREP/icgrep-devel/icgrep/toolchain
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/toolchain/cpudriver.cpp

    r5995 r6030  
    8686    builder.setEngineKind(EngineKind::JIT);
    8787#endif
    88     builder.setTargetOptions(codegen::Options);
     88    builder.setTargetOptions(codegen::target_Options);
    8989    builder.setOptLevel(codegen::OptLevel);
    9090
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.cpp

    r5930 r6030  
    88#include <pablo/pablo_toolchain.h>
    99#include <UCD/UCD_Config.h>
    10 #include <llvm/CodeGen/CommandFlags.h>
     10#include <llvm/Support/CommandLine.h>
    1111#include <llvm/Support/raw_ostream.h>
    1212
     
    117117unsigned GroupNum;
    118118
    119 const llvm::Reloc::Model RelocModel = ::RelocModel;
    120 
    121 const llvm::CodeModel::Model CMModel = ::CMModel;
    122 
    123 const std::string MArch = ::MArch;
    124 
    125 const llvm::TargetMachine::CodeGenFileType FileType = ::FileType;
    126 
    127 TargetOptions Options;
     119TargetOptions target_Options;
    128120
    129121const cl::OptionCategory * LLVM_READONLY codegen_flags() {
     
    135127}
    136128
    137 std::string getCPUStr() {
    138     return ::getCPUStr();
    139 }
    140 
    141 std::string getFeaturesStr() {
    142     return ::getFeaturesStr();
    143 }
    144 
    145 void setFunctionAttributes(llvm::StringRef CPU, llvm::StringRef Features, llvm::Module &M) {
    146     return ::setFunctionAttributes(CPU, Features, M);
    147 }
    148129
    149130std::string ProgramName;
     
    163144    }
    164145    ObjectCacheDir = ObjectCacheDirOption.empty() ? nullptr : ObjectCacheDirOption.data();
    165     Options = InitTargetOptionsFromCodeGenFlags();
    166146#if LLVM_VERSION_INTEGER >= LLVM_VERSION_CODE(3, 7, 0)
    167     Options.MCOptions.AsmVerbose = true;
     147    target_Options.MCOptions.AsmVerbose = true;
    168148#endif
    169149    switch (OptLevelOption) {
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.h

    r5841 r6030  
    11/*
    2  *  Copyright (c) 2017 International Characters.
     2 *  Copyright (c) 2018 International Characters.
    33 *  This software is licensed to the public under the Open Software License 3.0.
    44 *  icgrep is a trademark of International Characters.
     
    2323#define CL_ENUM_VAL_SENTINEL
    2424#endif
    25 
    26 // FIXME: llvm/CodeGen/CommandFlags.h can only be included once or the various cl::opt causes multiple definition
    27 // errors. To bypass for now, the relevant options and functions are accessible from here. Re-evaluate with later
    28 // versions of LLVM.
    2925
    3026namespace llvm { namespace cl { class OptionCategory; } }
     
    6864extern unsigned GroupNum;
    6965extern std::string ProgramName;
    70 extern llvm::TargetOptions Options;
    71 extern const llvm::Reloc::Model RelocModel;
    72 extern const llvm::CodeModel::Model CMModel;
    73 extern const std::string MArch;
    74 extern const std::string RunPass;
    75 extern const llvm::TargetMachine::CodeGenFileType FileType;
    76 extern const std::string StopAfter;
    77 extern const std::string StartAfter;
    78 
    79 std::string getCPUStr();
    80 std::string getFeaturesStr();
    81 void setFunctionAttributes(llvm::StringRef CPU, llvm::StringRef Features, llvm::Module &M);
     66extern llvm::TargetOptions target_Options;
    8267
    8368void ParseCommandLineOptions(int argc, const char *const *argv, std::initializer_list<const llvm::cl::OptionCategory *> hiding = {});
Note: See TracChangeset for help on using the changeset viewer.