Skip to content

Bug Report: Missing Library Include #9

Description

@mgdickerson

When trying to build the project (on master and main branch) using LLVM 12 and the given directions, the following error occurs:

Scanning dependencies of target pdg_shared
[  3%] Building CXX object CMakeFiles/pdg_shared.dir/src/CallWrapper.cpp.o
[  7%] Building CXX object CMakeFiles/pdg_shared.dir/src/ControlDependencyGraph.cpp.o
[ 11%] Building CXX object CMakeFiles/pdg_shared.dir/src/DataDependencyGraph.cpp.o
In file included from /root/program-dependence-graph/src/DataDependencyGraph.cpp:1:
/root/program-dependence-graph/include/DataDependencyGraph.hh:21:11: error: ‘AliasResult’ in namespace ‘llvm’ does not name a type
   21 |     llvm::AliasResult queryAliasUnderApproximate(llvm::Value &v1, llvm::Value &v2);
      |           ^~~~~~~~~~~
/root/program-dependence-graph/src/DataDependencyGraph.cpp: In member function ‘void pdg::DataDependencyGraph::addAliasEdges(llvm::Instruction&)’:
/root/program-dependence-graph/src/DataDependencyGraph.cpp:44:25: error: ‘queryAliasUnderApproximate’ was not declared in this scope
   44 |     auto alias_result = queryAliasUnderApproximate(inst, *inst_iter);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
/root/program-dependence-graph/src/DataDependencyGraph.cpp:45:25: error: ‘NoAlias’ was not declared in this scope
   45 |     if (alias_result != NoAlias)
      |                         ^~~~~~~
/root/program-dependence-graph/src/DataDependencyGraph.cpp: At global scope:
/root/program-dependence-graph/src/DataDependencyGraph.cpp:95:1: error: ‘AliasResult’ does not name a type
   95 | AliasResult pdg::DataDependencyGraph::queryAliasUnderApproximate(Value &v1, Value &v2)
      | ^~~~~~~~~~~
cc1plus: note: unrecognized command-line option ‘-Wno-everything’ may have been intended to silence earlier diagnostics
make[2]: *** [CMakeFiles/pdg_shared.dir/build.make:108: CMakeFiles/pdg_shared.dir/src/DataDependencyGraph.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/pdg_shared.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

This issue appears to be a missing include in the file include/DataDependencyGraph.hh and adding the following line appears to fix the issue:

#include "llvm/Analysis/AliasAnalysis.h"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions