trailofbits / vast

VAST is an experimental compiler pipeline designed for program analysis of C and C++. It provides a tower of IRs as MLIR dialects to choose the best fit representations for a program analysis or further program abstraction.
https://trailofbits.github.io/vast/
Apache License 2.0
391 stars 23 forks source link

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

Open anthro-poid opened 2 months ago

frabert commented 1 month ago

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.

github-actions[bot] commented 1 month ago

Cpp-Linter Report :warning:

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' ```hpp 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 ```hpp 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' ```hpp 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 ```hpp 23 | : EnqueuedBlocks(Cfg.getNumBlockIDs()), WorkList(C) {} | ^~~~~~~~~~~ ``` - **include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:25:27:** error: [clang-diagnostic-error] > use of undeclared identifier 'cfg' ```hpp 25 | void enqueueBlock(cfg::CFGBlockInterface Block) { | ^ ``` - **include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:28:17:** error: [clang-diagnostic-error] > use of undeclared identifier 'WorkList' ```hpp 28 | WorkList.push(Block); | ^ ``` - **include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:32:9:** error: [clang-diagnostic-error] > use of undeclared identifier 'cfg' ```hpp 32 | cfg::CFGBlockInterface dequeue() { | ^ ``` - **include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:33:17:** error: [clang-diagnostic-error] > use of undeclared identifier 'WorkList' ```hpp 33 | if (WorkList.empty()) { | ^ ``` - **include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:36:13:** error: [clang-diagnostic-error] > use of undeclared identifier 'cfg' ```hpp 36 | cfg::CFGBlockInterface B = WorkList.top(); | ^ ``` - **include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:36:40:** error: [clang-diagnostic-error] > use of undeclared identifier 'WorkList' ```hpp 36 | cfg::CFGBlockInterface B = WorkList.top(); | ^ ``` - **include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:37:13:** error: [clang-diagnostic-error] > use of undeclared identifier 'WorkList' ```hpp 37 | WorkList.pop(); | ^ ``` - **include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:45:25:** error: [clang-diagnostic-error] > use of undeclared identifier 'cfg' ```hpp 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' ```hpp 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' ```hpp 46 | VAST_UNIMPLEMENTED; | ^ ``` - **include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:57:33:** error: [clang-diagnostic-error] > use of undeclared identifier 'cfg' ```hpp 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 ```hpp 58 | : DataflowWorklistBase(Cfg, ReversePostOrderCompare{POV->getComparator()}) {} | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` - **include/vast/Analysis/Clang/FlowSensitive/DataflowWorklist.hpp:60:33:** error: [clang-diagnostic-error] > use of undeclared identifier 'cfg' ```hpp 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'? ```hpp 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' ```hpp 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 ```hpp 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 ```hpp 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 ```hpp 21 | #include "vast/Interfaces/AST/TypeInterface.h.inc" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```

Have any feedback or feature suggestions? Share it here.