Ignore:
Timestamp:
Jul 19, 2015, 3:34:52 PM (4 years ago)
Author:
nmedfort
Message:

Minor simplification of generate_predefined_ucd_functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/generate_predefined_ucd_functions.cpp

    r4684 r4685  
    4848UCDSourcePath("dir", cl::desc("UCD source code directory"), cl::value_desc("directory"), cl::Required);
    4949
    50 static cl::opt<std::string>
    51 UCDLibraryPath("lib", cl::desc("Static UCD library path"), cl::value_desc("filename"), cl::Required);
    52 
    5350#ifdef ENABLE_MULTIPLEXING
    5451static cl::opt<bool> EnableMultiplexing("multiplexing", cl::init(false),
     
    7673    if (EnableMultiplexing) {
    7774        AutoMultiplexing::optimize(function);
     75        Simplifier::optimize(function);
    7876    }
    7977    #endif
     
    223221    }
    224222
    225     auto MCPU = llvm::sys::getHostCPUName();
    226 
    227223    TargetOptions Options;
    228224
    229225    std::unique_ptr<TargetMachine> Target(
    230                 TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, "", Options,
     226                TheTarget->createTargetMachine(TheTriple.getTriple(), sys::getHostCPUName(), "", Options,
    231227                                               Reloc::Default, CodeModel::Small, CodeGenOpt::Aggressive));
    232228
     
    237233    #ifdef USE_LLVM_3_5
    238234    std::string error;
    239     std::unique_ptr<tool_output_file> Out = make_unique<tool_output_file>(ObjectFilename.c_str(), error, sys::fs::F_None);
     235    std::unique_ptr<tool_output_file> out = make_unique<tool_output_file>(ObjectFilename.c_str(), error, sys::fs::F_None);
    240236    if (!error.empty()) {
    241237        throw std::runtime_error(error);
     
    243239    #else
    244240    std::error_code error;
    245     std::unique_ptr<tool_output_file> Out = make_unique<tool_output_file>(ObjectFilename, error, sys::fs::F_None);
     241    std::unique_ptr<tool_output_file> out = make_unique<tool_output_file>(ObjectFilename, error, sys::fs::F_None);
    246242    if (error) {
    247243        throw std::runtime_error(error.message());
     
    273269    PM.add(createSinkingPass());
    274270
    275     formatted_raw_ostream FOS(Out->os());
     271    formatted_raw_ostream FOS(out->os());
    276272    // Ask the target to add backend passes as necessary.
    277273    if (Target->addPassesToEmitFile(PM, FOS, TargetMachine::CGFT_ObjectFile)) {
     
    281277    PM.run(*module);
    282278
    283     Out->keep();
     279    out->keep();
    284280}
    285281
Note: See TracChangeset for help on using the changeset viewer.