Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new AST interfaces and initial form of UnitializedValues analysis. #682

Closed
wants to merge 46 commits into from

Conversation

anthro-poid
Copy link
Contributor

No description provided.

@anthro-poid anthro-poid reopened this Jul 29, 2024
@anthro-poid anthro-poid force-pushed the clang-cfg-interfaces branch from d084446 to 0acda7e Compare July 29, 2024 13:14
@xlauko xlauko added the Clang static analyzer Experimental support of clang static analyzer over MLIR label Jul 30, 2024
include/vast/Analyses/CFG.hpp Outdated Show resolved Hide resolved
include/vast/Analyses/CFG.hpp Outdated Show resolved Hide resolved
include/vast/Analyses/UninitializedValues.hpp Outdated Show resolved Hide resolved
include/vast/Analyses/UninitializedValues.hpp Outdated Show resolved Hide resolved
include/vast/Interfaces/AST/DeclInterface.td Show resolved Hide resolved
include/vast/Interfaces/AST/DeclInterface.td Outdated Show resolved Hide resolved
@anthro-poid anthro-poid requested a review from xlauko July 30, 2024 17:26
@anthro-poid anthro-poid force-pushed the clang-cfg-interfaces branch from 64fb227 to 4152a97 Compare July 31, 2024 09:01
include/vast/Analyses/UninitializedValues.hpp Outdated Show resolved Hide resolved
include/vast/Analyses/Iterators.cpp Outdated Show resolved Hide resolved
include/vast/Analyses/Iterators.cpp Outdated Show resolved Hide resolved
@anthro-poid anthro-poid marked this pull request as ready for review August 5, 2024 08:59
@frabert
Copy link
Contributor

frabert commented Aug 12, 2024

Upstream MLIR uses Analysis instead of Analyses for its directory name, not sure if we want to follow their convention or go with our own.

@anthro-poid anthro-poid force-pushed the clang-cfg-interfaces branch from e0b9d1b to 8ec5f35 Compare August 12, 2024 10:56
@anthro-poid anthro-poid force-pushed the clang-cfg-interfaces branch from 8ec5f35 to f7308ba Compare August 12, 2024 11:05
Copy link
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format reports: 11 file(s) not formatted
  • include/vast/Analysis/Clang/CFG.hpp
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp
  • include/vast/Analysis/Iterators.hpp
  • include/vast/Analysis/UninitializedValues.hpp
  • include/vast/Interfaces/AST/DeclInterface.hpp
  • include/vast/Interfaces/AST/StmtVisitor.h
  • include/vast/Interfaces/CFG/CFGInterface.hpp
  • lib/vast/Analysis/Iterators.cpp
  • lib/vast/Dialect/HighLevel/HighLevelOps.cpp
  • lib/vast/Interfaces/AST/TypeInterface.cpp
  • tools/vast-repl/command.cpp
