Displaying 20 results from an estimated 22 matches for "gettypebynam".
Did you mean:
gettypebyname
2018 Jun 12
2
Proper method to initialize all LLVM Internal Data Structures?
...LLVMContext context;
SMDiagnostic diag;
Module *M = parseIRFile(InputIR, diag, context).get();
if (M == nullptr) {
diag.print("LLVM", errs());
exit(-1);
}
assert(M->isMaterialized() && "Module not materialized!");
PointerType *ArrayPtrTy =
M->getTypeByName("struct._Array")->getPointerTo();
```
However this piece of code crashes at Module::getTypeByName because getContext().pImpl is NULL pointer. Other similar issues include Module::getTypeByName results in a NULL pointer dereference because TheTable in StringMap is not allocated/initi...
2011 Jul 25
4
[LLVMdev] Lack of use of LLVMContextImpl::NamedStructTypes
...named StructType instance with the same name in two different modules
being resolved into two StructTypes with different names due to StructType::
setName(…) collision behavior. Looking at BitcodeReader::ParseTypeTableBody(…),
I don't see use of LLVMContextImpl::NamedStructTypes or of Module::getTypeByName(…).
Nor do I see this use anywhere else in BitcodeReader's implementation (.cpp file).
Doesn't the context's NamedStructTypes (checking for a previously created StructType
with the same name), have to be used before setName(…) is called so that a new structure
is not erroneously crea...
2009 Dec 06
2
[LLVMdev] Pass linking problems
Hi,
I'm attempting to use Module::getTypeByName in my pass, but when I
run the pass with opt, I get this:
opt: symbol lookup error:
/home/mmwu/Download/32/llvm/Release/lib/ParallelSort.so: undefined
symbol: _ZNK4llvm6Module13getTypeByNameENS_9StringRefE
The pass worked before I added the call in. What do I need to link with
the pass to ge...
2009 Dec 07
0
[LLVMdev] Pass linking problems
Hi,
> I'm attempting to use Module::getTypeByName in my pass, but when I
> run the pass with opt, I get this:
>
> opt: symbol lookup error:
> /home/mmwu/Download/32/llvm/Release/lib/ParallelSort.so: undefined
> symbol: _ZNK4llvm6Module13getTypeByNameENS_9StringRefE
>
> The pass worked before I added the call in. What do...
2011 Jul 25
0
[LLVMdev] Lack of use of LLVMContextImpl::NamedStructTypes
...ype instance with the same name in two different modules
> being resolved into two StructTypes with different names due to StructType::
> setName(…) collision behavior. Looking at BitcodeReader::ParseTypeTableBody(…),
> I don't see use of LLVMContextImpl::NamedStructTypes or of Module::getTypeByName(…).
> Nor do I see this use anywhere else in BitcodeReader's implementation (.cpp file).
The BitcodeReader has nothing to do with the issue in question; the
relevant code is in lib/Linker.
-Eli
2011 Jul 26
0
[LLVMdev] Lack of use of LLVMContextImpl::NamedStructTypes
...ype instance with the same name in two different modules
> being resolved into two StructTypes with different names due to StructType::
> setName(…) collision behavior. Looking at BitcodeReader::ParseTypeTableBody(…),
> I don't see use of LLVMContextImpl::NamedStructTypes or of Module::getTypeByName(…).
> Nor do I see this use anywhere else in BitcodeReader's implementation (.cpp file).
>
> Doesn't the context's NamedStructTypes (checking for a previously created StructType
> with the same name), have to be used before setName(…) is called so that a new structure
>...
2011 Nov 11
2
[LLVMdev] Argument's types mismatch when creating CallInst.
Hello. I have an .bc, which defines @foo(%type* arg1, %type* arg2, %type*
arg3).
Firstly, i do this:
runtimeModule = getLazyIRFileModule("runtime.bc", smd, llctx);
then this:
fooFunction = runtimeModule->getFunction("foo");
myType = runtimeModule->getTypeByName("type");
After that, i'm creating another module:
myModule = new Module("My Module", llctx);
and create some AllocaInsts with type %type:
AllocaInst * retZval = new AllocaInst(myType,
"arg1",...
2011 Sep 22
2
[LLVMdev] Need help in converting int to double
...);
> //lhs = mBuilder.CreatePointerCast(lhs,
> PointerType::get(mBuilder.getDoubleTy(),0));
> lhs = convertIntToDouble(lhs);
> typelhs = getValueType(lhs);
>
>
>
> llvm::Value* returnValue = mBuilder.CreateAlloca(PointerType::get(
> mModule->getTypeByName("Value"), 0));
>
> llvm::Value* valueStructSize = getValueStructSize();
> llvm::Value* memory = insertCallToMalloc(valueStructSize);
>
> memory = mBuilder.CreatePointerCast(memory, PointerType::get(
> mModule->getTypeByName("Value"),...
2011 Sep 22
0
[LLVMdev] Need help in converting int to double
...s);
lhs = mBuilder.CreateShl(lhs, rhs);
//lhs = mBuilder.CreatePointerCast(lhs, PointerType::get(mBuilder.getDoubleTy(),0));
lhs = convertIntToDouble(lhs);
typelhs = getValueType(lhs);
llvm::Value* returnValue = mBuilder.CreateAlloca(PointerType::get(
mModule->getTypeByName("Value"), 0));
llvm::Value* valueStructSize = getValueStructSize();
llvm::Value* memory = insertCallToMalloc(valueStructSize);
memory = mBuilder.CreatePointerCast(memory, PointerType::get(
mModule->getTypeByName("Value"), 0));
mBuilder.CreateSt...
2011 Sep 22
3
[LLVMdev] Need help in converting int to double
Hi,
I'm pursuing M.Tech course. As a part of the project work i'm using
LLVM as back-end. My project area is "Enhancing the performance of V8
javascript engine using LLVM as a back-end".
Now i'm writing code for shift left(SHL) operator. I had my own Value
Structure .. it's like this
Struct Value
{
void *val ;
char type;
}
The "char type" holds
2011 Sep 22
1
[LLVMdev] Need help in converting int to double
...);
> //lhs = mBuilder.CreatePointerCast(lhs,
> PointerType::get(mBuilder.getDoubleTy(),0));
> lhs = convertIntToDouble(lhs);
> typelhs = getValueType(lhs);
>
>
>
> llvm::Value* returnValue = mBuilder.CreateAlloca(PointerType::get(
> mModule->getTypeByName("Value"), 0));
>
> llvm::Value* valueStructSize = getValueStructSize();
> llvm::Value* memory = insertCallToMalloc(valueStructSize);
>
> memory = mBuilder.CreatePointerCast(memory, PointerType::get(
> mModule->getTypeByName("Value"),...
2009 Apr 29
0
[LLVMdev] Anonymous Structures
On 2009-04-29, at 10:53, Nick Johnson wrote:
> I am writing a pass which must insert calls to an external library.
> One of the parameters to functions in this library is a very large,
> complex structure (let's call it Foo). [...] The internal
> representation of Foo is important to this library, but the code my
> pass generates will only deal with Foo-pointers.
>
2011 Nov 11
0
[LLVMdev] Argument's types mismatch when creating CallInst.
...c, which defines @foo(%type* arg1, %type* arg2, %type*
> arg3).
> Firstly, i do this:
>
> runtimeModule = getLazyIRFileModule("runtime.bc", smd, llctx);
>
> then this:
>
> fooFunction = runtimeModule->getFunction("foo");
> myType = runtimeModule->getTypeByName("type");
>
> After that, i'm creating another module:
>
> myModule = new Module("My Module", llctx);
>
> and create some AllocaInsts with type %type:
>
> AllocaInst * retZval = new AllocaInst(myType,
> &qu...
2010 Feb 19
0
[LLVMdev] ocaml survey
On Feb 18, 2010, at 12:51, Erick Tryzelaar wrote:
>
> I'm in the process of finishing up the ocaml llvm bindings, and I had
> some last minute questions before we code freeze:
>
> 1. What version of ocaml is everyone using, and how old of an ocaml
> version do you need to support?
Still using OCaml 3.11.1, but will but upgrading to OCaml 3.11.2 around the same time as the
2009 Apr 29
2
[LLVMdev] Anonymous Structures
Hello,
I am writing a pass which must insert calls to an external library.
One of the parameters to functions in this library is a very large,
complex structure (let's call it Foo). Foo has many fields, strange
target-dependent alignment requirements, and is likely to change many
times in the future. The internal representation of Foo is important
to this library, but the code my pass
2012 Dec 14
2
[LLVMdev] StructType for dispatch_object_t changed by Linker
...r `dispatch_release`:
Assertion failed: ((i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"), function init, file Instructions.cpp, line 274.
This happens because the StructType returned by `mod->getTypeByName("union.dispatch_object_t")` is different between Step 2 and Step 4. According to `Type::dump()`, it is:
Step 2: %union.dispatch_object_t = type { %struct.dispatch_object_s* }
Step 4: %union.dispatch_object_t = type { %struct.dispatch_object_s.1* }
Code that reproduces the problem...
2011 Jul 26
2
[LLVMdev] Lack of use of LLVMContextImpl::NamedStructTypes
...with the same name in two different modules
>> being resolved into two StructTypes with different names due to StructType::
>> setName(…) collision behavior. Looking at BitcodeReader::ParseTypeTableBody(…),
>> I don't see use of LLVMContextImpl::NamedStructTypes or of Module::getTypeByName(…).
>> Nor do I see this use anywhere else in BitcodeReader's implementation (.cpp file).
>>
>> Doesn't the context's NamedStructTypes (checking for a previously created StructType
>> with the same name), have to be used before setName(…) is called so that a n...
2010 Feb 18
6
[LLVMdev] ocaml survey
I'm in the process of finishing up the ocaml llvm bindings, and I had
some last minute questions before we code freeze:
1. What version of ocaml is everyone using, and how old of an ocaml
version do you need to support?
2. Would it be alright if I renamed some functions? Module providers
are being removed for 2.7. I can keep the old functions around, but
I'd prefer to keep the API clean.
2006 Feb 24
0
[LLVMdev] gcc like attributes and annotations
On Fri, 24 Feb 2006, Jakob Praher wrote:
> out of a matter of fact I am still using llvm version 1.5. I don't know
> how 1.6 works in this matter.
ok.
> When translating a complex c application to llvm bytecodes, some
> semantics are lost:
>
> Take for isntance the interesting attribute to put a variable in the
> thread local data section (.tdata), this would be
2006 Feb 24
5
[LLVMdev] Re: gcc like attributes and annotations
....B = type { int }
>>
>> BTW: How would one generate a type alias like the above through the LLVM
>> API?
>
>
> Add two entries to the module symbol table for the same Type using
> Module::addTypeName.
Very interesting. I then have to take the type by calling
Module::getTypeByName to have a second Type pointer or?
since I saw the llvm-gcc generates code like:
%pa = alloca %struct.A
%pb = alloca %struct.B
this means that the AllocaInst must have knowledge about two types which
can only be so by having two different pointers? right?
>
>> But sometimes it would b...