[llvm-dev] My Pass error

James Molloy via llvm-dev llvm-dev at lists.llvm.org
Sat Mar 19 13:35:45 PDT 2016


Hi Manideepa,

Moving from 3.4 to 3.8 is a huge step. LLVM's codebase moves very quickly
and we are (deliberately) worry very little about refactoring heavily.
Therefore build errors are expected.

Looking at your errors, I can't see any reason your CMakeLists would be at
fault. The errors are primarily API changes - you'll have to go and look at
each individually to understand what LLVM now returns/accepts and how to
modify your code.

Specifically:

*error: base operand of ‘->’ has non-pointer type ‘llvm::LoopInfo’*

This means you previously had a LoopInfo*, and now you have a LoopInfo&.

*error: ‘ID’ is not a member of ‘llvm::PostDominatorTree’*

PostDominatorTree is no longer a Pass. It is an analysis object - you get
one by using a different pass: PostDominatorWrapperPass, and calling
->getDomTree() on it. There are examples in in-tree LLVM passes.

/home/manideepa/Desktop/research/compiler/llvm3.8/llvm/include/llvm/PassAnalysisSupport.h:61:39:
error: ‘ID’ is not a member of ‘llvm::AAResults’

The Alias Analysis hierarchy has changed substantially. I suggest going and
looking at the documentation, but you now need to obtain an
AliasAnalysisWrapperPass and call getAAResults().

You've got the same problem with MemoryDependenceAnalysis and
ScalarEvolution. I'd go look at a pass in-tree and see what that does
differently to your pass.

*PS*: LLVM now uses range based for loops heavily, so you can rewrite this:
    for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I)
//gives the collection of Loops

to this:
  for(auto *L : LI)

On Sat, 19 Mar 2016 at 17:29 Manideepa Mukherjee via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi,
>
> I am trying to integrate my pass with the current llvm version 3.8.0. My
> pass was running fine with llvm 3.4. I am novice in CMake. I am getting a
> huge error list at the time of make.
> My CMakeLists file:
>
> set( LLVM_DIR "${LLVM_ROOT}/share/llvm/cmake" )
> set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_DIR} )
> find_package(LLVM)
> include(AddLLVM)
> add_definitions(${LLVM_DEFINITIONS})
> include_directories(${LLVM_INCLUDE_DIRS})
> link_directories(${LLVM_LIBRARY_DIRS})
>
> add_llvm_loadable_module(LoopGraphAnalysisPass_0
>   LoopGraphAnalysisPass.cpp
>   )
> My errors are attached in a separate file
>
> Deep
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160319/1436e0ac/attachment.html>


More information about the llvm-dev mailing list