]> granicus.if.org Git - clang/log
clang
10 years agoWork around an MSVC 2013 miscompile with the Redeclarable class. Fixes PR16606
Aaron Ballman [Wed, 6 Nov 2013 22:39:46 +0000 (22:39 +0000)]
Work around an MSVC 2013 miscompile with the Redeclarable class.  Fixes PR16606

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

10 years agoUpdate \param in ToolInvocation() corresponding to r194164. [-Wdocumentation]
NAKAMURA Takumi [Wed, 6 Nov 2013 22:37:12 +0000 (22:37 +0000)]
Update \param in ToolInvocation() corresponding to r194164. [-Wdocumentation]

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

10 years agoclang-cl: Hide ignored flags
Alp Toker [Wed, 6 Nov 2013 22:36:09 +0000 (22:36 +0000)]
clang-cl: Hide ignored flags

We don't want to them to appear in the help text for now.

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

10 years agoThis patch modified ExeBasename as clang-cl.exe to match the preceding comment.
Yaron Keren [Wed, 6 Nov 2013 21:57:50 +0000 (21:57 +0000)]
This patch modified ExeBasename as clang-cl.exe to match the preceding comment.

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

10 years ago[build] Update runtime library and tests to work with relocatable SDKs on OS X 10.9.
Daniel Dunbar [Wed, 6 Nov 2013 21:44:54 +0000 (21:44 +0000)]
[build] Update runtime library and tests to work with relocatable SDKs on OS X 10.9.

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

10 years agoclang-cl: Add /FS as an ignored flag
Alp Toker [Wed, 6 Nov 2013 21:01:23 +0000 (21:01 +0000)]
clang-cl: Add /FS as an ignored flag

CMake-generated Makefiles include this cl flag which can be safely ignored
until we get PDB server support.

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

10 years agoIntroduce ClangTool::buildASTs, and buildASTFromCode.
Peter Collingbourne [Wed, 6 Nov 2013 20:12:45 +0000 (20:12 +0000)]
Introduce ClangTool::buildASTs, and buildASTFromCode.

These allow clients to retrieve persistent AST objects (ASTUnits) which
can be used in an ad-hoc manner after parsing.

To accommodate this change, the code for processing a CompilerInvocation
using a FrontendAction has been factored out to FrontendActionFactory, and
a new base class, ToolAction, has been introduced, allowing the tool to do
arbitrary things with each CompilerInvocation.  This change was necessary
because ASTUnit does not use the FrontendAction interface directly.

This change also causes the FileManager in ClangTool to use shared ownership.
This will become necessary because ASTUnit takes shared ownership of
FileManager (ClangTool's FileManager is currently unused by ASTUnit; this
is a FIXME).  As shown in the tests, any client of ToolInvocation will
need to be modified to use shared ownership for FileManager.

Differential Revision: http://llvm-reviews.chandlerc.com/D2097

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

10 years agoFix diagnostic goof in r194161.
Richard Smith [Wed, 6 Nov 2013 19:43:09 +0000 (19:43 +0000)]
Fix diagnostic goof in r194161.

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

10 years agoAdd a limit to the length of a sequence of 'operator->' functions we will
Richard Smith [Wed, 6 Nov 2013 19:31:51 +0000 (19:31 +0000)]
Add a limit to the length of a sequence of 'operator->' functions we will
follow when building a class member access expression. Based on a patch by
Rahul Jain!

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

10 years agoFix the -cxx-abi microsoft -mconstructor-aliases combination.
Rafael Espindola [Wed, 6 Nov 2013 19:18:55 +0000 (19:18 +0000)]
Fix the -cxx-abi microsoft -mconstructor-aliases combination.

On the microsoft ABI clang is producing one weak_odr and one linkonce_odr
destructor, which is reasonable since only one is required.

The fix is simply to move the assert past the special case treatment of
linkonce_odr.

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

10 years agoThread safety analysis: minor bugfix to smart pointer handling, and expanded
DeLesley Hutchins [Wed, 6 Nov 2013 18:40:01 +0000 (18:40 +0000)]
Thread safety analysis: minor bugfix to smart pointer handling, and expanded
test case.

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

10 years agoSilencing some MSVC warnings about not all control paths returning a value when they...
Aaron Ballman [Wed, 6 Nov 2013 18:15:02 +0000 (18:15 +0000)]
Silencing some MSVC warnings about not all control paths returning a value when they actually do.

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

10 years ago[libclang] Some changes on the linker options for libclang on a CMake build.
Argyrios Kyrtzidis [Wed, 6 Nov 2013 08:37:50 +0000 (08:37 +0000)]
[libclang] Some changes on the linker options for libclang on a CMake build.

- Use the 'libclang.exports' file.
- Pass -Wl,-current_version
- Set install name to "@rpath"

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

10 years agoFix PR17738 - add support for vtordisp thunks when using -cxx-abi microsoft
Timur Iskhodzhanov [Wed, 6 Nov 2013 06:24:31 +0000 (06:24 +0000)]
Fix PR17738 - add support for vtordisp thunks when using -cxx-abi microsoft

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

10 years agoImplement AArch64 Neon instruction set Perm.
Jiangning Liu [Wed, 6 Nov 2013 03:35:53 +0000 (03:35 +0000)]
Implement AArch64 Neon instruction set Perm.

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

10 years agoImplement AArch64 Neon instruction set Bitwise Extract.
Jiangning Liu [Wed, 6 Nov 2013 02:26:12 +0000 (02:26 +0000)]
Implement AArch64 Neon instruction set Bitwise Extract.

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

10 years agoMore constant evaluation cleanup, and fix an issue where we'd override an
Richard Smith [Wed, 6 Nov 2013 02:19:10 +0000 (02:19 +0000)]
More constant evaluation cleanup, and fix an issue where we'd override an
earlier 'non-constant' diagnostic with a later one if the earlier one was from
a side-effect we thought we could evaluate past.

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

10 years agoMicrosoft adds weird padding before virtual bases if the last field was a bitfield
Warren Hunt [Wed, 6 Nov 2013 00:54:59 +0000 (00:54 +0000)]
Microsoft adds weird padding before virtual bases if the last field was a bitfield

This patch adds the same behavior to clang.

Differential Revision: http://llvm-reviews.chandlerc.com/D2103

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

10 years agoIntroduce DynTypedNode::print, dump and getSourceRange.
Peter Collingbourne [Wed, 6 Nov 2013 00:27:12 +0000 (00:27 +0000)]
Introduce DynTypedNode::print, dump and getSourceRange.

These functions can generally be applied to multiple kinds of AST node,
so it makes sense to add them to DynTypedNode.

Differential Revision: http://llvm-reviews.chandlerc.com/D2096

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

10 years agoIntroduce BoundNodes::getMap.
Peter Collingbourne [Wed, 6 Nov 2013 00:27:07 +0000 (00:27 +0000)]
Introduce BoundNodes::getMap.

The purpose of this function is to allow clients of the dynamic AST matcher
to enumerate each binding.

Differential Revision: http://llvm-reviews.chandlerc.com/D2095

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

10 years agoThread safety analysis: check pt_guarded_by attribute when calling -> and *
DeLesley Hutchins [Tue, 5 Nov 2013 23:09:56 +0000 (23:09 +0000)]
Thread safety analysis: check pt_guarded_by attribute when calling -> and *
on smart pointers.  -Wthread-safety-beta only.

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

10 years agoObjectiveC migrator. Please annotation of properties with
Fariborz Jahanian [Tue, 5 Nov 2013 22:28:30 +0000 (22:28 +0000)]
ObjectiveC migrator. Please annotation of properties with
NS_RETURNS_INNER_POINTER under -objcmt-returns-innerpointer-property
flag (off by default), as older compilers do not support such annotations.
// rdar://15396636

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

10 years agoSimplify: we don't care why constant evaluation might have failed when we're
Richard Smith [Tue, 5 Nov 2013 22:23:30 +0000 (22:23 +0000)]
Simplify: we don't care why constant evaluation might have failed when we're
checking an expression for constant overflow.

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

10 years agoRefactor constant expression handling and make a couple of tweaks to make it a
Richard Smith [Tue, 5 Nov 2013 22:18:15 +0000 (22:18 +0000)]
Refactor constant expression handling and make a couple of tweaks to make it a
bit more robust against future changes. This includes a slight diagnostic
improvement: if we know we're only trying to form a constant expression, take
the first diagnostic which shows the expression is not a constant expression,
rather than preferring the first one which makes the expression unfoldable.

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

10 years agoWith this patch -Wwrite-strings is still implemented with the terrible
Rafael Espindola [Tue, 5 Nov 2013 21:43:54 +0000 (21:43 +0000)]
With this patch -Wwrite-strings is still implemented with the terrible
hack of passing -fconst-strings to -cc1, but at least the driver uses
the regular warning checking code path.

Since we don't support a warning that is DefaultIgnore in one language
but not in another, this patch creates a dummy C only warning in the same
group as the existing one to get the desired effect.

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

10 years agoProduce direct calls instead of alias to linkonce_odr functions.
Rafael Espindola [Tue, 5 Nov 2013 21:37:29 +0000 (21:37 +0000)]
Produce direct calls instead of alias to linkonce_odr functions.

This is a small optimization on linux, but should help more on windows
where msvc only outputs one destructor if there would be two identical ones.

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

10 years agoDocumentation tweaks: Fix a typo in a reference to the C++ standard,
James Dennett [Tue, 5 Nov 2013 19:37:38 +0000 (19:37 +0000)]
Documentation tweaks: Fix a typo in a reference to the C++ standard,
another typo in a comment, and update formatting of some comments to
use Doxygen \brief annotations instead of repeating the name of the
documented entity.

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

10 years agoclang-format: Allow line merging and partial formatting of nested blocks
Daniel Jasper [Tue, 5 Nov 2013 19:10:03 +0000 (19:10 +0000)]
clang-format: Allow line merging and partial formatting of nested blocks

Before, clang-format would always format entire nested blocks, which
can be unwanted e.g. for long DEBUG({...}) statements. Also
clang-format would not allow to merge lines in nested blocks (e.g. to
put "if (a) return;" on one line in Google style).

This is the first step of several refactorings mostly focussing on the
additional functionality (by reusing the "format many lines" code to
format the children of a nested block). The next steps are:
* Pull out the line merging into its own class.
* Seperate the formatting of many lines from the formatting of a single
  line (and the analysis of the solution space).

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

10 years agoRevert "Try to correct a mistyped "-" or ">" to "->" for some C++ cases."
Kaelyn Uhrain [Tue, 5 Nov 2013 18:28:21 +0000 (18:28 +0000)]
Revert "Try to correct a mistyped "-" or ">" to "->" for some C++ cases."

Revert this patch until cases of rejected valid code (e.g. identifiers
that require ADL to be resolved properly) are fixed.

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

10 years agoImplement AArch64 Neon Crypto instruction classes AES, SHA, and 3 SHA.
Jiangning Liu [Tue, 5 Nov 2013 17:42:24 +0000 (17:42 +0000)]
Implement AArch64 Neon Crypto instruction classes AES, SHA, and 3 SHA.

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

10 years agoFix vbtable indices when a class shares the vbptr with a non-virtual base
Timur Iskhodzhanov [Tue, 5 Nov 2013 15:54:58 +0000 (15:54 +0000)]
Fix vbtable indices when a class shares the vbptr with a non-virtual base

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

10 years agoDisable test fully with REQUIRES
Alp Toker [Tue, 5 Nov 2013 13:27:19 +0000 (13:27 +0000)]
Disable test fully with REQUIRES

Third time's the charm, sorry for the noise.

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

10 years agoDisable the test that crashes
Alp Toker [Tue, 5 Nov 2013 12:55:00 +0000 (12:55 +0000)]
Disable the test that crashes

XFAIL wasn't enough for some of the build servers.

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

10 years agoFix a test that was never being run, mark it XFAIL
Alp Toker [Tue, 5 Nov 2013 12:45:46 +0000 (12:45 +0000)]
Fix a test that was never being run, mark it XFAIL

Turns out this has always been crashing since the test landed in
r186647:

  Assertion failed: (Access != AS_none && "Access specifier is AS_none inside a record decl"), function CheckAccessDeclContext, file clang/lib/AST/DeclBase.cpp, line 690.

Needs attention.

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

10 years agoMake test run reliably
Alp Toker [Tue, 5 Nov 2013 12:45:43 +0000 (12:45 +0000)]
Make test run reliably

llc waits for input on stdin, which was not provided in this test. It
was running only thanks to a quirk in the way lit concatenates
commands.

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

10 years agoFix test that was not being run
Alp Toker [Tue, 5 Nov 2013 12:45:40 +0000 (12:45 +0000)]
Fix test that was not being run

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

10 years agoFix test that wasn't testing anything
Alp Toker [Tue, 5 Nov 2013 12:45:37 +0000 (12:45 +0000)]
Fix test that wasn't testing anything

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

10 years agoDo not allow functions or kernels called 'main' in OpenCL.
Joey Gouly [Tue, 5 Nov 2013 12:30:39 +0000 (12:30 +0000)]
Do not allow functions or kernels called 'main' in OpenCL.

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

10 years agoSimplify test case added in r194059
David Majnemer [Tue, 5 Nov 2013 10:05:58 +0000 (10:05 +0000)]
Simplify test case added in r194059

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

10 years agoLex: Require that '#' be followed by a macro parameter name when preceded by '##'
David Majnemer [Tue, 5 Nov 2013 09:30:17 +0000 (09:30 +0000)]
Lex: Require that '#' be followed by a macro parameter name when preceded by '##'

After lexing a '##', we would look ahead and check to see if it was
followed by '__VA_ARGS__'.  After doing so, we would then go ahead and
lex the token.

However we would fail in the case where the '##' was followed by a '#'
followed by an identifier because we would have lexed the '#' separately
from the identifier, bypassing our parameter validation logic.

Instead, lex the tokens coming after the '##' later.

This fixes PR17804.

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

10 years agoRemove stray comma from documentation.
Richard Smith [Tue, 5 Nov 2013 09:12:55 +0000 (09:12 +0000)]
Remove stray comma from documentation.

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

10 years agoC++1y sized deallocation: if we have a use, but not a definition, of a sized
Richard Smith [Tue, 5 Nov 2013 09:12:18 +0000 (09:12 +0000)]
C++1y sized deallocation: if we have a use, but not a definition, of a sized
deallocation function (and the corresponding unsized deallocation function has
been declared), emit a weak discardable definition of the function that
forwards to the corresponding unsized deallocation.

This allows a C++ standard library implementation to provide both a sized and
an unsized deallocation function, where the unsized one does not just call the
sized one, for instance by putting both in the same object file within an
archive.

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

10 years agoEnable links now that they work.
Richard Smith [Tue, 5 Nov 2013 08:27:00 +0000 (08:27 +0000)]
Enable links now that they work.

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

10 years agoSema: Improve comment introduced in r193397
David Majnemer [Tue, 5 Nov 2013 08:01:18 +0000 (08:01 +0000)]
Sema: Improve comment introduced in r193397

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

10 years agoExpand the test a bit.
Rafael Espindola [Tue, 5 Nov 2013 07:11:42 +0000 (07:11 +0000)]
Expand the test a bit.

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

10 years agoAdd a testcase from the recent bootstrap failure.
Rafael Espindola [Tue, 5 Nov 2013 06:44:57 +0000 (06:44 +0000)]
Add a testcase from the recent bootstrap failure.

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

10 years agoRevert "Produce direct calls instead of alias to linkonce_odr functions."
Rafael Espindola [Tue, 5 Nov 2013 05:29:54 +0000 (05:29 +0000)]
Revert "Produce direct calls instead of alias to linkonce_odr functions."

This reverts commit r194046.
Debugging a bootstrap issue.

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

10 years agoProduce direct calls instead of alias to linkonce_odr functions.
Rafael Espindola [Tue, 5 Nov 2013 05:22:36 +0000 (05:22 +0000)]
Produce direct calls instead of alias to linkonce_odr functions.

This is a small optimization on linux, but should help more on windows
where msvc only outputs one destructor if there would be two identical ones.

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

10 years agoImplemented aarch64 neon intrinsic vcopy_lane with float type.
Kevin Qin [Tue, 5 Nov 2013 02:05:44 +0000 (02:05 +0000)]
Implemented aarch64 neon intrinsic vcopy_lane with float type.

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

10 years agoObjectiveC. Method implementations should only check for
Fariborz Jahanian [Tue, 5 Nov 2013 00:28:21 +0000 (00:28 +0000)]
ObjectiveC. Method implementations should only check for
"Missing call to Super" in the overriding method and
not in the method itself. // rdar://15385981.

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

10 years agoInclude non-explicit submodules in exported module list
Dmitri Gribenko [Mon, 4 Nov 2013 21:51:33 +0000 (21:51 +0000)]
Include non-explicit submodules in exported module list

This change fixes Richard's testcase for r193815.  Now we include non-explicit
submodules into the list of exports.

The test failed previously because:
- recursive_visibility_a1.inner is not imported (only recursive_visibility_a1 is),
- thus the 'inner' submodule is not showing up in any of the import lists,
- and because of this getExportedModules() is not returning the
  correct module set -- it only considers modules that are imported.

