Commit Graph

21917 Commits

Author SHA1 Message Date
David Blaikie 1c286f6d8f PR19623: Support typedefs (and alias templates) of void.
llvm-svn: 207781
2014-05-01 18:25:19 +00:00
David Blaikie 80bec83d8d Fix debug-info-alias test to add CHECK to some lines that were missing it.
To simplify source location offsets, this test uses line directives to
force particular lines of interest to have known line numbers so that
adjustments before/after those points don't require updates to the CHECK
lines.

llvm-svn: 207779
2014-05-01 18:13:24 +00:00
David Majnemer daff37013c AST: Mangle reference temporaries reliably
Summary:
Previously, we would generate a single name for all reference
temporaries and allow LLVM to rename them for us.  Instead, number the
reference temporaries as we build them in Sema.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 207776
2014-05-01 17:50:17 +00:00
Reid Kleckner 756199ccea Fix declspec-thread.cpp test with a triple
Not all triples support it.

llvm-svn: 207772
2014-05-01 17:12:20 +00:00
Reid Kleckner e502507d34 MSVCCompat: Don't produce an invalid AST when accepting void pseudo-dtors
We accept 'void *p; p->~void();' for MSVC compatibility since r148682.
However, we were returning ExprError, rather than producing an AST,
despite only diagnosing it with a warning.  CodeGen noticed that the
template function specialization had an invalid AST, and therefore
didn't generate code for it.  This change makes us produce an AST with a
void pseudo-dtor call.

Part of PR18256.

llvm-svn: 207771
2014-05-01 16:50:23 +00:00
Joey Gouly 81228382cf [libclang] Add attribute support for 'pure', 'const' and 'noduplicate'.
This bumps CINDEX_VERSION_MINOR up (to 26).

llvm-svn: 207767
2014-05-01 15:41:58 +00:00
Tobias Grosser 86a85678f2 Support 'remark' in VerifyDiagnosticConsumer
After Diego added support for -Rpass=inliner we have now in-tree remarks which
we can use to properly test this feature.

llvm-svn: 207765
2014-05-01 14:06:01 +00:00
Lubos Lunak 10961c0eab do not use "1" for line marker for the main file
"1" means entering a new file (from a different one), but the main
file is not included from anything (and this would e.g. confuse -Wunused-macros
to not report unused macros in the main file, see pr15610, or also see pr18948).
The line marker is still useful e.g. if the resulting file is renamed or used
via a pipe.

llvm-svn: 207764
2014-05-01 13:50:44 +00:00
Lubos Lunak 64568ca18a revert r207756
There's nothing wrong with the change itself, but
test/Frontend/rewrite-includes-messages.c fails without another
not-yet-committed fix.

llvm-svn: 207762
2014-05-01 13:37:55 +00:00
Lubos Lunak 576a0415cb do not warn about unknown pragmas in modes that do not handle them (pr9537)
And refactor to have just one place in code that sets up the empty
pragma handlers.

llvm-svn: 207758
2014-05-01 12:54:03 +00:00
Lubos Lunak c5f2bca866 write a line marker right before adding included file
Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.

llvm-svn: 207756
2014-05-01 12:45:08 +00:00
Reid Kleckner 7d6d2705f6 Add support for __declspec(thread) under -fms-extensions
Reviewers: rsmith

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

llvm-svn: 207734
2014-05-01 03:16:47 +00:00
Reid Kleckner ac64060c80 MS ABI x64: Don't destroy arguments twice on x64
We were destroying them in the callee, and then again in the caller.  We
should use an EH-only cleanup and disable it at the point of the call
for win64, even though we don't use inalloca.

llvm-svn: 207733
2014-05-01 03:07:18 +00:00
Richard Smith 09d5b3a928 Make typo-correction of inheriting constructors work a bit better. Limit
correction to direct base class members, and recover properly after we apply
such a correction.

llvm-svn: 207731
2014-05-01 00:35:04 +00:00
Dmitri Gribenko 0b2026de6b Comment parsing: remove HTML attribute validation
Since the community says that a blacklist is not good enough, and I don't have
enough time now to implement a proper whitelist, let's just remove the
attribute validation.

But, nevertheless, we can still communicate in the generated XML if our parser
found an issue with the HTML.  But this bit is best-effort and is specifically
called out in the schema as such.

llvm-svn: 207712
2014-04-30 21:54:30 +00:00
David Majnemer deca705593 Sema: Implement DR477
Summary: Friend declarations shouldn't mention explicit or virtual.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 207682
2014-04-30 18:24:01 +00:00
Richard Smith d94f2f16bd When typo-correcting a member using declaration, don't exclude member templates.
llvm-svn: 207681
2014-04-30 18:15:00 +00:00
Richard Smith 21866c3267 When typo-correcting a member using-declaration, only consider members of base classes.
llvm-svn: 207680
2014-04-30 18:03:21 +00:00
Richard Smith 30a615dca8 Fix crash if typo correction corrects a member using-declaration to a
non-member declaration. Patch by Dinesh Dwivedi!

