Richard Trieu [Fri, 29 Jun 2012 21:12:16 +0000 (21:12 +0000)]
Update the %diff modifer to have an alternate string print when a template tree
is selected. This will allow more flexibility when converting diagnostics to
use template type diffing.
Also updated the internal manual and test cases for correctly keeping the bold
attribute and for tree printing.
Ted Kremenek [Fri, 29 Jun 2012 20:44:58 +0000 (20:44 +0000)]
Tweak insecureAPI analyzer checks to have the ability to be individually disabled.
The solution is a bit inefficient: it creates N checkers, one for each check, and
each check does a dispatch on the function name. This is redundant, but we can fix
this once we have the proper ability to enable/disable subchecks.
objective-c modern translator: synthesize argument type
correctly for blocks and function pointer arguments
in the written constructor. // rdar://11359268
objective-c modern translator: Translation into objc_msgSend_stret
entry point which requires nil check before calling objc_msgSend_stret.
// rdar://11359268 - wip.
Axel Naumann [Fri, 29 Jun 2012 07:30:33 +0000 (07:30 +0000)]
From Philippe Canal:
Update the two function overloads
void TemplateSpecializationType::PrintTemplateArgumentList(raw_ostream &OS,....
to behave like
std::string TemplateSpecializationType::PrintTemplateArgumentList(const TemplateArgument *Args,...
hence making sure that clang consistently adds a space between two '>' at the end of nested template arguments.
Douglas Gregor [Fri, 29 Jun 2012 01:05:22 +0000 (01:05 +0000)]
When a builtin that requires a constant is given a type- or
value-dependent expression, don't complain that it wasn't the constant
we wanted. Fixes <rdar://problem/11688587> and PR11074.
Manman Ren [Fri, 29 Jun 2012 00:54:35 +0000 (00:54 +0000)]
X86: add more GATHER intrinsics in Clang
Corrected type for index of _mm256_mask_i32gather_pd
from 256-bit to 128-bit
Corrected types for src|dst|mask of _mm256_mask_i64gather_ps
from 256-bit to 128-bit
Support the following intrinsics:
_mm_mask_i32gather_epi64, _mm256_mask_i32gather_epi64,
_mm_mask_i64gather_epi64, _mm256_mask_i64gather_epi64,
_mm_mask_i32gather_epi32, _mm256_mask_i32gather_epi32,
_mm_mask_i64gather_epi32, _mm256_mask_i64gather_epi32
Douglas Gregor [Fri, 29 Jun 2012 00:49:17 +0000 (00:49 +0000)]
Teach the __is_trivially_assignable and __is_trivially_constructible
type traits that assignment to/construction of a lifetime-qualified
object under ARC is *not* trivial. Fixes <rdar://problem/11738725>.
Jordan Rose [Fri, 29 Jun 2012 00:33:10 +0000 (00:33 +0000)]
[analyzer] Add a test that we are, in fact, doing a DFS on the ExplodedGraph.
Previously:
...the comment said DFS...
...the WorkList being instantiated said BFS...
...and the implementation was actually DFS...
...due to an unintentional change in 2010...
...and everything kept working anyway.
This fixes our std::deque implementation of BFS, but switches back to a
SmallVector-based implementation of DFS.
We should probably still investigate the ramifications of DFS vs. BFS,
especially for large functions (and especially when we hit our block path
limit), since this might completely change our memory use. It can also mask
some bugs and reveal others depending on when we halt analysis. But at least
we will not have this kind of little mistake creep in again.
Benjamin Kramer [Thu, 28 Jun 2012 20:08:55 +0000 (20:08 +0000)]
Dead code eliminate the massive hexagon builtin intrinsic supporting code.
The tablegen'd code does the same thing without this egregious duplication.
In my limited testing everything seems to work, however there can be
differences if the clang and llvm builtin definitions don't match.
Rafael Espindola [Thu, 28 Jun 2012 14:28:57 +0000 (14:28 +0000)]
Don't devirtualize calls when we don't have the correct type of the this pointer
handy. It can be done, but we would have to build a derived-to-base cast
during codegen to compute the correct this pointer.
Richard Smith [Thu, 28 Jun 2012 07:51:56 +0000 (07:51 +0000)]
Add warning flag -Winvalid-pp-token for preprocessing-tokens which have
undefined behaviour, and move the diagnostic for '' from an Error into
an ExtWarn in this group. This is important for some users of the preprocessor,
and is necessary for gcc compatibility.
Rafael Espindola [Thu, 28 Jun 2012 01:56:38 +0000 (01:56 +0000)]
Fix another issue with devirtualizing calls to final methods by passing them
the correct this pointer. There is some potential for sharing a bit more
code with canDevirtualizeMemberFunctionCalls, but that can be done in an
independent patch.
Richard Smith [Wed, 27 Jun 2012 20:23:58 +0000 (20:23 +0000)]
Check for non-POD vararg argument type after default argument promotion, not
before, so we don't incorrectly think arguments of function type are non-POD.
Dmitri Gribenko [Wed, 27 Jun 2012 16:53:58 +0000 (16:53 +0000)]
Remove unsigned and a pointer from a comment token (so that each token can have only one semantic string value attached to it), at a cost of adding an additional token.
Dmitri Gribenko [Wed, 27 Jun 2012 16:30:35 +0000 (16:30 +0000)]
Comment lexer: counting backwards from token end is thought to be confusing. We already have a pointer to the beginning of the token, so use it to extract the text instead.
Chandler Carruth [Wed, 27 Jun 2012 10:06:26 +0000 (10:06 +0000)]
Remove a completely unused and remarkably inaccurate list of test
directories from the cmake file. Dunno what the history is here, but
we're not using it.
Axel Naumann [Wed, 27 Jun 2012 09:17:42 +0000 (09:17 +0000)]
From Vassil Vassilev:
add interface for removing a FileEntry from the cache.
Forces a re-read the contents from disk, e.g. because a tool (like cling) wants to pick up a modified file.
Add a few (currently failing) tests for the PR13207 (template mangling in the presence of back references).
I've added an extra FileCheck pass for that with an extra "CURRENT" prefix.
I've carefully chosed the CURRENT/CORRECT prefixes so they
a) are self-descriptive
b) have the same length so the mangling between the current and the correct version is obvious
Feel free to ask me to change the prefixes if you know a better alternative.
preprocessing: gcc supports #line 0. So, treat this
as a gcc supported extension with usual treatment
with -pedantic (warn) and -pedantic-errors (error).
// rdar://11550996
Manman Ren [Tue, 26 Jun 2012 19:55:09 +0000 (19:55 +0000)]
X86: add GATHER intrinsics (AVX2) in Clang
Support the following intrinsics:
_mm_mask_i32gather_pd, _mm256_mask_i32gather_pd, _mm_mask_i64gather_pd
_mm256_mask_i64gather_pd, _mm_mask_i32gather_ps, _mm256_mask_i32gather_ps
_mm_mask_i64gather_ps, _mm256_mask_i64gather_ps
Rafael Espindola [Tue, 26 Jun 2012 19:18:25 +0000 (19:18 +0000)]
Fix a bug in my previous patch: If we are not doing a virtual call because
the member expression is qualified, call the method specified in the code,
not the most derived one we can find.
Richard Trieu [Tue, 26 Jun 2012 18:18:47 +0000 (18:18 +0000)]
Add template type diffing to Clang. This feature will provide a better
comparison between two templated types when they both appear in a diagnostic.
Type elision will remove indentical template arguments, which can be disabled
with -fno-elide-type. Cyan highlighting is applied to the differing types.
For more formatting, -fdiagnostic-show-template-tree will output the template
type as an indented text tree, with differences appearing inline. Template
tree works with or without type elision.
Rafael Espindola [Tue, 26 Jun 2012 17:45:31 +0000 (17:45 +0000)]
During codegen of a virtual call we would extract any casts in the expression
to see if we had an underlying final class or method, but we would then
use the cast type to do the call, resulting in a direct call to the wrong
method.
block literal irgen: several improvements on naming block
literal helper functions. All helper functions (global
and locals) use block_invoke as their prefix. Local literal
helper names are prefixed by their enclosing mangled function
names. Blocks in non-local initializers (e.g. a global variable
or a C++11 field) are prefixed by their mangled variable name.
The descriminator number added to end of the name starts off
with blank (for first block) and _<N> (for the N+2-th block).
Richard Smith [Tue, 26 Jun 2012 08:12:11 +0000 (08:12 +0000)]
Fix lifetime issue for backing APValue of OpaqueValueExpr in recursive
constexpr function evaluation, and corresponding ASan / valgrind issue in
tests, by storing the corresponding value with the relevant stack frame. This
also prevents re-evaluation of the source of the underlying OpaqueValueExpr,
which makes a major performance difference for certain contrived code (see
testcase update).