search for: getunqu

Displaying 20 results from an estimated 78 matches for "getunqu".

Did you mean: getunqual
2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...Target, MemRef(LV.Ptr, Alignment, isVolatile), TREE_TYPE(exp)); @@ -5885,9 +5896,10 @@ LValue TreeToLLVM::EmitLV_DECL(tree exp) Value *Decl = DECL_LLVM(exp); if (Decl == 0) { if (errorcount || sorrycount) { - const PointerType *Ty = - PointerType::getUnqual(ConvertType(TREE_TYPE(exp))); - return ConstantPointerNull::get(Ty); + const Type *Ty = ConvertType(TREE_TYPE(exp)); + const PointerType *PTy = PointerType::getUnqual(Ty); + LValue LV(ConstantPointerNull::get(PTy), TD.getABITypeAlignment(Ty)); + return LV; }...
2007 Dec 17
3
[LLVMdev] PointerType API Change
Christopher, > The API for getting PointerType objects has just changed to make > Embedded C address space information explicit. The old semantics of > PointerType::get() now apply to PointerType::getUnqual(), which > returns a pointer in the generic address space. PointerType::get() now > requires both a type and an address space. What is the reason of such change? -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University.
2009 May 21
3
[LLVMdev] Passing a pointer to a function
...Where load_fcall is build using a call to Module::getOrInsertFunction as in the example here: http://wiki.llvm.org/HowTo:_Insert_a_function_call My question is, what do I pass as the argument type for P above? The following seems to work, as long as there are no floating point ops: PointerType::getUnqual(IntegerType::get(32)) So I tried using just a void pointer type, as in: PointerType::getUnqual(Type::VoidTy) But then Type.cpp throws this assertion. Assertion `ValueType != Type::VoidTy && "Pointer to void is not valid, use sbyte* instead!"' failed. I can try checking th...
2007 Dec 17
2
[LLVMdev] PointerType API Change
..., 2007, at 10:22 PM, Anton Korobeynikov wrote: > > Christopher, > > > >> The API for getting PointerType objects has just changed to make > >> Embedded C address space information explicit. The old semantics of > >> PointerType::get() now apply to PointerType::getUnqual(), which > >> returns a pointer in the generic address space. PointerType::get() > >> now > >> requires both a type and an address space. > > > > What is the reason of such change? > > Sorry for not providing that. Here's the conversation with Chri...
2007 Dec 17
2
[LLVMdev] PointerType API Change
...ear in the > source where address space qualifiers are preserved/added or stripped > from the pointer type. Allowing clients to use get() and then > dynamically track "undefined" address spaces under the hood is > counter to this goal. Informally, what I'd like to have is getUnqual() semantics as default for get(), thus giving you the same safety properties but without having to change all occurrences. If clients do handle address spaces, they could use getQual(...) and getUnqual(). I don't see how this would be counter to your goals. If a module with address spaces...
2007 Dec 17
0
[LLVMdev] PointerType API Change
On Dec 16, 2007, at 10:22 PM, Anton Korobeynikov wrote: > Christopher, > >> The API for getting PointerType objects has just changed to make >> Embedded C address space information explicit. The old semantics of >> PointerType::get() now apply to PointerType::getUnqual(), which >> returns a pointer in the generic address space. PointerType::get() >> now >> requires both a type and an address space. > What is the reason of such change? Sorry for not providing that. Here's the conversation with Chris: > On Dec 12, 2007, at 1:32 AM,...
2009 Jan 09
0
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...bool isVolatile = TREE_THIS_VOLATILE(Op); > - unsigned Alignment = expr_align(Op) / 8; > + unsigned Alignment = LV.getAlignment(); This also looks like it was already ok. > if (errorcount || sorrycount) { > - const PointerType *Ty = > - PointerType::getUnqual(ConvertType(TREE_TYPE(exp))); > - return ConstantPointerNull::get(Ty); > + const Type *Ty = ConvertType(TREE_TYPE(exp)); > + const PointerType *PTy = PointerType::getUnqual(Ty); > + LValue LV(ConstantPointerNull::get(PTy), > TD.getABITypeAlignment(Ty)); > +...
2007 Dec 17
0
[LLVMdev] PointerType API Change
...2 PM, Anton Korobeynikov wrote: >>> Christopher, >>> >>>> The API for getting PointerType objects has just changed to make >>>> Embedded C address space information explicit. The old semantics of >>>> PointerType::get() now apply to PointerType::getUnqual(), which >>>> returns a pointer in the generic address space. PointerType::get() >>>> now >>>> requires both a type and an address space. >>> >>> What is the reason of such change? >> >> Sorry for not providing that. Here's the...
2007 Dec 17
3
[LLVMdev] PointerType API Change
The API for getting PointerType objects has just changed to make Embedded C address space information explicit. The old semantics of PointerType::get() now apply to PointerType::getUnqual(), which returns a pointer in the generic address space. PointerType::get() now requires both a type and an address space. The clang, llvm-gcc-4.0, and llvm-gcc-4.2, and internal llvm projects have all been updated to take this API change into account. The only current omission is the C i...
2010 Jun 15
2
[LLVMdev] Adding fields in a already built type? (2)
...efine" opaque types to other types. There is a section in the programmer's manual on this: > http://llvm.org/docs/ProgrammersManual.html#TypeResolve > > -Chris So I succeeded in using a "PATypeHolder" for the "opaque" type, define a Type* with PointerType::getUnqual, prepare a field, then use " refineAbstractTypeTo " to built the real type with this added field. The thing is that I would need to do that repeatedly, that is progressively adding fields, generates code that access those ready fields, and "refine" the type step by step. Is...
2009 Sep 23
2
[LLVMdev] DebugFactory
...ize 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 using "sizeof({i8, T}) - sizeof > (T)" > return ConstantExpr::getSub( > getSize(StructTy...
2007 Dec 17
0
[LLVMdev] PointerType API Change
...e where address space qualifiers are preserved/added or stripped >> from the pointer type. Allowing clients to use get() and then >> dynamically track "undefined" address spaces under the hood is >> counter to this goal. > > Informally, what I'd like to have is getUnqual() semantics as > default for > get(), thus giving you the same safety properties but without > having to > change all occurrences. If clients do handle address spaces, they > could use > getQual(...) and getUnqual(). > I don't see how this would be counter to your g...
2009 Jul 04
2
[LLVMdev] A beginner question
...I am getting the assertion 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
2009 Sep 22
0
[LLVMdev] DebugFactory
...; > // 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 using "sizeof({i8, T}) - sizeof(T)" return ConstantExpr::getSub( getSize(StructType::get(Type::Int8Ty, type, NULL)),...
2009 Sep 22
5
[LLVMdev] Verifier should not make any assumptions about calls to "malloc"
Hi Victor, this code from the verifier broke the Ada front-end build: const Module* M = CI.getParent()->getParent()->getParent(); Constant *MallocFunc = M->getFunction("malloc"); if (CI.getOperand(0) == MallocFunc) { const PointerType *PTy = PointerType::getUnqual(Type::getInt8Ty(CI.getParent()->getContext())); Assert1(CI.getType() == PTy, "Malloc call must return i8*", &CI); } I think it is completely wrong for the verifier to be checking anything about calls to functions that happen to be called "malloc". What if I ha...
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 Nov 17
2
[LLVMdev] Assertion `castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"' failed.
...ut what you have suggested. I have written the below code which basically tries to write the constant 10 to a file. myprint is a function pointer to a function which takes char * parameter and writes it to file. Value *Ten = ConstantInt::get(Type::Int32Ty, 10); const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty); AllocaInst *AI = new AllocaInst(Type::Int32Ty); Value *ST = new StoreInst(Ten,AI,false,4,j); Value *BT = new BitCastInst(ST,VoidPtrTy,"",j); CallInst *CallPrint = CallInst::Create(myprint, BT, "", j); CallPrint->setTailCall(true); I am getting the following...
2009 May 21
0
[LLVMdev] Passing a pointer to a function
.../HowTo:_Insert_a_function_call > > My question is, what do I pass as the argument type for P above? The > following seems to work, as long as there are no floating point ops: I would suggest bit-casting p to an i8*. > So I tried using just a void pointer type, as in: > PointerType::getUnqual(Type::VoidTy) > > But then Type.cpp throws this assertion. > Assertion `ValueType != Type::VoidTy && "Pointer to void is not valid, > use sbyte* instead!"' failed. Yeah, void* in C == i8* in LLVM. VoidTy is only used for function return types. I'm not sure...
2009 Sep 23
0
[LLVMdev] DebugFactory
...fied 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 using "sizeof({i8, T}) - sizeof(T)" >> return ConstantExpr::getSub( >>...
2010 Jan 28
1
[LLVMdev] about pointer type
Dear all, In the early llvm version, we could use PointerType::get(Type::Int32Ty)) to get the pointer type. But in the latest llvm (version 2.6), it doesn't work. Compiler says "‘Int32Ty’ is not a member of ‘llvm::Type’". I've looked the doxygen document, however, I can't find an answer, would you please help me? Thanks! -Wink -- View this message in context: