Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-Analysis into main
  • Loading branch information
jumormt committed Oct 18, 2023
2 parents 361c136 + 4e50e36 commit 4cfa82b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/svf-teaching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, macos-11]
os: [ubuntu-20.04, macos-11]
steps:
# checkout the repo
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"request": "launch",
// Please change to executable of your working assignment e.g. Assignment-1: assign-1
"program": "${workspaceFolder}/bin/assign-1",
"args": ["-stat=false"], // may input the test llvm bc file or other options may use
"args": [], // may input the test llvm bc file or other options may use
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
Expand Down
23 changes: 16 additions & 7 deletions Assignment-3/Test3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
#include "SVF-LLVM/LLVMUtil.h"
#include "SVF-LLVM/SVFIRBuilder.h"
#include "WPA/Andersen.h"
#include "Util/SVFUtil.h"
#include "Assignment-3.h"
#include "Util/Options.h"
#include "Util/CommandLine.h"


void Test1()
{
Expand Down Expand Up @@ -90,13 +91,21 @@ void Test()

int main(int argc, char ** argv)
{
// add "args": ["-stat=false"] to launch.json file to eliminate the redundant program analysis details

int arg_num = 0;
char **arg_value = new char*[argc];
int extraArgc = 1;
char **arg_value = new char *[argc + extraArgc];
for (; arg_num < argc; ++arg_num) {
arg_value[arg_num] = argv[arg_num];
}

// You may comment it to see the details of the analysis
arg_value[arg_num++] = (char*) "-stat=false";

std::vector<std::string> moduleNameVec;
SVF::LLVMUtil::processArguments(argc, argv, arg_num, arg_value, moduleNameVec);
llvm::cl::ParseCommandLineOptions(arg_num, arg_value,
"Whole Program Points-to Analysis\n");
moduleNameVec = OptionBase::parseOptions(
arg_num, arg_value, "Teaching-Software-Analysis Assignment 3", "[options]"
);
Test();
return 0;
}
24 changes: 19 additions & 5 deletions Assignment-4/Test4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@
//
//
*/
#include "Assignment-4.h"

#include "SVF-LLVM/LLVMUtil.h"
#include "SVF-LLVM/SVFIRBuilder.h"
#include "Graphs/PTACallGraph.h"
#include "Assignment-4.h"
#include "Util/Options.h"
#include "Util/CommandLine.h"


using namespace std;

Expand Down Expand Up @@ -102,11 +106,19 @@ void Test4()
int main(int argc, char ** argv)
{
int arg_num = 0;
char **arg_value = new char*[argc];
int extraArgc = 1;
char **arg_value = new char *[argc + extraArgc];
for (; arg_num < argc; ++arg_num) {
arg_value[arg_num] = argv[arg_num];
}

// You may comment it to see the details of the analysis
arg_value[arg_num++] = (char*) "-stat=false";

std::vector<std::string> moduleNameVec;
LLVMUtil::processArguments(argc, argv, arg_num, arg_value, moduleNameVec);
llvm::cl::ParseCommandLineOptions(arg_num, arg_value,
"Whole Program Points-to Analysis\n");
moduleNameVec = OptionBase::parseOptions(
arg_num, arg_value, "Teaching-Software-Analysis Assignment 4", "[options]"
);
Test1();
Test2();
Test3();
Expand All @@ -115,3 +127,5 @@ int main(int argc, char ** argv)
}




0 comments on commit 4cfa82b

Please sign in to comment.