Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 729924 | Differences between
and this patch

Collapse All | Expand All

(-)a/CMakeLists.txt (-6 / +3 lines)
Lines 218-224 if (WASM_ENABLED) Link Here
218
    list(APPEND ISPC_TARGETS wasm-i32x4)
218
    list(APPEND ISPC_TARGETS wasm-i32x4)
219
endif()
219
endif()
220
220
221
set(CLANG_LIBRARY_LIST clangFrontend clangDriver clangSerialization clangParse clangSema clangAnalysis clangAST clangBasic clangEdit clangLex)
221
set(CLANG_LIBRARY_LIST clang clang-cpp)
222
set(LLVM_COMPONENTS engine ipo bitreader bitwriter instrumentation linker option)
222
set(LLVM_COMPONENTS engine ipo bitreader bitwriter instrumentation linker option)
223
223
224
if (${LLVM_VERSION_NUMBER} VERSION_GREATER_EQUAL "10.0.0")
224
if (${LLVM_VERSION_NUMBER} VERSION_GREATER_EQUAL "10.0.0")
Lines 402-412 if (ISPC_USE_ASAN) Link Here
402
endif()
402
endif()
403
403
404
# Link against Clang libraries
404
# Link against Clang libraries
405
foreach(clangLib ${CLANG_LIBRARY_LIST})
405
find_package(Clang REQUIRED)
406
    find_library(${clangLib}Path NAMES ${clangLib} HINTS ${LLVM_LIBRARY_DIRS})
406
target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_LIST})
407
    list(APPEND CLANG_LIBRARY_FULL_PATH_LIST ${${clangLib}Path})
408
endforeach()
409
target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_FULL_PATH_LIST})
410
407
411
# Link against LLVM libraries
408
# Link against LLVM libraries
412
target_link_libraries(${PROJECT_NAME} ${LLVM_LIBRARY_LIST})
409
target_link_libraries(${PROJECT_NAME} ${LLVM_LIBRARY_LIST})
(-)a/src/llvmutil.cpp (-1 / +2 lines)
Lines 42-47 Link Here
42
#include <llvm/IR/BasicBlock.h>
42
#include <llvm/IR/BasicBlock.h>
43
#include <llvm/IR/Instructions.h>
43
#include <llvm/IR/Instructions.h>
44
#include <llvm/IR/Module.h>
44
#include <llvm/IR/Module.h>
45
#include <llvm/Support/raw_ostream.h>
45
#include <map>
46
#include <map>
46
#include <set>
47
#include <set>
47
#include <vector>
48
#include <vector>
Lines 1394-1400 static void lDumpValue(llvm::Value *v, std::set<llvm::Value *> &done) { Link Here
1394
        return;
1395
        return;
1395
1396
1396
    fprintf(stderr, "  ");
1397
    fprintf(stderr, "  ");
1397
    v->dump();
1398
    v->print(llvm::outs(), false);
1398
    done.insert(v);
1399
    done.insert(v);
1399
1400
1400
    if (inst == NULL)
1401
    if (inst == NULL)
(-)a/src/opt.cpp (-6 / +6 lines)
Lines 142-148 static llvm::Pass *CreateFixBooleanSelectPass(); Link Here
142
                                                                       getenv("FUNC"), strlen(getenv("FUNC")))))) {    \
142
                                                                       getenv("FUNC"), strlen(getenv("FUNC")))))) {    \
143
        fprintf(stderr, "Start of " NAME "\n");                                                                        \
143
        fprintf(stderr, "Start of " NAME "\n");                                                                        \
144
        fprintf(stderr, "---------------\n");                                                                          \
144
        fprintf(stderr, "---------------\n");                                                                          \
145
        bb.dump();                                                                                                     \
145
        bb.print(llvm::outs(), false);                                                                               \
146
        fprintf(stderr, "---------------\n\n");                                                                        \
146
        fprintf(stderr, "---------------\n\n");                                                                        \
147
    } else /* eat semicolon */
147
    } else /* eat semicolon */
148
148
Lines 152-158 static llvm::Pass *CreateFixBooleanSelectPass(); Link Here
152
                                                                       getenv("FUNC"), strlen(getenv("FUNC")))))) {    \
152
                                                                       getenv("FUNC"), strlen(getenv("FUNC")))))) {    \
153
        fprintf(stderr, "End of " NAME " %s\n", modifiedAny ? "** CHANGES **" : "");                                   \
153
        fprintf(stderr, "End of " NAME " %s\n", modifiedAny ? "** CHANGES **" : "");                                   \
154
        fprintf(stderr, "---------------\n");                                                                          \
154
        fprintf(stderr, "---------------\n");                                                                          \
155
        bb.dump();                                                                                                     \
155
        bb.print(llvm::outs(), false);                                                                               \
156
        fprintf(stderr, "---------------\n\n");                                                                        \
156
        fprintf(stderr, "---------------\n\n");                                                                        \
157
    } else /* eat semicolon */
157
    } else /* eat semicolon */
158
#else
158
#else
Lines 453-459 void Optimize(llvm::Module *module, int optLevel) { Link Here
453
#ifndef ISPC_NO_DUMPS
453
#ifndef ISPC_NO_DUMPS
454
    if (g->debugPrint) {
454
    if (g->debugPrint) {
455
        printf("*** Code going into optimization ***\n");
455
        printf("*** Code going into optimization ***\n");
456
        module->dump();
456
        module->print(llvm::outs(), nullptr);
457
    }
457
    }
458
#endif
458
#endif
459
    DebugPassManager optPM;
459
    DebugPassManager optPM;
Lines 666-672 void Optimize(llvm::Module *module, int optLevel) { Link Here
666
#ifndef ISPC_NO_DUMPS
666
#ifndef ISPC_NO_DUMPS
667
    if (g->debugPrint) {
667
    if (g->debugPrint) {
668
        printf("\n*****\nFINAL OUTPUT\n*****\n");
668
        printf("\n*****\nFINAL OUTPUT\n*****\n");
669
        module->dump();
669
        module->print(llvm::outs(), nullptr);
670
    }
670
    }
671
#endif
671
#endif
672
}
672
}
Lines 4256-4262 char DebugPass::ID = 0; Link Here
4256
bool DebugPass::runOnModule(llvm::Module &module) {
4256
bool DebugPass::runOnModule(llvm::Module &module) {
4257
    fprintf(stderr, "%s", str_output);
4257
    fprintf(stderr, "%s", str_output);
4258
    fflush(stderr);
4258
    fflush(stderr);
4259
    module.dump();
4259
    module.print(llvm::outs(), nullptr);
4260
    return true;
4260
    return true;
4261
}
4261
}
4262
4262
Lines 4303-4309 void DebugPassFile::run(llvm::Module &module, bool init) { Link Here
4303
    snprintf(fname, sizeof(fname), "%s_%d_%s.ll", init ? "init" : "ir", pnum, sanitize(std::string(pname)).c_str());
4303
    snprintf(fname, sizeof(fname), "%s_%d_%s.ll", init ? "init" : "ir", pnum, sanitize(std::string(pname)).c_str());
4304
    llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::F_None);
4304
    llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::F_None);
4305
    Assert(!EC && "IR dump file creation failed!");
4305
    Assert(!EC && "IR dump file creation failed!");
4306
    module.print(OS, 0);
4306
    module.print(OS, nullptr);
4307
}
4307
}
4308
4308
4309
bool DebugPassFile::runOnModule(llvm::Module &module) {
4309
bool DebugPassFile::runOnModule(llvm::Module &module) {

Return to bug 729924