search for: hasvalue

Displaying 13 results from an estimated 13 matches for "hasvalue".

2018 Jan 24
2
[llvm] r322838 - [ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
...age(const T &y) : hasVal(true) { new (storage.buffer) T(y); > } > + OptionalStorage &operator=(const T &y) { > + new (storage.buffer) T(y); > + hasVal = true; > + return *this; > } > > - explicit operator bool() const { return hasVal; } > - bool hasValue() const { return hasVal; } > - const T *operator->() const { return getPointer(); } > - T *operator->() { return getPointer(); } > - const T &operator*() const LLVM_LVALUE_FUNCTION { > - assert(hasVal); > - return *getPointer(); > + void reset() { hasVal = fals...
2018 Jan 24
0
[llvm] r322838 - [ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
...new (storage.buffer) T(y); >> } >> + OptionalStorage &operator=(const T &y) { >> + new (storage.buffer) T(y); >> + hasVal = true; >> + return *this; >> } >> >> - explicit operator bool() const { return hasVal; } >> - bool hasValue() const { return hasVal; } >> - const T *operator->() const { return getPointer(); } >> - T *operator->() { return getPointer(); } >> - const T &operator*() const LLVM_LVALUE_FUNCTION { >> - assert(hasVal); >> - return *getPointer(); >> + void...
2018 Jan 24
1
[llvm] r322838 - [ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
...gt; >> + OptionalStorage &operator=(const T &y) { > >> + new (storage.buffer) T(y); > >> + hasVal = true; > >> + return *this; > >> } > >> > >> - explicit operator bool() const { return hasVal; } > >> - bool hasValue() const { return hasVal; } > >> - const T *operator->() const { return getPointer(); } > >> - T *operator->() { return getPointer(); } > >> - const T &operator*() const LLVM_LVALUE_FUNCTION { > >> - assert(hasVal); > >> - return *getPo...
2012 Feb 28
1
colour by z value, persp in raster package
Hi all!   My question is how to colour pixels by z value in persp plot in raster package. Here is an example:     x <- seq(-1.95, 1.95, length = 30) y <- seq(-1.95, 1.95, length = 35) z <- outer(x, y, function(a,b) a*b^2) r1 <- raster(nrows=35, ncols=30, xmn=0, xmx=30, ymn = 0, ymx = 35) r1[] <- c(z) persp(r1)   There already exist some function to produce persp plot for anothe
2017 Jul 17
3
A bug related with undef value when bootstrap MemorySSA.cpp
It seems MemorySSA.cpp is the only real code where we found the problem happening. Is it possible to change the source of MemorySSA.cpp to hide the problem and buy some time for now? Now we use an empty generic_def_path_iterator with Optional<ListIndex> N being initialized by None as the end of range. Can we initialize the Optional var with a special value instead of None?
2015 Jan 26
0
[LLVMdev] question about enabling cfl-aa and collecting a57 numbers
Inline George > On Jan 26, 2015, at 1:05 PM, Daniel Berlin <dberlin at dberlin.org> wrote: > > George, given that, can you just build constexpr handling (it's not as easy as you think) as a separate funciton and have it use it in the right places? Will do. :) > FWIW, my current list of CFLAA issues is: > > 1. Unknown values (results from ptrtoint, incoming
2015 Jan 09
0
RFC: getifexists() {was [Bug 16065] "exists" ...}
...ot provide access to the value, which is typically >>> R_UnboundValue. But this does not even need to be implemented with SYMSXP. >>> The design would allow something like: >>> >>> binding <- getBinding("x", env) >>> if (hasValue(binding)) { >>> x <- value(binding) # throws an error if none >>> message(name(binding), "has value", x) >>> } >>> >>> That I think it is a bit verbose but readable and could be made fast. And >>> I...
2015 Jan 26
2
[LLVMdev] question about enabling cfl-aa and collecting a57 numbers
George, given that, can you just build constexpr handling (it's not as easy as you think) as a separate funciton and have it use it in the right places? FWIW, my current list of CFLAA issues is: 1. Unknown values (results from ptrtoint, incoming pointers, etc) are not treated as unknown. These should be done through graph edge (so that they can be one way, otherwise, you will unify
2015 Jan 30
2
[LLVMdev] question about enabling cfl-aa and collecting a57 numbers
...or<Edge, 8> Edges; + argsToEdges(Analysis, &Inst, Edges); + + // In the case of an unused alloca (or similar), edges may be empty. Note + // that it exists so we can potentially answer NoAlias. + if (Edges.empty()) { + auto MaybeVal = getTargetValue(&Inst); + assert(MaybeVal.hasValue()); + auto *Target = *MaybeVal; + findOrInsertNode(Target); + return; + } - // In the case of an unused alloca (or similar), edges may be empty. Note - // that it exists so we can potentially answer NoAlias. - if (Edges.empty()) { - auto MaybeVal = getTargetValue(&...
2015 Jan 08
2
RFC: getifexists() {was [Bug 16065] "exists" ...}
...rse (name >> objects) but they do not provide access to the value, which is typically >> R_UnboundValue. But this does not even need to be implemented with SYMSXP. >> The design would allow something like: >> >> binding <- getBinding("x", env) >> if (hasValue(binding)) { >> x <- value(binding) # throws an error if none >> message(name(binding), "has value", x) >> } >> >> That I think it is a bit verbose but readable and could be made fast. And >> I >> think binding objects would be useful in other...
2015 Jan 08
4
RFC: getifexists() {was [Bug 16065] "exists" ...}
...value. We already have SYMSXPs at the R level of course (name objects) but they do not provide access to the value, which is typically R_UnboundValue. But this does not even need to be implemented with SYMSXP. The design would allow something like: binding <- getBinding("x", env) if (hasValue(binding)) { x <- value(binding) # throws an error if none message(name(binding), "has value", x) } That I think it is a bit verbose but readable and could be made fast. And I think binding objects would be useful in other ways, as they are essentially a "named object". F...
2015 Jan 08
0
RFC: getifexists() {was [Bug 16065] "exists" ...}
...Ps at the R level of course (name > objects) but they do not provide access to the value, which is typically > R_UnboundValue. But this does not even need to be implemented with SYMSXP. > The design would allow something like: > > binding <- getBinding("x", env) > if (hasValue(binding)) { > x <- value(binding) # throws an error if none > message(name(binding), "has value", x) > } > > That I think it is a bit verbose but readable and could be made fast. And I > think binding objects would be useful in other ways, as they are > essential...
2015 Jan 08
5
RFC: getifexists() {was [Bug 16065] "exists" ...}
In November, we had a "bug repository conversation" with Peter Hagerty and myself: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16065 where the bug report title started with --->> "exists" is a bottleneck for dispatch and package loading, ... Peter proposed an extra simplified and henc faster version of exists(), and I commented > --- Comment #2