]> granicus.if.org Git - clang/log
clang
12 years agoFix inversion of static analyzer path diagnostics for path conditions.
Ted Kremenek [Tue, 20 Dec 2011 22:00:25 +0000 (22:00 +0000)]
Fix inversion of static analyzer path diagnostics for path conditions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146993 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a crash on invalid, http://llvm.org/pr11599
Nico Weber [Tue, 20 Dec 2011 20:32:49 +0000 (20:32 +0000)]
Fix a crash on invalid, http://llvm.org/pr11599

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146988 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoLet the KNR promotion warning be disabled.
Roman Divacky [Tue, 20 Dec 2011 18:35:44 +0000 (18:35 +0000)]
Let the KNR promotion warning be disabled.

Patch by Dimitry Andric!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146982 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen performing name lookup for a redeclaration, ignore module
Douglas Gregor [Tue, 20 Dec 2011 18:11:52 +0000 (18:11 +0000)]
When performing name lookup for a redeclaration, ignore module
visibility restrictions. This ensures that all declarations of the
same entity end up in the same redeclaration chain, even if some of
those declarations aren't visible. While this may seem unfortunate to
some---why can't two C modules have different functions named
'f'?---it's an acknowedgment that a module does not introduce a new
"namespace" of names.

As part of this, stop merging the 'module-private' bit from previous
declarations to later declarations, because we want each declaration
in a module to stand on its own because this can effect, for example,
submodule visibility.

Note that this notion of names that are invisible to normal name
lookup but are available for redeclaration lookups is how we should
implement friend declarations and extern declarations within local
function scopes. I'm not tackling that problem now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146980 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen performing layout for an Objective-C class, make sure to dig out
Douglas Gregor [Tue, 20 Dec 2011 15:50:13 +0000 (15:50 +0000)]
When performing layout for an Objective-C class, make sure to dig out
the definition of that class. Fixes PR11613 / <rdar://problem/10604077>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146976 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd AVX2 intrinsics for pavg, pblend, and pcmp instructions. Also remove unneeded...
Craig Topper [Tue, 20 Dec 2011 09:55:26 +0000 (09:55 +0000)]
Add AVX2 intrinsics for pavg, pblend, and pcmp instructions. Also remove unneeded builtins for SSE pcmp. Change SSE pcmpeqq and pcmpgtq to not use builtins and just use vector == and >.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146969 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate the CMake build for r146959's new files.
Chandler Carruth [Tue, 20 Dec 2011 08:42:15 +0000 (08:42 +0000)]
Update the CMake build for r146959's new files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146967 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRelax type checking for a few Neon intrinsics. <rdar://problem/10538555>
Bob Wilson [Tue, 20 Dec 2011 06:16:48 +0000 (06:16 +0000)]
Relax type checking for a few Neon intrinsics.  <rdar://problem/10538555>

Not long ago, I tightened up the type checking for pointer arguments of
Neon intrinsics to match the specifications provided by ARM.  One consequence
was that it became impossible to access the unaligned versions of a few
Neon load/store operations.  Since there are just a few of these intrinsics
where it makes a difference, I think it's better to relax the type checking
than to either introduce new non-standard unaligned intrinsics or to disallow
intrinsics for the unaligned operations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146963 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix off-by-one error in an assert condition. No functionality change, but better
Richard Smith [Tue, 20 Dec 2011 04:39:57 +0000 (04:39 +0000)]
Fix off-by-one error in an assert condition. No functionality change, but better
error detection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146962 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r146766, and add a testcase for which it introduced a wrong-code bug.
Richard Smith [Tue, 20 Dec 2011 04:00:21 +0000 (04:00 +0000)]
Revert r146766, and add a testcase for which it introduced a wrong-code bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146961 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUnweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
David Blaikie [Tue, 20 Dec 2011 02:48:34 +0000 (02:48 +0000)]
Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146959 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUnlike in C++03, a constant-expression is not an unevaluated operand in C++11.
Richard Smith [Tue, 20 Dec 2011 02:08:33 +0000 (02:08 +0000)]
Unlike in C++03, a constant-expression is not an unevaluated operand in C++11.
Split out a new ExpressionEvaluationContext flag for this case, and don't treat
it as unevaluated in C++11. This fixes some crash-on-invalids where we would
allow references to class members in potentially-evaluated constant expressions
in static member functions, and also fixes half of PR10177.