The fix is to make Module::getExportedModules() include non-explicit submodules
into the list of exports.

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

10 years ago[analyzer] Track the count of NSOrderedSet similarly to other fast enumerations.
Anna Zaks [Mon, 4 Nov 2013 19:13:08 +0000 (19:13 +0000)]
[analyzer] Track the count of NSOrderedSet similarly to other fast enumerations.

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

10 years ago[analyzer] Suppress warnings coming out of std::basic_string.
Anna Zaks [Mon, 4 Nov 2013 19:13:03 +0000 (19:13 +0000)]
[analyzer] Suppress warnings coming out of std::basic_string.

The analyzer cannot reason about the internal invariances of the data structure (radar://15194597).

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

10 years agoTry to correct a mistyped "-" or ">" to "->" for some C++ cases.
Kaelyn Uhrain [Mon, 4 Nov 2013 18:59:34 +0000 (18:59 +0000)]
Try to correct a mistyped "-" or ">" to "->" for some C++ cases.

Similar C code isn't caught as it seems to hit a different code path.
Also, as the check is only done for record pointers, cases involving
an overloaded operator-> are not handled either. Note that the reason
this check is done in the parser instead of Sema is not related to
having enough knowledge about the current state as it is about being
able to fix up the parser's state to be able to recover and traverse the
correct code paths.

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

10 years agoUse aliases for more constructors and destructors.
Rafael Espindola [Mon, 4 Nov 2013 18:38:59 +0000 (18:38 +0000)]
Use aliases for more constructors and destructors.

With this patch we produce alias for cases like

template<typename T>
struct foobar {
  foobar() {
  }
};
template struct foobar<void>;

We just have to be careful to produce the same aliases in every TU because
of comdats.

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

10 years agoclang-format this if.
Rafael Espindola [Mon, 4 Nov 2013 17:13:51 +0000 (17:13 +0000)]
clang-format this if.

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

10 years agoCodeGen: Test that simple expressions are simplified at -O0
Justin Bogner [Mon, 4 Nov 2013 16:13:23 +0000 (16:13 +0000)]
CodeGen: Test that simple expressions are simplified at -O0

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

10 years agoCodeGen: Use EmitBranchOnBool when generating For and CXXForRange
Justin Bogner [Mon, 4 Nov 2013 16:13:21 +0000 (16:13 +0000)]
CodeGen: Use EmitBranchOnBool when generating For and CXXForRange

A while ago EmitForStmt was changed to explicitly evaluate the
condition expression and create a branch instead of using
EmitBranchOnBool, so that the condition expression could be used for
some cleanup logic. The cleanup stuff has since been reorganized, and
this is no longer necessary.

In EmitCXXForRange, the evaluated condition was never used for
anything else. The logic was presumably modeled on EmitForStmt.

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

10 years agoCodeGen: Move an initialization away from an unrelated comment
Justin Bogner [Mon, 4 Nov 2013 16:13:18 +0000 (16:13 +0000)]
CodeGen: Move an initialization away from an unrelated comment

An initialization somehow found its way in between a comment and the
block of code the comment is about. Moving the initialization makes
this less confusing.

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

10 years agoclang/lib/Parse/CMakeLists.txt: Fixup corresponding to r193989. ClangAttrTypeArg...
NAKAMURA Takumi [Mon, 4 Nov 2013 13:10:53 +0000 (13:10 +0000)]
clang/lib/Parse/CMakeLists.txt: Fixup corresponding to r193989. ClangAttrTypeArg is required here.

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

10 years agoUpdating the makefile to reflect CMake; addendum to r193989.
Aaron Ballman [Mon, 4 Nov 2013 13:02:44 +0000 (13:02 +0000)]
Updating the makefile to reflect CMake; addendum to r193989.

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

10 years agoAttributes which accept a type as their sole argument are no longer hard coded into...
Aaron Ballman [Mon, 4 Nov 2013 12:55:56 +0000 (12:55 +0000)]
Attributes which accept a type as their sole argument are no longer hard coded into the parser. Instead, they are automatically listed through tablegen.

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

10 years agoMake ADLResult::iterator a proper iterator.
Benjamin Kramer [Mon, 4 Nov 2013 10:29:56 +0000 (10:29 +0000)]
Make ADLResult::iterator a proper iterator.

PR17796.

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

10 years agoDriver: Add support for -march=bdver3 on x86.
Benjamin Kramer [Mon, 4 Nov 2013 10:29:51 +0000 (10:29 +0000)]
Driver: Add support for -march=bdver3 on x86.

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

11 years agoIssue a diagnostic if an implicitly-defined move assignment operator would move
Richard Smith [Mon, 4 Nov 2013 04:26:14 +0000 (04:26 +0000)]
Issue a diagnostic if an implicitly-defined move assignment operator would move
the same virtual base class multiple times (and the move assignment is used,
and the move assignment for the virtual base is not trivial).

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

11 years agoIt is no longer necessary to opt out of pretty stack traces.
Filip Pizlo [Mon, 4 Nov 2013 02:25:34 +0000 (02:25 +0000)]
It is no longer necessary to opt out of pretty stack traces.

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

11 years agoUpdate a comment to match current core issues list.
Richard Smith [Mon, 4 Nov 2013 02:02:27 +0000 (02:02 +0000)]
Update a comment to match current core issues list.

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

11 years agoImplement final resolution of DR1402: implicitly-declared move operators that
Richard Smith [Mon, 4 Nov 2013 01:48:18 +0000 (01:48 +0000)]
Implement final resolution of DR1402: implicitly-declared move operators that
would be deleted are still declared, but are ignored by overload resolution.

Also, don't delete such members if a subobject has no corresponding move
operation and a non-trivial copy. This causes us to implicitly declare move
operations in more cases, but risks move-assigning virtual bases multiple
times in some circumstances (a warning for that is to follow).

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

11 years agoSema: Do not allow overloading between methods based on restrict
David Majnemer [Sun, 3 Nov 2013 23:51:28 +0000 (23:51 +0000)]
Sema: Do not allow overloading between methods based on restrict

If the sole distinction between two declarations is that one has a
__restrict qualifier then we should not consider it to be an overload.

Instead, we will consider it as an incompatible redeclaration which is
similar to how MSVC, ICC and GCC would handle it.

This fixes PR17786.

N.B. We must not mangle in __restrict into method qualifiers becase we
don't allow overloading between such declarations anymore.  To do
otherwise would be a violation of the Itanium ABI.

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

11 years agoFix test to actually check the FixIt-applied code
Alp Toker [Sun, 3 Nov 2013 01:50:38 +0000 (01:50 +0000)]
Fix test to actually check the FixIt-applied code

r102230 added an 'echo' making this a no-op.

Also fixes FAIL on native Windows with no shell/GnuWin32.

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

11 years agoFix typo in err_flexible_array_empty_aggregate
David Majnemer [Sun, 3 Nov 2013 00:16:44 +0000 (00:16 +0000)]
Fix typo in err_flexible_array_empty_aggregate

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

11 years agoOS X 10.9+ and iOS 7+ support load/store of big atomic objects.
Bob Wilson [Sat, 2 Nov 2013 23:27:49 +0000 (23:27 +0000)]
OS X 10.9+ and iOS 7+ support load/store of big atomic objects.

rdar://13973577

Patch by Fariborz Jahanian.

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

11 years agoDefault to use libc++ on OS X 10.9+ and iOS 7+.
Bob Wilson [Sat, 2 Nov 2013 23:19:53 +0000 (23:19 +0000)]
Default to use libc++ on OS X 10.9+ and iOS 7+.

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

11 years agoAdd test case for r193923
David Majnemer [Sat, 2 Nov 2013 12:11:58 +0000 (12:11 +0000)]
Add test case for r193923

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

11 years agoSema: Disallow inheriting from classes with flexible array members
David Majnemer [Sat, 2 Nov 2013 12:00:36 +0000 (12:00 +0000)]
Sema: Disallow inheriting from classes with flexible array members

Flexible array members inherently index off of the end of their parent
type.

We shouldn't allow this type to be used as a base, virtual or otherwise,
because indexing off the end may find us inside of another base or the
derived types members.

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

11 years agoSema: Remove stray whitespace around Sema::CheckBaseSpecifier
David Majnemer [Sat, 2 Nov 2013 11:24:41 +0000 (11:24 +0000)]
Sema: Remove stray whitespace around Sema::CheckBaseSpecifier

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

11 years agoRemove a stray tab character from warn_objc_root_class_missing
David Majnemer [Sat, 2 Nov 2013 11:21:23 +0000 (11:21 +0000)]
Remove a stray tab character from warn_objc_root_class_missing

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

11 years agoSema: Disallow derived classes with virtual bases from having flexible array members
David Majnemer [Sat, 2 Nov 2013 11:19:13 +0000 (11:19 +0000)]
Sema: Disallow derived classes with virtual bases from having flexible array members

Flexible array members only work out if they are the last field of a
record, however virtual bases would give us many situations where the
flexible array member would overlap with the virtual base fields.

It is unlikely in the extreme that this behavior was intended by the
user so raise a diagnostic instead of accepting.  This is will not
reject conforming code because flexible array members are an extension
in C++ mode.

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

11 years agoSema: Cleanup and simplify anonymous union diagnostics
David Majnemer [Sat, 2 Nov 2013 10:38:05 +0000 (10:38 +0000)]
Sema: Cleanup and simplify anonymous union diagnostics

The determination of which diagnostics would be issued for certain
anonymous unions started to get a little ridiculous.  Clean this up by
inverting the condition-tree's logic from dialect -> issue to
issue -> diagnostic.

As part of this cleanup, move ext_c99_flexible_array_member from
DiagnosticParseKinds.td to DiagnosticSemaKinds.td because it's driven by
Sema, not Parse.

Also, the liberty was taken to edit ext_c99_flexible_array_member to
match other, similar, diagnostics.

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

11 years agoSema: Flexible array members were introduced in C99, diagnose their use in C++
David Majnemer [Sat, 2 Nov 2013 09:22:44 +0000 (09:22 +0000)]
Sema: Flexible array members were introduced in C99, diagnose their use in C++

The declaration of a flexible array member was correctly diagnosed as an
extension in C89 mode but not in C++.

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

11 years agoSema: Properly indent statements in Sema::ActOnLastBitfield
David Majnemer [Sat, 2 Nov 2013 08:41:50 +0000 (08:41 +0000)]
Sema: Properly indent statements in Sema::ActOnLastBitfield

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

11 years agoSema: trim trailing whitespace in Sema::ActOnLastBitfield
David Majnemer [Sat, 2 Nov 2013 08:41:01 +0000 (08:41 +0000)]
Sema: trim trailing whitespace in Sema::ActOnLastBitfield

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

11 years agoclang/test/CodeGenCXX/builtins.cpp: Fix for -Asserts.
NAKAMURA Takumi [Sat, 2 Nov 2013 02:58:42 +0000 (02:58 +0000)]
clang/test/CodeGenCXX/builtins.cpp: Fix for -Asserts.

  - Don't seek "entry:" It dosen't appear with -Asserts.
  - Take care that Codegen'ed Instruction(s) wouldn't have name(s) in -Asserts.

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

11 years agoChange the other -Wtautological-compare warnings to not trigger in template
Richard Trieu [Sat, 2 Nov 2013 02:11:23 +0000 (02:11 +0000)]
Change the other -Wtautological-compare warnings to not trigger in template
specializations.  Also switch to -Wuninitialized for a test case that depended
on a warning firing in template specializations.

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

11 years agoAdding triple to lit test fixed in r193901
Warren Hunt [Sat, 2 Nov 2013 00:34:45 +0000 (00:34 +0000)]
Adding triple to lit test fixed in r193901

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

11 years agoFixes lit test that doesn't fail on windows
Warren Hunt [Sat, 2 Nov 2013 00:12:15 +0000 (00:12 +0000)]
Fixes lit test that doesn't fail on windows

long in linux 64 is 64 bits but is always 32 bits on windows.  The lit test was modified
to use long long instead of long and check for 64-bit mangling.

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

11 years agoImproves compatibility with cl.exe when laying out array fields
Warren Hunt [Fri, 1 Nov 2013 23:59:41 +0000 (23:59 +0000)]
Improves compatibility with cl.exe when laying out array fields

Differential Revision: http://llvm-reviews.chandlerc.com/D2090

Clang was "improperly" over-aligning arrays with sizes are not a multiple of
their alignment.
This behavior was removed in microsoft 32 bit mode.

In addition, after examination of ASTContext::getTypeInfoImpl, a redundant code block in
MicrosoftRecordLayoutBuilder::getAdjustedFieldInfo was deleted.

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

11 years agoWraps lazily generated builtins in an extern "C" context
Warren Hunt [Fri, 1 Nov 2013 23:46:51 +0000 (23:46 +0000)]
Wraps lazily generated builtins in an extern "C" context

Differential Revision: http://llvm-reviews.chandlerc.com/D2082

Adds a lang_c LinkageSpecDecl to lazily generated builtins. This enforces correct
behavior for builtins in a variety of cases without special treatment elsewhere within
the compiler (special treatment is removed by the patch). It also allows for C++
overloads of builtin functions, which Microsoft uses in their headers e.g.
_InterlockedExchangeAdd is an extern C builtin for the long type but an inline wrapper
for int type.

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

11 years agoPreload module maps in normal user directories, too.
Douglas Gregor [Fri, 1 Nov 2013 23:08:38 +0000 (23:08 +0000)]
Preload module maps in normal user directories, too.

... in case someone decides to -I/usr/include <rdar://problem/15235948>.

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

11 years agoAdd non-type template parameter test for disabled -Wtautological-compare
Richard Trieu [Fri, 1 Nov 2013 22:12:15 +0000 (22:12 +0000)]
Add non-type template parameter test for disabled -Wtautological-compare
warning in template specializations.

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

11 years agoObjectiveC. Define a new cc1 flag
Fariborz Jahanian [Fri, 1 Nov 2013 21:58:17 +0000 (21:58 +0000)]
ObjectiveC. Define a new cc1 flag
-fobjc-subscripting-legacy-runtime which is off
by default and on only when using ObjectiveC
legacy runtime. Use this flag to allow
array and dictionary subscripting and disallow
objectiveC pointer arithmatic in ObjectiveC
legacy runtime. // rdar://15363492

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

11 years agoDisable -Wtautological-compare in template instantiations.
Richard Trieu [Fri, 1 Nov 2013 21:47:19 +0000 (21:47 +0000)]
Disable -Wtautological-compare in template instantiations.

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

11 years agoDisable -Wtautological-constant-out-of-range-compare in template instantiations.
Richard Trieu [Fri, 1 Nov 2013 21:19:43 +0000 (21:19 +0000)]
Disable -Wtautological-constant-out-of-range-compare in template instantiations.

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

11 years agoSanitizerArgs: add ability to filter/diagnose unsupported sanitizers.
Peter Collingbourne [Fri, 1 Nov 2013 18:16:25 +0000 (18:16 +0000)]
SanitizerArgs: add ability to filter/diagnose unsupported sanitizers.

The thread, memory, dataflow and function sanitizers are now diagnosed if
enabled explicitly on an unsupported platform.  Unsupported sanitizers which
are enabled implicitly (as part of a larger group) are silently disabled.  As a
side effect, this makes SanitizerArgs parsing toolchain-dependent (and thus
essentially reverts r188058), and moves SanitizerArgs ownership to ToolChain.

Differential Revision: http://llvm-reviews.chandlerc.com/D1990

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

11 years agoAArch64: Fix wildcard matching on CHECK lines. Now recognises arch64--.
Amara Emerson [Fri, 1 Nov 2013 12:53:57 +0000 (12:53 +0000)]
AArch64: Fix wildcard matching on CHECK lines. Now recognises arch64--.

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

11 years agoSema: Make helper function static.
Benjamin Kramer [Fri, 1 Nov 2013 11:50:55 +0000 (11:50 +0000)]
Sema: Make helper function static.

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

11 years agoSimplify computation of visible module set.
Richard Smith [Fri, 1 Nov 2013 02:19:14 +0000 (02:19 +0000)]
Simplify computation of visible module set.

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

11 years agoSupport return type deduction for templates in -fdelayed-template-parsing (microsoft...
Faisal Vali [Fri, 1 Nov 2013 02:01:01 +0000 (02:01 +0000)]
Support return type deduction for templates in -fdelayed-template-parsing (microsoft) mode

Please see http://llvm-reviews.chandlerc.com/D2053 for discussion and Richard's stamp.

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

11 years agoObjectiveC migrator. When inferring readwrite property,
Fariborz Jahanian [Fri, 1 Nov 2013 00:26:48 +0000 (00:26 +0000)]
ObjectiveC migrator. When inferring readwrite property,
do not remove the setter if its availability differs
from availability of the getter (which is now turned into
a property). Otherwise, synthesized setter will
inherit availability of the property (which is incorrect).
// rdar://15300059

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

11 years ago[AArch64] Add support for NEON scalar fixed-point convert to floating-point instructions.
Chad Rosier [Thu, 31 Oct 2013 22:37:08 +0000 (22:37 +0000)]
[AArch64] Add support for NEON scalar fixed-point convert to floating-point instructions.

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