llvm-svn: 207677
2014-04-30 17:40:35 +00:00
Reid Kleckner 92fc0178c6 __thread: Move constant init check to CheckCompleteVariableDeclaration
We were emitting dynamic initializers for __thread variables if there
was no explicit initializer, as in this test case:

struct S { S(); };
__thread S s;

llvm-svn: 207675
2014-04-30 17:10:18 +00:00
Reid Kleckner 121b1a1fa5 -Wunused-parameter: Don't fire on defaulted or deleted functions
Patch by Dinesh Dwivedi!

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

llvm-svn: 207672
2014-04-30 16:31:28 +00:00
Logan Chien 28f87f80e2 Android uses -fpic for arm64 as well.
llvm-svn: 207642
2014-04-30 12:18:12 +00:00
James Molloy 7c39a5ad02 Add a test for big-endian NEON on ARM64.
The enabled test #includes <arm_neon.h>, which is sufficient to test all
the code in r207624.

llvm-svn: 207641
2014-04-30 12:12:45 +00:00
Bradley Smith 4da7dd837d [ARM64] Port remaining relevant AArch64 clang tests over to ARM64
llvm-svn: 207632
2014-04-30 10:52:05 +00:00
Andrea Di Biagio c7ce72c9f2 Simplify test. No functional change intended.
llvm-svn: 207623
2014-04-30 10:04:58 +00:00
Nico Weber ae360dc36c Add a triple to new test.
NULL is just 0 on Windows, so the Wsentinel part of the test doesn't pass there.

llvm-svn: 207607
2014-04-30 04:54:42 +00:00
Nico Weber 272bcf6768 Let stddef.h respect __need_{wchar_t, size_t, NULL, ptrdiff_t, wint_t}.
glibc expects that stddef.h only defines a single thing if either of these
defines is set.  For example, before this change, a C file containing

  #include <stdlib.h>
  int ptrdiff_t = 0;

would compile with gcc but not with clang. Now it compiles with clang too.

This also fixes PR12997, where older versions of the Linux headers would define
NULL incorrectly, and glibc would define __need_NULL and expect stddef.h to
redefine NULL with the correct definition.

llvm-svn: 207606
2014-04-30 04:35:09 +00:00
Richard Smith d1c4674603 Defer loading any pending update records until we've finished deserializing.
This fixes a bug where an update record causes us to load an entity that refers
to an entity we've not finished loading yet, resulting in badness.

llvm-svn: 207603
2014-04-30 02:24:17 +00:00
Rafael Espindola b5b622a03c Drop non-cfi assembly support from clang.
After this patch clang will ignore -fdwarf2-cfi-asm and -ffno-dwarf2-cfi-asm and
always print assembly that uses cfi directives.

In llvm, MC itself supports cfi since the end of 2010 (support started
in r119972, is reported in the 2.9 release notes).

In binutils the support has been around for much longer. It looks like
support started to be added in May 2003. It is available in 2.15
(31-Aug-2011, 2.14 is from 12-Jun-2003).

llvm-svn: 207602
2014-04-30 02:22:09 +00:00
Andrea Di Biagio e653811af2 Add test case for revision 207575 to verify that on Windows, clang doesn't
crash with an assertion failure when 'nul' is passed in input.

Modified clang/test/lit.py to add feature 'system-windows' if
`platform.system()` returns 'Windows'.

llvm-svn: 207576
2014-04-29 20:19:13 +00:00
Hans Wennborg df51ee6c50 scanf analysis: handle scanlists that start with ^] (PR19559)
llvm-svn: 207573
2014-04-29 19:42:27 +00:00
Argyrios Kyrtzidis fe6b880de5 [PCH/Modules] Don't tie TargetOptions::LinkerVersion to a module/PCH, it's a driver only thing and doesn't affect any language/preprocessor/etc. semantics.
rdar://16714526

llvm-svn: 207570
2014-04-29 18:45:01 +00:00
Logan Chien 4ecf0158a4 Android uses -fpic for aarch64.
llvm-svn: 207567
2014-04-29 18:18:58 +00:00
Jordan Rose 6017348856 [analyzer] Improve test from r207486.
The constructor that comes right before a variable declaration in the CFG might
not be the initialization of that variable. Previously, we just checked that
the variable's initializer expression was different from the construction
expression, but forgot to see whether the variable had an initializer expression
at all.

Thanks for the prompting, David.

llvm-svn: 207562
2014-04-29 17:08:17 +00:00
Jordan Rose 62ac9ecadc [analyzer] Don't assert when combining using .* on a temporary.
While we don't model pointer-to-member operators yet (neither .* nor ->*),
CallAndMessageChecker still checks to make sure the 'this' object is not
null or undefined first. However, it also expects that the object should
always have a valid MemRegion, something that's generally important elsewhere
in the analyzer as well. Ensure this is true ahead of time, just like we do
for member access.