The fix to PR10177 exposed a case where template instantiation failed to provide
a source location for a diagnostic, so TreeTransform has been tweaked to supply
source locations when transforming a type. The source location is still not very
good, but MarkDeclarationsReferencedInType would need to operate on a TypeLoc to
improve it further.

Also fix MarkDeclarationReferenced in C++98 mode to trigger instantiation for
static data members of class templates which are used in constant expressions.
This fixes a link-time problem, but we still incorrectly treat the member as
non-constant. The rest of the fix for that issue is blocked on PCH support for
early-instantiated static data members, which will be added in a subsequent
patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146955 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix tentative parsing so it knows how to handle an ambiguous for-range-declaration...
Eli Friedman [Tue, 20 Dec 2011 01:50:37 +0000 (01:50 +0000)]
Fix tentative parsing so it knows how to handle an ambiguous for-range-declaration.  PR11601.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146953 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove some extraneous carriage returns from these files. One of the
Chandler Carruth [Tue, 20 Dec 2011 01:45:15 +0000 (01:45 +0000)]
Remove some extraneous carriage returns from these files. One of the
Windows subversion clients isn't setup to default to eol:native again...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146952 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRefine error diagnostic for using bridged casts when not using ARC.
Ted Kremenek [Tue, 20 Dec 2011 01:03:40 +0000 (01:03 +0000)]
Refine error diagnostic for using bridged casts when not using ARC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146938 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDetect when mapping a #include/#import over to a submodule ends up
Douglas Gregor [Tue, 20 Dec 2011 00:28:52 +0000 (00:28 +0000)]
Detect when mapping a #include/#import over to a submodule ends up
hitting a submodule that was never actually created, e.g., because
that header wasn't parsed. In such cases, complain (because the
module's umbrella headers don't cover everything) and fall back to
including the header.

Later, we'll add a warning at module-build time to catch all such
cases. However, this fallback is important to eliminate assertions in
the ASTWriter when this happens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146933 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMark the calls to the _setjmp function as returns twice. <rdar://problem/10492556>
Bill Wendling [Mon, 19 Dec 2011 23:53:28 +0000 (23:53 +0000)]
Mark the calls to the _setjmp function as returns twice. <rdar://problem/10492556>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146926 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSwitch a few callers of MakeAddrLValue places over to MakeNaturalAlignAddrLValue.
Eli Friedman [Mon, 19 Dec 2011 23:03:09 +0000 (23:03 +0000)]
Switch a few callers of MakeAddrLValue places over to MakeNaturalAlignAddrLValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146920 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc-arc: bridge casts in non-arc mode are now
Fariborz Jahanian [Mon, 19 Dec 2011 22:52:53 +0000 (22:52 +0000)]
objc-arc: bridge casts in non-arc mode are now
error. // rdar://10597832

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146918 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEvaluation support for ExprWithCleanups. We won't evaluate any expression which
Richard Smith [Mon, 19 Dec 2011 22:12:41 +0000 (22:12 +0000)]
Evaluation support for ExprWithCleanups. We won't evaluate any expression which
actually requires non-trivial cleanups, so no cleanups need to be performed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146916 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImprove r146813 (for PR11595) to give an appropriate diagnostic.
Richard Smith [Mon, 19 Dec 2011 22:01:37 +0000 (22:01 +0000)]
Improve r146813 (for PR11595) to give an appropriate diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146915 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoloads also handled of course.
Chris Lattner [Mon, 19 Dec 2011 21:17:33 +0000 (21:17 +0000)]
loads also handled of course.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146910 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix PR5279 - don't sliently drop alignment information on stores of types that have...
Chris Lattner [Mon, 19 Dec 2011 21:16:08 +0000 (21:16 +0000)]
Fix PR5279 - don't sliently drop alignment information on stores of types that have alignment less than the natural alignment of the type when it comes from a typedef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146908 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agofilecheckize.
Chris Lattner [Mon, 19 Dec 2011 21:11:59 +0000 (21:11 +0000)]
filecheckize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146907 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agorename test.
Chris Lattner [Mon, 19 Dec 2011 21:10:59 +0000 (21:10 +0000)]
rename test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146906 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEliminate the first->last redeclaration map from the AST file
Douglas Gregor [Mon, 19 Dec 2011 21:09:25 +0000 (21:09 +0000)]
Eliminate the first->last redeclaration map from the AST file
format. It's no longer being used, now that we have a new
implementation of redeclaration chains.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146905 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc-arc: bridge casts in non-objc-arc mode are ignord.
Fariborz Jahanian [Mon, 19 Dec 2011 21:06:15 +0000 (21:06 +0000)]
objc-arc: bridge casts in non-objc-arc mode are ignord.
But, warn too. // rdar://10597832

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146904 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove ASTReader's PendingForwardRefs, which is now handled by the
Douglas Gregor [Mon, 19 Dec 2011 20:51:16 +0000 (20:51 +0000)]
Remove ASTReader's PendingForwardRefs, which is now handled by the
(more general) fix-up of definition data pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146903 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAttempt to fix test in Release builds.
Eli Friedman [Mon, 19 Dec 2011 20:09:01 +0000 (20:09 +0000)]
Attempt to fix test in Release builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146898 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix typo 'typdefs', from Nikola Smiljanic
Douglas Gregor [Mon, 19 Dec 2011 19:50:23 +0000 (19:50 +0000)]
Fix typo 'typdefs', from Nikola Smiljanic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146894 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoOnce we have fully deserialized a redeclaration chain for something
Douglas Gregor [Mon, 19 Dec 2011 19:00:47 +0000 (19:00 +0000)]
Once we have fully deserialized a redeclaration chain for something
with a definition pointer (e.g., C++ and Objective-C classes), zip
through the redeclaration chain to make sure that all of the
declarations point to the definition data.

