similar to: cerr and cout not working calling c++ from R

Displaying 20 results from an estimated 3000 matches similar to: "cerr and cout not working calling c++ from R"

2006 May 23
3
[LLVMdev] Binary output to cout on Windows
The solution (provided in Microsoft's documentation) is to add: #include <cstdio> #include <io.h> #include <fcntl.h> and run: int result = _setmode( _fileno(stdin), _O_BINARY ); if( result == -1 ) { std::cerr<<"Cannot set input mode to binary."<<std::endl; return 1; } result = _setmode( _fileno(stdout), _O_BINARY ); if( result == -1 ) {
2006 May 23
0
[LLVMdev] Binary output to cout on Windows
On Tue, 23 May 2006, Michael Smith wrote: > The solution (provided in Microsoft's documentation) is to add: > #include <cstdio> > #include <io.h> > #include <fcntl.h> > and run: > int result = _setmode( _fileno(stdin), _O_BINARY ); > if( result == -1 ) > { std::cerr<<"Cannot set input mode to binary."<<std::endl; return 1; >
2006 May 22
1
[LLVMdev] Binary output to cout on Windows
Hi Reid, llvm-as interprets "-" as using standard output (cout), so llvm-as < input.ll -o - | opt has the same behavior. You'll actually find a comment on it in llvm-as.cpp, so I guess I shouldn't hold out hope that there's a good way to do it. Michael -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of
2007 Aug 15
2
[LLVMdev] Extending AsmPrinter
On Wed, 2007-08-15 at 09:32 -0700, Chris Lattner wrote: > On Tue, 14 Aug 2007, David Greene wrote: > >> Yes, this is one advantage, another is that we wouldn't have to fix the > >> same bug in multiple places :) > > > > Right. I've figured out where I need to make the changes in AsmWriterEmitter > > given the current design. > > Ok, cool. >
2009 May 12
1
[LLVMdev] Tutorial 1: casting cout
To get Tutorial 1 to compile, I had to cast cout as a raw_osstream, as in: PM.add(createPrintModulePass(&llvm::cout)); ----> PM.add(createPrintModulePass((raw_ostream*)&llvm::cout)); I was getting the following error: $ c++ -g tut1.cpp `llvm-config --cxxflags --ldflags --libs core` -o tut1 tut1.cpp: In function ‘int main(int, char**)’: tut1.cpp:19: error: cannot convert
2006 May 23
1
[LLVMdev] Binary output to cout on Windows
Nothing really needs to be done on Unix, because to my knowledge Unix doesn't differentiate between text and binary on stdin/stdout. ~Michael -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Reid Spencer Sent: Tuesday, May 23, 2006 11:25 AM To: LLVM Developers Mailing List Subject: RE: [LLVMdev] Binary output to cout on
2006 May 22
1
[LLVMdev] Binary output to cout on Windows
I'm trying to resolve an issue that occurs in the native Windows implementation of LLVM (it probably doesn't occur in Cygwin, but I haven't checked). Namely, when calling llvm-as < input.ll > output.bc OR llvm-as < input.ll | opt outputting to cout is adding \r (the CR character) to newlines. This specifically causes problems in WriterContext::write(...)
2007 Aug 15
0
[LLVMdev] Extending AsmPrinter
On Wednesday 15 August 2007 13:10, Reid Spencer wrote: > > It really depends on what you mean. I've found that iostreams are > > extremely slow, much slower than C stdio streams. Eventually I'd like to > > move them to stdio, not to more complex streambufs :) > > Eventually I'd like to move them to native syscalls adapted by > lib/System and suited to the
2007 Nov 08
3
[LLVMdev] Newbie JITter
Hi, I'm experimenting with using LLVM to generate dynamic FFI bridges in VisualWorks Smalltalk. LLVM is an amazing thing! I'm going from dynamically generated assembler source to machine code, and I have that all working, copied from the llc tool and the JIT example. I have two questions: 1. What optimization passes, if any, should I run on the module before I pass it to the
2011 Dec 13
1
[LLVMdev] Issues in converting C++ code to C using llvm and llc
Hello All, I came to know from a friend that using LLVM insfrastucture one can convert C++ programs to C. I needed this for my cross-compiler because we don't have support for C++ compilation in our cross-compiler. I tried following: http://llvm.org/docs/FAQ.html#translatecxx While I can generate .bc its llc which gives error. Then I also tried "clang" as oppose to llvm-g++. Here
2019 Nov 13
2
Compiling libc++ using GNU Arm Embedded Toolchain for arm-cortex-m4
Hello, lately, I have been thinking about how to resolve the problem with that the program size increases enormously when including <iostream> when compiling with libstdc++. In this library, in <iostream> there is a static object __ioinit initialized like so: ... // For construction of filebuffers for cout, cin, cerr, clog et. al. static ios_base::Init __ioinit; ... This
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
2009 Aug 25
0
[LLVMdev] std::cout << *MyModule does not work anymore
On Mon, Aug 24, 2009 at 5:40 PM, Óscar Fuentes<ofv at wanadoo.es> wrote: > 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. Correct. std::ostream has been purged from LLVM; the only
2006 Dec 07
7
[LLVMdev] #include <iostream>
Hi all, With the newest patches to LLVM, there should be no reason for having "#include <iostream>" in any library source code file, except for lib/ Support/Streams.cpp. Please use the following instead: OLD NEW --- --- std::ostream llvm::OStream std::istream llvm::IStream std::cerr llvm::cerr std::cerr llvm::cout
2006 Dec 08
0
[LLVMdev] #include <iostream>
On Thu, 7 Dec 2006, Bill Wendling wrote: > With the newest patches to LLVM, there should be no reason for having > "#include <iostream>" in any library source code file, except for lib/ > Support/Streams.cpp. Please use the following instead: > > OLD NEW > --- --- > std::ostream llvm::OStream > std::istream
2007 May 31
1
Problems when linking to R shared library
Folks, I'm fairly sure that I'm doing something stupid, but I'm getting a few really strange results from *some* of the distributions, but by no means all, when I link directly to the R shared library. I've tried this on both Windows with the precompiled Mingw binary of R-2.5.0 (compiling my code with MinGW-3.4.2), and by building R-2.5.0 on Mandriva Linux with gcc-3.4.4 and
2013 Jan 14
2
[LLVMdev] Need some brief explanation about llvm::MemoryBuffer and llvm::SourceMgr
Hello list, I learned that under LLVM, #including of <iostream> is forbidden. Instead LLVM provides llvm::raw_ostream(for std::cout, std::cerr) and llvm::MemoryBuffer(for input stream). And using of llvm::raw_ostream is pretty easy but for me learning of how to use llvm::MemoryBuffer is pretty much difficult. I found a good sample code; utils/yaml2obj/yaml2obj.cpp. The function, main() in
2018 Dec 09
2
Parse LLVM IR
Hello, I am a newbie to LLVM and right now I am on the hook to parse some IR code and do some instrumentations. However, my problem is that no matter how I tweak my parsing code, it simply cannot print out anything. So here is my C code: int your_fun(int arg2) { int x = arg2; return x+2; } And here is my parsing code: #include <llvm/IR/Module.h> #include
2007 Aug 15
3
[LLVMdev] Extending AsmPrinter
On Monday 13 August 2007 15:50, Chris Lattner wrote: > > I also have a few questions on the general design of AsmPrinter. Why is > > runOnMachineFunction implemented for each target AsmPrinter? I would > > Historical reasons that aren't very good. Over the years, I've taken > several stabs at merging the asmprinters from various targets together. > They used to
2009 Jul 08
0
[LLVMdev] [PATCH] Fix for bugpoint -remote-client
Thanks Viktor. + std::cout << "<run locally>" << std::flush; This should use std::cerr and make sure it is wrapped inside the DEBUG macro. Also, we don't want RemoteRunSafely.sh to be under utils/bugpoint. Can you move it to test-suite? Are you planning to change the llvm test suite makefile to make use of RemoteRunSafely.sh? Thanks, Evan On Jul 7,