Comments (6)
To build on the previous answer - the exact changes needed in the Skeleton.cpp code to make it work with LLVM-10 were the following:
Change line-23 from Constant *logFunc = F.getParent()->getOrInsertFunction("logop", logFuncType);
to : FunctionCallee logFunc = F.getParent()->getOrInsertFunction("logop", logFuncType);
Change line-34 from builder.CreateCall(logFunc, args);
to : builder.CreateCall(logFuncType,logFunc.getCallee(), args);
from llvm-pass-skeleton.
I came here following the Mike Shah's seminar, and I am using LLVM version 11.0. Here is my solution for the problem:
Change the line
Constant* hook = M.getOrInsertFunction(InstrumentingFunctionName, funcTy);
to
Value* hook = M.getOrInsertFunction(InstrumentingFunctionName, funcTy).getCallee();
and add #include "llvm/IR/Value.h" . Here is the explanation, the FunctionCallee class has a *Value attribute and Value class is a super class of Constant. In the new version of LLVM, the CallInst::Create also takes *Value as parameter rather than *Constant. Alternatively, passing the FunctionCallee as an argument to CallInst::Create might also work.
from llvm-pass-skeleton.
Hello! As the README says, this repository currently targets LLVM 3.8. Which version are you trying to use?
from llvm-pass-skeleton.
I'm using LLVM 8.0. However, I also followed another tutorial by Mike Shah (Northeastern+MIT LLVM Seminar - Introduction to LLVM) that works with LLVM 8.0, and I get the same error using his code. So, I'm thinking it does not have to do with the LLVM version. What do you think?
from llvm-pass-skeleton.
I'm not sure about that other tutorial, but I'm nearly certain that this error with this code is version-related. In 3.8, getOrInsertFunction
returned a Function*
. Now, it returns a FunctionCallee
. You can either try with 3.8 or—if you're feeling generous!—help update the code for the new API changes since then.
from llvm-pass-skeleton.
OK, that makes sense. Thank you!
from llvm-pass-skeleton.
Related Issues (20)
- Running annotation module HOT 1
- Fatal Error For Attributes.gen HOT 6
- Unable to run the program HOT 3
- Compile error in the rtlib branch HOT 1
- Error while running the program HOT 7
- Error while compiling HOT 1
- Support for iOS in XCODE HOT 2
- Getting error : undefined symbol: _ZN4llvm23EnableABIBreakingChecksE HOT 1
- llvm instrumentation HOT 3
- pass has no effect HOT 1
- instrumentation: Linking With a Runtime Library HOT 1
- error: clang frontend command failed due to signal (use -v to see invocation) HOT 1
- Cmake for the "mutate" branch needs C++ 14 support
- Clang 14.0.5 unable to execute command: Aborted HOT 1
- fixes for version 15? HOT 1
- Now Make the Pass Do Something Mildly Interesting HOT 1
- ModulePasses with Auto Registration HOT 31
- Using C++ files for rtlib HOT 11
- The imported target "LLVMSupport" references the file "/usr/lib/libLLVMSupport.a" Error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llvm-pass-skeleton.