Ignore:
Timestamp:
Jul 13, 2015, 10:18:31 PM (4 years ago)
Author:
nmedfort
Message:

UCD generator working but yet incorporated into icGrep.

File:
1 edited

Legend:

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

    r4665 r4666  
    3333#include <llvm/Target/TargetSubtargetInfo.h>
    3434#include <llvm/Support/FormattedStream.h>
    35 
    3635#include "llvm/Support/FileSystem.h"
     36#include <llvm/Transforms/Scalar.h>
     37
    3738
    3839#include <boost/algorithm/string/case_conv.hpp>
     
    118119    Triple TheTriple;
    119120
    120     if (TheTriple.getTriple().empty()) {
    121         TheTriple.setTriple(sys::getDefaultTargetTriple());
    122     }
     121    // Initialize targets first, so that --version shows registered targets.
     122    InitializeAllTargets();
     123    InitializeAllTargetMCs();
     124    InitializeAllAsmPrinters();
     125    InitializeAllAsmParsers();
     126
     127
     128    TheTriple.setTriple(sys::getDefaultTargetTriple());
    123129
    124130    // Get the target specific parser.
     
    140146    if (Target == nullptr) {
    141147        throw std::runtime_error("Could not allocate target machine!");
     148    }
     149
     150    if (OutputFilename.empty()) {
     151        OutputFilename = "ucd.o";
    142152    }
    143153
     
    174184    }
    175185    PM.add(new DataLayoutPass());
     186    PM.add(createReassociatePass());
     187    PM.add(createInstructionCombiningPass());
     188    PM.add(createSinkingPass());
    176189
    177190    formatted_raw_ostream FOS(Out->os());
Note: See TracChangeset for help on using the changeset viewer.