search for: int32ty

Displaying 20 results from an estimated 131 matches for "int32ty".

Did you mean: int32_t
2013 Dec 12
2
[LLVMdev] LLVM Type Int32Ty Problems & LLVMContextImpl.h Problems
Hello! I'm newer to LLVM development . I'm trying to use AllocaInst class to construct an instruction , I wrote like this: AllocaInst *alloc = new AllocaInst(llvm::Int32Ty, 0, "indexLoc",i); but it return the error: error: use of undeclared identifier 'llvm::Int32Ty' AllocaInst *alloc = new AllocaInst(Int32Ty, 0, "indexLoc",i); I found that the Int32Ty is defined in the LLVMContextImpl.h , but I can not find it in the...
2013 Dec 12
0
[LLVMdev] LLVM Type Int32Ty Problems & LLVMContextImpl.h Problems
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of Jin Huang > Subject: [LLVMdev] LLVM Type Int32Ty Problems & LLVMContextImpl.h Problems >    AllocaInst *alloc = new AllocaInst(llvm::Int32Ty, 0, "indexLoc",i); I think you should be using llvm::Type::getInt32Ty(Context), not llvm::Int32Ty, which is for internal LLVM usage. Also, using llvm::IRBuilder<> is a whole lot eas...
2014 Oct 27
2
[LLVMdev] How to call a pointer that points to a C function
...r to a function that I need to invoke without going through llvm::Module::getOrInsertFunction. This example does not work: static int add(int x, int y); llvm::Value *one, *two; llvm::Constant* addfn = llvm::ConstantInt::get(JB->getIntPtrTy(DataLayout), (intptr_t)add); llvm::Type* args[] = { Int32Ty, Int32Ty }; llvm::FunctionType* ftype = llvm::FunctionType::get(Int32Ty, args); addfn = llvm::ConstantExpr::getPointerCast(addfn, ftype); CreateCall(addfn, one, two); --- Is there a way? Or must I call getOrInsertFunction? Before anyone asks why I am doing this, it is because I have maybe 200 f...
2008 Aug 19
7
[LLVMdev] Please help with LLVM C++ integration
...d::endl; return 8848; } int _tmain(int argc, _TCHAR* argv[]){ Module *M = new Module("test"); ExistingModuleProvider* MP = new ExistingModuleProvider(M); ExecutionEngine* EE = ExecutionEngine::create(MP, false); std::vector<const Type *> func_args; func_args.push_back(Type::Int32Ty); FunctionType * func_type = FunctionType::get(Type::Int32Ty, func_args, false); Function * my_function = Function::Create( func_type, Function::ExternalLinkage, "some_test_func", M ); EE->addGlobalMapping( my_function, (void*)&some_test_func ); Function *FooF = cast<Functi...
2009 Jul 04
2
[LLVMdev] A beginner question
...rtion failure main: Type.cpp:1309: static llvm::PointerType* llvm::PointerType::get(const llvm::Type*, unsigned int): Assertion `ValueType && "Can't get a pointer to <null> type!"' failed. from this line- fields.push_back( llvm::PointerType::getUnqual(llvm::Type::Int32Ty) ); Is something needed to initialize the llvm::Type::Int32Ty? Thanks in advance, Carter
2008 Jun 28
2
[LLVMdev] need to store the address of a variable
...s array will be used for transfering these Variables to another execution engine. I've code which generates this array, and a pointer to the target field of the array. name = variables.fname + "_pointerArray"; Instruction* pointerArray = new AllocaInst(PointerType::get(Type::Int32Ty,NULL), ConstantInt::get(Type::Int32Ty, variables.inst.size()), name, alloca_point); // fill array with the addresses of the functions for(unsigned int i = 0; i < variables.inst.size(); i++) { name = "store_" + variables.inst[i]->getName(); Value* GEP = new GetElem...
2008 Aug 19
0
[LLVMdev] Please help with LLVM C++ integration
...> Module *M = new Module("test"); > ExistingModuleProvider* MP = new ExistingModuleProvider(M); > ExecutionEngine* EE = ExecutionEngine::create(MP, false); > > std::vector<const Type *> func_args; > func_args.push_back(Type::Int32Ty); > FunctionType * func_type = FunctionType::get(Type::Int32Ty, > func_args, false); > Function * my_function = Function::Create( func_type, > Function::ExternalLinkage, "some_test_func", M ); > EE->addGlobalMapping( my_function, (void*)&some_...
2008 Aug 19
0
[LLVMdev] Please help with LLVM C++ integration
...> Module *M = new Module("test"); > ExistingModuleProvider* MP = new ExistingModuleProvider(M); > ExecutionEngine* EE = ExecutionEngine::create(MP, false); > > std::vector<const Type *> func_args; > func_args.push_back(Type::Int32Ty); > FunctionType * func_type = FunctionType::get(Type::Int32Ty, func_args, false); > Function * my_function = Function::Create( func_type, > Function::ExternalLinkage, "some_test_func", M ); > EE->addGlobalMapping( my_function, (void*)&some_test_...
2013 Oct 07
1
[LLVMdev] Typecasting int32ty to int64ty
...of instruction. Due to which my vector<Value*> has different Type of Value*. How can I convert i32 to i64 type before pushing it to the vector<Value*>, so that all Value* on my vector is of same Type? -- View this message in context: http://llvm.1065342.n5.nabble.com/Typecasting-int32ty-to-int64ty-tp61814.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
2009 Sep 23
2
[LLVMdev] DebugFactory
On Sep 22, 2009, at 4:49 PM, Talin wrote: > > // Calculate the size of the specified LLVM type. > Constant * DebugInfoBuilder::getSize(const Type * type) { > Constant * one = ConstantInt::get(Type::Int32Ty, 1); > return ConstantExpr::getPtrToInt( > ConstantExpr::getGetElementPtr( > ConstantPointerNull::get(PointerType::getUnqual(type)), > &one, 1), Type::Int32Ty); > } > > Constant * DebugInfoBuilder::getAlignment(const Type * type) { >...
2009 Jul 04
0
[LLVMdev] A beginner question
...: Type.cpp:1309: static llvm::PointerType* llvm::PointerType::get(const llvm::Type*, unsigned int): Assertion `ValueType && "Can't get a pointer to <null> type!"' failed. > > from this line- > > fields.push_back( llvm::PointerType::getUnqual(llvm::Type::Int32Ty) ); > > Is something needed to initialize the llvm::Type::Int32Ty? Type::Int32Ty is a static const Type* with an initializer. You might need static constructors to run in order to initialize it, but in C++ that should require no action on your part. It should be impossible for that line...
2009 Jul 24
2
[LLVMdev] RFC: Constant Creation API
On Jul 24, 2009, at 9:30 AM, Duncan Sands wrote: >> The ones that don't can be static functions on the type class that >> take a context. For example, Type::Int32Ty needs to become a >> function >> that takes a context at some point. > > Why is that? If it is read-only then it should be possible to share > it between all threads. Type's aren't readonly, see all the mutable fields in them. While we might be able to get away w...
2009 Jun 18
3
[LLVMdev] Initialising global Array
Hi, I try to create a array that has a nonzero initialiser: What i do is, first create the array type. > const ArrayType *ATy = ArrayType::get(Type::Int32Ty, NumEdges); Then create some constant values for the initializer. > std::vector<Constant*> Initializer; Initializer.reserve(NumEdges); > APInt zero(32,0); Constant* zeroc = ConstantInt::get(zero); > APInt minusone(32,-1); Constant* minusonec = ConstantInt::get(minusone); C...
2009 Jul 04
1
[LLVMdev] A beginner question
...e* > llvm::PointerType::get(const llvm::Type*, unsigned int): > Assertion `ValueType && "Can't get a pointer to > <null> type!"' failed. > > > > from this line- > > > > fields.push_back( > llvm::PointerType::getUnqual(llvm::Type::Int32Ty) ); > > > > Is something needed to initialize the > llvm::Type::Int32Ty? > > Type::Int32Ty is a static const Type* with an initializer. > You might > need static constructors to run in order to initialize it, > but in C++ > that should require no action on your...
2009 Jul 25
0
[LLVMdev] RFC: Constant Creation API
Hi, On Fri, Jul 24, 2009 at 7:03 PM, Chris Lattner <clattner at apple.com> wrote: > > On Jul 24, 2009, at 9:30 AM, Duncan Sands wrote: > > >> The ones that don't can be static functions on the type class that > >> take a context. For example, Type::Int32Ty needs to become a > >> function > >> that takes a context at some point. > > > > Why is that? If it is read-only then it should be possible to share > > it between all threads. > > Type's aren't readonly, see all the mutable fields in them. While...
2009 Sep 22
0
[LLVMdev] DebugFactory
...IFactory can figure this out with Target info in all > cases ? > > oops... I meant to say "... without Target info..." > > // Calculate the size of the specified LLVM type. Constant * DebugInfoBuilder::getSize(const Type * type) { Constant * one = ConstantInt::get(Type::Int32Ty, 1); return ConstantExpr::getPtrToInt( ConstantExpr::getGetElementPtr( ConstantPointerNull::get(PointerType::getUnqual(type)), &one, 1), Type::Int32Ty); } Constant * DebugInfoBuilder::getAlignment(const Type * type) { // Calculates the alignment of T usi...
2009 Jun 18
0
[LLVMdev] Initialising global Array
Andreas Neustifter wrote: > Hi, > > I try to create a array that has a nonzero initialiser: > > What i do is, first create the array type. > > > const ArrayType *ATy = ArrayType::get(Type::Int32Ty, NumEdges); > > Then create some constant values for the initializer. > > > std::vector<Constant*> Initializer; Initializer.reserve(NumEdges); > > I ran the following two functions in a ModulePass. The Initializer initialization is the difference. static void and...
2017 Feb 21
3
What is the proper usage of LLVMContext?
...ween the following (A)`my_context` and (B)`global_context`? Do I have to create a LLVMContext by myself? Or use `getGlobalContext()`? Could you tell me what situation needs a LLVMContext which is created by myself such as (A)? (A) { llvm::LLVMContext my_context; // codes using only my_context (get Int32ty() or StructType::create or etc...) } (B) { llvm::LLVMContext &globa_context = llvm::getGlobalContext(); // codes using only globa_context (get Int32ty() or StructType::create or etc...) } Q2) What situation do I need to create multiple `LLVMContext`s? I don't know the situation used mult...
2009 Sep 22
3
[LLVMdev] DebugFactory
On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com> wrote: > On Tue, Sep 22, 2009 at 12:14 AM, Talin <viridia at gmail.com> wrote: >> So, one feature of the late, lamented DebugInfoBuilder that I am missing >> quite badly, and which is not available in the current DIFactory, is the >> ability to specify structure offsets abstractly. The
2008 Jun 28
0
[LLVMdev] need to store the address of a variable
...hese Variables to > another execution engine. > > I've code which generates this array, and a pointer to the target field of the > array. > > name = variables.fname + "_pointerArray"; > Instruction* pointerArray = new > AllocaInst(PointerType::get(Type::Int32Ty,NULL), > ConstantInt::get(Type::Int32Ty, variables.inst.size()), > name, > alloca_point); > > // fill array with the addresses of the functions > for(unsigned int i = 0; i < variables.inst.size(); i++) { > name = "store_" + variables.inst[i]->get...