Displaying 20 results from an estimated 331 matches for "unique_ptr".
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()...
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 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
>
>
>...
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 w...
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 fixed in ErrorOr.h? Or am I
> totally not getting something?
>
> -Ni...
2013 Nov 22
0
[LLVMdev] ErrorOr<> conflicts with unique_ptr<>
...e:
>
> 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 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 somethin...
2017 Oct 11
3
TargetRegistry and MC object ownership.
...ctStreamer() {
delete &Assembler->getBackend();
delete &Assembler->getEmitter();
delete &Assembler->getWriter();
delete Assembler;
}
In the depths of a fever from a head-cold, I snapped. I've been hacking MC
to convert these raw pointers (and worse: references!) to unique_ptrs
(apologies to people whose backbends I've broken), but I hit a big blocker
when I get to Target in "llvm/Support/TargetRegistry.h".
Target vends MC objects by calling registered ctor functions. E.g.:
MCAsmBackend *createMCAsmBackend(const MCRegisterInfo &MRI,...
2020 May 23
4
Assertion triggered when running simple hello-world code on iOS device using ORC/LLLazyJIT
...LinkGraphBuilder.cpp:36
#8 0x000000010666cd08 in
llvm::jitlink::MachOJITLinker_arm64::buildGraph(llvm::MemoryBufferRef) at
/Users/igorgomon/dev/third-party/llvm-project/llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp:493
#9 0x00000001066236bc in
llvm::jitlink::JITLinkerBase::linkPhase1(std::__1::unique_ptr<llvm::jitlink::JITLinkerBase,
std::__1::default_delete<llvm::jitlink::JITLinkerBase> >) at
/Users/igorgomon/dev/third-party/llvm-project/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp:28
#10 0x000000010665fc10 in void
llvm::jitlink::JITLinker<llvm::jitlink::MachOJITLinker_arm64...
2015 Mar 09
2
[LLVMdev] LLVM 3.6: problems building on Windows using MSVC 2013
...s\LLVMPlugin.dir\tools\clang\lib\Dri
ver\Compilation.cpp.obj
/Fdsrc\plugins\thirdParty\LLVM\CMakeFiles\LLVMPlugin.dir\ /FS -c
..\src\plugins\thirdParty\LLVM\tools\clang\lib\Driver\Compilation.cpp
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\INCLUDE\xutility(2045) : error C2280:
'std::unique_ptr<clang::driver::Job,std::default_delete<_Ty>>
&std::unique_ptr<_Ty,std::default_delete<_Ty>>::operator =(const
std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference
a deleted function
with
[
_Ty=clan...
2012 Jun 15
3
[LLVMdev] object construction patterns and unique_ptr
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 interface that can be simplified down to:
virtual error_code readFile(StringRef path, std::unique_ptr<lld::File> &result);
But this interface has become awkward to use. There are two "return" values. This...
2014 Jul 17
8
[LLVMdev] Use of Smart Pointers in LLVM Projects
There seems to be some uncertainty about the use of smart pointers
(previously OwningPtr, now std::unique_ptr and std::shared_ptr
predominantly) in the LLVM project as a whole, so here's a thread to
discuss/clarify/etc the project preferences/direction with regard to
smart pointer usage.
For some context, see discussions in LLVM r212403 and Clang r213307.
The basic question here seems to be whether s...
2012 Jun 20
1
[LLVMdev] object construction patterns and unique_ptr
...:
>> > >
>> > >> 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 interface that can be simplified down to:
>> > >>
>> > >> virtual error_code readFile(StringRef path, std::unique_ptr<lld::File> &result);
>>...
2015 Mar 09
2
[LLVMdev] LLVM 3.6: problems building on Windows using MSVC 2013
...es\LLVMPlugin.dir\tools\clang\lib\Driver\Compilation.cpp.obj /Fdsrc\plugins\thirdParty\LLVM\CMakeFiles\LLVMPlugin.dir\ /FS -c ..\src\plugins\thirdParty\LLVM\tools\clang\lib\Driver\Compilation.cpp
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(2045) : error C2280: 'std::unique_ptr<clang::driver::Job,std::default_delete<_Ty>> &std::unique_ptr<_Ty,std::default_delete<_Ty>>::operator =(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function
with
[
_Ty=clan...
2012 Jun 20
3
[LLVMdev] object construction patterns and unique_ptr
...> >
> > >> 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 interface that can be simplified
> down to:
> > >>
> > >> virtual error_code readFile(StringRef path,
> std::unique_ptr<lld::File> &result);
> >...
2020 Jun 06
4
Assertion triggered when running simple hello-world code on iOS device using ORC/LLLazyJIT
...64::buildGraph(llvm::MemoryBufferRef) at
>>>>> /Users/igorgomon/dev/third-party/llvm-project/llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp:493
>>>>>
>>>>> #9 0x00000001066236bc in
>>>>> llvm::jitlink::JITLinkerBase::linkPhase1(std::__1::unique_ptr<llvm::jitlink::JITLinkerBase,
>>>>> std::__1::default_delete<llvm::jitlink::JITLinkerBase> >) at
>>>>> /Users/igorgomon/dev/third-party/llvm-project/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp:28
>>>>>
>>>>> #10 0x00000...
2012 Jun 20
0
[LLVMdev] object construction patterns and unique_ptr
...ik 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 interface that can be simplified down to:
> > >>
> > >> virtual error_code readFile(StringRef path, std::unique_ptr<lld::File> &result);
> > >>
>...
2014 Jul 18
2
[LLVMdev] [cfe-dev] Use of Smart Pointers in LLVM Projects
On Fri, Jul 18, 2014 at 12:06 PM, Jordan Rose <jordan_rose at apple.com> wrote:
> I don't have much to add here besides +1. I think using std::unique_ptr
> even for create* functions/methods is the right way to go.
+1 smart pointers here are a win in terms of safety and self-documentation.
I don't see why create* factories should be treated differently.
Eli
> Reid's point about an abstraction penalty is interesting, but I don...
2020 Jun 20
1
Assertion triggered when running simple hello-world code on iOS device using ORC/LLLazyJIT
...er_arm64::buildGraph(llvm::MemoryBufferRef) at
> /Users/igorgomon/dev/third-party/llvm-project/llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp:493
> >>>>>>>
> >>>>>>> #9 0x00000001066236bc in
> llvm::jitlink::JITLinkerBase::linkPhase1(std::__1::unique_ptr<llvm::jitlink::JITLinkerBase,
> std::__1::default_delete<llvm::jitlink::JITLinkerBase> >) at
> /Users/igorgomon/dev/third-party/llvm-project/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp:28
> >>>>>>>
> >>>>>>> #10 0x00000001066...
2012 Jun 16
0
[LLVMdev] object construction patterns and unique_ptr
...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 interface that can be simplified down to:
>
> virtual error_code readFile(StringRef path, std::unique_ptr<lld::File> &result);
>
> But this interface has become awkward to use. There are two &qu...
2020 Apr 16
4
ORC Assertion failure
...gt;,llvm::detail::DenseMapPair<llvm::orc::SymbolStringPtr,llvm::JITEvaluatedSymbol>>
& Symbols) Line 449 C++
libravi.dll!llvm::orc::RTDyldObjectLinkingLayer::onObjLoad(unsigned
__int64 K, llvm::orc::MaterializationResponsibility & R,
llvm::object::ObjectFile & Obj,
std::unique_ptr<llvm::RuntimeDyld::LoadedObjectInfo,std::default_delete<llvm::RuntimeDyld::LoadedObjectInfo>>
LoadedObjInfo, std::map<llvm::StringRef,llvm::JITEvaluatedSymbol,std::less<llvm::StringRef>,std::allocator<std::pair<llvm::StringRef
const ,llvm::JITEvaluatedSymbol>>> R...
2016 Sep 14
2
setDataLayout segfault
Ok. I can make a copy of the unique_ptr before moving it into the
builder's constructor and use the copy later on. It is confusing to
require a unique_ptr.
Frank
On 09/14/2016 12:11 PM, Frank Winter via llvm-dev wrote:
> I am constructing the engine builder in the following way:
>
> llvm::SMDiagnostic Err;
> unique_pt...