As part of this, realized again why the first redeclaration of an
entity in a file is important, and brought back that idea.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146886 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRe-implement (de-)serialization of redeclaration chains for
Douglas Gregor [Mon, 19 Dec 2011 18:19:24 +0000 (18:19 +0000)]
Re-implement (de-)serialization of redeclaration chains for
redeclaration templates (RedeclarableTemplateDecl), similarly to the
way (de-)serialization is implemented for Redeclarable<T>. In the
process, found a simpler formulation for handling redeclaration
chains and implemented that in both places.

The new test establishes that we're building the redeclaration chains
properly. However, the FIXME indicates where we're tickling a
different bug that has to do with us not setting the DefinitionData
pointer properly in redeclarations that we detected after the
definition itself was deserialized. The (separable) fix for that bug
is forthcoming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146883 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a triple to the test.
Rafael Espindola [Mon, 19 Dec 2011 16:30:30 +0000 (16:30 +0000)]
Add a triple to the test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146871 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThe submodule offset map can introduce "empty" remapping entries for
Douglas Gregor [Mon, 19 Dec 2011 16:14:14 +0000 (16:14 +0000)]
The submodule offset map can introduce "empty" remapping entries for
imported modules that don't introduce any new entities of a particular
kind. Allow these entries to be replaced with entries for another
loaded module.

In the included test case, selectors exhibit this behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146870 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoOptimize serialized representation of redeclarable declarations for
Douglas Gregor [Mon, 19 Dec 2011 15:27:36 +0000 (15:27 +0000)]
Optimize serialized representation of redeclarable declarations for
which there are no redeclarations. This reduced by size of the PCH
file for Cocoa.h by ~650k: ~536k of that was in the new
LOCAL_REDECLARATIONS table, which went from a ridiculous 540k down to
an acceptable 3.5k, while the rest was due to the more compact
abbreviated representation of redeclarable declaration kinds (which no
longer need to store the 'first' declaration ID).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146869 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure this test works in C++, too
Douglas Gregor [Mon, 19 Dec 2011 14:42:41 +0000 (14:42 +0000)]
Make sure this test works in C++, too

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146868 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoExtend the fix for PR9614 to handle inline asm in the outer decl and
Rafael Espindola [Mon, 19 Dec 2011 14:41:01 +0000 (14:41 +0000)]
Extend the fix for PR9614 to handle inline asm in the outer decl and
the inner decl being a builtin. This is needed to support the glibc headers
in fedora 16 (2.14).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146867 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCombine common (de-)serialization logic for typedefs and type aliases
Douglas Gregor [Mon, 19 Dec 2011 14:40:25 +0000 (14:40 +0000)]
Combine common (de-)serialization logic for typedefs and type aliases
into operations on TypedefNameDecl. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146866 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd AVX2 intrinsics for and, andn, or, and xor.
Craig Topper [Mon, 19 Dec 2011 09:03:48 +0000 (09:03 +0000)]
Add AVX2 intrinsics for and, andn, or, and xor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146862 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSourceManager: use getBufferSize()
Dylan Noblesmith [Mon, 19 Dec 2011 08:51:05 +0000 (08:51 +0000)]
SourceManager: use getBufferSize()

Forming an out of bounds pointer to check if it's out
of bounds was undefined behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146861 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agofix a broken link
Chris Lattner [Mon, 19 Dec 2011 07:49:23 +0000 (07:49 +0000)]
fix a broken link

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146859 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMore AVX2 intrinsic support including saturating add/sub and palignr.
Craig Topper [Mon, 19 Dec 2011 07:03:25 +0000 (07:03 +0000)]
More AVX2 intrinsic support including saturating add/sub and palignr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146857 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoconstexpr handling improvements. Produce detailed diagnostics when a 'constexpr'
Richard Smith [Mon, 19 Dec 2011 06:19:21 +0000 (06:19 +0000)]
constexpr handling improvements. Produce detailed diagnostics when a 'constexpr'
variable is initialized by a non-constant expression, and pass in the variable
being declared so that earlier-initialized fields' values can be used.

Rearrange VarDecl init evaluation to make this possible, and in so doing fix a
long-standing issue in our C++ constant expression handling, where we would
mishandle cases like:

  extern const int a;
  const int n = a;
  const int a = 5;
  int arr[n];

Here, n is not initialized by a constant expression, so can't be used in an ICE,
even though the initialization expression would be an ICE if it appeared later
in the TU. This requires computing whether the initializer is an ICE eagerly,
and saving that information in PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146856 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBegin adding AVX2 intrinsics. Necessitated increasing the number of bits used to...
Craig Topper [Mon, 19 Dec 2011 05:04:33 +0000 (05:04 +0000)]
Begin adding AVX2 intrinsics. Necessitated increasing the number of bits used to store builtinID when serializing identifier table.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146855 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agotest/Analysis: fix error message
Dylan Noblesmith [Sun, 18 Dec 2011 18:07:42 +0000 (18:07 +0000)]
test/Analysis: fix error message

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146848 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSilence gcc warnings.
Benjamin Kramer [Sun, 18 Dec 2011 12:18:02 +0000 (12:18 +0000)]
Silence gcc warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146847 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoexamples: flesh out PFN readme
Dylan Noblesmith [Sun, 18 Dec 2011 11:30:53 +0000 (11:30 +0000)]
examples: flesh out PFN readme

Show how to actually use the arguments it has.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146845 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR11604: don't allow floating-literal-to-integer casts in ICEs if the (truncated)
Richard Smith [Sun, 18 Dec 2011 02:33:09 +0000 (02:33 +0000)]
PR11604: don't allow floating-literal-to-integer casts in ICEs if the (truncated)
floating literal value does not fit into the destination type. Such casts have
undefined behavior at translation time; treating them as non-ICE matches the
behavior of modern gcc versions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146842 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCompletely re-implement (de-)serialization of declaration
Douglas Gregor [Sat, 17 Dec 2011 23:38:30 +0000 (23:38 +0000)]
Completely re-implement (de-)serialization of declaration
chains. The previous implementation relied heavily on the declaration
chain being stored as a (circular) linked list on disk, as it is in
memory. However, when deserializing from multiple modules, the
different chains could get mixed up, leading to broken declaration chains.

The new solution keeps track of the first and last declarations in the
chain for each module file. When we load a declaration, we search all
of the module files for redeclarations of that declaration, then
splice together all of the lists into a coherent whole (along with any
redeclarations that were actually parsed).

As a drive-by fix, (de-)serialize the redeclaration chains of
TypedefNameDecls, which had somehow gotten missed previously. Add a
test of this serialization.

This new scheme creates a redeclaration table that is fairly large in
the PCH file (on the order of 400k for Cocoa.h's 12MB PCH file). The
table is mmap'd in and searched via a binary search, but it's still
quite large. A future tweak will eliminate entries for declarations
that have no redeclarations anywhere, and should
drastically reduce the size of this table.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146841 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSplit the Windows toolchain definition into its own file. This is
Chandler Carruth [Sat, 17 Dec 2011 23:10:01 +0000 (23:10 +0000)]
Split the Windows toolchain definition into its own file. This is
especially nice as the Windows toolchain needs the windows header files,
and has lots of platform specific hooks in it.

To facilitate the split, hoist a bunch of file-level static helpers into
class-level static helpers. Spiff up their doxygen comments while there
as they're now more likely to be looked up via docs.

Hopefully, this will be followed by further breaking apart of the
toolchain definitions. Most of the large and complex ones should likely
live on their own. I'm looking at you Darwin. ;]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146840 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix an abiguous-else warning from GCC. I have no idea why Clang doesn't
Chandler Carruth [Sat, 17 Dec 2011 22:32:42 +0000 (22:32 +0000)]
Fix an abiguous-else warning from GCC. I have no idea why Clang doesn't
have this warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146839 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach the link-step test to verify that we don't pass bad --hash-style
Chandler Carruth [Sat, 17 Dec 2011 21:57:25 +0000 (21:57 +0000)]
Teach the link-step test to verify that we don't pass bad --hash-style
flags on MIPS paltforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146837 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate CMake dependencies.
Ted Kremenek [Sat, 17 Dec 2011 20:08:54 +0000 (20:08 +0000)]
Update CMake dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146836 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd -mavx2 and -mno-avx2 command line support. Also add core-avx2 processor type.
Craig Topper [Sat, 17 Dec 2011 19:55:21 +0000 (19:55 +0000)]
Add -mavx2 and -mno-avx2 command line support. Also add core-avx2 processor type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146835 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFrontend/VerifyDiagnosticConsumer.cpp: Fix an expression that had side-effect.
NAKAMURA Takumi [Sat, 17 Dec 2011 13:00:31 +0000 (13:00 +0000)]
Frontend/VerifyDiagnosticConsumer.cpp: Fix an expression that had side-effect.

It had been causing test "Misc/diag-verify.cpp" failure on ms cl.exe. The emission was ordered unexpectedly as below;

First)  error: 'error' diagnostics seen but not expected:
Second) error: 'error' diagnostics expected but not seen:

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146830 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] Remove extraneous line in the test that was mistakenly copied.
Argyrios Kyrtzidis [Sat, 17 Dec 2011 08:11:28 +0000 (08:11 +0000)]
[PCH] Remove extraneous line in the test that was mistakenly copied.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146825 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] Don't deserialize bodies of interesting decls while iterating
Argyrios Kyrtzidis [Sat, 17 Dec 2011 08:11:25 +0000 (08:11 +0000)]
[PCH] Don't deserialize bodies of interesting decls while iterating
over them because more interesting decls can be added during body
deserialization.

Should fix msvc build tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146824 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRefactor SerializeDiagnosticsPrinter to using DiagnosticRenderer. This gives us...
Ted Kremenek [Sat, 17 Dec 2011 05:26:11 +0000 (05:26 +0000)]
Refactor SerializeDiagnosticsPrinter to using DiagnosticRenderer.  This gives us comparative diagnostics
to TextDiagnosticPrinter.

This certainly can be cleaned up a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146820 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRefactor 'TextDiagnostic' to have a parent class 'DiagnosticRenderer' which handles
Ted Kremenek [Sat, 17 Dec 2011 05:26:04 +0000 (05:26 +0000)]
Refactor 'TextDiagnostic' to have a parent class 'DiagnosticRenderer' which handles
the policy of how diagnostics are lowered/rendered, while TextDiagnostic handles
the actual pretty-printing.

This is a first part of reworking SerializedDiagnosticPrinter to use the same
inclusion-stack/macro-expansion logic as TextDiagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146819 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] Fix bug where we failed to update an identifier for a single token
Argyrios Kyrtzidis [Sat, 17 Dec 2011 04:13:31 +0000 (04:13 +0000)]
[PCH] Fix bug where we failed to update an identifier for a single token
macro expansion.

rdar://10588825

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146818 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] In ASTReader::FinishedDeserializing fully load the interesting decls,
Argyrios Kyrtzidis [Sat, 17 Dec 2011 04:13:28 +0000 (04:13 +0000)]
[PCH] In ASTReader::FinishedDeserializing fully load the interesting decls,
including deserializing their bodies, so that any other declarations that
get referenced in the body will be fully deserialized by the time we pass them to the consumer.

