Rafael Espindola [Tue, 17 Jul 2012 15:14:47 +0000 (15:14 +0000)]
Merge visibility from previous decls before looking at visibility pragma. This
is a bit fuzzy, but matches gcc behavior and existing code bases seem to
depend on it.
- lib/Driver/Driver.cpp, tools/driver/driver.cpp: Exit status should not be propagated, although clang driver should catch exceptions.
- test/Driver/crash-report.c: Add REQUIRES:shell for now.
FIXME: setenv should work also on Lit.InternalShellRunner.
- test/Driver/crash-report.c: Remove XFAIL.
Richard Smith [Tue, 17 Jul 2012 01:27:33 +0000 (01:27 +0000)]
Uninitialized variables: two little changes:
* Treat compound assignment as a use, at Jordy's request.
* Always add compound assignments into the CFG, so we can correctly diagnose the use in 'return x += 1;'
Richard Smith [Tue, 17 Jul 2012 00:06:14 +0000 (00:06 +0000)]
-Wuninitialized: Split the classification of DeclRefExprs as initialization or
use out of TransferFunctions, and compute it in advance rather than on-the-fly.
This allows us to handle compound assignments with DeclRefExprs on the RHS
correctly, and also makes it trivial to treat const& function parameters as not
initializing the argument. The patch also makes both of those changes.
Add hack (provided by Jonathan Sauer) to fall back to assuming Xcode is installed in /Developer
when using Python < 2.7.0. This is the case on Snow Leopard, where the tools are always
installed in /Developer. This isn't a proper fix for really figuring out where Xcode
is installed, but should work to fix an obvious problem on Snow Leopard.
Jordan Rose [Mon, 16 Jul 2012 20:52:12 +0000 (20:52 +0000)]
Don't crash when emitting fixits following Unicode characters.
This code is very sensitive to the difference between "columns" as printed
and "bytes" (SourceManager columns). All variables are now named explicitly
and our assumptions are (hopefully) documented as both comment and assertion.
Whether parseable fixits should use byte offsets or Unicode character counts
is pending discussion on the mailing list; currently the implementation uses
bytes (and has no problems on lines containing multibyte characters).
This has been added to the user manual.
Anna Zaks [Mon, 16 Jul 2012 20:21:42 +0000 (20:21 +0000)]
[analyzer] Make CmpRuns external-user friendly.
CmpRuns can be used for static analyzer bug report comparison. However,
we want to make sure external users do not rely on the way bugs are
represented (plist files). Make sure that we have a user
friendly/documented API for CmpRuns script.
Simon Atanasyan [Mon, 16 Jul 2012 18:52:02 +0000 (18:52 +0000)]
MIPS: Implement __builtin_mips_shll_qb builtin function overloading.
This function has two versions. The first one is used for a register operand.
The second one is used for an immediate number.
Richard Smith [Mon, 16 Jul 2012 01:59:26 +0000 (01:59 +0000)]
More for PR11848: a pack expansion type isn't necessarily type-dependent (its
pattern might be an alias template which doesn't use its arguments). It's always
instantiation-dependent, though.
Richard Smith [Mon, 16 Jul 2012 01:09:10 +0000 (01:09 +0000)]
PR13365: Fix code which was trying to treat an array of DeducedTemplateArgument
as an array of its base class TemplateArgument. Switch the const
TemplateArgument* parameters of InstantiatingTemplate's constructors to
ArrayRef<TemplateArgument> to prevent this from happening again in the future.
Richard Smith [Mon, 16 Jul 2012 00:20:35 +0000 (00:20 +0000)]
Related to PR11848 and core-21989: switch ContainsUnexpandedParameterPack from
being a property of a canonical type to being a property of the fully-sugared
type. This should only make a difference in the case where an alias template
ignores one of its parameters, and that parameter is an unexpanded parameter
pack.
Which is a bit silly and got a lot noisier now that we correctly handle
visibility pragmas. This patch fixes that and also has some extra quality
improvements:
* We now produce an error instead of a warning for
Refine CFG so that '&&' and '||' don't lead to extra confluence points when used in a branch, but
instead push the terminator for the branch down into the basic blocks of the subexpressions of '&&' and '||'
respectively. This eliminates some artifical control-flow from the CFG and results in a more
compact CFG.
Note that this patch only alters the branches 'while', 'if' and 'for'. This was complex enough for
one patch. The remaining branches (e.g., do...while) can be handled in a separate patch, but they
weren't immediately tackled because they were less important.
It is possible that this patch introduces some subtle bugs, particularly w.r.t. to destructor placement.
I've tried to audit these changes, but it is also known that the destructor logic needs some refinement
in the area of '||' and '&&' regardless (i.e., their are known bugs).
Chad Rosier [Fri, 13 Jul 2012 23:57:43 +0000 (23:57 +0000)]
Add a per target max vector alignment field (e.g., 32-byte alignment for x86 due to
AVX). Currently, if no aligned attribute is specified the alignment of a vector is
inferred from its size. Thus, very large vectors will be over-aligned with no
benefit. Target owners should set this target max.
Richard Smith [Fri, 13 Jul 2012 23:33:44 +0000 (23:33 +0000)]
PR13360: When deciding the earliest point which inevitably leads to an
uninitialized variable use, walk back over branches where we've reached all the
non-null successors, not just cases where we've reached all successors.
Joel Jones [Fri, 13 Jul 2012 23:26:27 +0000 (23:26 +0000)]
This is one of the first steps at moving to replace target-dependent
intrinsics with target-indepdent intrinsics. The first instruction(s) to be
handled are the vector versions of count leading zeros (ctlz).
The changes here are to clang so that it generates a target independent
vector ctlz when it sees an ARM dependent vector ctlz. The changes in llvm
are to match the target independent vector ctlz and in VMCore/AutoUpgrade.cpp
to update any existing bc files containing ARM dependent vector ctlzs with
target-independent ctlzs. There are also changes to an existing test case in
llvm for ARM vector count instructions and a new test for the bitcode upgrade.
There is deliberately no test for the change to clang, as so far as I know, no
consensus has been reached regarding how to test neon instructions in clang;
q.v. <rdar://problem/8762292>
Richard Trieu [Fri, 13 Jul 2012 21:18:32 +0000 (21:18 +0000)]
Modify tree printing mode for template type diffing. If a diagnostic has
multiple %diff's, only print the first tree and fallback to inline printing
for the rest of the diagnostic.
Rafael Espindola [Fri, 13 Jul 2012 18:04:45 +0000 (18:04 +0000)]
Apply visibility pragmas to class template declarations. This is needed because
we might use the declaration to build a type before seeing the definition.
Richard Smith [Fri, 13 Jul 2012 04:12:04 +0000 (04:12 +0000)]
Provide a special-case diagnostic when two class member functions instantiate
to the same signature. Fix a bug in the type printer which would cause this
diagnostic to print wonderful types like 'const const int *'.
Rafael Espindola [Fri, 13 Jul 2012 01:19:08 +0000 (01:19 +0000)]
Fix a bug in my previous commit. The problem is not that we were not using the
canonical decl for the template, but that we were not merging attributes for
templates at all!
Dmitri Gribenko [Thu, 12 Jul 2012 16:34:32 +0000 (16:34 +0000)]
Always initialize variable. If opening quote is the last character in comment, we will be using an uninitialized value. There is already a test for that in unittests/AST/CommentLexer.cpp, but it seems like we were lucky with the value that got loaded into the variable so the test passed.
Daniel Jasper [Thu, 12 Jul 2012 08:50:38 +0000 (08:50 +0000)]
This commit combines three patches to the ASTMatchers.
One adds matchers for the various parts of a for loop (initializer, condition,
increment), as well as extending the hasBody matcher to work for while and
do-while loops. The second patch adds an isInteger matcher for types.
The third patch fixes a bug in allOf, where a few of the name chages
(AllOf --> allOf) had been missed.
Benjamin Kramer [Thu, 12 Jul 2012 08:34:31 +0000 (08:34 +0000)]
Be lax about trailing whitespace when checking fixit formatting, this depends on locale settings.
If a non-unicode locale is used, the unicode character is escaped and any
byte that is in the escaped representation but not the semicolon will
become whitespace.