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

Add llvm-17.0.6 support #1422

Merged
merged 2 commits into from
Apr 2, 2024
Merged

Conversation

adityavardhanpadala
Copy link
Contributor

There were only very few changes from llvm 16 to llvm 17

  • Module::getGlobalList() was made private since insertGlobalVariable() was added
  • DbgInfoIntrinsic was used instead of DbgAddrIntrinsic, as debug.addr was removed from the IR

fixing these issues lets SVF build with llvm 17 and passes all the tests in the test suite.

@@ -511,7 +510,7 @@ void LLVMUtil::removeFunAnnotations(Set<Function*>& removedFuncList)
glob->setName("llvm.global.annotations.old");
GlobalVariable *GV = new GlobalVariable(newCA->getType(), glob->isConstant(), glob->getLinkage(), newCA, "llvm.global.annotations");
GV->setSection(glob->getSection());
module->getGlobalList().push_back(GV);
module->insertGlobalVariable(GV);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. Could you add a macro for this?

#if (LLVM_VERSION_MAJOR < 17)
module->getGlobalList().push_back(GV);
#elif (LLVM_VERSION_MAJOR >= 17)
module->insertGlobalVariable(GV);
#else
assert(false && "llvm version not supported!");
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the macro.

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.04%. Comparing base (cc81fe9) to head (3d23dbd).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1422      +/-   ##
==========================================
- Coverage   68.05%   68.04%   -0.01%     
==========================================
  Files         250      250              
  Lines       27781    27780       -1     
==========================================
- Hits        18905    18904       -1     
  Misses       8876     8876              
Files Coverage Δ
svf-llvm/lib/LLVMUtil.cpp 78.04% <100.00%> (-0.06%) ⬇️

@yuleisui yuleisui merged commit 72dcf10 into SVF-tools:master Apr 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants