Skip to content

Commit

Permalink
Debugging commit, revert later.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpatki committed Sep 26, 2024
1 parent 9034235 commit 58d71e9
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/c/weaver/weave/perfflow_weave_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,34 @@

bool WeaveCommon::modifyAnnotatedFunctions(Module &m)
{
auto annotations = m.getNamedGlobal("llvm.global.annotations");
auto annotations = m.getNamedGlobal("llvm.global.annotations");
if (!annotations)
{
return false;
}

bool changed = false;
auto a = cast<ConstantArray> (annotations->getOperand(0));

if (annotations.getNumOperands() > 0)
{
outs() << "I have %d operands!" << annotations.getNumOperands() << "\n";
auto a = cast<ConstantArray> (annotations->getOperand(0));
}
else
return changed;


for (unsigned int i = 0; i < a->getNumOperands(); i++)
{
auto e = cast<ConstantStruct> (a->getOperand(i));
if (!e)
{
outs() << "I failed here at obtaining the struct. \n";
}

if (auto *fn = dyn_cast<Function> (e->getOperand(0)->getOperand(0)))
{
outs() << "I entered the part where we parse annotations. \n";
auto anno = cast<ConstantDataArray>(
cast<GlobalVariable>(e->getOperand(1)->getOperand(0))
->getOperand(0))
Expand Down Expand Up @@ -77,11 +92,10 @@ bool WeaveCommon::modifyAnnotatedFunctions(Module &m)
}
}
}
return changed;
return changed;

}


/******************************************************************************
* *
* Private Methods of WeaveCommon Class *
Expand Down

0 comments on commit 58d71e9

Please sign in to comment.