similar to: [LLVMdev] object construction patterns and unique_ptr

Displaying 20 results from an estimated 7000 matches similar to: "[LLVMdev] object construction patterns and unique_ptr"

2012 Jun 16
0
[LLVMdev] object construction patterns and unique_ptr
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 object ownership. > > The Reader class currently has an
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
2012 Jun 18
0
[LLVMdev] object construction patterns and unique_ptr
On Mon, Jun 18, 2012 at 1:22 PM, Nick Kledzik <kledzik at apple.com> wrote: > 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)
2012 Jun 19
2
[LLVMdev] object construction patterns and unique_ptr
On Jun 18, 2012, at 4:36 PM, Michael Spencer wrote: >>>> >>>> In asking around for clean models on how to do this better, I've heard two interesting ideas: >>>> >>>> 1) Incorporate the error_code and string message into the File class. That is the factory method always returns a File object. But there is a method on File objects to query if
2012 Jun 20
0
[LLVMdev] object construction patterns and unique_ptr
On Jun 20, 2012, at 12:28 AM, Chandler Carruth wrote: > On Tue, Jun 19, 2012 at 11:18 AM, Jeffrey Yasskin <jyasskin at google.com> wrote: > On Jun 18, 2012 1:24 PM, "Nick Kledzik" <kledzik at apple.com> wrote: > > > > On Jun 16, 2012, at 3:51 PM, Chris Lattner wrote: > > > On Jun 15, 2012, at 3:48 PM, Nick Kledzik wrote: > > > > >
2012 Jun 19
0
[LLVMdev] object construction patterns and unique_ptr
On Jun 18, 2012 1:24 PM, "Nick Kledzik" <kledzik at apple.com> wrote: > > 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
2012 Jun 20
3
[LLVMdev] object construction patterns and unique_ptr
On Tue, Jun 19, 2012 at 11:18 AM, Jeffrey Yasskin <jyasskin at google.com>wrote: > On Jun 18, 2012 1:24 PM, "Nick Kledzik" <kledzik at apple.com> wrote: > > > > 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
2012 Jun 20
1
[LLVMdev] object construction patterns and unique_ptr
On Wed, Jun 20, 2012 at 12:36 PM, Nick Kledzik <kledzik at apple.com> wrote: > On Jun 20, 2012, at 12:28 AM, Chandler Carruth wrote: >> On Tue, Jun 19, 2012 at 11:18 AM, Jeffrey Yasskin <jyasskin at google.com> wrote: >> On Jun 18, 2012 1:24 PM, "Nick Kledzik" <kledzik at apple.com> wrote: >> > >> > On Jun 16, 2012, at 3:51 PM, Chris
2012 Jun 19
0
[LLVMdev] object construction patterns and unique_ptr
On Jun 18, 2012, at 1:22 PM, Nick Kledzik wrote: >>> But this interface has become awkward to use. There are two "return" values. This method is a unique_ptr "source" but the use of a by-refernce parameter means you have to start with an uninitialized unique_ptr and the readFile() has to std::move() into it. unique_ptr is much nicer to use as a return value.
2013 Nov 21
3
[LLVMdev] ErrorOr<> conflicts with unique_ptr<>
Michael, In lld, we have places that used nested a ErrorOr<std::unique_ptr<xx>> and I often hit compiler errors that require breaking up expressions to work around. Do you have suggestions on how to code the following simple examples to not error? Can some of these be fixed in ErrorOr.h? Or am I totally not getting something? -Nick struct Foo { void doit(); };
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
2017 Nov 09
10
Experiment on how to improve our temporary file handing.
Currently a power failure or other hard crash can cause lld leave a temporary file around. The same is true for other llvm tools. As an example, put a breakpoint in Writer.cpp:236 ("writeBuildId()") and restart the run a few times. You will get t.tmp43a735a t.tmp4deeabb t.tmp9bacdd3 t.tmpe4115c4 t.tmpeb01fff The same would happen if there was a fatal error between the
2013 Nov 22
0
[LLVMdev] ErrorOr<> conflicts with unique_ptr<>
On Thu, Nov 21, 2013 at 3:57 PM, Nick Kledzik <kledzik at apple.com> wrote: > Michael, > > In lld, we have places that used nested a ErrorOr<std::unique_ptr<xx>> and > I often hit compiler errors that require breaking up expressions to work > around. Do you have suggestions on how to code the following simple > examples to not error? Can some of these be
2014 Apr 15
2
[LLVMdev] unique_ptr and llvm cast machinery
Anyone have opinions on whether the cast machinery should be taught to handle unique_ptr? Presumably that'd involve cast, etc, returning raw pointers when it was passed references to unique_ptr, which might be surprising/error-prone? But the only errors would be: 1) double delete - if the result of the cast was used to take ownership because the caller didn't realize there was a
2013 Nov 22
3
[LLVMdev] ErrorOr<> conflicts with unique_ptr<>
On Nov 21, 2013, at 4:07 PM, David Blaikie <dblaikie at gmail.com> wrote: > > > > On Thu, Nov 21, 2013 at 3:57 PM, Nick Kledzik <kledzik at apple.com> wrote: > Michael, > > In lld, we have places that used nested a ErrorOr<std::unique_ptr<xx>> and I often hit compiler errors that require breaking up expressions to work around. Do you have
2020 Apr 16
4
ORC Assertion failure
Hi On Windows 10 when using a debug build of LLVM 10, I get this assertion failure: Assertion failed: (KV.second.getFlags() & ~WeakFlags) == (I->second & ~WeakFlags) && "Resolving symbol with incorrect flags", file C:\work\github\llvm-10.0.0.src\lib\ExecutionEngine\Orc\Core.cpp, line 450 The same failure occurred in LLVM 9 too: Assertion failed: I->second ==
2017 Oct 11
3
TargetRegistry and MC object ownership.
Hi All, While trying to put together an MC-based assembler the other day, I again encountered MC's non-obvious memory ownership rules. The most egregious example of these is MCObjectStreamer's destructor: MCObjectStreamer::~MCObjectStreamer() { delete &Assembler->getBackend(); delete &Assembler->getEmitter(); delete &Assembler->getWriter(); delete Assembler;
2013 Nov 22
0
[LLVMdev] ErrorOr<> conflicts with unique_ptr<>
On Thu, Nov 21, 2013 at 4:33 PM, Nick Kledzik <kledzik at apple.com> wrote: > > On Nov 21, 2013, at 4:07 PM, David Blaikie <dblaikie at gmail.com> wrote: > > > > > On Thu, Nov 21, 2013 at 3:57 PM, Nick Kledzik <kledzik at apple.com> wrote: > >> Michael, >> >> In lld, we have places that used nested a
2018 Aug 13
2
Error: ‘class llvm::PassManager<llvm::Module>’ has no member named ‘add’
Hi, I am begineer to llvm, implementing a main.cpp from https://github.com/davidar/lljvm/blob/master/backend/main.cpp A) : When I am declaring a command: * PassManager PM* * PM.add(new DataLayout td)* It shows error: > *error: missing template arguments before ‘PM’* * PassManager PM;* ^ >*main_test.cpp:48:2: error: ‘PM’ was not declared in this scope* *
2020 May 23
4
Assertion triggered when running simple hello-world code on iOS device using ORC/LLLazyJIT
Hello, I am trying to run this basic C++ hello-world code in my iOS app that has LLVM libraries linked in (the app runs on the actual device - iPad Pro, iOS 13.4.1). #include <iostream> int main (int argh, char *argv[]) { std::cout << "Hello World!" << std::endl; return 0; } So below is the break down of the steps that I do: First I compile this code to an