Changeset 5732


Ignore:
Timestamp:
Nov 11, 2017, 6:12:46 PM (19 months ago)
Author:
cameron
Message:

More changes in preparation for LLVM 3.9, 4.0

Location:
icGREP/icgrep-devel/icgrep
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_builder.cpp

    r5730 r5732  
    487487// full shift producing {shiftout, shifted}
    488488std::pair<Value *, Value *> IDISA_Builder::bitblock_indexed_advance(Value * strm, Value * index_strm, Value * shiftIn, unsigned shiftAmount) {
    489     Value * popcount_f = Intrinsic::getDeclaration(getModule(), Intrinsic::ctpop, getSizeTy());
    490489    unsigned bitWidth = sizeof(size_t) * 8;
    491490    Type * iBitBlock = getIntNTy(getBitBlockWidth());
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5726 r5732  
    7878
    7979void GrepEngine::initFileResult(std::vector<std::string> & filenames) {
    80     const int n = filenames.size();
     80    const unsigned n = filenames.size();
    8181    mResultStrs.resize(n);
    8282    for (unsigned i = 0; i < n; i++) {
  • icGREP/icgrep-devel/icgrep/grep_interface.cpp

    r5705 r5732  
    3535        clEnumValN(re::RE_Syntax::BRE, "basic-regexp", "Alias for -G"),
    3636        clEnumValN(re::RE_Syntax::PCRE, "perl-regexp", "Alias for -P"),
    37         clEnumValN(re::RE_Syntax::PROSITE, "PROSITE", "PROSITE protein patterns syntax"),
    38         clEnumValEnd), cl::cat(RE_Options), cl::Grouping, cl::location(RegexpSyntax), cl::init(re::RE_Syntax::PCRE));
     37        clEnumValN(re::RE_Syntax::PROSITE, "PROSITE", "PROSITE protein patterns syntax")
     38        CL_ENUM_VAL_SENTINEL), cl::cat(RE_Options), cl::Grouping, cl::location(RegexpSyntax), cl::init(re::RE_Syntax::PCRE));
    3939
    4040bool IgnoreCaseFlag;
     
    110110static cl::opt<DevDirAction, true> DevicesOption("D", cl::desc("Processing mode for devices:"),
    111111                                                 cl::values(clEnumValN(Read, "read", "Treat devices as files to be searched."),
    112                                                             clEnumValN(Skip, "skip", "Silently skip devices."),
    113                                                             clEnumValEnd), cl::cat(Input_Options), cl::location(DevicesFlag), cl::init(Read));
     112                                                            clEnumValN(Skip, "skip", "Silently skip devices.")
     113                                                            CL_ENUM_VAL_SENTINEL), cl::cat(Input_Options), cl::location(DevicesFlag), cl::init(Read));
    114114static cl::alias DevicesAlias("devices", cl::desc("Alias for -D"), cl::aliasopt(DevicesOption));
    115115
     
    118118                                                     cl::values(clEnumValN(Read, "read", "Print an error message for any listed directories."),
    119119                                                                clEnumValN(Skip, "skip", "Silently skip directories."),
    120                                                                 clEnumValN(Recurse, "recurse", "Recursive process directories, equivalent to -r."),
    121                                                                 clEnumValEnd), cl::cat(Input_Options), cl::location(DirectoriesFlag), cl::init(Read));
     120                                                                clEnumValN(Recurse, "recurse", "Recursive process directories, equivalent to -r.")
     121                                                                CL_ENUM_VAL_SENTINEL), cl::cat(Input_Options), cl::location(DirectoriesFlag), cl::init(Read));
    122122static cl::alias DirectoriesAlias("directories", cl::desc("Alias for -d"), cl::aliasopt(DirectoriesOption));
    123123
     
    126126                                                     cl::values(clEnumValN(Binary, "binary", "Report match/non-match without printing matches."),
    127127                                                                clEnumValN(WithoutMatch, "without-match", "Always report as non-matching."),
    128                                                                 clEnumValN(Text, "text", "Treat binary files as text."),
    129                                                                 clEnumValEnd), cl::cat(Input_Options), cl::location(BinaryFilesFlag), cl::init(Binary));
     128                                                                clEnumValN(Text, "text", "Treat binary files as text.")
     129                                                                CL_ENUM_VAL_SENTINEL), cl::cat(Input_Options), cl::location(BinaryFilesFlag), cl::init(Binary));
    130130   
    131131/*
     
    148148        clEnumValN(FilesWithoutMatch, "files-without-match", "Alias for -L"),
    149149        clEnumValN(QuietMode, "quiet", "Alias for -q"),
    150         clEnumValN(QuietMode, "silent", "Alias for -q"),
    151         clEnumValEnd), cl::cat(Output_Options), cl::Grouping, cl::location(Mode), cl::init(NormalMode));
     150        clEnumValN(QuietMode, "silent", "Alias for -q")
     151        CL_ENUM_VAL_SENTINEL), cl::cat(Output_Options), cl::Grouping, cl::location(Mode), cl::init(NormalMode));
    152152
    153153bool NoMessagesFlag;
     
    216216                                 cl::values(clEnumValN(alwaysColor, "always", "Enable colorization"),
    217217                                            clEnumValN(autoColor,   "auto", "Colorize output to stdout"),
    218                                             clEnumValN(neverColor,  "never", "Disable colorization"),
    219                                             clEnumValEnd));
     218                                            clEnumValN(neverColor,  "never", "Disable colorization")
     219                                            CL_ENUM_VAL_SENTINEL));
    220220static cl::alias ColorAlias("colour", cl::desc("Alias for -color"), cl::aliasopt(Color));
    221221//
  • icGREP/icgrep-devel/icgrep/kernels/kernel.cpp

    r5721 r5732  
    1313#include <llvm/IR/Module.h>
    1414#include <llvm/Support/raw_ostream.h>
     15#if LLVM_VERSION_INTEGER < LLVM_4_0_0
    1516#include <llvm/Bitcode/ReaderWriter.h>
     17#else
     18#include <llvm/Bitcode/BitcodeWriter.h>
     19#endif
    1620#include <llvm/Transforms/Utils/Local.h>
    1721#include <kernels/streamset.h>
  • icGREP/icgrep-devel/icgrep/pablo/pablo_toolchain.cpp

    r5620 r5732  
    55 */
    66
     7#include <toolchain/toolchain.h>
    78#include "pablo_toolchain.h"
    89#include <pablo/pablo_kernel.h>
     
    3334                        clEnumVal(ShowOptimizedPablo, "Print optimizeed Pablo code"),
    3435                        clEnumVal(VerifyPablo, "Run the Pablo verifier"),
    35                         clEnumVal(DumpTrace, "Generate dynamic traces of executed Pablo assignments."),                       
    36                         clEnumValEnd), cl::cat(PabloOptions));
     36                        clEnumVal(DumpTrace, "Generate dynamic traces of executed Pablo assignments.")
     37                        CL_ENUM_VAL_SENTINEL), cl::cat(PabloOptions));
    3738   
    3839static cl::opt<std::string> PabloOutputFilename("print-pablo-output", cl::init(""), cl::desc("output Pablo filename"), cl::cat(PabloOptions));
     
    4445                                         clEnumVal(EnableDistribution, "Apply distribution law optimization."),                                         
    4546                                         clEnumVal(EnableSchedulingPrePass, "Pablo Statement Scheduling Pre-Pass"),
    46                                          clEnumVal(EnableProfiling, "Profile branch statistics."),
    47                                          clEnumValEnd), cl::cat(PabloOptions));
     47                                         clEnumVal(EnableProfiling, "Profile branch statistics.")
     48                                         CL_ENUM_VAL_SENTINEL), cl::cat(PabloOptions));
    4849
    4950bool DebugOptionIsSet(const PabloDebugFlags flag) {return DebugOptions.isSet(flag);}
  • icGREP/icgrep-devel/icgrep/re/re_compiler.h

    r5720 r5732  
    6262
    6363    RE_Compiler(pablo::PabloKernel * kernel, cc::CC_Compiler & ccCompiler, bool local = false);
    64     LLVM_ATTRIBUTE_UNUSED_RESULT RE * compileUnicodeNames(RE * re);
    65     LLVM_ATTRIBUTE_UNUSED_RESULT pablo::PabloAST * compile(RE * re);
     64    RE * compileUnicodeNames(RE * re);
     65    pablo::PabloAST * compile(RE * re);
    6666
    6767    static LLVM_ATTRIBUTE_NORETURN void UnsupportedRE(std::string errmsg);
  • icGREP/icgrep-devel/icgrep/re/re_name_resolve.cpp

    r5728 r5732  
    3030
    3131struct NameResolver {
    32     RE * resolve(RE * re) LLVM_ATTRIBUTE_UNUSED_RESULT {
     32    RE * resolve(RE * re) {
    3333        if (Name * name = dyn_cast<Name>(re)) {
    3434            auto f = mMemoizer.find(name);
  • icGREP/icgrep-devel/icgrep/re/re_name_resolve.h

    r5646 r5732  
    99    class Name;
    1010
    11     RE * resolveNames(RE * re) LLVM_ATTRIBUTE_UNUSED_RESULT;
     11    RE * resolveNames(RE * re);
    1212
    1313}
  • icGREP/icgrep-devel/icgrep/re/re_nullable.h

    r5646 r5732  
    1111class RE_Nullable {
    1212public:
    13     static RE * removeNullablePrefix(RE * re) LLVM_ATTRIBUTE_UNUSED_RESULT;
    14     static RE * removeNullableSuffix(RE * re) LLVM_ATTRIBUTE_UNUSED_RESULT;
    15     static RE * removeNullableAssertion(RE * re) LLVM_ATTRIBUTE_UNUSED_RESULT;
    16     static RE * removeNullableAfterAssertion(RE * re) LLVM_ATTRIBUTE_UNUSED_RESULT;
     13    static RE * removeNullablePrefix(RE * re);
     14    static RE * removeNullableSuffix(RE * re);
     15    static RE * removeNullableAssertion(RE * re);
     16    static RE * removeNullableAfterAssertion(RE * re);
    1717    static bool isNullable(const RE * re);
    1818    static bool hasNullablePrefix(const RE * re);
  • icGREP/icgrep-devel/icgrep/re/re_parser.h

    r5679 r5732  
    4040    static LLVM_ATTRIBUTE_NORETURN void ParseFailure(std::string errmsg);
    4141
    42     static RE * parse(const std::string &input_string, ModeFlagSet initialFlags, RE_Syntax syntax = RE_Syntax::PCRE, bool ByteMode = false) LLVM_ATTRIBUTE_UNUSED_RESULT;
     42    static RE * parse(const std::string &input_string, ModeFlagSet initialFlags, RE_Syntax syntax = RE_Syntax::PCRE, bool ByteMode = false);
    4343
    4444protected:
  • icGREP/icgrep-devel/icgrep/re/re_simplifier.h

    r5646 r5732  
    1010class RE_Simplifier {
    1111public:
    12     static RE * simplify(RE * re) LLVM_ATTRIBUTE_UNUSED_RESULT;
     12    static RE * simplify(RE * re);
    1313};
    1414
  • icGREP/icgrep-devel/icgrep/re/re_toolchain.cpp

    r5646 r5732  
    11/*
    2  *  Copyright (c) 2015 International Characters.
     2 *  Copyright (c) 2017 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.
    55 */
    66
     7#include <toolchain/toolchain.h>
    78#include <re/re_toolchain.h>
    89#include <cc/cc_compiler.h>            // for CC_Compiler
     
    3334                            clEnumVal(ShowAllREs, "Print all regular expression passes"),
    3435                            clEnumVal(ShowStrippedREs, "Print REs with nullable prefixes/suffixes removed"),
    35                             clEnumVal(ShowSimplifiedREs, "Print final simplified REs"),
    36                             clEnumValEnd), cl::cat(RegexOptions));
     36                            clEnumVal(ShowSimplifiedREs, "Print final simplified REs")
     37                            CL_ENUM_VAL_SENTINEL), cl::cat(RegexOptions));
    3738
    3839static cl::bits<RE_AlgorithmFlags>
     
    4142                              clEnumVal(DisableMatchStar, "disable MatchStar optimization"),
    4243                              clEnumVal(DisableUnicodeMatchStar, "disable Unicode MatchStar optimization"),
    43                               clEnumVal(DisableUnicodeLineBreak, "disable Unicode line breaks - use LF only"),
    44                               clEnumValEnd),
    45                    cl::cat(RegexOptions));
     44                              clEnumVal(DisableUnicodeLineBreak, "disable Unicode line breaks - use LF only")
     45                              CL_ENUM_VAL_SENTINEL), cl::cat(RegexOptions));
    4646
    4747bool AlgorithmOptionIsSet(RE_AlgorithmFlags flag) {
  • icGREP/icgrep-devel/icgrep/re/re_toolchain.h

    r5646 r5732  
    2929const llvm::cl::OptionCategory * re_toolchain_flags();
    3030
    31 RE * regular_expression_passes(RE * re_ast) LLVM_ATTRIBUTE_UNUSED_RESULT;
     31RE * regular_expression_passes(RE * re_ast);
    3232
    33 pablo::PabloAST * re2pablo_compiler(pablo::PabloKernel * kernel, RE * re_ast) LLVM_ATTRIBUTE_UNUSED_RESULT;
     33pablo::PabloAST * re2pablo_compiler(pablo::PabloKernel * kernel, RE * re_ast);
    3434   
    3535}
  • icGREP/icgrep-devel/icgrep/toolchain/object_cache.cpp

    r5731 r5732  
     1#include "toolchain.h"
    12#include "object_cache.h"
    23#include <kernels/kernel.h>
     
    1415#include <boost/range/iterator_range.hpp>
    1516#include <boost/container/flat_set.hpp>
     17#if LLVM_VERSION_INTEGER < LLVM_4_0_0
    1618#include <llvm/Bitcode/ReaderWriter.h>
     19#else
     20#include <llvm/Bitcode/BitcodeReader.h>
     21#include <llvm/Bitcode/BitcodeWriter.h>
     22#endif
    1723#include <llvm/IR/Verifier.h>
    1824#include <ctime>
     
    113119                //MemoryBuffer * kb = kernelBuffer.get().release();
    114120                //auto loadedFile = parseBitcodeFile(kb->getMemBufferRef(), mContext);
     121#if LLVM_VERSION_INTEGER < LLVM_4_0_0
    115122                auto loadedFile = getLazyBitcodeModule(std::move(kernelBuffer.get()), idb->getContext());
     123#else
     124                auto loadedFile = getOwningLazyBitcodeModule(std::move(kernelBuffer.get()), idb->getContext());
     125#endif
    116126                if (*loadedFile) {
    117127                    Module * const m = loadedFile.get().release(); assert (m);
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.cpp

    r5731 r5732  
    66
    77#include <toolchain/toolchain.h>
    8 
    98#include <UCD/UCD_Config.h>
    109#include <llvm/CodeGen/CommandFlags.h>
     
    3433                        clEnumVal(TraceDynamicBuffers, "Show dynamic buffer allocations and deallocations."),
    3534                        clEnumVal(EnableAsserts, "Enable built-in Parabix framework asserts in generated IR."),
    36                         clEnumVal(EnableCycleCounter, "Count and report CPU cycles per kernel."),
    37                         clEnumValEnd), cl::cat(CodeGenOptions));
     35                        clEnumVal(EnableCycleCounter, "Count and report CPU cycles per kernel.")
     36                        CL_ENUM_VAL_SENTINEL), cl::cat(CodeGenOptions));
    3837
    3938static cl::opt<std::string> IROutputFilenameOption("dump-generated-IR-output", cl::init(""),
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.h

    r5731 r5732  
    2121#define LLVM_5_0_0 50000
    2222
     23// From LLVM 4.0.0 the clEnumValEnd sentinel is no longer needed.
     24// We define a macro to adapt to the CommandLine syntax based on LLVM version.
     25#if LLVM_VERSION_INTEGER < LLVM_4_0_0
     26#define CL_ENUM_VAL_SENTINEL , clEnumValEnd
     27#else
     28#define CL_ENUM_VAL_SENTINEL
     29#endif
    2330
    2431// FIXME: llvm/CodeGen/CommandFlags.h can only be included once or the various cl::opt causes multiple definition
  • icGREP/icgrep-devel/icgrep/wc.cpp

    r5646 r5732  
    3939             clEnumValN(WordOption, "w", "Report the number of words in each input file."),
    4040             clEnumValN(CharOption, "m", "Report the number of characters in each input file (override -c)."),
    41              clEnumValN(ByteOption, "c", "Report the number of bytes in each input file (override -m)."),
    42              clEnumValEnd), cl::cat(wcFlags), cl::Grouping);
     41             clEnumValN(ByteOption, "c", "Report the number of bytes in each input file (override -m).")
     42             CL_ENUM_VAL_SENTINEL), cl::cat(wcFlags), cl::Grouping);
    4343                                                 
    4444
Note: See TracChangeset for help on using the changeset viewer.