Displaying 20 results from an estimated 4000 matches similar to: "Global is external, but doesn't have external or weak linkage!"
2019 Feb 22
2
Create the GlobalVariable which have extern in one header file
Hi
Good day. I am facing issue with creating a GlobalVariable. I already have an extern for that global in a header file to use it in the following way
extern const void* DATA_TABLE[];
And with a LLVM PASS, I am trying to create this array with the same name and with initializer. So, I have following:
GlobalVariable *gvar_data = new GlobalVariable(
M, blockItems->getType(), true,
2015 Jul 24
3
[LLVMdev] LLVM linkage flags
An enumeration for the kinds of linkage for global values.
Hi, I'm currently writing a compiler that takes llvm-ir input. I'm a little
confused by the following linkage flags:
Enumerator:
>
> ExternalLinkage: Externally visible function
>
> AvailableExternallyLinkage: Available for inspection, not emission.
>
> LinkOnceAnyLinkage: Keep one copy of function when linking
2019 Feb 22
1
Create the GlobalVariable which have extern in one header file
I have changed it to ExternalLinkage. Now, in LLVM IR, it looks like that:
@DATA_TABLE = external global [0 x i8*], section "data_section", align 16 #0
@DATA_TABLE.1 = global [10 x i8*] [i8* inttoptr (i64 53415718 to i8*), i8* bitcast (void (%class.Hello*)* @_ZN5Hello5ptofnEv to i8*),...], section "data_section", align 16 #0
In my uses:
%arrayidx = getelementptr inbounds [0 x
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
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
2015 Jul 21
1
[LLVMdev] RFC: ThinLTO Symbol Linkage and Renaming
Thanks for the comments! Responses below.
Teresa
On Tue, Jul 21, 2015 at 1:06 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:
>
> > On 2015-Jul-14, at 13:33, Teresa Johnson <tejohnson at google.com> wrote:
> >
> > As mentioned in the Updated ThinLTO RFC (
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-May/086211.html), I am
> sending the
2015 Nov 24
2
How to create a sprintf call in IR
Hi,
I created a global char array, char buffer[1024]. I want to call a function
to append the string information to the buffer repeatedly. For example, I
need to implement the following code, where length, a, b, c, are global
variables.
int length = 0;
length += sprintf(buffer+length, "str%d", a);
length += sprintf(buffer+length, "str%c", b);
length += sprintf(buffer+length,
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
2012 Jun 23
2
[LLVMdev] [llvm-commits] [Patch, RFC] Re: Adding support for explicitly specified TLS models (PR9788)
> OK, let's go with GeneralDynamicTLSModel then.
OK
>> The restrictions should be documented too.
>
> I'm not sure how much detail we should go into here, because the
> restrictions might vary depending on the environment. For example,
> with glibc, it will be possible to use initial-exec in a .so that will
> be loaded dynamically, given that the amount of tls
2012 Jun 22
0
[LLVMdev] [llvm-commits] [Patch, RFC] Re: Adding support for explicitly specified TLS models (PR9788)
Thanks for the review! Comments inline; new patch attached.
On Thu, Jun 21, 2012 at 8:40 PM, Rafael Espíndola
<rafael.espindola at gmail.com> wrote:
>> If we don't want to do that, I think we should try to add the new
>> constructors while keeping the old ones around, and then delete the
>> old constructors once clang is updated.
>
> Yes, this would probably be
2013 Feb 08
0
[LLVMdev] Error when Inserting Global variable
I'm writing an LLVM pass which modifies the LLVM IR code. However, I am
having trouble inserting global variables. For example, when I try to
insert a global variable using the following code.
llvm::Value *val = new llvm::GlobalVariable(mod,
llvm::Type::getInt32Ty(mod.getContext()),
false, llvm::GlobalValue::ExternalLinkage, 0, "myvar");
I get the following error.
opt: symbol
2020 Feb 18
4
LLD doesn't handle globals with appending linkage
Hello.
I'm posting this question here, because there seem to be no LLD-specific
mailing list. Sorry in advance if this is wrong one.
I compile two C source with following command:
clang -flto -o %name.bc %name.c
LLVM is augmented with my custom pass, which amongst other things create a
global with appending linkage:
@myvar = appending constant [1 x [1 x i8]*] ...
I also have another pass
2015 Jul 14
3
[LLVMdev] RFC: ThinLTO Symbol Linkage and Renaming
As mentioned in the Updated ThinLTO RFC (
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-May/086211.html), I am
sending the symbol linkage and renaming required by ThinLTO as a separate
RFC. It is included below. I've also attached the doc in pdf form, since
the formatting (especially for the table at the end) may not come through
in the copied text below well.
Thanks!
Teresa
ThinLTO
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
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
2015 Jul 21
2
[LLVMdev] RFC: ThinLTO Symbol Linkage and Renaming
>
> This scares me a little for linkonce -- there's a minor change to
> semantics if the importing module would have linked against a
> *different* definition of the same symbol -- but I'm not really
> sure it matters much.
>
>
This should not be an issue in practice as it exists non thinLTO
compilations too. For instance changing the optimization level of one
module
2003 Nov 21
1
[LLVMdev] Linkage Types
Okay, I'm past the GEP "have to dereference pointer first" problem of my
last post.
I now have a linkage error (I get undefined symbol when I try to
assemble the program).
gcc -o test.o test.s says:
> /tmp/cczhiFk7.o(.text+0x7): In function `a':
> : undefined reference to `_index_'
_index_ is defined like this:
> %_index_ = external global long ;
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())
2012 May 24
1
svychisq using two frames
Hello,
I?m hoping you have a few minutes to help out someone very new to R. I?ve
done some searching, but cannot find this particular issue.
I have survey data from two different time periods (years). Both years are
stratified samples and have the same variables (and variable names), but are
different people in the community answering in the different years.
Everything loads into the survey
2018 May 17
0
Pass segmentation fault after llvm_shutdown.
It's working with trunk though. Do you think the patch will end up in
6.0.1?
Thanks.
Simone
On Tue, May 15, 2018 at 11:18 AM, Friedman, Eli <efriedma at codeaurora.org>
wrote:
> I ran into a similar problem a while ago; see https://reviews.llvm.org/
> D30107 and https://reviews.llvm.org/D33515 . You get the unusual stack
> trace because it's trying to call a destructor