Displaying 20 results from an estimated 26 matches for "visitcallinst".
2009 Apr 14
3
[LLVMdev] InstVisitor Example
...urposes, you
> just derive a class from the InstVisitor template, and overload the
> visit routines that you want.
>
> class StrcpyVisitor : public InstVisitor<StrcpyVisitor> {
> void handleStrcpy(CallSite strcpy);
> string strcpyName;
> public:
> void visitCallInst(CallInst& call) {
> if (call.getName() == strcpyName)
> handleStrcpy(&call);
> }
> void visitInvokeInst(InvokeInst& invoke) {
> if (call.getName() == strcpyName)
> handleStrcpy(&invoke);
> }
> };
>
> Then, you p...
2009 Apr 14
0
[LLVMdev] InstVisitor Example
...to use InstVisitor for other purposes, you
just derive a class from the InstVisitor template, and overload the
visit routines that you want.
class StrcpyVisitor : public InstVisitor<StrcpyVisitor> {
void handleStrcpy(CallSite strcpy);
string strcpyName;
public:
void visitCallInst(CallInst& call) {
if (call.getName() == strcpyName)
handleStrcpy(&call);
}
void visitInvokeInst(InvokeInst& invoke) {
if (call.getName() == strcpyName)
handleStrcpy(&invoke);
}
};
Then, you probably want to inherit from ModulePass,...
2009 Apr 14
2
[LLVMdev] InstVisitor Example
I just read the LLVM Programmer's Manual, which mentions (but
specifically does not include any details of) the InstVisitor
template. Could someone please provide an example of how to use this
template to find (as an example) all CallSites for the function
strcpy?
Thanks,
Brice Lin
2009 Apr 14
0
[LLVMdev] InstVisitor Example
...e a class from the InstVisitor template, and overload the
>> visit routines that you want.
>>
>> class StrcpyVisitor : public InstVisitor<StrcpyVisitor> {
>> void handleStrcpy(CallSite strcpy);
>> string strcpyName;
>> public:
>> void visitCallInst(CallInst& call) {
>> if (call.getName() == strcpyName)
>> handleStrcpy(&call);
>> }
>> void visitInvokeInst(InvokeInst& invoke) {
>> if (call.getName() == strcpyName)
>> handleStrcpy(&invoke);
>> }
>...
2006 Apr 13
0
[LLVMdev] Re: Creating Release 1.7 Branch at 1:00pm PDT
...7]
> [0xb7faa420]
> [0xb7faa402]
> /lib/tls/libc.so.6(gsignal+0x55)[0x7e77d5]
> /lib/tls/libc.so.6(abort+0xe9)[0x7e9149]
> /lib/tls/libc.so.6(__assert_fail+0x101)[0x7e0db1]
> gccas(llvm::Function::getIntrinsicID() const+0x6df)[0x8469d75]
> gccas((anonymous namespace)::Verifier::visitCallInst
> (llvm::CallInst&)+0x51b)[0x8485ebd]
> gccas(llvm::InstVisitor<(anonymous namespace)::Verifier,
> void>::visitCall(llvm::CallInst&)+0x18)[0x84f09b2]
> gccas(llvm::InstVisitor<(anonymous namespace)::Verifier, void>::visit
> (llvm::Instruction&)+0x2e0)[0x84f15f...
2014 Jul 07
4
[LLVMdev] Splitting basic block results in unknown instruction type assertion
...-------------- Test.cpp
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include "llvm/InstVisitor.h"
using namespace llvm;
namespace {
class TestInstVisitor : public InstVisitor<TestInstVisitor> {
public:
void visitCallInst(CallInst &I) {
Instruction *splitPoint = I.getNextNode();
BasicBlock *head = splitPoint->getParent();
BasicBlock *tail = head->splitBasicBlock(splitPoint);
}
};
class TestPass : public ModulePass {
public:
static cha...
2005 Jan 04
2
[LLVMdev] Math instructions
...'t really want to deal with.
Other compilers have options to enable the direct use of fp instructions
for math operations (gcc has -fno-math-errno,
-funsafe-math-optimizations and -fno-trapping-math), this could be
useful also for LLVM. Assuming there is such an option, should I modify
the visitCallInst function to generate machine instructions directly for
calls to math functions or is it better to include a pass which converts
the calls into intrinsics? An advantage of the second solution is that
it makes it easier for other front ends (like ours) which don't have the
semantics of libmat...
2006 Apr 13
2
[LLVMdev] Re: Creating Release 1.7 Branch at 1:00pm PDT
...[0xb7faa402]
> > /lib/tls/libc.so.6(gsignal+0x55)[0x7e77d5]
> > /lib/tls/libc.so.6(abort+0xe9)[0x7e9149]
> > /lib/tls/libc.so.6(__assert_fail+0x101)[0x7e0db1]
> > gccas(llvm::Function::getIntrinsicID() const+0x6df)[0x8469d75]
> > gccas((anonymous namespace)::Verifier::visitCallInst
> > (llvm::CallInst&)+0x51b)[0x8485ebd]
> > gccas(llvm::InstVisitor<(anonymous namespace)::Verifier,
> > void>::visitCall(llvm::CallInst&)+0x18)[0x84f09b2]
> > gccas(llvm::InstVisitor<(anonymous namespace)::Verifier, void>::visit
> > (llvm::Instruct...
2006 Apr 13
3
[LLVMdev] Re: Creating Release 1.7 Branch at 1:00pm PDT
...::SignalHandler(int)+0xd3)[0x85a1187]
[0xb7faa420]
[0xb7faa402]
/lib/tls/libc.so.6(gsignal+0x55)[0x7e77d5]
/lib/tls/libc.so.6(abort+0xe9)[0x7e9149]
/lib/tls/libc.so.6(__assert_fail+0x101)[0x7e0db1]
gccas(llvm::Function::getIntrinsicID() const+0x6df)[0x8469d75]
gccas((anonymous namespace)::Verifier::visitCallInst
(llvm::CallInst&)+0x51b)[0x8485ebd]
gccas(llvm::InstVisitor<(anonymous namespace)::Verifier,
void>::visitCall(llvm::CallInst&)+0x18)[0x84f09b2]
gccas(llvm::InstVisitor<(anonymous namespace)::Verifier, void>::visit
(llvm::Instruction&)+0x2e0)[0x84f15f2]
gccas(void llvm::InstV...
2006 Apr 13
0
[LLVMdev] Re: Creating Release 1.7 Branch at 1:00pm PDT
...gt;>> /lib/tls/libc.so.6(gsignal+0x55)[0x7e77d5]
>>> /lib/tls/libc.so.6(abort+0xe9)[0x7e9149]
>>> /lib/tls/libc.so.6(__assert_fail+0x101)[0x7e0db1]
>>> gccas(llvm::Function::getIntrinsicID() const+0x6df)[0x8469d75]
>>> gccas((anonymous namespace)::Verifier::visitCallInst
>>> (llvm::CallInst&)+0x51b)[0x8485ebd]
>>> gccas(llvm::InstVisitor<(anonymous namespace)::Verifier,
>>> void>::visitCall(llvm::CallInst&)+0x18)[0x84f09b2]
>>> gccas(llvm::InstVisitor<(anonymous namespace)::Verifier, void>::visit
>>>...
2020 Jun 03
2
Fwd: I cannot change value of global variable in LLVM IR using IRBuilder
...(text);
std::vector <Value *> params;
params.push_back(convertedText);
if (arg1)
params.push_back(arg1);
if (arg2)
params.push_back(arg2);
if (arg3)
params.push_back(arg3);
if (arg4)
params.push_back(arg4);
return Builder.CreateCall(printfFn, params);
}
return I;
}
void InstructionVisitor::visitCallInst(CallInst &CI) {
if (isAllocationFn(&CI, &TLI)) {
Value* allocatedAddress = &CI;
Instruction* I = &CI;
Value* allocatedSize = I->getOperand(0);
Instruction* next = incrementGlobalKey(I);
GlobalVariable* key = I->getModule()->getNamedGlobal("globalKey");
const c...
2006 Apr 13
0
[LLVMdev] Re: Creating Release 1.7 Branch at 1:00pm PDT
Branches have been created. You are free to checkin to cvs head again.
I'll send mail once I have the prerelease tar balls up. Please continue to
review and revise the documentation. I can fold this into the release
later.
Thanks,
Tanya
On Thu, 13 Apr 2006, Tanya Lattner wrote:
>
> I will be creating the release branch at 1:00pm PDT. Please refrain from
> checking in from
2006 Apr 13
3
[LLVMdev] Creating Release 1.7 Branch at 1:00pm PDT
I will be creating the release branch at 1:00pm PDT. Please refrain from
checking in from 1:00-1:30pm. I will send email once I am done.
Thanks,
Tanya
2019 Mar 09
2
Cast a function parameter to GEP
Hi all,
I'm still working on the Interpreter class and I would like to understand
why an operand cannot be cast to GetElementPtrInst.
My code is something like:
void MyInterpreter::visitCallInst(CallInst& I)
{
for(int i = 0; i < I.getNumArgOperands(); i++) {
operand = I.getOperand(i);
if(GetElementPtrInst* CI =
dyn_cast<GetElementPtrInst>(operand)) {
errs() << "GEP\n";
} else {
operand->...
2005 Jan 04
0
[LLVMdev] Math instructions
...direct use of fp instructions for
> math operations (gcc has -fno-math-errno, -funsafe-math-optimizations and
> -fno-trapping-math), this could be useful also for LLVM.
Yes, but this is really a separate issue, at least initially.
> Assuming there is such an option, should I modify the visitCallInst
> function to generate machine instructions directly for calls to math
> functions or is it better to include a pass which converts the calls
> into intrinsics? An advantage of the second solution is that it makes it
> easier for other front ends (like ours) which don't have the...
2013 Nov 18
2
[LLVMdev] Debug Info Slowing Things Down?!
...rame #66: 0x000000010c5af3d6 clang`(anonymous namespace)::Verifier::visitInstruction(llvm::Instruction&) + 2278
frame #67: 0x000000010c5b0bc1 clang`(anonymous namespace)::Verifier::VerifyCallSite(llvm::CallSite) + 1489
frame #68: 0x000000010c5af949 clang`(anonymous namespace)::Verifier::visitCallInst(llvm::CallInst&) + 73
frame #69: 0x000000010c5adbea clang`llvm::InstVisitor<(anonymous namespace)::Verifier, void>::visit(llvm::Instruction&) + 10058
frame #70: 0x000000010c5aa56b clang`(anonymous namespace)::Verifier::runOnFunction(llvm::Function&) + 1611
frame #71: 0...
2018 Sep 26
3
[FPEnv] FNEG instruction
On Wed, Sep 26, 2018 at 9:32 AM Sanjay Patel <spatel at rotateright.com> wrote:
>
>
> On Tue, Sep 25, 2018 at 7:47 PM Cameron McInally <cameron.mcinally at nyu.edu>
> wrote:
>
>>
>> This is the first time I'm looking at foldShuffledBinop(...), so maybe a
>> naive question, but why not do similar shuffle canonicalizations on unary
>> (or
2013 Nov 18
0
[LLVMdev] Debug Info Slowing Things Down?!
...: 0x000000010c5af3d6 clang`(anonymous namespace)::Verifier::visitInstruction(llvm::Instruction&) + 2278
> frame #67: 0x000000010c5b0bc1 clang`(anonymous namespace)::Verifier::VerifyCallSite(llvm::CallSite) + 1489
> frame #68: 0x000000010c5af949 clang`(anonymous namespace)::Verifier::visitCallInst(llvm::CallInst&) + 73
> frame #69: 0x000000010c5adbea clang`llvm::InstVisitor<(anonymous namespace)::Verifier, void>::visit(llvm::Instruction&) + 10058
> frame #70: 0x000000010c5aa56b clang`(anonymous namespace)::Verifier::runOnFunction(llvm::Function&) + 1611
>...
2016 Jun 21
3
function call replacement
Hi,
Thanks both of you for the help. I just missed that Create function had
many optional arguments... sorry for that. However my problem wasn't coming
from here (IRBuilder CreateCall function still return a pointer to CallInst
so I just added 2 times the call?). I didn't wanted to detail the all issue
previously because I knew I had a problem with my syntax. So here's my
problem:
I
2013 Nov 18
3
[LLVMdev] Debug Info Slowing Things Down?!
...0000010c5af3d6 clang`(anonymous namespace)::Verifier::visitInstruction(llvm::Instruction&) + 2278
>> frame #67: 0x000000010c5b0bc1 clang`(anonymous namespace)::Verifier::VerifyCallSite(llvm::CallSite) + 1489
>> frame #68: 0x000000010c5af949 clang`(anonymous namespace)::Verifier::visitCallInst(llvm::CallInst&) + 73
>> frame #69: 0x000000010c5adbea clang`llvm::InstVisitor<(anonymous namespace)::Verifier, void>::visit(llvm::Instruction&) + 10058
>> frame #70: 0x000000010c5aa56b clang`(anonymous namespace)::Verifier::runOnFunction(llvm::Function&) + 1611
&g...