similar to: [LLVMdev] adding args to func call

Displaying 20 results from an estimated 500 matches similar to: "[LLVMdev] adding args to func call"

2006 May 01
0
[LLVMdev] printf decleration
Ok, I think I figured it out. I talked to someone, and we figured out that when I make a call to printf with a constant string, I need to make a global variable and use getElementPtr to reference it. The modified call for accessing the printf is: /* m is Module*, f is Function*, i is Instruction* */ Constant* constStr = ConstantArray::get("test\n"); GlobalVariable* gv =
2006 Jun 30
1
[LLVMdev] instruction sequence
I'm trying to insert a call to fprintf(stderr, ...). I've looked at the emitted assembly from llvm-gcc, and it consists of a LoadInst (of stderr) and CallInst. It looks like this: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %tmp.1 = load %struct._IO_FILE** %stderr ; ty=%struct._IO_FILE* %tmp.0 = call int (%struct._IO_FILE*, sbyte*, ...)* %fprintf(%struct._IO_FILE* %tmp.1, sbyte*
2006 May 01
2
[LLVMdev] printf decleration
I am writing a pass where I need to make a function deceleration for printf. Below is the code I'm trying to use. ----- bool MyPass::runOnModule(Module &m) { vector<const Type*> args; args.push_back(PointerType::get(Type::SByteTy)); Function* f = m.getOrInsertFunction("printf", FunctionType::get(Type::IntTy, args, true)); ----- When I insert a call
2005 Mar 16
2
[LLVMdev] Dynamic Creation of a simple program
Hi Misha, Thanks for your answer I was doing this: ======================== BasicBlock *BBlock = new BasicBlock("entry", MyFunc); ... Value *Zero = ConstantSInt::get(Type::IntTy, 0); Value *UZero = ConstantUInt::get(Type::UIntTy, 0); MallocInst* mi = new MallocInst( STyStru ); mi->setName("tmp.0"); BBlock->getInstList().push_back( mi );
2005 Apr 11
2
[LLVMdev] JIT and array pointers
On Sun, 2005-04-10 at 19:47 -0500, Chris Lattner wrote: > On Mon, 11 Apr 2005, Paul wrote: > > I'm trying to pass an array pointer to my run-time generated module, and > > after a long time of searching for the answer, the only thing I got was > > a headache. Basically I have a few arrays (few megabytes which will > > sometimes be accessed as 8 / 16 / 32 / 64 bit
2005 Apr 11
0
[LLVMdev] JIT and array pointers
On Mon, 11 Apr 2005, dummy1 at boxpl.com wrote: >> There are many possible ways to do this, can you be a bit more specific >> about what you're trying to do? > Here is a basic example: Ah, ok, I see what you're trying to do. Below is some *pseudo* code for the basic idea: > ============================================ > unsigned int buff[4096]; > > int main
2005 Apr 11
0
[LLVMdev] JIT and array pointers
On Mon, 11 Apr 2005, Paul wrote: > I'm trying to pass an array pointer to my run-time generated module, and > after a long time of searching for the answer, the only thing I got was > a headache. Basically I have a few arrays (few megabytes which will > sometimes be accessed as 8 / 16 / 32 / 64 bit binary / fp values), that > will be modified by both the generated module, and my
2005 Apr 10
2
[LLVMdev] JIT and array pointers
I'm trying to pass an array pointer to my run-time generated module, and after a long time of searching for the answer, the only thing I got was a headache. Basically I have a few arrays (few megabytes which will sometimes be accessed as 8 / 16 / 32 / 64 bit binary / fp values), that will be modified by both the generated module, and my main c program, so I would like to put those into global
2006 Mar 03
0
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
On Thu, 2 Mar 2006, Chris Lattner wrote: >> Any ideas what could be wrong? > > Sorry for the delay, please try this tarball: > http://nondot.org/sabre/2006-03-02-llvm-gcc-4.tar.gz Actually, do to a recent change in CVS, this tarball will probably not work anymore. Please apply the attached (small) patch on top of it in the gcc directory. Worth noting, this front-end only works
2006 Mar 02
4
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
On Thu, 2 Mar 2006, Vladimir Prus wrote: >>> The instructions seem to have one path wrong. It says to get: >> >> I'll put together a tarball today. That will be easier than dealing with >> a patch, and it will include a bunch of bugfixes since the previous email. > Further into process, I get this error: > In file included from
2002 Sep 29
0
[LLVMdev] Re: llvm question
Sorry for the delay Lee, I was out of town yesterday. In general it's better to send questions to the LLVMdev list... > hi. all i want to do now is make a new SetCondInst that i can replace > some old ones with, and it is turning out *impossible*. the first > parameter is the opcode, which is of class BinaryOps, which turns out to > be an enum i can't understand in
2006 May 17
0
[LLVMdev] Obfuscation with LLVM
Hi all, I was trying to implement an obfuscation tool for C-code on the basis of LLVM. I got a prototype of the simple obfuscation transformation which converting control flow graph to something like a state machine. I am not sure I will have time to work on extending further this tool with new transformations like opaque predicates and decided to put here source code I have by now with hope
2004 May 21
1
[LLVMdev] Re: LLVMdev digest, Vol 1 #292 - 4 msgs
Hi, Thank Brian Gaeke so much. Following TraceBasicBlocks.cpp, I modified the code as below and could insert instruction or function I need into anywhere in Module. But it works well without BB->getInstList().push_back(InstrCall), and if I add the BB->getInstList().push_back() following new CallInst(), I got error information when runing opt. What is the reason for it? And is it necessary
2005 Apr 07
0
[LLVMdev] arguments to standard library functions
Right now I am trying to capture the function name and the number of arguments , so this following is the pass I wrote . ------------------------------------------------------------- struct pass06a : public ModulePass { virtual bool runOnModule(Module &M) { std::vector<const Type*> pList; pList.push_back( PointerType::get(Type::SByteTy) ); pList.push_back(
2003 Jan 28
1
[LLVMdev] Building a new struct type, etc
Hi folks, I was just wondering if someone would be willing to tell me the best way to make a new structure type in LLVM and get it inserted as a valid type into a particular Module instance? I've done the following: vector<const Type*> types; types.push_back(Type::UIntTy); types.push_back(Type::UIntTy); structType = StructType::get(types); But
2007 Mar 07
1
[LLVMdev] UIntTy, IntTy, and SByteTy
I have llvm code that uses llvm::Type::UIntTy, llvm::Type::IntTy, and llvm::Type::SByteTy, but these are now removed. What should I use for their replacement. If I need to specify a size for IntTy and UIntTy, I want them to be the same size that an integer would be in C on the platform on which I'm compiling. So, if I need the sizes is their a way to fetch the size that an integer
2005 Mar 21
3
[LLVMdev] arguments to standard library functions
HI , I understand that the standard C library functions are executed using the native library of the host machine. ( for example when we execute a bytecode to extract the profile info ) Is it possible to extract for each standard library function that is executed , the arguments that the function is called with. For example if printf ("%d", some_int ) when called during runtime
2002 Sep 23
2
[LLVMdev] Accessing constant indexes in GetElementPtr
> Also sprach Wojciech Stryjewski: > } Ok. Let's say I have a GetElementPtrInst that is used to access > structure > } elements. In this case the indexes will be constants and I want > to get the > } constant values as an a native C int. > } > } Now I can iterate over all the indexes with idx_begin(). I can cast > } all of the indexes to a ConstantIntegral. However,
2002 Sep 22
2
[LLVMdev] Accessing constant indexes in GetElementPtr
Ok. Let's say I have a GetElementPtrInst that is used to access structure elements. In this case the indexes will be constants and I want to get the constant values as an a native C int. Now I can iterate over all the indexes with idx_begin(). I can cast all of the indexes to a ConstantIntegral. However, I cannot cast the indexes to a ConstantSInt or ConstantUInt (cast<> throws an
2005 Mar 16
1
[LLVMdev] Dynamic Creation of a simple program
Hi, Given these C instructions: ============================== struct stru { struct stru *Next; }; struct list *NewStru = malloc ( sizeof ( struct stru ) ); struct list *tmp.3; ... tmp.3 = NewStru->Next; ============================== LLVM generates something like this: %tmp.0 = malloc %struct.stru ; <%struct.stru*> %tmp.3 = getelementptr %struct.stru* %tmp.0, int 0, uint 1 ;