clang-tidy reports: 22 concern(s)
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:18:30: error: [clang-diagnostic-error]

    use of undeclared identifier 'cfg'

       18 |         llvm::PriorityQueue< cfg::CFGBlockInterface,
          |                              ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:19:84: error: [clang-diagnostic-error]

    expected member name or ';' after declaration specifiers

       18 |         llvm::PriorityQueue< cfg::CFGBlockInterface,
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       19 |                              llvm::SmallVector< cfg::CFGBlockInterface, QueueSize >,
          |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:22:30: error: [clang-diagnostic-error]

    use of undeclared identifier 'cfg'

       22 |         DataflowWorklistBase(cfg::CFGInterface Cfg, Comp C)
          |                              ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:23:53: error: [clang-diagnostic-error]

    member initializer 'WorkList' does not name a non-static data member or base class

       23 |             : EnqueuedBlocks(Cfg.getNumBlockIDs()), WorkList(C) {}
          |                                                     ^~~~~~~~~~~
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:25:27: error: [clang-diagnostic-error]

    use of undeclared identifier 'cfg'

       25 |         void enqueueBlock(cfg::CFGBlockInterface Block) {
          |                           ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:28:17: error: [clang-diagnostic-error]

    use of undeclared identifier 'WorkList'

       28 |                 WorkList.push(Block);
          |                 ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:32:9: error: [clang-diagnostic-error]

    use of undeclared identifier 'cfg'

       32 |         cfg::CFGBlockInterface dequeue() {
          |         ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:33:17: error: [clang-diagnostic-error]

    use of undeclared identifier 'WorkList'

       33 |             if (WorkList.empty()) {
          |                 ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:36:13: error: [clang-diagnostic-error]

    use of undeclared identifier 'cfg'

       36 |             cfg::CFGBlockInterface B = WorkList.top();
          |             ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:36:40: error: [clang-diagnostic-error]

    use of undeclared identifier 'WorkList'

       36 |             cfg::CFGBlockInterface B = WorkList.top();
          |                                        ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:37:13: error: [clang-diagnostic-error]

    use of undeclared identifier 'WorkList'

       37 |             WorkList.pop();
          |             ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:45:25: error: [clang-diagnostic-error]

    use of undeclared identifier 'cfg'

       45 |         bool operator()(cfg::CFGBlockInterface lhs, cfg::CFGBlockInterface rhs) const {
          |                         ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:45:53: error: [clang-diagnostic-error]

    use of undeclared identifier 'cfg'

       45 |         bool operator()(cfg::CFGBlockInterface lhs, cfg::CFGBlockInterface rhs) const {
          |                                                     ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:46:13: error: [clang-diagnostic-error]

    use of undeclared identifier 'VAST_UNIMPLEMENTED'

       46 |             VAST_UNIMPLEMENTED;
          |             ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:57:33: error: [clang-diagnostic-error]

    use of undeclared identifier 'cfg'

       57 |         ForwardDataflowWorklist(cfg::CFGInterface Cfg, clang::PostOrderCFGView *POV)
          |                                 ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:58:11: error: [clang-diagnostic-error]

    member initializer 'DataflowWorklistBase' does not name a non-static data member or base class

       58 |         : DataflowWorklistBase(Cfg, ReversePostOrderCompare{POV->getComparator()}) {}
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:60:33: error: [clang-diagnostic-error]

    use of undeclared identifier 'cfg'

       60 |         ForwardDataflowWorklist(cfg::CFGInterface Cfg, AnalysisDeclContextInterface Ctx)
          |                                 ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:60:56: error: [clang-diagnostic-error]

    unknown type name 'AnalysisDeclContextInterface'; did you mean 'clang::AnalysisDeclContextManager'?

       60 |         ForwardDataflowWorklist(cfg::CFGInterface Cfg, AnalysisDeclContextInterface Ctx)
          |                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                                        clang::AnalysisDeclContextManager
    /usr/lib/llvm-18/include/clang/Analysis/AnalysisDeclContext.h:425:7: note: 'clang::AnalysisDeclContextManager' declared here
      425 | class AnalysisDeclContextManager {
          |       ^
  • include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:63:32: error: [clang-diagnostic-error]

    use of undeclared identifier 'cfg'

       63 |         void enqueueSuccessors(cfg::CFGBlockInterface Block) {
          |                                ^
  • include/vast/Interfaces/AST/ASTContextInterface.hpp:15:10: error: [clang-diagnostic-error]

    'vast/Interfaces/AST/ASTContextInterface.h.inc' file not found

       15 | #include "vast/Interfaces/AST/ASTContextInterface.h.inc"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • include/vast/Interfaces/AST/StmtInterface.hpp:17:10: error: [clang-diagnostic-error]

    'vast/Interfaces/AST/StmtInterface.h.inc' file not found

       17 | #include "vast/Interfaces/AST/StmtInterface.h.inc"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • include/vast/Interfaces/AST/TypeInterface.hpp:21:10: error: [clang-diagnostic-error]

    'vast/Interfaces/AST/TypeInterface.h.inc' file not found

       21 | #include "vast/Interfaces/AST/TypeInterface.h.inc"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Have any feedback or feature suggestions? Share it here.

@xlauko xlauko closed this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clang static analyzer Experimental support of clang static analyzer over MLIR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants