Displaying 4 results from an estimated 4 matches for "_do_message".
2014 Mar 14
2
[LLVMdev] Users of llvm::error_code all inherit from _do_message
There are several libraries in LLVM that create their own `error_code`
categories, so that they can return errors in a consistent way and with
convenient messages.
To do this, these libraries create an error category type that inherits
from `_do_message` in system_error.h. There are a number of ways that
this is wrong:
1. From the name, it's quite clear that _do_message is an implementation
detail.
2. The only function defined in _do_message is specifically intended for
system errors that report via errno, which is not what the custom...
2012 Jun 19
2
[LLVMdev] object construction patterns and unique_ptr
...gt; I believe that specifically for object file parsing errors a
> pair<error_code, vector<string> values> (or something similar) as a
> member of File would work. This would be used as:
>
> // In the error_category stuff
> class blah_reader_error_category : public llvm::_do_message {
> public:
> virtual std::string message(int ev) const {
> ...
> case uknown_reloc:
> return "uknown relocation % at %";
> ...
> }
> };
>
> // In the reader.
>
> setError(make_pair(blah_error::unkown_reloc,
> vector<string>{r...
2012 Jun 18
0
[LLVMdev] object construction patterns and unique_ptr
...be parsed.
>
> -Nick
I believe that specifically for object file parsing errors a
pair<error_code, vector<string> values> (or something similar) as a
member of File would work. This would be used as:
// In the error_category stuff
class blah_reader_error_category : public llvm::_do_message {
public:
virtual std::string message(int ev) const {
...
case uknown_reloc:
return "uknown relocation % at %";
...
}
};
// In the reader.
setError(make_pair(blah_error::unkown_reloc,
vector<string>{relocationumer, loc})); // loc could be calculated by
backtr...
2012 Jun 18
6
[LLVMdev] object construction patterns and unique_ptr
On Jun 16, 2012, at 3:51 PM, Chris Lattner wrote:
> On Jun 15, 2012, at 3:48 PM, Nick Kledzik wrote:
>
>> In lld we have a Reader class which is a factory that takes .o file(s) and produces an in memory lld::File object(s). But in doing so, there could be I/O errors (file not readable) or file may be malformed. We are also using C++11 in lld, so we use std::unique_ptr for managing