search for: ostringstream

Displaying 20 results from an estimated 24 matches for "ostringstream".

Did you mean: stringstream
2009 Mar 08
2
[LLVMdev] addPassesToEmitFile
...const llvm::TargetMachineRegistry::entry* _arch = llvm::TargetMachineRegistry::getClosestTargetForJIT(Err); std::string FeaturesStr; llvm::TargetMachine* target(_arch->CtorFn(*_module, FeaturesStr)); assert(target && "Could not allocate target machine!"); std::ostringstream os; target->addPassesToEmitFile(*_passManager, os, llvm::TargetMachine::AssemblyFile, true); target->addPassesToEmitFileFinish(*_passManager, 0, true); However, in newer versions of llvm, like 2.5 that I'm testing now, I had to change the code to something like this: std...
2007 Aug 17
1
[LLVMdev] Inserting trace information during opt transformations
...bed 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 it into a constant array): std::ostringstream instr; (*wp)->print(instr); Constant *itext = ConstantArray::get(instr.str()); This bit seems OK. I am calling a function in my run time system with the signature void mcp_trace_instruction(const char *) by first declaring i...
2009 Mar 08
0
[LLVMdev] addPassesToEmitFile
...stry::entry* _arch = > llvm::TargetMachineRegistry::getClosestTargetForJIT(Err); > >    std::string FeaturesStr; >    llvm::TargetMachine* target(_arch->CtorFn(*_module, FeaturesStr)); >    assert(target && "Could not allocate target machine!"); > >    std::ostringstream os; > >    target->addPassesToEmitFile(*_passManager, os, > llvm::TargetMachine::AssemblyFile, true); >    target->addPassesToEmitFileFinish(*_passManager, 0, true); > > > > However, in newer versions of llvm, like 2.5 that I'm testing now, I > had to change the...
2009 Mar 09
1
[LLVMdev] addPassesToEmitFile
...> llvm::TargetMachineRegistry::getClosestTargetForJIT(Err); > > >    std::string FeaturesStr; > >    llvm::TargetMachine* target(_arch->CtorFn(*_module, FeaturesStr)); > >    assert(target && "Could not allocate target machine!"); > > >    std::ostringstream os; > > >    target->addPassesToEmitFile(*_passManager, os, > > llvm::TargetMachine::AssemblyFile, true); > >    target->addPassesToEmitFileFinish(*_passManager, 0, true); > > > However, in newer versions of llvm, like 2.5 that I'm testing now, I > > ha...
2012 Jun 26
2
[LLVMdev] Error compiling llvm/clang with clang+libc++ with -std=cxx0x
...;-L/local/mnt/workspace/ashoknn/519_libcxx_transition/llvm/build/../../libcxx.artifacts/linux-clang/lib' > /local/mnt/workspace/ashoknn/519_libcxx_transition/llvm/src/tools/bugpoint/ToolRunner.cpp:131:12: error: invalid operands to binary expression ('llvm::raw_ostream' and 'std::ostringstream' > (aka 'basic_ostringstream<char>')) > errs() << OS; > ~~~~~~ ^ ~~ If I remove the -std=c++0x, then the compilation is successful. I checked to see if libc++ itself was compiled with the flag and indeed it was. Any pointers? TIA, Ashok
2007 Dec 03
2
interaction with C++ code (PR#10487)
...older redhat and new ubuntu and with both g++4.1 and g++3.4. I have a problem with character data that is passed back from C++ code. A small example is the following C++ code and R functions. #include <sstream> extern "C" { void extracttxt( char **txt, int *nchars) { std::ostringstream oss; oss << "abcdefghij"; const char *ltxt=oss.str().c_str(); for (int j=0;j<*nchars;j++) *txt[j]=static_cast<char>(ltxt[j]); } } # begin R code dyn.load("test.so") "testtxt" <- function() { nchars <- 80 txt <-...
2017 Jun 28
2
Multiple Inheritance with dyn_cast
...Base *c = new Child(); Base *i = new ChildWithInfo(); try { if (Info *inf = llvm::dyn_cast<Info>(c)) { throw std::string("Casted a child to an info incorrectly"); } if (Info *inf = llvm::dyn_cast<Info>(i)) { if (inf->size != 10) { std::ostringstream str; str << "Object was sliced: expected 10 but got " << inf->size; throw str.str(); } } else { throw std::string("Couldn't cast child with info to info"); } } catch (std::string &msg) { std::cout << msg <...
2012 Jun 26
0
[LLVMdev] Error compiling llvm/clang with clang+libc++ with -std=cxx0x
On 2012-06-26 04:22, Ashok Nalkund wrote: ... >> /local/mnt/workspace/ashoknn/519_libcxx_transition/llvm/src/tools/bugpoint/ToolRunner.cpp:131:12: error: invalid operands to binary expression ('llvm::raw_ostream' and 'std::ostringstream' >> (aka 'basic_ostringstream<char>')) >> errs() << OS; >> ~~~~~~ ^ ~~ > Hi Ashok, please try applying this diff from r155978 to your 3.1 release tree: --- llvm/trunk/tools/bugpoint/ToolRunner.cpp 2012/05/02 05:31:31 155977 +++ llvm/tru...
2008 Jul 25
2
[LLVMdev] Slightly improve bugpoint output
...t; #include <set> using namespace llvm; @@ -469,7 +470,9 @@ } else { if (BugpointIsInterrupted) goto ExitLoops; - std::cout << "Checking instruction '" << I->getName() << "': "; + std::ostringstream SS; I->print(SS); + + std::cout << "Checking instruction '" << SS.str() << "': "; Module *M = BD.deleteInstructionFromProgram(I, Simplification); // Find out if the pass still crashes on this pass... -----...
2008 May 28
1
[LLVMdev] Asm output while executing
...assert(target.get() && "Could not allocate target machine!"); llvm::TargetMachine &Target = *target.get(); llvm::FunctionPassManager Passes(new llvm::ExistingModuleProvider(_module)); Passes.add(new llvm::TargetData(*Target.getTargetData())); std::ostringstream os; Target.addPassesToEmitFile(Passes,os,llvm::TargetMachine::AssemblyFile, true); Passes.doInitialization(); for (llvm::Module::iterator I = _module->begin(), E=_module->end(); I != E; ++I) if (!I->isDeclaration()) { Passes.run(*I); }...
2004 Oct 06
3
[LLVMdev] Re: Starting with LLVM-GCC on Cygwin
"Chris Lattner" <sabre at nondot.org> wrote in message news:Pine.LNX.4.44.0410051204480.5863-100000 at nondot.org... > On Tue, 5 Oct 2004, Alex Vinokur wrote: > > > I would like to use LLVM-GCC to compare its performance with other compilers. > > Something like testsuite "Computing very large Fibonacci numbers" at > >
2009 Mar 17
0
[LLVMdev] Printing x86 ASM for Function
Dear Maxime, Nyx wrote: > Hello, > > I would like to know how to go about printing the x86 assembly output for a > compiled function (I'm using the JIT). I saw there is a X86IntelAsmPrinter > on doxygen. However, it takes several arguments I don't know how to fill in. > Is there a helper function to create such a pass? Once I have the pass > created, do I just add it
2012 Jun 26
1
[LLVMdev] Error compiling llvm/clang with clang+libc++ with -std=cxx0x
...On 6/26/2012 1:30 AM, Dimitry Andric wrote: > On 2012-06-26 04:22, Ashok Nalkund wrote: > ... >>> /local/mnt/workspace/ashoknn/519_libcxx_transition/llvm/src/tools/bugpoint/ToolRunner.cpp:131:12: error: invalid operands to binary expression ('llvm::raw_ostream' and 'std::ostringstream' >>> (aka 'basic_ostringstream<char>')) >>> errs() << OS; >>> ~~~~~~ ^ ~~ >> > > Hi Ashok, please try applying this diff from r155978 to your 3.1 release tree: > > --- llvm/trunk/tools/bugpoint/ToolRunner.cpp 201...
2008 Jul 25
0
[LLVMdev] Slightly improve bugpoint output
...eam headers are ok. Also, for bugpoint, we don't really care... we care in the libraries primarily. > @@ -469,7 +470,9 @@ > - std::cout << "Checking instruction '" << I->getName() > << "': "; > + std::ostringstream SS; I->print(SS); > + > + std::cout << "Checking instruction '" << SS.str() << > "': "; Instead of using sstream, why not just use "... << *I << "? -Chris
2009 Mar 16
2
[LLVMdev] Printing x86 ASM for Function
Hello, I would like to know how to go about printing the x86 assembly output for a compiled function (I'm using the JIT). I saw there is a X86IntelAsmPrinter on doxygen. However, it takes several arguments I don't know how to fill in. Is there a helper function to create such a pass? Once I have the pass created, do I just add it to a FunctionPassManager? Thank you for your time, -
2009 Aug 19
3
[LLVMdev] X86 Disassembler
...rged. > 13. You use "std::ostream" a lot. Would it be appropriate to use > "raw_ostream" instead? To make sure that the table definition file looks pretty, I use <iomanip>, and none of those functions work with raw_ostreams. I actually only create three std::ostringstreams – during table generation – so for now I'm going to leave that the way it is. > 14. In DisassemblerTables::setTableFields, you emit things to > "std::cerr". Use "errs()" instead. Or, better yet, > "llvm_report_error". :-) Fixed to use errs(). &gt...
2012 May 07
0
R CMD check, interfacing c++ linking errors
...ConfModules(treeMap,bootstraps,significantVec,mergers,confnew); SEXP name = VECTOR_ELT(gdiag,0); SEXP links = VECTOR_ELT(gdiag,2); Rprintf("teve"); int totalDegree = INTEGER(VECTOR_ELT(gdiag,4))[0]*2; string networkName = string(CHAR(STRING_ELT(name,0))); ofstream outfile; ostringstream oss; int nLinks = INTEGER(links)[0]; oss.str(""); oss << networkName << ".smap"; outfile.open(oss.str().c_str()); outfile << "# modules: " << l << endl; outfile << "# modulelinks: " << "na" <...
2012 May 08
0
R CMD check, c++ source linking errors
...ConfModules(treeMap,bootstraps,significantVec,mergers,confnew); SEXP name = VECTOR_ELT(gdiag,0); SEXP links = VECTOR_ELT(gdiag,2); Rprintf("teve"); int totalDegree = INTEGER(VECTOR_ELT(gdiag,4))[0]*2; string networkName = string(CHAR(STRING_ELT(name,0))); ofstream outfile; ostringstream oss; int nLinks = INTEGER(links)[0]; oss.str(""); oss << networkName << ".smap"; outfile.open(oss.str().c_str()); outfile << "# modules: " << l << endl; outfile << "# modulelinks: " << "na" <...
2005 Oct 16
2
[LLVMdev] Help on LLVM Instrumentation
Hi , I am using LLVM for my Post Graduate course project on Optimization. I am trying to do some insrtumentation to the bytecode.I 've been going through your Instrumentation code for the past few days in /llvm/lib/Transforms/Instrumentation folder and finally found two ways of instrumentation : 1) injecting LLVM bytecode instructions 2) calling an external C function. I am trying both and
2009 Aug 22
0
[LLVMdev] X86 Disassembler
..."std::ostream" a lot. Would it be appropriate to use >> "raw_ostream" instead? > > To make sure that the table definition file looks pretty, I use > <iomanip>, and none of those functions work with raw_ostreams. I > actually only create three std::ostringstreams – during table > generation – so for now I'm going to leave that the way it is. I actually find iomanip to be pretty ugly for simple things. llvm/ Support/Format.h lets you do things like: OS << "mynumber: " << format("%4.5f", 1234.412) << '\n...