Skip to content

Commit

Permalink
Do Control Flow Analysis on StmtASTNodes instead of BasicBlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeac committed Jul 2, 2019
1 parent d774981 commit eaba3e3
Show file tree
Hide file tree
Showing 11 changed files with 623 additions and 246 deletions.
4 changes: 4 additions & 0 deletions src/boomerang-plugins/codegen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ include_directories(
BOOMERANG_ADD_CODEGEN(
NAME "C"
SOURCES
c/ASTNode.cpp
c/ASTNode.h
c/CCodeGenerator.cpp
c/CCodeGenerator.h
c/CodeWriter.cpp
c/CodeWriter.h
c/ControlFlowAnalyzer.cpp
c/ControlFlowAnalyzer.h
c/StmtASTNode.cpp
c/StmtASTNode.h
)
21 changes: 21 additions & 0 deletions src/boomerang-plugins/codegen/c/ASTNode.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma region License
/*
* This file is part of the Boomerang Decompiler.
*
* See the file "LICENSE.TERMS" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL
* WARRANTIES.
*/
#pragma endregion License
#include "ASTNode.h"


ASTNode::ASTNode()
{
}


ASTNode::~ASTNode()
{
}

36 changes: 36 additions & 0 deletions src/boomerang-plugins/codegen/c/ASTNode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#pragma region License
/*
* This file is part of the Boomerang Decompiler.
*
* See the file "LICENSE.TERMS" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL
* WARRANTIES.
*/
#pragma endregion License
#pragma once


class BasicBlock;
class OStream;


/**
* Base class for all nodes in the Abstract Syntax Tree.
*/
class ASTNode
{
public:
ASTNode();
ASTNode(const ASTNode &other) = delete;
ASTNode(ASTNode &&other) = default;

virtual ~ASTNode();

ASTNode &operator=(const ASTNode &other) = delete;
ASTNode &operator=(ASTNode &&other) = default;

public:
virtual bool isStmt() const { return false; }

virtual void printAST(OStream &os) const = 0;
};
Loading

0 comments on commit eaba3e3

Please sign in to comment.