Could not reduce to a test case unfortunately. rdar://10587158.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146817 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a sanity check in the Redeclarable::redecl_iterator to avoid infinite loop
Argyrios Kyrtzidis [Sat, 17 Dec 2011 04:13:25 +0000 (04:13 +0000)]
Add a sanity check in the Redeclarable::redecl_iterator to avoid infinite loop
when we formed an invalid redeclaration chain due to a bug.

Thanks to Doug for the hint!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146816 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn Parser::SkipUntil do not stop at '@' unconditionally.
Argyrios Kyrtzidis [Sat, 17 Dec 2011 04:13:22 +0000 (04:13 +0000)]
In Parser::SkipUntil do not stop at '@' unconditionally.

Stopping at '@' was originally intended to avoid skipping an '@' at the @interface context
when doing parser recovery, but we should not stop at all '@' tokens because they may be part
of expressions (e.g. in @"string", @selector(), etc.), so in most cases we will want to skip them.

This commit caused 'test/Parser/method-def-in-class.m' to fail for the cases where we tried to
recover from unmatched angle bracket but IMO it is not a big deal to not have good recovery
from such broken code and the way we did recovery would not always work anyway (e.g. if there was '@'
in an expression).

The case that rdar://7029784 is about still passes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146815 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAfter late parsing an objc method, make sure there are no leftover cached tokens,
Argyrios Kyrtzidis [Sat, 17 Dec 2011 04:13:18 +0000 (04:13 +0000)]
After late parsing an objc method, make sure there are no leftover cached tokens,
because the memory associated with them is going to get released.
We also don't want them to affect later parsing.
(We do the same for C++ inline methods.)

The underlying cause for the leftover tokens is going to be addressed in the
next commit.

Couldn't get a test case for the crash though. rdar://10583033.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146814 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a missing check before trying to evaluate a temporary. PR11595.
Eli Friedman [Sat, 17 Dec 2011 02:24:21 +0000 (02:24 +0000)]
Add a missing check before trying to evaluate a temporary.  PR11595.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146813 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix _mm_permute_ps and _mm256_permute_ps AVX intrinsics to use "I" (ICE)
Chad Rosier [Sat, 17 Dec 2011 01:51:05 +0000 (01:51 +0000)]
Fix _mm_permute_ps and _mm256_permute_ps AVX intrinsics to use "I" (ICE)
markings.  Fix avxintrin.h to take them into account.
Part of rdar://10595450

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146810 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r146797, which was a partial revert of r146791; It was correct in the
Chad Rosier [Sat, 17 Dec 2011 01:39:56 +0000 (01:39 +0000)]
Revert r146797, which was a partial revert of r146791; It was correct in the
first place.  The permutevar_* (note the *var*) intrinsics use ymm/mem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146807 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix _mm256_extractf128_* AVX intrinsics to use "I" (ICE) markings. Fix
Chad Rosier [Sat, 17 Dec 2011 01:22:27 +0000 (01:22 +0000)]
Fix _mm256_extractf128_* AVX intrinsics to use "I" (ICE) markings.  Fix
avxintrin.h to take them into account.
Part of rdar://10595450

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146804 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPartial revert of r146791; vpermilps/vpermilpd instructions accepts ymm/mem/imm8.
Chad Rosier [Sat, 17 Dec 2011 00:50:42 +0000 (00:50 +0000)]
Partial revert of r146791; vpermilps/vpermilpd instructions accepts ymm/mem/imm8.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146797 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove a non-gcc-compatible extension that would apply attributes on declarations...
Eli Friedman [Sat, 17 Dec 2011 00:36:09 +0000 (00:36 +0000)]
Remove a non-gcc-compatible extension that would apply attributes on declarations without a declarator to structs.  Add a warning for ignored attributes.  Patch by Michael Han.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146796 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a triple to this test to hopefully get it passing on i386-freebsd.
Eric Christopher [Sat, 17 Dec 2011 00:35:01 +0000 (00:35 +0000)]
Add a triple to this test to hopefully get it passing on i386-freebsd.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146795 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Fixup for r146793. Add tests for atol and atoll.
Anna Zaks [Sat, 17 Dec 2011 00:30:16 +0000 (00:30 +0000)]
[analyzer] Fixup for r146793. Add tests for atol and atoll.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146794 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Add support for taint flowing through a function (atoi).
Anna Zaks [Sat, 17 Dec 2011 00:26:34 +0000 (00:26 +0000)]
[analyzer] Add support for taint flowing through a function (atoi).