PR19531

llvm-svn: 207561
2014-04-29 17:08:12 +00:00
Ben Langmuir b92de02f17 Reapply r207477 and r207479 without cyclic dependency
Fixed by moving ProcessWarningOptions from Frontend into Basic. All of
the dependencies for ProcessWarningOptions were already in Basic, so
this was a small change.

llvm-svn: 207549
2014-04-29 16:25:26 +00:00
Fariborz Jahanian f1a22f487e Objective-C. Improve diagnosis of bridging types.
// rdar://16737117

llvm-svn: 207542
2014-04-29 16:12:56 +00:00
Alexey Volkov 0692103653 Pass -pie to linker when generating executable on Android
This fixes problem with LTO on Android.

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

llvm-svn: 207520
2014-04-29 10:25:20 +00:00
David Majnemer 35b02bc7ab AST: Fix visibility calculation for VarTemplateSpecializationDecl
It is possible that a variable template specialization might not have a
VisibilityAttr attached to it while the template that it specializes
does, in fact, have one.

We should consider the template in such cases.

This fixes PR19597.

llvm-svn: 207498
2014-04-29 07:32:26 +00:00
NAKAMURA Takumi 366363dac1 Revert r207477 (and r207479), "Check -Werror options during module validation"
It tried to introduce cyclic dependencies. Serialization shouldn't depend on Frontend, since Frontend depends on Serialization.

llvm-svn: 207497
2014-04-29 06:58:59 +00:00
David Majnemer 846c2833ec CodeGen: Reference temporaries inherit visibility
Reference temporaries inherited many properties from the variable that
they correspond to but visibility wasn't one of them.

llvm-svn: 207496
2014-04-29 06:18:53 +00:00
Adrian Prantl c4405c87c6 Make test independent of label. Thanks to Richard Smith for catching this!
llvm-svn: 207489
2014-04-29 02:27:33 +00:00
Richard Smith dfbe47650e Run this test through instnamer to stop it failing on non-asserts clang builds.
llvm-svn: 207488
2014-04-29 02:18:35 +00:00
Jordan Rose bcd889730d [analyzer] Don't crash when a construction is followed by an uninitialized variable.
This could happen due to unfortunate CFG coincidences.

PR19579

llvm-svn: 207486
2014-04-29 01:56:12 +00:00
Nico Weber f077c51a70 Revert r207482; I fail at reading IRC.
llvm-svn: 207483
2014-04-29 01:25:49 +00:00
Nico Weber 8af28c1e61 Let stddef.h redefine NULL if __need_NULL is set, as needed by glibc, PR12997.
See the bug and the cfe-commits thread "[patch] Let stddef.h redefine NULL if
__need_NULL is set" for discussion.

Fixes PR12997 and is similar to the __need_wint_t bits already in this file.

llvm-svn: 207482
2014-04-29 01:19:21 +00:00
Adrian Prantl 2cede0f92c Debug info: Improve line table for functions with cleanups an early exit
and no return expr at the end of the function.
The "function has only simple returns" check in FinishFunction tests
whether the number of simple return exprs equals the number of return
exprs, but so far a fallthrough at the end of a function was not counted
as a return, which would result in cleanup code being associated with the
wrong source line.

rdar://problem/16733984.

llvm-svn: 207480
2014-04-29 01:07:59 +00:00
Ben Langmuir c829f19e24 Add missing triple to make -isysroot work
llvm-svn: 207479
2014-04-29 01:04:34 +00:00
Ben Langmuir be84adbf1b Check -Werror options during module validation
This patch checks whether the diagnostic options that could lead to
errors (principally -Werror) are consistent between when a module was
built and when it is loaded.  If there are new -Werror flags, then the
module is rebuilt.  In order to canonicalize the options we do this
check at the level of the constructed DiagnosticsEngine, which contains
the final set of diag to diagnostic level mappings.  Currently we only
rebuild with the new diagnostic options, but we intend to refine this in
the future to include the union of the new and old flags, since we know
the old ones did not cause errors.  System modules are only rebuilt when
-Wsystem-headers is enabled.

One oddity is that unlike checking language options, we don’t perform
this diagnostic option checking when loading from a precompiled header.
The reason for this is that the compiler cannot rebuild the PCH, so
anything that requires it to be rebuilt effectively leaks into the build
system.  And in this case, that would mean the build system
understanding the complex relationship between diagnostic options and
the underlying diagnostic mappings, which is unreasonable.  Skipping the
check is safe, because these options do not affect the generated AST.
You simply won’t get new build errors due to changed -Werror options
automatically, which is also true for non-module cases.

llvm-svn: 207477
2014-04-29 00:36:53 +00:00
Reid Kleckner 982a589d3a LLVM supports TLS on Windows and we can use it from Clang
Patch by Martell Malone!

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

llvm-svn: 207470
2014-04-29 00:11:30 +00:00