search for: errorinfo

Displaying 20 results from an estimated 48 matches for "errorinfo".

2017 Jul 06
2
ErrorInfo::message() possibly broken in LLVM-4.0.1
...valgrind to freak out over unitialized bytes. llvm::Expected<llvm::object::OwningBinary<llvm::object::ObjectFile>> e = llvm::object::ObjectFile::createObjectFile(llvm::StringRef(fname)); if (!e) { llvm::handleAllErrors(e.takeError(), [](const llvm::ErrorInfo<llvm::ECError> &EI) { std::cerr << EI.message() << std::endl; }); return 1; } Am I doing something wrong here? -- Will Song
2013 Aug 14
2
[LLVMdev] raw_ostream behavior
Hi, When I run the below example, it results in :- hello world LLVM ERROR: IO failure on output stream. Testcase :- #include <llvm/Support/raw_ostream.h> int fn() { std::string errorInfo; llvm::raw_fd_ostream out("-", errorInfo); out << "world\n"; return 0; } int main(int argc, char **argv) { llvm::outs() << "hello\n"; fn(); return 0; } I tried to fix this by making llvm::outs(), not close the stdout descriptor, but I thi...
2013 Nov 26
2
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...builder(body); llvm::Value * result = builder.CreateBinOp(llvm::Instruction::BinaryOps::Add, llvm::ConstantInt::getSigned(functionType, 40), llvm::ConstantInt::getSigned(functionType, 2)); builder.CreateRet(result); llvm::verifyModule(module, llvm::PrintMessageAction); std::string errorInfo; llvm::raw_fd_ostream fileStream("test.ll", errorInfo); llvm::PassManager pm; pm.add(llvm::createPrintModulePass(& fileStream)); pm.run(module); And here is the result: ; ModuleID = 'test' define i16 @foo() { __entry__: ret i16 42 }...
2009 Aug 25
2
[LLVMdev] std::cout << *MyModule does not work anymore
On Aug 25, 2009, at 1:04 AM, Albert Graef wrote: > . For many applications > other than LLVM itself, the basic LLVM <=2.5 interface which just > overwrites existing files is all that's ever needed. On LLVM trunk, raw_fd_ostream is now back to overwriting files by default, as it is the unanimous preference among in-tree users (and out-of-tree users that I'm aware of). Dan
2009 Aug 25
0
[LLVMdev] std::cout << *MyModule does not work anymore
...s it is the unanimous preference among in-tree users (and > out-of-tree users that I'm aware of). But the raw_fd_ostream constructor is *still* incompatible with both LLVM <=2.5 and LLVM 2.6: LLVM 2.5: raw_fd_ostream(const char *Filename, bool Binary, std::string &ErrorInfo); LLVM 2.6: raw_fd_ostream(const char *Filename, bool Binary, bool Force, std::string &ErrorInfo); Trunk (r80020): raw_fd_ostream(const char *Filename, std::string &ErrorInfo, unsigned Flags = 0); It would be helpful to emulate the LLVM 2.5 variant o...
2013 Aug 14
3
[LLVMdev] raw_ostream behavior
...>> >> When I run the below example, it results in :- >> >> hello >> world >> LLVM ERROR: IO failure on output stream. >> >> Testcase :- >> >> #include <llvm/Support/raw_ostream.h> >> >> int fn() { >> std::string errorInfo; >> llvm::raw_fd_ostream out("-", errorInfo); >> out << "world\n"; >> return 0; >> } >> int main(int argc, char **argv) { >> llvm::outs() << "hello\n"; >> fn(); >> return 0; >> } >&g...
2012 May 29
1
[LLVMdev] [cfe-commits] r157260 - in /cfe/trunk: include/clang/Rewrite/Rewriter.h lib/Rewrite/Rewriter.cpp unittests/CMakeLists.txt unittests/Tooling/RewriterTest.cpp unittests/Tooling/RewriterTestContext.h
...+        Rewrite(Sources, Options) { >>> > +    Diagnostics.setClient(&DiagnosticPrinter, false); >>> > +  } >>> > + >>> > +  ~RewriterTestContext() { >>> > +    if (TemporaryDirectory.isValid()) { >>> > +      std::string ErrorInfo; >>> > +      TemporaryDirectory.eraseFromDisk(true, &ErrorInfo); >>> > +      assert(ErrorInfo.empty()); >>> > +    } >>> > +  } >>> >>> Don't try to remove the TemporaryDirectory given by PathV1. Fixed in >>> r1575...
2013 Aug 14
0
[LLVMdev] raw_ostream behavior
...t;shankare at codeaurora.org>wrote: > > Hi, > > When I run the below example, it results in :- > > hello > world > LLVM ERROR: IO failure on output stream. > > Testcase :- > > #include <llvm/Support/raw_ostream.h> > > int fn() { > std::string errorInfo; > llvm::raw_fd_ostream out("-", errorInfo); > out << "world\n"; > return 0; > } > int main(int argc, char **argv) { > llvm::outs() << "hello\n"; > fn(); > return 0; > } > > I tried to fix this by making llvm::ou...
2013 Nov 28
0
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...lt = > builder.CreateBinOp(llvm::Instruction::BinaryOps::Add, > llvm::ConstantInt::getSigned(functionType, 40), > llvm::ConstantInt::getSigned(functionType, 2)); > builder.CreateRet(result); > > llvm::verifyModule(module, llvm::PrintMessageAction); > > std::string errorInfo; > llvm::raw_fd_ostream fileStream("test.ll", errorInfo); > > llvm::PassManager pm; > pm.add(llvm::createPrintModulePass(& fileStream)); > pm.run(module); > > And here is the result: > > ; ModuleID = 'test' > > define i16...
2010 Jun 24
0
[LLVMdev] [patch] New feature: debug info for function memory ranges (-jit-emit-debug-function-range)
...angeStream << I.FnStart << " " << I.FnEnd << " " << F->getName() << "\n"; + } + Stay in 80 cols (also elsewhere). + if (JITEmitDebugInfoFunctionRange && JITEmitDebugInfoFunctionRangeStream==NULL) { + std::string ErrorInfo; + static bool first_pass = true; + os = JITEmitDebugInfoFunctionRangeStream = new raw_fd_ostream("/tmp/llvm_debug_functions.txt", ErrorInfo, first_pass?0:raw_fd_ostream::F_Append); + if (!ErrorInfo.empty()) { Please don't use statics. -Chris
2013 Aug 14
5
[LLVMdev] raw_ostream behavior
...t;>> hello >>>> world >>>> LLVM ERROR: IO failure on output stream. >>>> >>>> Testcase :- >>>> >>>> #include <llvm/Support/raw_ostream.h> >>>> >>>> int fn() { >>>> std::string errorInfo; >>>> llvm::raw_fd_ostream out("-", errorInfo); >>>> out << "world\n"; >>>> return 0; >>>> } >>>> int main(int argc, char **argv) { >>>> llvm::outs() << "hello\n"; >&...
2009 Dec 18
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...ual uint64_t current_pos() { I didn't notice this earlier, but is there any reason for current_pos to be non-const in raw_ostream? > + /// circular_raw_ostream - Open the specified file for > + /// writing. If an error occurs, information about the error is > + /// put into ErrorInfo, and the stream should be immediately > + /// destroyed; the string will be empty if no error occurred. This comment is out of date, there is no ErrorInfo. > + /// > + /// As a side effect, the given Stream is set to be Unbuffered. > + /// This is because circular_raw_ostr...
2013 Aug 14
0
[LLVMdev] raw_ostream behavior
...ple, it results in :- >>> >>> hello >>> world >>> LLVM ERROR: IO failure on output stream. >>> >>> Testcase :- >>> >>> #include <llvm/Support/raw_ostream.h> >>> >>> int fn() { >>> std::string errorInfo; >>> llvm::raw_fd_ostream out("-", errorInfo); >>> out << "world\n"; >>> return 0; >>> } >>> int main(int argc, char **argv) { >>> llvm::outs() << "hello\n"; >>> fn(); >>&gt...
2010 Jun 22
2
[LLVMdev] [patch] New feature: debug info for function memory ranges (-jit-emit-debug-function-range)
On 06/19/2010 14:03, Yuri wrote: > This new option (--jit-emit-debug-function-range) will allow to output > function information for memory ranges that functions occupy in memory > while they run in JIT. File format generated is like this: > ... > 0x5000000 0x5001000 function_name_is_here > ... > > This feature is useful for external tools like valgrind and >
2013 Feb 05
2
[LLVMdev] AsmParser for backend
...rsedAsmOperand*> &Operands); bool mnemonicIsValid(StringRef Mnemonic); unsigned MatchInstructionImpl( const SmallVectorImpl<MCParsedAsmOperand*> &Operands, MCInst &Inst, unsigned &ErrorInfo, bool matchingInlineAsm, unsigned VariantID = 0); enum OperandMatchResultTy { MatchOperand_Success, // operand matched successfully MatchOperand_NoMatch, // operand did not match MatchOperand_ParseFail // operand matched but had errors }; O...
2009 Dec 17
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...am.current_pos(), + // but that interface is private. + return TheStream->tell() - TheStream->GetNumBytesInBuffer(); + } + + public: + /// circular_raw_ostream - Open the specified file for + /// writing. If an error occurs, information about the error is + /// put into ErrorInfo, and the stream should be immediately + /// destroyed; the string will be empty if no error occurred. + /// + /// As a side effect, the given Stream is set to be Unbuffered. + /// This is because circular_raw_ostream does its own buffering, + /// so it doesn't want another layer...
2013 Aug 14
0
[LLVMdev] raw_ostream behavior
...; world >>>>> LLVM ERROR: IO failure on output stream. >>>>> >>>>> Testcase :- >>>>> >>>>> #include <llvm/Support/raw_ostream.h> >>>>> >>>>> int fn() { >>>>> std::string errorInfo; >>>>> llvm::raw_fd_ostream out("-", errorInfo); >>>>> out << "world\n"; >>>>> return 0; >>>>> } >>>>> int main(int argc, char **argv) { >>>>> llvm::outs() << &q...
2009 Aug 22
0
[LLVMdev] X86 Disassembler
...public: virtual ~MCDisassembler(); /// DisassembleInstruction - Disassemble the first instruction in the specified region, printing the disassembled instruction to the specified raw_ostream, and returning the size of the instruction in bytes. On error, this returns zero and fills in ErrorInfo with a human readable description of the error. virtual unsigned DisassembleInstruction(MemoryObject &region, raw_ostream &OS, std::string &ErrorInfo) = 0; } Having this sort of stateless API means that higher level clients (which are stateful) can be built on top of them wit...
2012 Sep 19
1
[LLVMdev] Saving code for later execution
I'm using the LLVM C++ API to create code on-the-fly for execution. This works fine. But what if I want to save this code to disk, quit, relaunch my app at some later time, reload the previously generated code off disk, and execute it? How can I do that? Can somebody point me to some documentation or examples? Thanks. - Paul
2013 Feb 05
0
[LLVMdev] AsmParser for backend
...nds); > bool mnemonicIsValid(StringRef Mnemonic); > unsigned MatchInstructionImpl( > const > SmallVectorImpl<MCParsedAsmOperand*> &Operands, > MCInst &Inst, > unsigned &ErrorInfo, bool matchingInlineAsm, > unsigned VariantID = 0); > > enum OperandMatchResultTy { > MatchOperand_Success, // operand matched successfully > MatchOperand_NoMatch, // operand did not match > MatchOperand_ParseFail // operand ma...