Check if the input parameters are tainted (or point to tainted data) on
a checkPreStmt<CallExpr>. If the output should be tainted, record it in
the state. On post visit (checkPostStmt<CallExpr>), use the state to
make decisions (in addition to the existing logic). Use this logic for
atoi and fscanf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146793 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Minor: Simplify & assert.
Anna Zaks [Sat, 17 Dec 2011 00:26:29 +0000 (00:26 +0000)]
[analyzer] Minor: Simplify & assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146792 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix _mm256_round_pd, _mm256_round_ps, _mm_permute_pd and _mm256_permute_pd AVX
Chad Rosier [Sat, 17 Dec 2011 00:15:26 +0000 (00:15 +0000)]
Fix _mm256_round_pd, _mm256_round_ps, _mm_permute_pd and _mm256_permute_pd AVX
intrinsics to use "I" (ICE) markings.  Fix avxintrin.h to take them into
account.
Part of rdar://10595450

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146791 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen in a limited debug information situation if we can find the original
Eric Christopher [Fri, 16 Dec 2011 23:40:18 +0000 (23:40 +0000)]
When in a limited debug information situation if we can find the original
declaration for the type then go ahead and use that, it's still smaller
than creating an all new derived type.

Part of rdar://10335756 and others.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146779 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoStart down the path of getting clang to internally agree on structs versus
Eric Christopher [Fri, 16 Dec 2011 23:40:14 +0000 (23:40 +0000)]
Start down the path of getting clang to internally agree on structs versus
classes.

