PacktPublishing / Learn-LLVM-12

Learn LLVM 12, published by Packt
MIT License
474 stars 103 forks source link

Couple of issues in Chapter 8 for compiling with LLVM 17.0 #25

Open Fare9 opened 1 year ago

Fare9 commented 1 year ago

I have found a couple of issues that can be easily fixed for allow compilation in last version of LLVM, after those changes the examples compile perfectly and run without problems.

Adding the Pass to the LLVM source code tree, the next line must be added to the file llvm/lib/Passes/CMakeLists.txt:

    CountIR
)

The line must be included as the last on the CMakeLists.txt of LINK_COMPONENTS.

Also in the part of the section of Adding an optimization pipeline to your compiler, in the CMakeLists.txt of the Driver, we must include a DEPENDS:

add_tinylang_tool(tinylang
    Driver.cpp

    DEPENDS
    SUPPORT_PLUGINS
)

For the moment I've spotted, and fixed those issues for the last version of LLVM.