Displaying 20 results from an estimated 50 matches for "getint8ti".
Did you mean:
getint8ty
2010 May 05
2
[LLVMdev] How to cast an integer array to an integer pointer? (user question)
I am new to LLVM and couldn't find any llvm-user list, so I am posting
my user question here, sorry.
I am trying to create a simple "puts" call accepting the static string,
with the code below.
The last line (CallInst::Create) fails with an assert: "Calling a
function with a bad signature!"
Because the type of function is void(u8*) and the argument supplied is:
2010 Jun 01
2
[LLVMdev] How to create global string array? (user question)
I am trying to create such module with API (it's equivalent to c++:
const char* ss[] = {"s1","s2"};):
@ss = global [2 x i8*] [i8* getelementptr inbounds ([3 x i8]* @.str1,
i32 0, i32 0), i8* getelementptr inbounds ([3 x i8]* @.str2, i32 0, i32
0)] ; <[2 x i8*]*> [#uses=0]
@.str1 = private constant [3 x i8] c"s1\00", align 1 ; <[3 x i8]*> [#uses=1]
2010 Nov 29
3
[LLVMdev] FunctionType as a function argument
Hi all.
I would like to declare a function that takes a function pointer as an
argument.
In C, it would be :
void execute(char (*func)(void*), void *param)
So, in my compiler, I have :
std::vector<const Type *> cbFPtrArgs(1, Type::getInt8PtrTy(C));
FunctionType * cbFPtrTy = FunctionType::get(Type::getInt8Ty(C), cbFPtrArgs,
false);
Function * func =
2010 May 11
2
[LLVMdev] How to create Global Variables using LLVM API?
I am new to LLVM API. and I am experimenting with it.
I want to create Global Variables in a module.
I am able to create local variables using IRBuilder class. I tried using
GlobalVariable class to create global variables.
but it doesn't work. my code looks like this:
Module* mod = new Module("test", getGlobalContext());
Constant* c = mod->getOrInsertFunction("main",
2016 Apr 17
2
Problems with GEP and CallInst
I got a little problems with strings (const char pointers). Global variables holding the string literal are declared correctly, but i have a problem when I pass this string to a function: it asserts with this message.
Assertion failed: ((i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"), function
2015 Aug 05
2
[BUG] Incorrect ASCII escape characters on Mac
On Wed, 2015-08-05 at 10:02 -0400, Ramkumar Ramachandra wrote:
>
> - at 5 = internal global [10 x i8] c"\22\D0\12\F4!\00\15\F9\EC\E1"
> - at 6 = internal global [10 x i8] c"\D0\19\FB+\FD\F8#\03\E2\11"
> + at 5 = internal global [10 x i8] c"\22Ð\12ô!\00\15ùìá"
> + at 6 = internal global [10 x i8] c"Ð\19û+ýø#\03â\11"
>
> The diff
2012 Dec 19
2
[LLVMdev] GetElementPtrConstantExpr
Ok, now it's arising another problem. IR code that I obtain is the
following:
i8* bitcast ([5 x i8] c"hello\00" to i8*)
generated from instructions:
ConstantExpr::getBitCast (ConstantDataArray::getString (getGlobalContext
(), "hello"), PointerType::get (Type::getInt8Ty (getGlobalContext ()), 0))
but the LLC tool says: invalid cast opcode for cast from '[5 x i8]'
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
2013 May 21
1
[LLVMdev] Is it valid to add parameters to a function once it is created
I create a function with an empty signature:
void llvm_start_new_function() {
llvm::outs() << "Staring new LLVM function ...\n";
Mod = new llvm::Module("module", llvm::getGlobalContext());
builder = new llvm::IRBuilder<>(llvm::getGlobalContext());
llvm::FunctionType *funcType =
llvm::FunctionType::get(builder->getVoidTy(), false);
2010 May 11
0
[LLVMdev] How to create Global Variables using LLVM API?
subramanyam wrote:
>
> I am new to LLVM API. and I am experimenting with it.
> I want to create Global Variables in a module.
> I am able to create local variables using IRBuilder class. I tried using
> GlobalVariable class to create global variables.
> but it doesn't work. my code looks like this:
>
> Module* mod = new Module("test", getGlobalContext());
>
2018 Mar 17
1
Migration from 3.8 to 6.0 questions (segfault most concerning)
I'm encountering a few problems in my migration that I haven't yet
figured out.
`getOrInsertFunction` is generating a SEGFAULT at
FunctionType::isValidArgumentType(llvm::Type*). I'm calling it as:
generic_ptr_ = llvm::PointerType::get(
llvm::Type::getInt8Ty(context), 0 );
f_natural_int = llvm::IntegerType::get(context, 64);
module->getOrInsertFunction(
2010 Nov 29
0
[LLVMdev] FunctionType as a function argument
You need a pointer-to-function type, but FunctionType just gives you a
function type. Use PointerType::getUnqual(FunctionType::get(...)). Or
TypeBuilder<char (*func)(void*), false>::get(context) from
Support/TypeBuilder.h.
On Mon, Nov 29, 2010 at 10:37 AM, Salomon Brys <salomon.brys at gmail.com>wrote:
> Hi all.
> I would like to declare a function that takes a function pointer
2012 Jul 04
2
[LLVMdev] Bogus assert in VMCore/Instructions.cpp CallInst::Create?
Evening,
I was writing some code that tried to insert calls to the
llvm.annotation intrinsic function, which has a signature of (i32,
i8*, i8*, i32). The code is below.
void addAnnotation( BasicBlock *block, Function *F)
{
string foo = "foo";
string bar = "barr";
Type *charTy = Type::getInt8Ty(block->getContext());
ArrayType *s1Ty =
2015 Mar 10
4
[LLVMdev] noob IR builder question
I am trying to get a handle on IR builder, at least some basics. I ran through a tutorial here: Create a working compiler with the LLVM framework, Part 1 <http://www.ibm.com/developerworks/library/os-createcompilerllvm1/>, and it worked well enough. I have some simple code that creates a hello world IR. I am trying to now bring in some concepts from the Kaleidoscope tutorial, namely
2013 Mar 06
1
[LLVMdev] LLVM load instruction query
Duncan Sands <baldrick <at> free.fr> writes:
>
> Hi Anshul,
>
> > I am creating a pass that will pass loaded value by load instruction to an
> > external function.
> > I don't know how to do it.Please Help.
>
> your question is too vague for anyone to be able to help you. Add details,
> for example provide the code for your pass.
>
>
2010 Jan 18
5
[LLVMdev] [patch] Union Types - work in progress
On Jan 16, 2010, at 11:15 AM, Talin wrote:
> OK here's the patch for real this time :)
>
> On Fri, Jan 15, 2010 at 4:36 PM, Talin <viridia at gmail.com> wrote:
> Here's a work in progress of the union patch. Note that the test
> "union.ll" does not work, so you probably don't want to check this
> in as is. However, I'd be interested in any
2012 Sep 05
1
[LLVMdev] Calling a function with a pointer to a global char array as argument
Hello;
Thanks to Eli for the pointer to the ConstantDataArray::getString()
fucntion. Now I am trying to declare a global char array with the content
"hi" and call a function "print" (which takes a char pointer and return an
insteger.
I am doing the following in the code -
Function Creation:
PointerType* array =
PointerType::get(IntegerType::getInt8Ty(getGlobalContext())
2014 Jan 08
3
[LLVMdev] reference to non-static member function must be called
Hi,everyone.
I'm writing a pass in which a CallInst to an external function will be
inserted. The function is declared like this:
void func(int a, unsigned chat *p);
and in the Pass(a Function Pass ,and using the InstVistor template ), I
wrote like this:
void visitStoreInst(StoreInst &SI)
{
//Get the refference of the types
Module *M =
2012 Dec 19
0
[LLVMdev] GetElementPtrConstantExpr
On 19/12/12 10:25, Alessio Giovanni Baroni wrote:
> Ok, now it's arising another problem. IR code that I obtain is the following:
>
> i8* bitcast ([5 x i8] c"hello\00" to i8*)
You need to put your "hello" in a (constant) global variable. You can then
bitcast the address of the global to i8*. I suggest you compile some C code
that makes use of the address of a
2010 Dec 26
0
[LLVMdev] Generating target dependent function calls
>>>
>>>
>>> The reason for the difference is that e.g "long" in
>>>
>>>> bool GOMP_loop_runtime_next(long, long)
>>>
>>> has a different size on different architectures.
>>>
>>> Currently we generate the prototypes and functions ourselves:
>>>> declare i8 @GOMP_loop_runtime_next(i64*,