Commit Graph

5 Commits

Author SHA1 Message Date
Richard Smith 73c3c21fae Fix tracking of whether the previous template instantiation stack matches the current one.
Rather than attempting to compare whether the previous and current top of
context stack are "equal" (which fails for a number of reasons, such as the
context stack entries containing pointers to objects on the stack, or reaching
the same "top of stack" entry through two different paths), track the depth of
context stack at which we last emitted a note and invalidate it when we pop the
context stack to less than that depth.

This causes us to emit some missing "in instantiation of" notes and to stop
emitting redundant "in instantiation of" stacks matching the previous stack in
rare cases.

llvm-svn: 295921
2017-02-23 02:09:03 +00:00
David Majnemer c2406d46b8 [Sema] Don't artificially forbid BuiltinTemplateDecls in CheckTemplateArgument
After thinking about it, we don't really need to forbid
BuiltinTemplateDecls explicitly.  The restriction doesn't really buy us
anything.

llvm-svn: 275078
2016-07-11 17:09:56 +00:00
David Majnemer f580dd98cb [Sema] Disallow __make_integer_seq from showing up in __make_integer_seq
We hit over stringent asserts when trying to diagnose.  Loosen them as
appropriate.

This fixes PR28494.

llvm-svn: 275047
2016-07-11 05:59:24 +00:00
David Majnemer 5088cdf4d1 [Lex] Add __has_builtin support for __make_integer_seq
Differential Revision: http://reviews.llvm.org/D14349

llvm-svn: 252115
2015-11-05 01:01:47 +00:00
David Majnemer d9b1a4fb71 [Sema] Implement __make_integer_seq
This new builtin template allows for incredibly fast instantiations of
templates like std::integer_sequence.

Performance numbers follow:
My work station has 64 GB of ram + 20 Xeon Cores at 2.8 GHz.

__make_integer_seq<std::integer_sequence, int, 90000> takes 0.25
seconds.

std::make_integer_sequence<int, 90000> takes unbound time, it is still
running.  Clang is consuming gigabytes of memory.

Differential Revision: http://reviews.llvm.org/D13786

llvm-svn: 252036
2015-11-04 03:40:30 +00:00