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

F model dataflow for libraries #731

Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
05c9888
new data structure
bulletSpace Jun 10, 2024
e2b9645
data structure update
bulletSpace Jun 14, 2024
38deabf
data structure update
bulletSpace Jun 14, 2024
99cf4b4
data structur update
bulletSpace Jun 17, 2024
c5416e7
warning fixed
bulletSpace Jun 17, 2024
469ef99
update from call
fabianbs96 Jun 17, 2024
ba6b480
Sample use
fabianbs96 Jun 17, 2024
c7474ac
data structure updated and LibCSummary updated
bulletSpace Jun 23, 2024
91a646a
update summary
bulletSpace Jun 24, 2024
8bb3feb
Data Structure updated
bulletSpace Jun 28, 2024
80d3734
new function summaries
bulletSpace Jun 28, 2024
58a7305
function summaries updated
bulletSpace Jun 28, 2024
03a51ea
function summaries updated
bulletSpace Jun 28, 2024
446badb
function summaries updated
bulletSpace Jun 28, 2024
bcb9720
new function summaries
bulletSpace Jul 1, 2024
fbebec7
new function summaries
bulletSpace Jul 1, 2024
b8db96c
LLVMDataFlowFacts updated and new function summaries
bulletSpace Jul 8, 2024
8588c2d
new Function Summaries
bulletSpace Jul 12, 2024
ceac20b
new function summaries
bulletSpace Jul 15, 2024
4ab8013
Summarie functions finished
bulletSpace Jul 16, 2024
509e0e6
lambdaFlow flow function finished
bulletSpace Aug 12, 2024
a02ddb8
new unit test
bulletSpace Aug 17, 2024
fe2f54d
corrections for unit test
bulletSpace Aug 19, 2024
82d5a96
handle comments in config files
fabianbs96 Aug 25, 2024
0352353
Merge branch 'development' into f-model-dataflow-for-libraries
fabianbs96 Aug 25, 2024
eb9db08
updated pull request
bulletSpace Aug 28, 2024
853a491
pull request updated
bulletSpace Sep 1, 2024
0adb272
pull request updated
bulletSpace Sep 1, 2024
18a1d7e
FunctionDataFlowFactSerialization.cpp unfinished
bulletSpace Sep 2, 2024
1756599
make pr ready for merge
fabianbs96 Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FunctionDataFlowFactSerialization.cpp unfinished
bulletSpace committed Sep 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 18a1d7ed0a1d7dfc00f842c6ed793834b0cecba1
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ class FunctionDataFlowFacts {
Fdff[FuncKey][Index].emplace_back(Out);
}

// get out set for a function an the parameter index
// get outset for a function an the parameter index
[[nodiscard]] const std::vector<DataFlowFact> &
getDataFlowFacts(llvm::StringRef FuncKey, uint32_t &Index) const {
auto It = Fdff.find(FuncKey);
Original file line number Diff line number Diff line change
@@ -1,12 +1,101 @@
#include "phasar/PhasarLLVM/DataFlow/IfdsIde/FunctionDataFlowFacts.h"
// #include nlohman.json oder YAML
#include "llvm/Support/YAMLParser.h"
#include "llvm/Support/YAMLTraits.h"

#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <string>
#include <unordered_map>
#include <vector>

#include <llvm-14/llvm/ADT/StringMap.h>
#include <llvm-14/llvm/ADT/StringRef.h>
#include <llvm-14/llvm/Support/Path.h>
#include <llvm-14/llvm/Support/raw_ostream.h>

using namespace psr;
using llvm::yaml::Input;
using llvm::yaml::IO;
using llvm::yaml::MappingTraits;
using llvm::yaml::Output;
using llvm::yaml::SequenceTraits;

template <>
struct MappingTraits<
std::unordered_map<uint32_t, std::vector<DataFlowFact>>::iterator> {
static void
mapping(IO &Io,
std::unordered_map<uint32_t, std::vector<DataFlowFact>>::iterator
InnerElemPtr) {
for (const auto &Dff : InnerElemPtr->second) {
if (const Parameter *Param = std::get_if<Parameter>(&Dff.Fact)) {
Io.mapOptional(std::to_string(InnerElemPtr->first).c_str(),
Param->Index);
} else {
Io.mapOptional(std::to_string(InnerElemPtr->first).c_str(),
"ReturnValue");
}
}
}
};

// TO DO: implement in .cpp file
void serialize(const FunctionDataFlowFacts &Fdff, llvm::raw_ostream &OS) {}
template <>
struct MappingTraits<llvm::StringMapConstIterator<
std::unordered_map<uint32_t, std::vector<DataFlowFact>>>> {
static void
mapping(IO &Io, llvm::StringMapConstIterator<
std::unordered_map<uint32_t, std::vector<DataFlowFact>>>
ElemPtr) {
struct MappingTraits<
std::unordered_map<uint32_t, std::vector<DataFlowFact>>>
InnerElem; //{ElemPtr->second.begin()};
Io.mapOptional(((ElemPtr->first()).str()).c_str(), "");
Io.mapOptional(std::to_string(ElemPtr->second.begin()->first).c_str(), "");
// InnerElem.mapping(Io, ElemPtr->second.begin());
}
};

// TO DO: implement in .cpp file
[[nodiscard]] FunctionDataFlowFacts deserialize(llvm::raw_ostream &OS) {
return FunctionDataFlowFacts();
template <> struct SequenceTraits<std::vector<DataFlowFact>> {
static size_t size(IO &Io, std::vector<DataFlowFact> &List) {
return List.size();
}
static DataFlowFact &element(IO &Io, std::vector<DataFlowFact> &List,
size_t Index) {
if (Index < List.size()) {
return List[Index];
}
List.emplace_back();
return List[List.size() - 1];
}
};

void serialize(const FunctionDataFlowFacts &Fdff, llvm::raw_ostream &OS) {
/*std::string Yaml;
for (const auto &ItOuter : Fdff) {
OS << "- "
<< "ItOuter.first"
<< ":"
<< "\n";
for (const auto &ItInner : ItOuter.second) {
OS << " "
<< "- " << std::to_string(ItInner.first) << ":"
<< "\n";
for (DataFlowFact DFF : ItInner.second) {
if (const Parameter *Param = std::get_if<Parameter>(&DFF.Fact)) {
OS << " "
<< "- " << std::to_string(Param->Index) << "\n";
} else {
OS << " "
<< "- "
<< "ReturnValue"
<< "\n";
}
// Output yout(OS);
}
}
}*/
}

[[nodiscard]] FunctionDataFlowFacts deserialize(llvm::raw_ostream &OS) {}