Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] Re: Hide visible string in variable"
2004 Oct 19
1
[LLVMdev] Re:question about Insert callInst to call a function in library
Thanks Chris, but the method you mentioned is not what I want. Maybe I didn't make it clear.
As you said, /runtime/libprofile is runtime library for the following function.
llvm_start_func_profiling
llvm_start_block_profiling
llvm_start_basic_block_tracing
llvm_trace_basic_block
And those above functions can be inserted into basic block etc for getting profile. However, those
2004 Sep 28
1
[LLVMdev] How could I hide the visible string?
Hi,
Is there a way to modify the string such as char a or char b? Could I use the way like "Replace an instruction with another Value" in Programm Manual? In fact, what I am interested in is string with visible expression, not all string, and I am trying to hide the orignal string by using simple way like XOR..
Is there a way to reorder the basic blocks?
Thanks.
Qiuyu
C Source
2005 Jan 31
1
[LLVMdev] Question about Global Variable
Hi,
Sorry for bothering you guys again.
I got problem when I am trying to recover the Global Variable Initial value. What I did is like the following
ConstantArray *Cstr = dyn_cast<ConstantArray>(gI->getInitializer());
// the above instruction enable me to get the content of initial string of global variable, like char a[10] ="test global";
And then I make some change for
2005 Feb 02
1
[LLVMdev] RE: Question about Global Variable
Thanks for your reply.
After I change Cstr to gI, it compiled successfully. Thanks again.
Another question is for constructing getelementpt.
// C code
char gStrA[10] = "test str"; // here is Global variable,gStrA and initializer "test str"
char gStrB[10]= "test str2";
main(){
int = i;
char *pGVars[20]; // here, the pGVar is for storing the address of each
2004 Dec 09
1
[LLVMdev] Question about insert call func with pionter parameter
Hi,
I got a problem when I am trying to insert a call function 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*>
2004 Nov 30
0
[LLVMdev] Trouble using llvm tools
On Tue, 2004-11-30 at 08:58, Chris Lattner wrote:
> On Tue, 30 Nov 2004, Tanu Sharma wrote:
>
> > I have trouble using the llvm tools.Some of the errors are :
> >
> > $ llvm-dis prog.bc
> > $ llvm-dis: Invalid Top Level Block Length! Type:1, Size:456 (Vers=0, Pos=12)
>
> Can you explain how you generated this bytecode file? It looks corrupted
> or
2004 Oct 12
1
[LLVMdev] Re: Hide visible string in variable (Chris Lattner)
Hi,
Thanks so much at first.
> Here are some observations:
>
> > for C level,
> >
> > char a[]="global string test";
> > for(i=0;i<strlen(a);i++){
> > a[i]= a[i]^RANDMON;
> > }
>
> If you compile this C code, "global string test" will occur in the program
> binary, so you have not obfuscated anything. You can
2004 Jun 19
1
[LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol
Chris Lattner wrote:
> > And why isn't it possible to just make those functions known to LLVM?
> > After all, *I think*, if this function is to be called, it should be
> > declared in assembler, and so you have to pass some information abou
> > those function to the code printer. (Of course, it's possible to just
> > directly print the declarations, but
2004 Aug 22
2
[LLVMdev] conditionally reduced intrinsics (llvm.syscall)
Well, the complexity only occurs on x86, other archs are simpler. Since
this is not used much outside the c library, I can work around it in the
library and be satisifed with the simple case.
Oh, I suppose I should mention what I was working on. I made a syscall
intrinsic with codegen for linux/x86. It seemed a missing peice in
having a pure llvm compiled userland (mostly, being able to have a
2003 Dec 22
1
[LLVMdev] How to explain?
hi,
I want to know what is exact meaning in the following code.
target endian--
%struct..TorRec--
%struct.TorRec--
implementation--
;<sbyte>[#uses=1/0]--
how to explain them in details?
Does anyone give me a guide?
thanks
yueqiang
--------------------------------------------------------------
target endian = little
target pointersize = 32
%struct..TorRec = type { int, void ()* }
2006 Feb 27
2
[LLVMdev] Using llvm-gcc with a simple program and the '-c' option
Robert,
Thanks for the info, you've confirmed what I was trying to do, but when
I compile:
-----------------------
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("yo\n");
return 0;
}
-----------------------
without "-c" (llvm-gcc t1.c -o t1) the dissassembled bytecode does not
call __main:
-----------------------
; ModuleID =
2015 May 17
2
[LLVMdev] copy value of a global's data field to another global
Hi all,
I can get access to the data stored in globals as follows:
GlobalVariable* pGvarAct=_set_a_valid_global_;
const_ptr_indicesVec=_the_indexes_
llvm::Constant* pConst;
pConst=ConstantExpr::getGetElementPtr(pGvarAct, const_ptr_indicesVec);
and e.g. use this to repalece an argumrnt of an instruction like:
I->setOperand(someArgumentIndex,pConst);
However, getGetElementPtr returns a
2004 Jun 18
0
[LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol
On Fri, 18 Jun 2004, Vladimir Prus wrote:
> > actually exist in the LLVM module for the function. In particular, this
> > would include any functions in a code-generator specific runtime library
> > and malloc/free. The X86 code generator compiles floating point modulus
> > into fmod calls, and 64-bit integer div/rem into runtime library calls.
>
> And why isn't
2015 May 18
2
[LLVMdev] copy value of a global's data field to another global
getInitializer returns the complete initializer of the global.
My globals are complex nested structs, from which I want to extract e.g. one
double datafield.
Example:
>From a struct Stuct having double,array(3xint),float fields, I could extract
the second int value using the index sequence 0,1,1 with getGetElementPtr.
This gives me a constantPointer, but I would need to get a constInt...
2016 Aug 24
2
Change GlobalValue Type/Initializer
Hi,
I am trying to update the initializer of a global value and I have encounter two issues:
The first one is that I can not change the type of the global value. Let say that I have the following variable: @.str = private unnamed_addr constant [6 x i8] c”Test0A\00", align 1
How can I change the ”Test0A\00” to ”OtherTest0A\00”. Is this possible? I know that you can change the initializer
2004 Jun 18
3
[LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol
Chris Lattner wrote:
> > Second, MO_ExternalSymbol is used for storing name of external
> > variable/function, right? Why it's not possible to use MO_GlobalAddress,
> > where returned GlobalValue* has isExternal set to true? The
> > GlobalValue::getName would return the name of the symbol.
>
> Using the GlobalValue is certainly the preferred way if you have it.
2016 Aug 24
2
Change GlobalValue Type/Initializer
Hi Mehdi,
Thank you for you answer.
> Yes it is normal you *have* to use the same context to manipulate IR inside a Module. The context owns the module and destroying the context destroys everything that is created in the context. It is not clear to me what other context you could even manage to use here conceptually.
Actually I was using llvm::getGlobalContext() in order to get the context.
2011 Mar 06
2
[LLVMdev] how to zero-init a global
Hi!
I have a module containing a constant e.g.
@input = global %0 zeroinitializer, align 16
when I copy the global into another module I use
newGlobal->copyAttributesFrom(global);
but the new module now has
@input = external global %0, align 16
i.e. the zeroinitializer is missing. how do I set it or
copy it from the other global?
-Jochen
2003 Dec 22
1
[LLVMdev] what different in following type def?
hi,
how to explain the following two statement in detail?
(1) %struct.TorRec = type { int, void ()* }
(2) "struct._GLOBAL__N_::vtable_prefix" = type { int,
"struct.__cxxabiv1::__class_type_info"*, sbyte* }
yueqiang
2004 Jun 19
2
[LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol
On Fri, 2004-06-18 at 10:13, Chris Lattner wrote:
> Module::gbegin/gend iterate over the global variables, and ::begin/end
> iterate over the functions, some of which may be prototypes.
This confused Vladimir and I remember it confusing me when I was
reviewing LLVM core a few months ago. Would it be worthwhile to consider
naming these globals_begin/globals_end and