Displaying 20 results from an estimated 300 matches similar to: "[LLVMdev] arguments to standard library functions"
2005 Apr 07
0
[LLVMdev] arguments to standard library functions
Right now I am trying to capture the function name and the number of
arguments ,
so this following is the pass I wrote .
-------------------------------------------------------------
struct pass06a : public ModulePass {
virtual bool runOnModule(Module &M) {
std::vector<const Type*> pList;
pList.push_back( PointerType::get(Type::SByteTy) );
pList.push_back(
2004 Mar 02
3
error() and C++ destructors
Hi,
I am writing C++ functions that are to be called via .Call() interface.
I'd been using error() (from R.h) to return to R if there is an error,
but then I realized that this might be not safe as supposedly error()
doesn't throw an exception and therefore some destructors do not get
called and some memory may leak. Here is a simple example
extern "C" void foo() {
string
2014 Jun 12
1
do.call Error for Function Not Present When Manually Called
Hello,
The e1071 function naiveBayes gives an error when called by do.call, although it doesn't give any error if I call it manually.
Browse[1]> trainParams at classifier
function (x, ...)
UseMethod("naiveBayes")
<environment: namespace:e1071>
Browse[1]> trained <- do.call(trainParams at classifier, paramList)
Error in names(dimnames(tables[[i]])) <- c(Yname,
2008 Mar 25
2
responseXML not working on XML file
When creating an Ajax.Request(''/path.xml'') i don''t get responseXML.
I''m confused what I am doing wrong. If i change the response variable
and dump responseText, it shows the file, it just doesn''t recognize it
as xml.
function xml(url){
new Ajax.Request(url, {
method: ''post'', parameters:''resultSet=simcall'',
2016 Sep 12
3
RFC: FileCheck Enhancements
Hi,
I have question again about modifiers for pattern parameters.
Vedant suggested such way.
> CHECK-DEFINE-PATTERN: one_or_more(x): x {{+}}
But I have some doubts. This should be equal to x+. This approach differs from standard one.
In FileCheck I can write
CHECK: {{x|y}}{{something}}
This line will be equal to regex (x|y)(something).
But if I use suggested approach and write same
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
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 31
6
RFC: FileCheck Enhancements
> On Aug 24, 2016, at 4:46 PM, Vedant Kumar via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
>>
>> On Aug 24, 2016, at 2:04 AM, Elena Lepilkina <Elena.Lepilkina at synopsys.com> wrote:
>>
>> Hi all,
>>
>> Some discussions and comments were made in reviews. Much time has already passed since last comment and uploading changed patches. I
2016 Feb 16
2
LLVM IR to C++
Hi,
I want to convert LLVM bitcode files to cpp. I use these commands:
1. clang -c -emit-llvm -fopenmp=libiomp5 oh2.c -o oh2.bc2. llc -march=cpp oh2.bc -o oh2.cpp3. g++ -fno-rtti -O0 -g `$HOME/llvmbuild/bin/llvm-config --cxxflags` oh2.cpp `$HOME/llvmbuild/bin/llvm-config --ldflags --libs --system-libs` -o oh2c
After the 3rd command, I get a lot of compilation errors. Is it possible that llc
2015 Mar 18
5
[LLVMdev] casting Constant * to value *?
John, you are right.
I 'browsed' the doxygen's inheritance diagram.
Shouldn't I then be able to cast Constant * to Value*?
Plugging the retrieved Constant* (from ConstantExpr::getGetElementPtr)
into Instruction->setOperand compiles, but gives me an assertion failure at
runtime.
I have no access to the code at the moment. I will gather more information
possibly tomorrow.
2011 May 18
2
[LLVMdev] access array problem
δΊ 2011/5/18 14:29, Duncan Sands ει:
> Hi Tan Guangming,
>
>> I want to access an array in my instrumentation code. For example:
>>
>> GlobalVariable:
>> int *counter; //counter the number of load/store operations in run-time
>> int *counterArray; //record the load/store addresses
> strictly speaking these are not arrays, they are pointers. Also, you have
2011 May 18
3
[LLVMdev] access array problem
Hi,
I want to access an array in my instrumentation code. For example:
GlobalVariable:
int *counter; //counter the number of load/store operations in run-time
int *counterArray; //record the load/store addresses
//increase the counter if a load/store is performed
std::vector<Constant *>index(2);
index[0] = Constant::getNullvalue(Type:getInt32Ty(Context));
index[1] =
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);
2016 Sep 01
2
RFC: FileCheck Enhancements
I wanted to start making some change. But I thought and I don't understand why it's necessary to add @.
// RUN: FileCheck %s
// CHECK-DEFINE-PATERN: register(n): {{[a-z]+}}n
// CHECK: %[[register("1")]]
// CHECK-SAME: %[[register("2")]]
// CHECK: %[[register("1")]]
// CHECK-SAME: %[[register("2")]]
This example will be equivalent to
// RUN:
2011 Feb 01
2
[LLVMdev] Convenience methods in ConstantExpr et al
I notice that there's a lot of inconsistency in the various LLVM classes
with respect to convenience methods. Here's some examples:
For creating GEPS, IRBuilder has:
CreateGEP (2 overloads)
CreateInBoundsGEP (2 overloads)
CreateConstGEP1_32
CreateConstInBoundsGEP1_32
CreateConstGEP2_32
CreateConstInBoundsGEP2_32
CreateConstGEP1_64
CreateConstInBoundsGEP1_64
2016 Sep 05
2
RFC: FileCheck Enhancements
Ok, when I change syntax I will load new patch.
Thanks,
Elena.
-----Original Message-----
From: vsk at apple.com [mailto:vsk at apple.com]
Sent: Thursday, September 01, 2016 9:38 PM
To: Elena Lepilkina <Elena.Lepilkina at synopsys.com>
Cc: Mehdi Amini <mehdi.amini at apple.com>; llvm-dev at lists.llvm.org
Subject: Re: [llvm-dev] RFC: FileCheck Enhancements
It is necessary to be
2015 Mar 07
2
[LLVMdev] cannot understand global c++API code
Hi all,
translating the following c code to llvm c++Api code, I can not understand
the result.
Perhaps someone could explain it to me.
c code
---------------------------------
struct stest {
int age;
float weight;
} foo={44,67.2};
int main() {
foo.weight=68.2;
...
----------------------------------------
API code
// this is clear
ConstantFP* const_float_102 =
2015 Mar 17
2
[LLVMdev] casting Constant * to value *?
Hi all,
extracting datafields of globals, the API code ends up in a Constant *
Constant* const_ptr_103 = ConstantExpr::getGetElementPtr(gvar_struct_foo,
const_ptr_103_indices);
it can be used to initialize e.g. a new instruction like:
StoreInst* void_119 = new StoreInst(const_float_102, const_ptr_103, false,
label_entry_113);
But how about replacing the operand of an already existing
2011 May 18
0
[LLVMdev] access array problem
Hi Guangming Tan,
>>> GlobalVariable:
>>> int *counter; //counter the number of load/store operations in run-time
>>> int *counterArray; //record the load/store addresses
>> strictly speaking these are not arrays, they are pointers. Also, you have
>> written them in some kind of C-style idiom. What are the declarations in
>> LLVM IR?
> const Type