Part of rdar://10520586 and a couple others.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146778 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix an inconsistency in the syntactic form of InitListExpr in case of initialization...
Nicola Gigante [Fri, 16 Dec 2011 22:57:37 +0000 (22:57 +0000)]
Fix an inconsistency in the syntactic form of InitListExpr in case of initialization that involves a ConstructorConversion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146766 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't allow #include (and its friends #import, #include_next and
Richard Smith [Fri, 16 Dec 2011 22:50:01 +0000 (22:50 +0000)]
Don't allow #include (and its friends #import, #include_next and
#__include_macros) in the arguments of a function-style macro. Directives in the
arguments of such macros have undefined behaviour, and GCC does not correctly
support these cases. In some situations, this can lead to better diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146765 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd missing header change
Douglas Gregor [Fri, 16 Dec 2011 22:40:58 +0000 (22:40 +0000)]
Add missing header change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146764 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure we're always setting the previous declaration of an ObjCInterfaceDecl
Douglas Gregor [Fri, 16 Dec 2011 22:37:11 +0000 (22:37 +0000)]
Make sure we're always setting the previous declaration of an ObjCInterfaceDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146763 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd the value of "suitably aligned" from the C++11 standard to Basic/TargetInfo.
Nick Lewycky [Fri, 16 Dec 2011 22:34:14 +0000 (22:34 +0000)]
Add the value of "suitably aligned" from the C++11 standard to Basic/TargetInfo.
This is equal to alignof(std::max_align_t) on the platform and equal to the
alignment provided by malloc. (Platform owners please double-check your
platform's value.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146762 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix 80-column violation and whitespace. No functionality change.
Nick Lewycky [Fri, 16 Dec 2011 22:32:39 +0000 (22:32 +0000)]
Fix 80-column violation and whitespace. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146761 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd missing flush call. This is an attempt to fix a broken Windows buildbot.
Eli Friedman [Fri, 16 Dec 2011 22:12:23 +0000 (22:12 +0000)]
Add missing flush call.  This is an attempt to fix a broken Windows buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146760 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReduce recursion limit on this test further to try to make the msys bot green.
Richard Smith [Fri, 16 Dec 2011 21:59:02 +0000 (21:59 +0000)]
Reduce recursion limit on this test further to try to make the msys bot green.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146759 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix vinsertf128_* AVX intrinsics to use "I" (ICE) markings. Fix avxintrin.h to
Chad Rosier [Fri, 16 Dec 2011 21:40:31 +0000 (21:40 +0000)]
Fix vinsertf128_* AVX intrinsics to use "I" (ICE) markings.  Fix avxintrin.h to
take them into account.
rdar://10590282

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146758 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix vperm2f128_* AVX intrinsics to use "I" (ICE) markings. Fix avxintrin.h to
Chad Rosier [Fri, 16 Dec 2011 21:07:34 +0000 (21:07 +0000)]
Fix vperm2f128_* AVX intrinsics to use "I" (ICE) markings.  Fix avxintrin.h to
take them into account.
rdar://10576962

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146757 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a warning flag for ext_embedded_directive. gcc considers this undefined
Richard Smith [Fri, 16 Dec 2011 20:58:01 +0000 (20:58 +0000)]
Add a warning flag for ext_embedded_directive. gcc considers this undefined
behaviour to be an error, so it's useful to be able to make it an error in clang
too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146755 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR11594: Don't blindly build a UnaryOperator UO_Minus on an expression which
Richard Smith [Fri, 16 Dec 2011 19:31:14 +0000 (19:31 +0000)]
PR11594: Don't blindly build a UnaryOperator UO_Minus on an expression which
might not be an rvalue when checking array accesses. Instead, pass through a
flag indicating the array index is negated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146753 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoC++11 constexpr: Add note stacks containing backtraces if constant evaluation
Richard Smith [Fri, 16 Dec 2011 19:06:07 +0000 (19:06 +0000)]
C++11 constexpr: Add note stacks containing backtraces if constant evaluation
fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit
argument to driver and frontend, to control the maximum number of notes so
produced (default 10). Fix APValue printing to be able to pretty-print all
APValue types, and move the testing for this functionality from a unittest to
a -verify test now that it's visible in clang's output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146749 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Better stdin support.
Anna Zaks [Fri, 16 Dec 2011 18:28:50 +0000 (18:28 +0000)]
[analyzer] Better stdin support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146748 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixup to the relaxed diagnostic verification option r146633.
Anna Zaks [Fri, 16 Dec 2011 18:28:45 +0000 (18:28 +0000)]
Fixup to the relaxed diagnostic verification option r146633.

We should exit when matching the '+' even if nothing was found to
prevent searching for all UNIT_MAX items.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146747 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate tests to match r146744.
Devang Patel [Fri, 16 Dec 2011 17:56:38 +0000 (17:56 +0000)]
Update tests to match r146744.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146745 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIf there is a definition of an ObjCInterfaceDecl, make it the Decl returned from...
Douglas Gregor [Fri, 16 Dec 2011 16:34:57 +0000 (16:34 +0000)]
If there is a definition of an ObjCInterfaceDecl, make it the Decl returned from the corresponding ObjCInterfaceType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146740 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSupport decltype in pseudo destructors and dependent destructor calls.
David Blaikie [Fri, 16 Dec 2011 16:03:09 +0000 (16:03 +0000)]
Support decltype in pseudo destructors and dependent destructor calls.

Reviewed by Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146738 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc: after issuing the warning on direct use of __attribute__((NSObject))
Fariborz Jahanian [Fri, 16 Dec 2011 15:54:29 +0000 (15:54 +0000)]
objc: after issuing the warning on direct use of __attribute__((NSObject))
on properties, prevent consequential error  diagnostics. // rdar://10591336

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146737 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix chaining of ObjCInterfaceDecl redeclarations
Douglas Gregor [Fri, 16 Dec 2011 03:12:41 +0000 (03:12 +0000)]
Fix chaining of ObjCInterfaceDecl redeclarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146722 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSema::RequireCompleteType currently attempts to
Sean Callanan [Fri, 16 Dec 2011 00:20:31 +0000 (00:20 +0000)]
Sema::RequireCompleteType currently attempts to
instantiate a class from its template pattern
before it consults the ExternalASTSource.  LLDB
in particular will sometimes provide patterns
that need to be completed first.

To make this possible, I have moved the
completion before the code that does the
instantiation, allowing the ExternalASTSource
to provide the required information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146715 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn SourceManager::~SourceManager do a sanity check to make sure we
Argyrios Kyrtzidis [Thu, 15 Dec 2011 23:37:55 +0000 (23:37 +0000)]
In SourceManager::~SourceManager do a sanity check to make sure we
don't try to destruct a null ContentCache.

rdar://10567159

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146707 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen generating debug info for an ObjCInterfaceDecl, try to dig out the definition.
Douglas Gregor [Thu, 15 Dec 2011 23:32:29 +0000 (23:32 +0000)]
When generating debug info for an ObjCInterfaceDecl, try to dig out the definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146705 91177308-0d34-0410-b5e6-96231b3b80d8