Displaying 20 results from an estimated 300 matches similar to: "Problem using ofstream in C++ class in package for MacOS X"
2010 Jul 21
1
Bug: broken exception handling in S4 methods
Hi all:
we have noticed for quite a while that certain errors cannot be handled
by R try, tryCatch etc blocks, but it was fairly difficult to understand
what were the conditions for this incorrect behaviour. Finally I stabbed
across a very understandable case, which is outlined in the (runnable)
example below.
The main message is: wrapping an S4 method call in a try block will not
help if an
2009 Aug 20
6
[LLVMdev] Get LLVM assembler for a function.
We can get the llvm assembler for a Module with something as simple as
std::ofstream f("code.llvm");
f << *M;
Is there a method for obtaining the llvm assembler of a given Function?
--
Óscar
2009 Aug 25
4
[LLVMdev] std::cout << *MyModule does not work anymore
It seems that support for dumping text representation of LLVM objects to
standard channels and C++ output streams was removed. My guess is that
now we must use errs() instead of std::cerr, llvm::raw_fd_ostream
instead of std::ofstream, etc.
The changes are not trivial, as for instance llvm::raw_fd_ostream
without flags fails if the file exists, but std::ofstream does not. The
changes include
2016 Feb 11
3
Buildling with/without AddressSanitizer causes divergent execution behaviour
Hi Kostya & Yury,
Thanks for the advice.
On 9 February 2016 at 22:48, Kostya Serebryany <kcc at google.com> wrote:
> Hi Dan,
>
> On Tue, Feb 9, 2016 at 10:57 AM, Dan Liew <dan at su-root.co.uk> wrote:
>>
>> Hi,
>>
>> # TL;DR
>>
>> I've been building an application with and without the address
>> sanitizer (with gcc 5.3 and
2006 May 09
1
xapian-compact fails to rename iamflint.tmp for win32/cygwin builds
Hello,
Any call to xapian-compact compiled for Win32/Cygwin ultimately fails
when it tries to rename/replace iamflint.tmp with the final version. The
reason is you cannot rename an opened file with Win32/Cygwin libc.
To correct this, just close the output ofstream (xapian-compact.cc(534))
like:
"""
ofstream output(dest.c_str());
if (!output.write(buf, input.gcount())) {
cerr
2011 Apr 05
1
super basic questions about S4 classes
Apologies for asking something that is probably super obvious, i just started
with S4 classes and i guess i am not finding documentation that layout the
grammar rules and give enough examples. Some questions i am having are these
1. I understand that main method of writing a member function is to write a
generic function and setMethod for this particular object. This, however,
presumes that there
2010 Jun 04
5
[LLVMdev] Inserting a function call into bitcode
Hi All,
I am trying to write code for simple instrumentation. What I want to do is
to insert a call to an external function for result of each conditional
branch instruction. This external function simply print true or false based
on the result of condition. The modified code is then written into new file.
However when I try to link that file with another bitcode file (containing
external
2011 Aug 26
1
R.oo data members / inheritance
If someone is able, can you tell me if there is a better way to do this?
More specifically, do I have to rewrite all of the data members stuff and
extend stuff of parent class in the child class? See below. Thanks in
advance!
Example 1:
setConstructorS3("ClassA", function(A,x) {
if(missing(A))A=15;
if(missing(x))x=NA;
extend(Object(), "ClassA",
.size = A,
.x=x
2008 Nov 05
1
Methods dispatch and inheritance R.oo
Hi to all members, i have a question about class inheritance and methods
using R.oo package:
I have the following code and it doesn't work, guess i'm doing smth wrong
and there is nothing in the help.
library(R.oo)
setConstructorS3("ClassA", function(A=15) {
extend(Object(), "ClassA",
.size = A
);
})
setMethodS3("print", "ClassA",
2010 Jun 04
0
[LLVMdev] Inserting a function call into bitcode
On Thu, Jun 3, 2010 at 9:43 PM, Nehal Gandhi <nbg2k7 at gmail.com> wrote:
> Hi All,
>
>
>
> I am trying to write code for simple instrumentation. What I want to do is
> to insert a call to an external function for result of each conditional
> branch instruction. This external function simply print true or false based
> on the result of condition. The modified code is
Suggestion for exception handling: More informative error message for "no applicable method..." (S3)
2009 Oct 20
1
Suggestion for exception handling: More informative error message for "no applicable method..." (S3)
I'd like to suggest that whenever there is no S3 method implementation
available for a particular class, that the error message would also
report the class structure of the object dispatched on.
Example:
foo <- function(...) UseMethod("foo")
foo.ClassA <- function(object, ...) { cat("foo() for ClassA called.\n") }
> foo(structure(1, class="ClassA"))
2009 Jul 07
2
[LLVMdev] How to add an include file
Hi Eli,
Let's say I have a file ClassA.h, that pairs with a file ClassA.cpp
to product a library libClassA.a.
ClassA.h contains the single declaration.
class A {...};
I want to transform it to:
#include "ClassB.h"
class A : public class B {...};
ClassB.h is the header file for a library libClassB.a built from ClassB.cpp
and ClassB.h.
I can clearly link libClassB with libClassA.
2009 Jul 07
0
[LLVMdev] How to add an include file
On Tue, Jul 7, 2009 at 1:42 AM, David Minor<dahvid.minor at gmail.com> wrote:
> Hi Eli,
> Let's say I have a file ClassA.h, that pairs with a file ClassA.cpp
> to product a library libClassA.a.
> ClassA.h contains the single declaration.
>
> class A {...};
>
> I want to transform it to:
>
> #include "ClassB.h"
>
> class A : public class B
2007 Jan 22
2
[LLVMdev] addPassesToEmit(Whole)File changes?
Hi folks,
just installed the new llvm 1.9 build and noticed that my code no
longer worked. It seems something has changed with
addPassesToEmitFile(). First, the arguments to that method changed so
that it no longer takes a PassManager, but only a
FunctionPassManager. Instead there is a addPassesToEmitWholeFile()
method, but that is marked as optional, and when I change my code to
2003 Oct 02
1
"[[<-","[[" default?
Hi!
I have implemented class specific behaviour of "[[<-.myclass"<-function().
How it is posible to call the "[[.default" on an object of myclass?
Eryk
Dipl. bio-chem. Eryk Witold Wolski @ MPI-MG Dep. Vertebrate Genomics
Ihnestrasse 73 14195 Berlin 'v'
tel: 0049-30-84131285 / \
mail: wolski@molgen.mpg.de ---W-W----
2012 Sep 03
1
[LLVMdev] Selection DAG output as bare DAG, code review
Hello all,
I recently foudn myself wanting to view the basic blocks in the
selection DAG as pure DAGs - so just as a list of edges, with no other
information. I added the below code to the start of the "
void SelectionDAGISel::CodeGenAndEmitDAG()" function. It creates a
separate txt file for each basic block and gives a list of edges
between nodes. The segment of code is below -
2009 Mar 18
1
Why S4 methods of S3 'base' generics are not used in 'base' functions ?
Dear list,
It seems that S4 methods defined for an S3 'base' generic
are not used in 'base' functions.
This can be problematic when 'base' functions start with
something like 'as.matrix'.
### START R code
setClass("classA", contains = "matrix",
representation(realData = "numeric"))
setMethod("as.matrix",
2009 Jul 05
0
[LLVMdev] How to add an include file
On Sun, Jul 5, 2009 at 1:16 PM, David Minor<dahvid.minor at gmail.com> wrote:
> I'm writing a code transformation that involves adding an include to
> existing code, adding a base class
> to and existing class and then linking with a previously compiled library.
> The main problem for me
> seems to be how can I add the include? Can I compile the include alone to
> byte
2010 Jan 05
5
[LLVMdev] [Help] How can we call an object's virtual function inside IR?
Dear experts,
I am learning llvm by reading documents and have a question to ask.
The following is the example of code generation that I created.
[[a [10.00]] > [3.00]]
; ModuleID = 'ExprF'
define i1 @expr(double* %record) {
entry:
%0 = getelementptr double* %record, i32 0 ;
<double*> [#uses=1]
%1 = load double* %0 ; <double>
2009 Jul 05
2
[LLVMdev] How to add an include file
I'm writing a code transformation that involves adding an include to
existing code, adding a base class
to and existing class and then linking with a previously compiled library.
The main problem for me
seems to be how can I add the include? Can I compile the include alone to
byte code and pre-pend it?
Should I compile the library, which includes the include and parse out the
include and