Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Question about insert call func with pionter parameter"
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
2009 May 21
3
[LLVMdev] Passing a pointer to a function
I recently began hacking around with my first LLVM pass. The big
picture is that I would like to insert function calls for each
instruction type, and pass some parameters based on the instruction
type. Then I will link the output to some C file that implements those
functions.
Things were going well until I started trying to make function calls
with a pointer as a parameter. For example, I would
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 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
2012 May 07
0
[LLVMdev] Discussion of eliminating the void type
Hi Mitnick,
> === Overview ===
>
> The general concept is to replaced void with {}. And 'ret void' is a synonym of
> 'ret {} {}.'
in a sense the concept is just to delete void and not to replace it with
anything in particular. Of course front-ends (clang, dragonegg) need to produce
something instead of void, and {} is an example of what they might produce, but
they
2009 Aug 01
2
[LLVMdev] Inserting Instructions (pass)
Thank you Chris,
for your hint, but I am still too stupid. I tried two versions
asm_arguments.push_back(Type::VoidTy);
FunctionType *asm_type = FunctionType::get(Type::VoidTy, asm_arguments,
false);
Alternatively
FunctionType *asm_type = FunctionType::get(Type::VoidTy, std::vector<const
Type*>(), false);
. Can you give me a snippet of example code, or somebody else?
2012 Apr 28
2
Character string to R object
I've been creating some R tools that manipulate objective functions for optimization. In
so doing, I create a character string with R code, and then want to have it in my
workspace. Currently -- and this works fine -- I write the code out, then use source() to
bring it in again. Example:
cstr<-"jack<-function(x){\n cat(\"Silly x:\")\n print(x) \n }\n"
write(cstr,
2012 May 07
1
[LLVMdev] Discussion of eliminating the void type
On 5/7/12 10:36 AM, Duncan Sands wrote:
> Hi Mitnick,
>
>> === Overview ===
>>
>> The general concept is to replaced void with {}. And 'ret void' is a synonym of
>> 'ret {} {}.'
> in a sense the concept is just to delete void and not to replace it with
> anything in particular. Of course front-ends (clang, dragonegg) need to produce
>
2023 Feb 23
1
`dendrapply` Enhancements
Hi everyone,
My apologies if this isn?t the right place to submit this?I?m new to the R-devel community and still figuring out what is where.
If people want to skip my writeup and just look at the code, I?ve made a repository for it here: https://github.com/ahl27/new_dendrapply/tree/master. I?m not quite sure how to integrate it into a fork of R-devel; the package structure is different from
2012 May 07
4
[LLVMdev] Discussion of eliminating the void type
Hello all,
I am willing to do "eliminating the void type" project. Is there anyone
working on it?
=== Overview ===
The general concept is to replaced void with {}. And 'ret void' is a
synonym of 'ret {} {}.'
=== Further Implementation Details ===
1. Deleting VoidTyID
2. Deleting LLVMVoidTypeKind (one-to-one relation between VoidTyID and
LLVMVoidTypeKind)
3. Use
2009 Aug 01
0
[LLVMdev] Inserting Instructions (pass)
On Jul 31, 2009, at 5:04 PM, Michael Graumann wrote:
> Thank you Chris,
> for your hint, but I am still too stupid. I tried two versions
>
> asm_arguments.push_back(Type::VoidTy);
> FunctionType *asm_type = FunctionType::get(Type::VoidTy,
> asm_arguments, false);
>
> Alternatively
>
> FunctionType *asm_type = FunctionType::get(Type::VoidTy,
>
2009 Aug 01
1
[LLVMdev] Inserting Instructions (pass)
Hi,
both versions are working:
FunctionType *asm_Ftype = FunctionType::get(Type::VoidTy, std::vector<const
Type*>(), false);
InlineAsm* Iasm =
InlineAsm::get(asm_Ftype,"isync","~{dirflag},~{fpsr},~{flags}",true);
How can I insert this InlineAsm, because it is no instruction and this way
it will not work:
Instruction *pi = bi;
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
2006 Mar 03
0
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
On Thu, 2 Mar 2006, Chris Lattner wrote:
>> Any ideas what could be wrong?
>
> Sorry for the delay, please try this tarball:
> http://nondot.org/sabre/2006-03-02-llvm-gcc-4.tar.gz
Actually, do to a recent change in CVS, this tarball will probably not
work anymore. Please apply the attached (small) patch on top of it in
the gcc directory.
Worth noting, this front-end only works
2007 Aug 17
1
[LLVMdev] Inserting trace information during opt transformations
Hi all,
In several of the transformations I'm working on I need to embed the
logical equivalent of puts/printf/etc. calls inline with code. I am
having some difficulties getting the transformation code right. As I
understand it, I should be creating a ConstantArray based on the string
(in this case I'm taking an instruction, 'disassembling' it to an
ostringstream then turning
2004 Jul 07
9
Windows 2K outperform Linux/Samba very much?
Hi, all:
I want to check small files' property(such as date, path, and so on)
frequently. The files are stored in netwrok driver and their sizes
vary from 2KB to 5KB.
I found that Windows 2K outperform Linux/Samba very much after I
campared the bench results. I am very confused about it and who can
explain it?
The computers' configurations are as follows:
1. PC Client
It
2012 May 08
0
[LLVMdev] Discussion of eliminating the void type
Hello Duncan,
There is a discussion with Chris Lattner:
http://old.nabble.com/Eliminating-the-'void'-type-td33726468.html
In the discussion, Chris Lattner suggest Type::getVoidTy() should
still exist and
return {} for API continuity. If VoidTy and isVoidTy() go away, how do deal with
the isVoidTy() function call in LLVM source tree? Another issue is: What should
ReturnInst constructor
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