Douglas Gregor
bb5c9263b1
Add a few missing 'template' keywords
...
llvm-svn: 152525
2012-03-11 02:22:41 +00:00
Argyrios Kyrtzidis
267b14e42c
PointerUnion::getAddrOf() does not need to be template since we can only
...
use the first pointer type for it. Rename it to getAddrOfPtr1().
llvm-svn: 152106
2012-03-06 07:14:54 +00:00
Chris Lattner
ec2b25406c
Fix an obscure bug in PointerUnion that would bite PointerUnion3/4. Basically,
...
when checking isNull(), we'd pick off the sentinel bit for the outer
PointerUnion, but would not recursively convert the inner pointerunion to bool,
so if *its* sentinel bit is set, isNull() would incorrectly return false.
No testcase, because someone hit this when they were trying to refactor code
to use PointerUnion3, but they since found a better solution.
llvm-svn: 137428
2011-08-12 04:31:38 +00:00
Argyrios Kyrtzidis
5a57c82f11
Try fixing mingw build.
...
llvm-svn: 127153
2011-03-07 05:35:01 +00:00
Argyrios Kyrtzidis
9cd53db2f9
Do a compiler check that we use one of the types from PointerUnion[N], instead of a runtime check.
...
llvm-svn: 127145
2011-03-07 01:30:20 +00:00
Argyrios Kyrtzidis
a3437f732e
Allow getting the address of the value in a PointerUnion or PointerIntPair if one is
...
confident enough that he knows what he is doing.
llvm-svn: 126019
2011-02-19 03:55:58 +00:00
Ted Kremenek
59cdbd3cfc
Change PointerUnionX::getFromOpaqueValue() to be declared 'static inline' instead of 'static'.
...
llvm-svn: 99892
2010-03-30 16:20:03 +00:00
Douglas Gregor
790089c6e6
Add a bunch of missing "template" keywords to disambiguate dependent template names. GCC eats this ill-formed code, Clang does not. I already filed PR5404 to improve recovery in this case
...
llvm-svn: 86204
2009-11-06 00:12:53 +00:00
Douglas Gregor
7bc7d66441
Fix a typo, and all of its copies
...
llvm-svn: 77489
2009-07-29 18:27:22 +00:00
Douglas Gregor
9072f2cd18
Implement PointerUnion4.
...
llvm-svn: 77487
2009-07-29 18:19:47 +00:00
Sebastian Redl
51473d2434
Fix three MSVC 2008 warnings that completely clutter the build output.
...
llvm-svn: 74430
2009-06-29 17:12:06 +00:00
Douglas Gregor
aaa9263fc6
Allow the use of pointers to const within PointerUnion.
...
llvm-svn: 68159
2009-03-31 23:19:54 +00:00
Douglas Gregor
50b29cfe51
Stop guessing, start thinking, and make PointerUnion3::is actually be correct.
...
llvm-svn: 68126
2009-03-31 18:31:03 +00:00
Douglas Gregor
41ab75e9ef
Really, really fix PointerUnion3::is
...
llvm-svn: 68079
2009-03-31 00:34:31 +00:00
Douglas Gregor
0beaefea25
Make PointerUnion3::get work properly
...
llvm-svn: 68067
2009-03-30 21:44:13 +00:00
Chris Lattner
ccc73c9327
update comment.
...
llvm-svn: 68060
2009-03-30 20:44:04 +00:00
Chris Lattner
a172ae1d4f
add a PointerUnion3 class and generalize PointerUnion to work with
...
anything pointer-like, which may or may not actually be a pointer.
llvm-svn: 68056
2009-03-30 20:29:27 +00:00
Chris Lattner
be9cd842ae
add some comments, add a dyn_cast method.
...
llvm-svn: 67992
2009-03-29 07:03:30 +00:00
Chris Lattner
696742399a
add helper method.
...
llvm-svn: 67989
2009-03-29 06:32:46 +00:00
Chris Lattner
2c6632d760
Add a simple type-safe bit-mangling pointer union class. This allows
...
you to do things like:
/// PointerUnion<int*, float*> P;
/// P = (int*)0;
/// printf("%d %d", P.is<int*>(), P.is<float*>()); // prints "1 0"
/// X = P.get<int*>(); // ok.
/// Y = P.get<float*>(); // runtime assertion failure.
/// Z = P.get<double*>(); // does not compile.
/// P = (float*)0;
/// Y = P.get<float*>(); // ok.
/// X = P.get<int*>(); // runtime assertion failure.
llvm-svn: 67987
2009-03-29 06:06:02 +00:00