search for: arrayrefs

Displaying 20 results from an estimated 434 matches for "arrayrefs".

Did you mean: arrayref
2014 Jul 18
2
[LLVMdev] Bug in llvm/ADT/ArrayRef.h?
Hi, I think I ran into a rather subtle bug inside llvm/ADT/ArrayRef.h which only shows up when compiling the code with GCC-4.8 with switched-off optimizations. (Both clang and GCC-4.7 don't trigger the bug.) I already filed a bug against GCC-4.8 which was rejected by the GCC-folks as being invalid, because the code (basically ArrayRef.h) "is doing something bad - it's retaining a
2014 Aug 22
2
[LLVMdev] Addressing const reference in ArrayRef
On Fri, Aug 22, 2014 at 11:22 AM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote: > >> On 2014-Aug-22, at 10:43, David Blaikie <dblaikie at gmail.com> wrote: >> >> Yep - the convenience of one-element->ArrayRef is "cute" at best, I >> think. Having to wrap it doesn't seem detrimental. Would have to look >> at some numbers,
2014 Aug 22
4
[LLVMdev] Addressing const reference in ArrayRef
...ly gather the number of instances of this - I'm not sure of the easiest way to do that, given the build system likes to stop after it sees an error). I'm not sure if the "Temp" in the name would be a sufficient deterrent, but maybe. > This would cause a lot of churn though -- ArrayRefs are *usually* > temporaries. Although this makes sense to me, disallowing named > ArrayRefs might be more practical. Yeah, I'm not sure how practical that is either - we have (guessing) quite a few named ArrayRefs... but it might be tractible to remove them. Not sure how I feel about th...
2014 Aug 20
3
[LLVMdev] Addressing const reference in ArrayRef
Analyzing why GCC failed to build LLVM recently, one root cause lies in definition of ArrayRef: // ArrayRef.h: ArrayRef(const T &OneElt) : Data(&OneElt), Length(1) {} Here address of const reference is taken and stored to an object. It is believed that live range of const reference is only at the function call site, escaping of its address to an object with a longer live range is invalid.
2014 Aug 21
2
[LLVMdev] Addressing const reference in ArrayRef
On Thu, Aug 21, 2014 at 10:34 AM, Reid Kleckner <rnk at google.com> wrote: > Is there some way we can get lifetime extension of temporaries to kick in > here? Nope - since the temporary is a subexpression - not the thing being declared. > > > On Thu, Aug 21, 2014 at 8:05 AM, David Blaikie <dblaikie at gmail.com> wrote: >> >> Yeah - I suspect there are just
2014 Aug 21
2
[LLVMdev] Addressing const reference in ArrayRef
David Blaikie <dblaikie at gmail.com> writes: > I seem to recall discussing this before - is there an existing llvm > bug filed, another email thread or something (or perhaps it was just > an IRC conversation)? It would be good to keep all the discussion > together or at least reference the prior (llvm community) discussion. I'm not sure if it's been discussed before,
2014 Aug 21
2
[LLVMdev] Addressing const reference in ArrayRef
Yeah - I suspect there are just too many cases where we use this ctor correctly: where the ArrayRef is only a temporary to a function call. Perhaps this is a problem for which the best solution is a clang-tidy checker - though I'm not sure if we have good integration there yet. (& yes, Andreas, that looks like the previous thread - thanks!) On Thu, Aug 21, 2014 at 5:09 AM, Andreas Weber
2019 May 03
3
ArrayRef vs SmallVectorImpl
It is suggested in the documentation that if you would have declared a function parameter as SmallVector<Foo,N>&, it is better to instead declare it as SmallVectorImpl<Foo>&. This makes sense, but it seems to me that it is better still to declare it as ArrayRef<Foo>; a quick test suggests it compiles to the same (highly efficient) code, and adds a bit more flexibility in
2012 Jan 22
2
[LLVMdev] CreateGlobalStringPtr giving linker errors
Hi, I am trying to use some LLVM API in my C++ code, and I end up getting linker errors. I am working on Apple MacOSX Lion. Using g++ for the compile. It is the CreateGlobalStringPtr which is throwing the error. This is LLVM 3.0. Here's the codeI am trying to use some LLVM API in my C++ code, and I end up getting linker errors. I am working on Apple MacOSX Lion. Using g++ for the compile. It
2016 Aug 24
2
Pointer to temporary issue in ArrayRefTest.InitializerList
Hi all- I am mostly doing work in Clang (and am new there), so I apologize if this isn't the proper place to mention this. I appreciate guidance in advance. I was looking into some of the unit tests, and noticed that the ArrayRefTest.InitializerList, and thus the InitializerList constructor of ArrayRef (under normal use-case) hit undefined behavior. The test does the following:
2015 Jan 20
2
[LLVMdev] Bug in InsertElement constant propagation?
Does anybody else have an opinion on this issue? I'm planning to submit a patch which would add a new get method for ConstantDataVector taking an ArrayRef<Constant*> and use that in the few places in constant propagation where convertToFloat is used. Let me know if you think there is a more obvious way to do it. Right now the only way to create a ConstantDataVector are those method:
2017 Oct 01
2
Is ArrayRef supposed to be immutable?
...llvm.org>> wrote: > It wraps a constant T* and a size_t, so I'm surprised std::sort works. It shouldn't. > > On Sep 30, 2017 5:22 PM, "Daniel Berlin via llvm-dev" <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > It seems like ArrayRefs are supposed to be immutable ( > However, as far as i can tell, the iterators are defined wrong to make this true. > > While > ArrayRef<int> Foo(Something); > Foo[0] = 5; > > will give a compile time error. > > something like: > > ArrayRef<int> Foo(...
2017 Oct 01
2
Is ArrayRef supposed to be immutable?
It wraps a constant T* and a size_t, so I'm surprised std::sort works. It shouldn't. On Sep 30, 2017 5:22 PM, "Daniel Berlin via llvm-dev" < llvm-dev at lists.llvm.org> wrote: It seems like ArrayRefs are supposed to be immutable ( However, as far as i can tell, the iterators are defined wrong to make this true. While ArrayRef<int> Foo(Something); Foo[0] = 5; will give a compile time error. something like: ArrayRef<int> Foo(Something); std::sort(Foo.begin(), Foo.end()); Will wor...
2020 Apr 30
2
Discrepancy between Debug and Release+Asserts versions of Clang/LLVM
I agree that the ArrayRef is likely the issue. I've debugged a crash caused by a temporary ArrayRef like that a couple times. Either do what David suggested or use a normal array: Metadata *mdArray[] = {ConstantInt::get(Int64Ty, 0), newMD}; ~Craig On Thu, Apr 30, 2020 at 9:56 AM David Blaikie via llvm-dev < llvm-dev at lists.llvm.org> wrote: > > > On Thu, Apr 30, 2020 at
2016 Aug 24
2
Pointer to temporary issue in ArrayRefTest.InitializerList
Sorry for the inline-comment format being weird, I haven't figured out yet how to do '>' stuff in outlook yet :/ Hopefully this is clear enough. -----Original Message----- From: mehdi.amini at apple.com [mailto:mehdi.amini at apple.com] Sent: Wednesday, August 24, 2016 10:55 AM To: Keane, Erich <erich.keane at intel.com> Cc: llvm-dev at lists.llvm.org Subject: Re:
2012 Jan 22
0
[LLVMdev] CreateGlobalStringPtr giving linker errors
Probably your g++ compiles x86_64 binary by default, but i686 dylib is supplied? Try: g++ -m32 e.cpp /Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin10/4.2.1/libllvmgcc.dylib - D. 2012/1/22 Arpan Sen <arpansen at gmail.com>: > Hi, > > I am trying to use some LLVM API in my C++ code, and I end up getting linker > errors. I am
2015 Nov 05
2
Why StringRef is not a ArrayRef<char>
Hi, Why is StringRef not an ArrayRef<char> extension? That might simplify some interfaces. Cheers, Paweł -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151105/ef56dcdc/attachment.html>
2020 Apr 30
2
Discrepancy between Debug and Release+Asserts versions of Clang/LLVM
Hello, I am editing the LowerTypeTests pass in LLVM, and part of my additions include the following 3 lines of code: // newTypeName is a std::string MDString* newMD = MDString::get(M.getContext(), newTypeName); ArrayRef<Metadata*> mdArray {ConstantInt::get(Int64Ty, 0), newMD}; auto* node = MDTuple::get(M.getContext(), mdArray); Thus far, I have been developing on a version of Clang with
2017 Oct 01
0
Is ArrayRef supposed to be immutable?
It seems like ArrayRefs are supposed to be immutable ( However, as far as i can tell, the iterators are defined wrong to make this true. While ArrayRef<int> Foo(Something); Foo[0] = 5; will give a compile time error. something like: ArrayRef<int> Foo(Something); std::sort(Foo.begin(), Foo.end()); Will wor...
2017 Aug 31
2
LLD: patch to fix libCOFF calling exit() on success in a library function
I believe that LLD is not supposed to call exit on success when you call lld::coff::link. >From downstream fork of LLD: https://github.com/zig-lang/zig/commit/41da9fdb69065082f57c604b12eb02ca166cb18d diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp index 854c3e69098..8b17f039870 100644 --- a/lld/COFF/Driver.cpp +++ b/lld/COFF/Driver.cpp @@ -1030,7 +1030,7 @@ void