search for: uintty

Displaying 20 results from an estimated 27 matches for "uintty".

Did you mean: intty
2006 Mar 03
0
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
...P unsigned Align) { const Type *SBP = PointerType::get(Type::SByteTy); static Function *MemCpy = 0; - if (!MemCpy) - MemCpy = TheModule->getOrInsertFunction("llvm.memcpy", Type::VoidTy, SBP, - SBP, Type::UIntTy, Type::UIntTy, + const Type *IntPtr = TD.getIntPtrType(); + if (!MemCpy) { + const char *Name = IntPtr == Type::UIntTy ? + "llvm.memcpy.i32" : "llvm.memcpy.i64"; + MemCpy = TheModule->getOrInsertFunction(Name, Type::VoidTy, SBP, +...
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...
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
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 can't seem to find any member functions in Module that allow me to introduce this as a new type... Furthermore, how would I create a (preferably static) global instance of the above structure type, toget...
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 ); GetElementPtrInst *m_Next = new GetElementPtrInst(mi, UZero, Zero, "tmp.3", BBlock ); ... ======================== But I tried your code instead of the...
2005 Apr 11
2
[LLVMdev] JIT and array pointers
...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 variables. I also tried passing it > > as a function argument (with argument type PointerType::get > > (Type::UIntTy)), and failed miserably. I feel lost. Right now I got only > > a small module with some simple operations (big thanks to the examples, > > they really help a lot). Maybe its because I'm not a c++ guy, but I > > really want to use llvm, especially because of it's nice job a...
2005 Apr 10
2
[LLVMdev] JIT and array pointers
...tes 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 variables. I also tried passing it as a function argument (with argument type PointerType::get (Type::UIntTy)), and failed miserably. I feel lost. Right now I got only a small module with some simple operations (big thanks to the examples, they really help a lot). Maybe its because I'm not a c++ guy, but I really want to use llvm, especially because of it's nice job at optimizing code. And I only...
2006 Jun 25
1
[LLVMdev] adding args to func call
...on* */ Constant* constStr = ConstantArray::get("test\n"); GlobalVariable* gv = new GlobalVariable (constStr->getType(), true, GlobalValue::InternalLinkage, constStr, "", m); std::vector<Constant*> geplist; geplist.push_back(ConstantUInt::get(Type::UIntTy,0)); geplist.push_back(ConstantUInt::get(Type::UIntTy,0)); Constant* gep = ConstantExpr::getGetElementPtr(gv,geplist); -- Jerry Hom
2006 May 01
0
[LLVMdev] printf decleration
...on* */ Constant* constStr = ConstantArray::get("test\n"); GlobalVariable* gv = new GlobalVariable (constStr->getType(), true, GlobalValue::InternalLinkage, constStr, "", m); std::vector<Constant*> geplist; geplist.push_back(ConstantUInt::get(Type::UIntTy,0)); geplist.push_back(ConstantUInt::get(Type::UIntTy,0)); Constant* gep = ConstantExpr::getGetElementPtr(gv,geplist); std::vector<Value*> args; args.push_back(gep); new CallInst(f, args, "", i); Ryan M. Lefever wrote: > I am writing a pass where I need to make...
2005 Apr 11
0
[LLVMdev] JIT and array pointers
...imes 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 variables. I also tried passing it > as a function argument (with argument type PointerType::get > (Type::UIntTy)), and failed miserably. I feel lost. Right now I got only > a small module with some simple operations (big thanks to the examples, > they really help a lot). Maybe its because I'm not a c++ guy, but I > really want to use llvm, especially because of it's nice job at > optimizi...
2005 Apr 11
0
[LLVMdev] JIT and array pointers
...do. Below is some *pseudo* code for the basic idea: > ============================================ > unsigned int buff[4096]; > > int main (void) > { > buff[0] = 1; > > // compile and execute code that will change buff[0] to 2 > Value *c0 = ConstantUInt::get (Type::UIntTy, 0); > Value *c2 = ConstantUInt::get (Type::UIntTy, 2); > > Module *m = new Module ("test_module"); Here, create an LLVM GlobalVariable 'BuffGV' of the appropriate type, and insert it into m: GlobalVariable *BuffGV = new GlobalVariable([4096 x uint], false, GlobalVa...
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
2006 May 17
0
[LLVMdev] Obfuscation with LLVM
..., oldEntryBB ); BasicBlock* disMainBB = new BasicBlock( "dispatcher_main", &currFunction, oldEntryBB ); // Add instructions that allocate and initialize the dispatcher's state variable // to the initialization block. AllocaInst* statePtr = new AllocaInst( Type::UIntTy, 0, "state", disInitBB ); new StoreInst( ConstantUInt::get( Type::UIntTy, firstBBIndex ), statePtr, disInitBB ); new BranchInst( disMainBB, disInitBB ); // Connection to the dispatcher's main block. // Add instructions to the dispatcher's main block that implement...
2006 Jun 30
1
[LLVMdev] instruction sequence
...***** Constant* constStr = ConstantArray::get("test\n"); GlobalVariable* gv = new GlobalVariable (constStr->getType(), true, GlobalValue::InternalLinkage, constStr, "", MP); std::vector<Constant*> geplist; geplist.push_back(ConstantUInt::get(Type::UIntTy,0)); geplist.push_back(ConstantUInt::get(Type::UIntTy,0)); Constant* gep = ConstantExpr::getGetElementPtr(gv,geplist); IP = new LoadInst(GVstderr, "loadstderr", IP); IPstderr = IP; std::vector<Value*> args; args.push_back(IPstderr); args.push_back(gep); IP...
2002 Sep 29
0
[LLVMdev] Re: llvm question
...ey come from. > say i want it to be a eq or an ne. the next two parameters have to be > values; i want to just put constants in there, like 1s or something, and i > cannot for the life of me make that happen. i thought i'd figured out > that > (Value *) new ConstantUInt( Type::UIntTy, 1 ) > would give me a '1' for a constant, cast as a value, that i could use as > one of the operands to my new SetCondInst(). but making a new > constantuint is a protected operation and it won't let me do it. Ok, yeah that won't work. Try this instead: ConstantUInt::g...
2005 Apr 07
0
[LLVMdev] arguments to standard library functions
...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( Type::UIntTy ); FunctionType* FT = FunctionType::get( Type::IntTy, pList, /*is vararg*/ false); Function* CF = new Function(FT, Function::ExternalLinkage, std::string("logExternalCalls"), &M); for(Module::iterator i = M.begin(), e = M.end(); i != e; i++ ){ for(Functi...
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
2004 May 21
1
[LLVMdev] Re: LLVMdev digest, Vol 1 #292 - 4 msgs
...pen+0x41)[0x8381d2d] Aborted Source code: static void InsertInstrumentationCall( BasicBlock *BB, const std::string FnName, unsigned BBnumber){ Module &M = *BB->getParent()->getParent(); Function *InstrFn = M.getOrInsertFunction (FnName , Type::VoidTy, Type::UIntTy,0); std::vector<Value *> Args(1); Args[0] = ConstantUInt::get(Type::UIntTy, BBnumber); // Insert Call after first instruction BasicBlock :: iterator InsertPos = BB->begin(); Instruction *InstrCall = new CallInst (InstrFn, Args , "",InsertPos); BB->getInstList().p...
2007 May 17
8
[LLVMdev] Antw.: 2.0 Pre-release tarballs online
...ck to March 2007. Has any progress been made recently in adding LTO to the Darwin linker and/or GNU binutils? About porting from 1.9 to 2.0: it would be helpful to have some kind of porting guide as I encountered a lot of API changes, e.g.: * SymbolTable.h has vanished * Type::IntTy, Type::UIntTy, Type::SByteTy, ... are replaced by Type::Int8Ty, ... How does one keep code portable with the various TypeIntXTy's? * GetElementPtrInst's constructor doesn't accept an std::vector anymore but requires explicit arguments. * CastInst is now abstract and its functionality is spl...
2004 Jul 21
0
[LLVMdev] GC questions.
...: /var/cvs/llvm/llvm/lib/Transforms/Scalar/LowerGC.cpp,v retrieving revision 1.4 diff -r1.4 LowerGC.cpp 112c112 < GCRead = M.getOrInsertFunction("llvm_gc_read", VoidPtr, VoidPtrPtr, 0); --- > GCRead = M.getOrInsertFunction("llvm_gc_read", VoidPtr, VoidPtrPtr, Type::UIntTy, 0); 115c115 < VoidPtr, VoidPtrPtr, 0); --- > VoidPtr, VoidPtrPtr, Type::UIntTy, 0); 192c192 < CallInst *NC = new CallInst(GCRead, CI->getOperand(1), --- > CallInst *NC = new CallI...