Displaying 20 results from an estimated 4000 matches similar to: "[LLVMdev] Use still stuck around after Def is destroyed:"
2011 Oct 26
0
[LLVMdev] Use still stuck around after Def is destroyed:
On Oct 26, 2011, at 12:18 PM, ret val wrote:
> I made a GlobalVariable that is of type ConstantArray. For one of it's
> elements I assigned it the ConstantExpr::getBitCast of another
> GlobalVariable(the "shadow pointer" mentioned). This gives me:
>
> While deleting: i32 (i32)** %Shadow Variable for ptr1
> Use still stuck around after Def is
2011 Oct 27
1
[LLVMdev] Use still stuck around after Def is destroyed:
No, I am not trying to delete anything.
I wanted to created a GlobalVariable that is of Type ConstantArray,
where one of the elements its a BitCast of a GlobalVariable. I have
that, but I get those errors after my pass is done. I dont know why,
my code seems sane enough, and I dont know another way I can go about
this.
On Wed, Oct 26, 2011 at 4:42 PM, Tanya Lattner <lattner at apple.com>
2011 Nov 24
1
[LLVMdev] differences in IR and ELF?
I'm trying to create a GlobalVariable that is a ConstantArray. Id like
each element to be a pointer to other things in the program(global
variables, functions). So that they all have the same type Id like to
make the elements void pointers.
I think I am going about this wrong, heres how I am doing it:
void writeArray(Module &M, GlobalVariable *shadow, Function *val,
2020 Oct 01
3
Creating a global variable for a struct array
>The type you pass to GlobalVariable's constructor for that variable
should be "[10 x %struct.dlist]" because that's what you want storage
for. Then the GlobalVariable itself will be a Constant of type "[10 x
%struct.dlist]*".
Yes, I verified that this is the case.
I enabled assertions and the error seems to occur while creating GlobalVariable for both struct dhash
2020 Sep 30
2
Creating a global variable for a struct array
Let me clarify my question.
I have a struct array h1 as follows:
dhash h1[10];
I want to get a Constant* to variable h1. It looks like I can use ConstantStruct::get(StructType*, ArrayRef<Constant *>) to do this.
My question is how to get the second argument of type ArrayRef<Constant *> from the above variable h1.
Thanks,
Chaitra
________________________________
From: Tim Northover
2011 Nov 21
2
[LLVMdev] A way to pass const char* arg without creating a GlobalVariable
Hi,
Is it possible to make up a ConstantArray containing a "const char*"
string and pass it directly to the function "char*" argument *without*
creating a GlobalVaribable?
I looked around and found the usual implementation is
array->globalVar->gep. If we omit globalVar & gep, then the argument
type would be [ i8 x N ], where N is set to the exact string length,
and
2011 Nov 21
0
[LLVMdev] A way to pass const char* arg without creating a GlobalVariable
What memory would the pointer argument point to?
― Gordon
On Nov 20, 2011, at 16:58, "Dmitry N. Mikushin" <maemarcus at gmail.com> wrote:
> Hi,
>
> Is it possible to make up a ConstantArray containing a "const char*"
> string and pass it directly to the function "char*" argument *without*
> creating a GlobalVaribable?
> I looked around and
2011 Oct 20
2
[LLVMdev] common type at compile time?
I'm a bit confused. For the Type did you mean something like:
ArrayType *type = ArrayType::get(Type::getInt8PtrTy(M.getContext()), 4);
This does not work, it gives me ""Wrong type in array element
initializer" at runtime.
Also it doesn't look like ConstantExpr inherits ConstantArray, so I'm
not sure how I could use this instead.
Thanks
On Thu, Oct 20, 2011 at
2011 Oct 20
3
[LLVMdev] common type at compile time?
I'm trying to create a ConstantArray(whose contents will be of types
Function*, GlobalVariable *) so I can immediately create a new
GlobalVariable(that will be in its own section). I'm doing this so I
have these address stored. In order to create this ConstantArray I
need a valid ArrayType, but I'm not sure what to use for the element
type.
I want this to be done at compile time, so I
2006 Mar 27
1
[LLVMdev] could you give me some advice ?
excuse me for bother you again .
a little supplement
Constant* c = findValue(m,"E1$entry");
Constant* c2 = findValue(m,"E1$str");
I can get string object from c2
string s = cast<ConstantArray>(c2)->getAsString();
but it is not applicable for c
string s= cast<ConstantArray>(c)->getAsString(); // Assert Fail
because c is ConstantExpr::GetElementPtr
2011 Oct 20
0
[LLVMdev] common type at compile time?
On 10/20/11 11:34 AM, ret val wrote:
> I'm a bit confused. For the Type did you mean something like:
> ArrayType *type = ArrayType::get(Type::getInt8PtrTy(M.getContext()), 4);
I assume that creates an ArrayType of 4 elements whose elements are
pointers to 8-bit values. If so, then this is what I meant.
> This does not work, it gives me ""Wrong type in array
2011 Oct 20
0
[LLVMdev] common type at compile time?
On 10/20/11 10:43 AM, ret val wrote:
> I'm trying to create a ConstantArray(whose contents will be of types
> Function*, GlobalVariable *) so I can immediately create a new
> GlobalVariable(that will be in its own section). I'm doing this so I
> have these address stored. In order to create this ConstantArray I
> need a valid ArrayType, but I'm not sure what to use for
2012 Dec 18
2
[LLVMdev] GetElementPtrConstantExpr
Because I need to convert an [4 x i8] type to i8* in the instantiation of a
GlobalVariable.
I have the follow declaration: %xxx = type { i8* } and I must emit the
following variable:
@yyy = linkonce_odr constant %xxx { [4 x i8] c"hello\00" }, but it's wrong.
How do I do?
2012/12/18 Óscar Fuentes <ofv at wanadoo.es>
> Alessio Giovanni Baroni <alessiogiovanni.baroni at
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]
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]'
2014 Aug 09
3
[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?
On Sat, Aug 9, 2014 at 6:06 AM, Tim Northover <t.p.northover at gmail.com>
wrote:
> Hi Rob,
>
> On 9 August 2014 02:03, Rob Jansen <jansen at cs.umn.edu> wrote:
> > Why is the first for loop not equivalent to the second?
>
> In the second loop, "*ui" is an llvm::Use object. It's owned by a
> User, but isn't a subclass of one. To match the
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 =
2004 Dec 21
3
[LLVMdev] Help with code
Hi,
I have this call instruction to printf inserted which is causing
an assertion failure. Any pointers to where I am wrong :
Code Dump :
Function *printFn=M.getNamedFunction(std::string("printf"));
Constant *str=ConstantArray::get("Value : %d\n");
std::vector<Value *> Args(2);
std::vector<Constant *> GEPIndices(2);
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 Mar 25
1
[LLVMdev] could you give me some advice ?
hi
I have one llvm program like this :
...
; define ConstantArray
"E1$str" = internal constant [3 x sbyte] c"E1\00"
; use getPtrPtrFromArrayPtr to define SByte* from ConstantArray
"E1$entry" = internal constant sbyte* getelementptr ([3 x sbyte]* "E1$str", uint 0, uint 0)
...
when i want to get std::string object from this declaration in