Displaying 20 results from an estimated 33 matches for "sbytety".
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 in...
2004 Dec 09
1
[LLVMdev] Question about insert call func with pionter parameter
...nction with pointer arguments.
The function C proto-type is the following,
void stat_func(char *);
>ConstantArray *Cstr = dyn_cast<ConstantArray>(gI->getInitializer());
......
>Function *exFunc = M->getOrInsertFunction("stat_func", Type::VoidTy, PointerType::get(Type::SByteTy),0);
>std::vector<Value*> Args(1);
>Args[0] = constantArray::get(Cstr->getAsString());
>CallInst *call = new CallInst(exFunc, Args,"",InsertPos);
If the code look like the above, it could compile successfully. But once I run this pass, finally, I got errors as the foll...
2005 Mar 08
0
[LLVMdev] Recursive Types using the llvm support library
...tput
> would be perfect.
>
> %struct.linked_list = type { %struct.linked_list*, %sbyte* }
Use something like this:
PATypeHolder StructTy = OpaqueType::get();
std::vector<const Type*> Elts;
Elts.push_back(PointerType::get(StructTy));
Elts.push_back(PointerType::get(Type::SByteTy));
StructType *NewSTy = StructType::get(Elts);
// At this point, NewSTy = "{ opaque*, sbyte* }", tell VMCore that
// the struct and the opaque type are actually the same.
cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy);
// NewSTy is potentially inv...
2005 Mar 08
2
[LLVMdev] Recursive Types using the llvm support library
...t;> %struct.linked_list = type { %struct.linked_list*, %sbyte* }
>
> Use something like this:
>
> PATypeHolder StructTy = OpaqueType::get();
> std::vector<const Type*> Elts;
> Elts.push_back(PointerType::get(StructTy));
> Elts.push_back(PointerType::get(Type::SByteTy));
> StructType *NewSTy = StructType::get(Elts);
>
> // At this point, NewSTy = "{ opaque*, sbyte* }", tell VMCore that
> // the struct and the opaque type are actually the same.
> cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy);
>
>...
2005 Mar 08
3
[LLVMdev] Recursive Types using the llvm support library
As far as I can tell, when you construct a type using the support
library StructType::get, you have to pass in a list of types. How can
you make a Recursive type by passing in a pointer to the type you are
constucting.
An example where something really simple like the line below was output
would be perfect.
%struct.linked_list = type { %struct.linked_list*, %sbyte* }
Thanks for any help,
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 instruction to printf, I am using the following code:
-----
/* i an Instruction*, and f is the Function* from above */
std::vector<Value*> args...
2003 Nov 21
2
[LLVMdev] GetElementPtrInst Again!
I'm trying to set up a call to printf in stacker and have managed to
confuse myself. Perhaps you can shed some light.
I've declared printf as a function taking a pointer to SByteTy with var
args and returning SIntTy:
> // Create a function for output (int printf(format,...))
> std::vector<Type*> params;
> params.push_back( PointerType::get( Type::SByteTy ) );
> FunctionType* printf_type = FunctionType::get( Type::IntTy, params, true );
> The...
2006 Mar 03
0
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
...pp
===================================================================
--- llvm-convert.cpp (revision 111673)
+++ llvm-convert.cpp (working copy)
@@ -795,14 +795,18 @@ void TreeToLLVM::EmitMemCpy(Value *DestP
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...
2005 Mar 15
2
[LLVMdev] Dynamic Creation of a simple program
Thanks for the information
I am trying to use one of your examples for recursive data structures:
=========================
PATypeHolder StructTy = OpaqueType::get();
std::vector<const Type*> Elts;
Elts.push_back(PointerType::get(StructTy));
Elts.push_back(PointerType::get(Type::SByteTy));
StructType *NewSTy = StructType::get(Elts);
// At this point, NewSTy = "{ opaque*, sbyte* }", tell VMCore that
// the struct and the opaque type are actually the same.
cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy);
// NewSTy is potentially invalidated, but S...
2005 Mar 08
0
[LLVMdev] Recursive Types using the llvm support library
...type { %struct.linked_list*, %sbyte* }
>>
>> Use something like this:
>>
>> PATypeHolder StructTy = OpaqueType::get();
>> std::vector<const Type*> Elts;
>> Elts.push_back(PointerType::get(StructTy));
>> Elts.push_back(PointerType::get(Type::SByteTy));
>> StructType *NewSTy = StructType::get(Elts);
>>
>> // At this point, NewSTy = "{ opaque*, sbyte* }", tell VMCore that
>> // the struct and the opaque type are actually the same.
>> cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(...
2007 Jan 01
0
[LLVMdev] nightly tester grawp
...Function*, int> > >&, const char*)':
../../gcc.llvm/gcc/llvm-backend.cpp:346: error: 'IntTy' is not a
member of 'llvm::Type'
../../gcc.llvm/gcc/llvm-backend.cpp: In function 'void
llvm_asm_file_end()':
../../gcc.llvm/gcc/llvm-backend.cpp:370: error: 'SByteTy' is not a
member of 'llvm::Type'
make[1]: *** [llvm-backend.o] Error 1
make: *** [all-gcc] Error 2
We are out of luck until the changes are propagated.
Evan
On Dec 31, 2006, at 1:31 PM, Reid Spencer wrote:
> On Sun, 2006-12-31 at 13:37 -0800, Chris Lattner wrote:
>> On Sa...
2006 May 01
0
[LLVMdev] printf decleration
...yan M. Lefever wrote:
> 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 instruction to printf, I am using the following code:
>
> -----
> /* i an Instruction*, and f is the Function* from above...
2006 Dec 31
3
[LLVMdev] nightly tester grawp
On Sun, 2006-12-31 at 13:37 -0800, Chris Lattner wrote:
> On Sat, 30 Dec 2006, Reid Spencer wrote:
> >>> You all just need remove "stacker_rt.ll". the stacker_rt.ll is a
> >> rebuilt so they output proper .ll files. Reid, can you change the
> >> makefile rule to use "llvm-gcc -S -emit-llvm -o - | llvm-upgrade > $@" or
> >> the
2005 Mar 15
0
[LLVMdev] Dynamic Creation of a simple program
...ation
> I am trying to use one of your examples for recursive data structures:
>
> =========================
> PATypeHolder StructTy = OpaqueType::get();
> std::vector<const Type*> Elts;
> Elts.push_back(PointerType::get(StructTy));
> Elts.push_back(PointerType::get(Type::SByteTy));
> StructType *NewSTy = StructType::get(Elts);
>
> // At this point, NewSTy = "{ opaque*, sbyte* }", tell VMCore that
> // the struct and the opaque type are actually the same.
> cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy);
>
> // NewSTy...
2005 Jan 31
1
[LLVMdev] Question about Global Variable
...variable by gI->setInitializer(Constant *); Meanwhile I am trying to put a routine (constructing IR routine) into entry of main function, which is for recover initial vaule of global variable to the original string. In this routine,
Type *PointerAryType = ArrayType::get(PointerType::get(Type::SByteTy) , 20);
AllocaInst *PointerAry = new AllocaInst(PointerAryType , 0 , "AddrOfGstr", BB);
// Here, I tried to insert IR like alloca [20 x sbyte *], for C code, it is char *AddrOfGstr[20]; which pointer array is for storing the pointer of initial value of each
// global variable.
So next...
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
2007 May 17
8
[LLVMdev] Antw.: 2.0 Pre-release tarballs online
...07. 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 split into
sever...
2006 Oct 26
0
[LLVMdev] IMPORTANT: Working On HEAD before Release 1.9
...example, DIV will be automatically converted to SDIV, UDIV or FDIV
based on the
operand types. Similarly for the other instructions to be changed.
6. The distinction between unsigned and signed types probably won't go
away before
release time. That is, we'll still have UByteTy and SByteTy, etc. The
change to
merge those to "Int8" will occur after the 1.9 release accompanied by
another
bytecode version change (version 7). Similarly for Short, Int and
Long.
7. Until Release 1.9 goes out the door (Nov 6th), the definition of
version 6 bytecode
is in flux. Last nig...
2003 Nov 21
0
[LLVMdev] GetElementPtrInst Again!
On Fri, 21 Nov 2003, Reid Spencer wrote:
> I'm trying to set up a call to printf in stacker and have managed to
> confuse myself. Perhaps you can shed some light.
:)
> I've declared printf as a function taking a pointer to SByteTy with var
> args and returning SIntTy:
Sounds good.
> When I set up the call, I get the following from that pesky :) verifier:
Ah, but it's so helpful! :)
> Call parameter type does not match function signature!
> getelementptr [3 x sbyte]* %_str_format_, long 0...
2005 Apr 07
0
[LLVMdev] arguments to standard library functions
...mber 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( 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....