]> granicus.if.org Git - clang/log
clang
11 years agoPR16715: Fix assert in verifier: only mark call to 'operator new' as 'builtin' if
Richard Smith [Mon, 29 Jul 2013 20:14:16 +0000 (20:14 +0000)]
PR16715: Fix assert in verifier: only mark call to 'operator new' as 'builtin' if
corresponding 'operator new' was actually emitted as a function marked 'nobuiltin'.

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

11 years agoConvert a use of status with llvm::sys::fs::getUniqueID.
Rafael Espindola [Mon, 29 Jul 2013 18:43:40 +0000 (18:43 +0000)]
Convert a use of status with llvm::sys::fs::getUniqueID.

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

11 years agotest/Driver/cl.c, remove quotes around /help
Hans Wennborg [Mon, 29 Jul 2013 18:40:38 +0000 (18:40 +0000)]
test/Driver/cl.c, remove quotes around /help

The quotes (from r187330) didn't really help here, the trick was to disable
the test on MSYS builds. This removes those quotes, changes back the comment
to explain why /? has to be quoted specifically, and moves the REQUIRES
line to the top of the file because that's important.

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

11 years agoSupport for Thread Safety Analysis in C
David Blaikie [Mon, 29 Jul 2013 18:24:03 +0000 (18:24 +0000)]
Support for Thread Safety Analysis in C

Patch by Ethan Jackson.

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

11 years agoConvert a use of stat with sys::fs::status.
Rafael Espindola [Mon, 29 Jul 2013 18:22:23 +0000 (18:22 +0000)]
Convert a use of stat with sys::fs::status.

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

11 years agoFix handling of "clang c:foo"
Rafael Espindola [Mon, 29 Jul 2013 15:47:24 +0000 (15:47 +0000)]
Fix handling of "clang c:foo"

On windows, c:foo is a valid file path, but stat fails on just "c:". This
causes a problem for clang since its file manager wants to cache data about
the parent directory.

There are refactorings to be done in here, but this gives clang the correct
behavior and testing first.

Patch by Yunzhong Gao!

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

11 years agoReturn ExprError if both arguments to the mask form of __builtin_shufflvector don...
Craig Topper [Mon, 29 Jul 2013 06:47:04 +0000 (06:47 +0000)]
Return ExprError if both arguments to the mask form of __builtin_shufflvector don't have the same number of elements or the mask isn't an integer vector.

Previously a diagnostic was issued, but the code went ahead and built the ShuffleVectorExpr. While I'm here also simplify a couple lines by wrapping the return ExprError around the Diag calls.

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

11 years agoclang/test/Driver/cl.c: Don't attempt slash switches on msys bash.
NAKAMURA Takumi [Mon, 29 Jul 2013 01:37:10 +0000 (01:37 +0000)]
clang/test/Driver/cl.c: Don't attempt slash switches on msys bash.

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

11 years agoFix up formatting. No functional change.
Craig Topper [Sun, 28 Jul 2013 21:50:10 +0000 (21:50 +0000)]
Fix up formatting. No functional change.

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

11 years agoTry single quotes to fix the msys bot:
Rafael Espindola [Sun, 28 Jul 2013 17:13:24 +0000 (17:13 +0000)]
Try single quotes to fix the msys bot:

It was still failing with double quotes:

http://bb.pgr.jp/builders/clang-i686-msys/builds/698/steps/test_clang/logs/Clang%20%3A%3A%20Driver__cl.c

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

11 years agoAvoid crashing if a directory has no pch files.
Rafael Espindola [Sun, 28 Jul 2013 13:23:37 +0000 (13:23 +0000)]
Avoid crashing if a directory has no pch files.

Should fix some of the bots that have assertions disabled.

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

11 years agoReduce stack frame size by avoiding a large token vector on an error path.
Bob Wilson [Sat, 27 Jul 2013 21:59:57 +0000 (21:59 +0000)]
Reduce stack frame size by avoiding a large token vector on an error path.

Beginning with svn r186971, we noticed an internal test started to fail when
using clang built with LTO. After much investigation, it turns out that there
are no blatant bugs here, we are just running out of stack space and crashing.
Preprocessor::ReadFunctionLikeMacroArgs already has one vector of 64 Tokens,
and r186971 added another.  When built with LTO, that function is inlined into
Preprocessor::HandleMacroExpandedIdentifier, which for our internal test is
invoked in a deep recursive cycle. I'm leaving the original 64 Token vector
alone on the assumption that it is important for performance, but the new
FixedArgTokens vector is only used on an error path, so it should be OK if it
requires additional heap storage. It would be even better if we could avoid
the deep recursion, but I think this change is a good thing to do regardless.
<rdar://problem/14540345>

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

11 years agoFix test/Driver/cl.c.
Hans Wennborg [Sat, 27 Jul 2013 06:19:03 +0000 (06:19 +0000)]
Fix test/Driver/cl.c.

This test would fail in weird ways on systems with a one-letter filename
in the root directory, because the shell would helpfully expand /? to e.g. /n.

Make sure this doesn't happen by adding quotes.

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

11 years agoFix formatting. No functional change.
Craig Topper [Sat, 27 Jul 2013 05:00:42 +0000 (05:00 +0000)]
Fix formatting. No functional change.

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

11 years agoUsing the function pointer instead of the function type; this allows us to re-enable...
Aaron Ballman [Sat, 27 Jul 2013 03:34:50 +0000 (03:34 +0000)]
Using the function pointer instead of the function type; this allows us to re-enable a warning in MSVC by default.

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

11 years agoclang-cl: add support for the /? and /help options
Hans Wennborg [Sat, 27 Jul 2013 00:23:45 +0000 (00:23 +0000)]
clang-cl: add support for the /? and /help options

This establishes a new Flag in Options.td, which can be assigned to
options that should be made available in clang's cl.exe compatible
mode, and updates the Driver to make use of the flag.

(The whitespace change to CMakeLists forces the build to re-run CMake
 and pick up the include dependency on the new .td file. This makes the
 build work if someone moves backwards in commit history after this change.)

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

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

11 years agoDon't build expressions for invalid casts.
Eli Friedman [Fri, 26 Jul 2013 23:47:47 +0000 (23:47 +0000)]
Don't build expressions for invalid casts.

This matches how we normally perform semantic analysis for other sorts
of invalid expressions: it means we don't have to reason about invalid
sub-expressions.

Fixes PR16680.

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

11 years agoHandle a difference in lambda return type deduction between C++11 and C++1y: if
Richard Smith [Fri, 26 Jul 2013 23:45:07 +0000 (23:45 +0000)]
Handle a difference in lambda return type deduction between C++11 and C++1y: if
no return type is specified, C++11 will deduce a cv-qualified return type in
some cases, but C++1y never will.

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

11 years agoPR16708: If a lambda has an implicit return type, don't get confused if its return...
Richard Smith [Fri, 26 Jul 2013 22:53:54 +0000 (22:53 +0000)]
PR16708: If a lambda has an implicit return type, don't get confused if its return type has already been determined to be a type containing an 'auto'.

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

11 years agoUse the new boolean to StringRef function to generate the proper StringRefs.
Bill Wendling [Fri, 26 Jul 2013 21:51:11 +0000 (21:51 +0000)]
Use the new boolean to StringRef function to generate the proper StringRefs.

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

11 years agoFix up the BUILD_CLANG_ONLY code to work properly after r184794.
Bob Wilson [Fri, 26 Jul 2013 21:08:22 +0000 (21:08 +0000)]
Fix up the BUILD_CLANG_ONLY code to work properly after r184794.

When BUILD_CLANG_ONLY is set to YES, it is supposed to simply limit the tools
that get built.  The change in r184794 broke this feature by moving libclang
and c-index-test into PARALLEL_DIRS. Those are both supposed to be in DIRS,
because c-index-test has a build dependency on libclang and cannot be
reliably built in parallel with it.

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

11 years agoDebug Info / EmitCallArgs: arguments may modify the debug location.
Adrian Prantl [Fri, 26 Jul 2013 20:42:57 +0000 (20:42 +0000)]
Debug Info / EmitCallArgs: arguments may modify the debug location.
Restore it after each argument is emitted. This fixes the scope info for
inlined subroutines inside of function argument expressions. (E.g.,
anything STL).

rdar://problem/12592135

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

11 years agoOptions.td: rename CCC{Driver,Debug}Opt to Internal{Driver,Debug}Opt
Hans Wennborg [Fri, 26 Jul 2013 20:30:00 +0000 (20:30 +0000)]
Options.td: rename CCC{Driver,Debug}Opt to Internal{Driver,Debug}Opt

Also rename ccc_Group, ccc_driver_Group and ccc_Debug_Group similarly.

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

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

11 years agoOptions.td: remove a_Group and L_Group.
Hans Wennborg [Fri, 26 Jul 2013 19:41:43 +0000 (19:41 +0000)]
Options.td: remove a_Group and L_Group.

They don't seems to serve any purpose.

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

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

11 years agoAdd matcher for float literals.
Daniel Jasper [Fri, 26 Jul 2013 18:52:58 +0000 (18:52 +0000)]
Add matcher for float literals.

Patch by Chris Gray! Thanks!

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

11 years ago[libclang] Remove comma from the blacklist of characters that prevent a comment to...
Argyrios Kyrtzidis [Fri, 26 Jul 2013 18:38:12 +0000 (18:38 +0000)]
[libclang] Remove comma from the blacklist of characters that prevent a comment to be attached to a decl.

It's common to use an availability function macro at the start of a decl.
rdar://13965065

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

11 years agoOptions.td: Update HelpText of CCCDriverOpt
Hans Wennborg [Fri, 26 Jul 2013 17:18:08 +0000 (17:18 +0000)]
Options.td: Update HelpText of CCCDriverOpt

This should have been part of r186720.

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

11 years agoclang-format: Add two new style options to support WebKit style.
Daniel Jasper [Fri, 26 Jul 2013 16:56:36 +0000 (16:56 +0000)]
clang-format: Add two new style options to support WebKit style.

New options:
* Break before the commas of constructor initializers and align
  the commas with the colon.
* Break before binary operators

Additionally, for styles without column limit, don't just accept
linebreaks done by the user, but instead remove 'invalid' (according
to the current style) linebreaks and add 'required' ones.

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

11 years ago[frontend] '-frewrite-includes' should not ignore headers included from command-line.
Argyrios Kyrtzidis [Fri, 26 Jul 2013 15:32:04 +0000 (15:32 +0000)]
[frontend] '-frewrite-includes' should not ignore headers included from command-line.

rdar://14556182

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

11 years agoAdd not to a command that is expected to fail.
Rafael Espindola [Fri, 26 Jul 2013 14:10:55 +0000 (14:10 +0000)]
Add not to a command that is expected to fail.

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

11 years agoFix tests on targets that don't support thread_local
Pavel Labath [Fri, 26 Jul 2013 12:50:30 +0000 (12:50 +0000)]
Fix tests on targets that don't support thread_local

This also reverts r187197.

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

11 years agoAdd a triple. Should fix the windows bots.
Rafael Espindola [Fri, 26 Jul 2013 12:40:55 +0000 (12:40 +0000)]
Add a triple. Should fix the windows bots.

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

11 years ago[analyzer] Fix FP warnings when binding a temporary to a local static variable
Pavel Labath [Fri, 26 Jul 2013 11:50:42 +0000 (11:50 +0000)]
[analyzer] Fix FP warnings when binding a temporary to a local static variable

Summary:
When binding a temporary object to a static local variable, the analyzer would
complain about a dangling reference even though the temporary's lifetime should
be extended past the end of the function. This commit tries to detect these
cases and construct them in a global memory region instead of a local one.

Reviewers: jordan_rose

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1133

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

11 years agoRework r187192, to tweak expressions to be tolerant of DOSish paths. XFAILs can be...
NAKAMURA Takumi [Fri, 26 Jul 2013 10:13:27 +0000 (10:13 +0000)]
Rework r187192, to tweak expressions to be tolerant of DOSish paths. XFAILs can be removed.

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

11 years agoclang/test/Driver/linux-header-search.cpp: Add XFAILs, for now. I'll fix them later.
NAKAMURA Takumi [Fri, 26 Jul 2013 08:28:35 +0000 (08:28 +0000)]
clang/test/Driver/linux-header-search.cpp: Add XFAILs, for now. I'll fix them later.

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

11 years agoRemove trailing whitespace.
Craig Topper [Fri, 26 Jul 2013 06:16:11 +0000 (06:16 +0000)]
Remove trailing whitespace.

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

11 years agoRemove trailing whitespace.
Craig Topper [Fri, 26 Jul 2013 05:59:26 +0000 (05:59 +0000)]
Remove trailing whitespace.

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

11 years agoFix test for Release builds.
Eli Friedman [Fri, 26 Jul 2013 02:04:44 +0000 (02:04 +0000)]
Fix test for Release builds.

Attempt 2.  Sorry about the noise.

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

11 years ago[PowerPC] Support powerpc64le as a syntax-checking target.
Bill Schmidt [Fri, 26 Jul 2013 01:36:11 +0000 (01:36 +0000)]
[PowerPC] Support powerpc64le as a syntax-checking target.

This patch provides basic support for powerpc64le as an LLVM target.
However, use of this target will not actually generate little-endian
code.  Instead, use of the target will cause the correct little-endian
built-in defines to be generated, so that code that tests for
__LITTLE_ENDIAN__, for example, will be correctly parsed for
syntax-only testing.  Code generation will otherwise be the same as
powerpc64 (big-endian), for now.

The patch leaves open the possibility of creating a little-endian
PowerPC64 back end, but there is no immediate intent to create such a
thing.

The new test case variant ensures that correct built-in defines for
little-endian code are generated.

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

11 years agoFix test for Release builds.
Eli Friedman [Fri, 26 Jul 2013 01:21:11 +0000 (01:21 +0000)]
Fix test for Release builds.

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

11 years agoTighten type-checking for vector attributes.
Eli Friedman [Fri, 26 Jul 2013 00:53:47 +0000 (00:53 +0000)]
Tighten type-checking for vector attributes.

Based on patch by Yunzhong Gao.

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

11 years agoFix gcc search for cross-compiler on Ubuntu 13.04.
Eli Friedman [Fri, 26 Jul 2013 00:53:40 +0000 (00:53 +0000)]
Fix gcc search for cross-compiler on Ubuntu 13.04.

Just more craziness to find crtbegin.o etc.

Patch by Stephen Kelly.

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

11 years agoFix GNU ObjC ABI for a message returning a struct.
Eli Friedman [Fri, 26 Jul 2013 00:53:29 +0000 (00:53 +0000)]
Fix GNU ObjC ABI for a message returning a struct.

This allows the ObjFW runtime to correctly implement message forwarding
for messages which return a struct.

Patch by Jonathan Schleifer.

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

11 years agoPartially revert r186903.
Eli Friedman [Fri, 26 Jul 2013 00:06:45 +0000 (00:06 +0000)]
Partially revert r186903.

It turns out that Plum Hall depends on us not emitting an error on
integer literals which fit into long long, but fit into
unsigned long long.  So C99 conformance requires not conforming to C99. :)

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

11 years agoMove friend warning into CXX11 warning group.
Eli Friedman [Fri, 26 Jul 2013 00:06:39 +0000 (00:06 +0000)]
Move friend warning into CXX11 warning group.

Also, fix the wording to reflect this.

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

11 years agoOptions.td: fold the NoForward flag into DriverOption
Hans Wennborg [Thu, 25 Jul 2013 23:09:00 +0000 (23:09 +0000)]
Options.td: fold the NoForward flag into DriverOption

They seemed to have the same implications, and this makes for one
less flag to worry about.

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

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

11 years agoWhen we perform dependent name lookup during template instantiation, it's not
Richard Smith [Thu, 25 Jul 2013 23:08:39 +0000 (23:08 +0000)]
When we perform dependent name lookup during template instantiation, it's not
sufficient to only consider names visible at the point of instantiation,
because that may not include names that were visible when the template was
defined. More generally, if the instantiation backtrace goes through a module
M, then every declaration visible within M should be available to the
instantiation. Any of those declarations might be part of the interface that M
intended to export to a template that it instantiates.

The fix here has two parts:

1) If we find a non-visible declaration during name lookup during template
instantiation, check whether the declaration was visible from the defining
module of all entities on the active template instantiation stack. The defining
module is not the owning module in all cases: we look at the module in which a
template was defined, not the module in which it was first instantiated.

2) Perform pending instantiations at the end of a module, not at the end of the
translation unit. This is general goodness, since it significantly cuts down
the amount of redundant work that is performed in every TU importing a module,
and also implicitly adds the module containing the point of instantiation to
the set of modules checked for declarations in a lookup within a template
instantiation.

There's a known issue here with template instantiations performed while
building a module, if additional imports are added later on. I'll fix that
in a subsequent commit.

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

11 years agoOptions.td: finish comment about CompileOnly_Group
Hans Wennborg [Thu, 25 Jul 2013 22:55:46 +0000 (22:55 +0000)]
Options.td: finish comment about CompileOnly_Group

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

11 years ago[analyzer] Remove dead optimization for MaterializeTemporaryExpr.
Jordan Rose [Thu, 25 Jul 2013 22:32:35 +0000 (22:32 +0000)]
[analyzer] Remove dead optimization for MaterializeTemporaryExpr.

Previously, we tried to avoid creating new temporary object regions if
the value to be materialized itself came from a temporary object region.
However, once we became more strict about lvalues vs. rvalues (months
ago), this optimization became dead code, because the input to this
function will always be an rvalue (i.e. a symbolic value or compound
value rather than a region, at least for structs).

This would be a nice optimization to keep, but removing it makes it
simpler to reason about temporary regions.

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

11 years agoDon't forward all assembler arguments untouched to -cc1as
David Blaikie [Thu, 25 Jul 2013 21:19:01 +0000 (21:19 +0000)]
Don't forward all assembler arguments untouched to -cc1as

Use the same filtering for assembly arguments to -cc1as as we do for
-cc1, this allows a consistent (& more useful) diagnostic experience for
users (rather than getting an error from -cc1as (which a user shouldn't
really be thinking about) about --foo, they get an error from clang
about --foo in -Wa,)

I'm sort of surprised by the separation of -cc1as & the separate
argument handling, etc, but at least this removes a little bit of the
duplication.

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

11 years agoremove empty directories.
Rafael Espindola [Thu, 25 Jul 2013 19:40:15 +0000 (19:40 +0000)]
remove empty directories.

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

11 years agoRemove the mblaze backend from clang.
Rafael Espindola [Thu, 25 Jul 2013 18:42:13 +0000 (18:42 +0000)]
Remove the mblaze backend from clang.

Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html

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

11 years ago[analyzer] Add regression test for the crash in PR16664.
Jordan Rose [Thu, 25 Jul 2013 17:22:05 +0000 (17:22 +0000)]
[analyzer] Add regression test for the crash in PR16664.

This goes with r186925, which reverted Pavel's commit in r186498.

Also, add a correctness test for the future.

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

11 years ago[analyzer] Weaken assertion to account for pointer-to-integer casts.
Jordan Rose [Thu, 25 Jul 2013 17:22:02 +0000 (17:22 +0000)]
[analyzer] Weaken assertion to account for pointer-to-integer casts.

PR16690

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

11 years agoMove not past env.
Rafael Espindola [Thu, 25 Jul 2013 14:52:56 +0000 (14:52 +0000)]
Move not past env.

This only makes a difference with broken versions of env (like the one in
gnutools32) that always return 0.

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

11 years agoDon't pass %s twice to clang -cc1.
Rafael Espindola [Thu, 25 Jul 2013 13:45:29 +0000 (13:45 +0000)]
Don't pass %s twice to clang -cc1.

The reason this clang invocation was failing is that it had two %s. We would
close stdout after the first one and report a fatal error when trying to
print the second.

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

11 years agoclang-format: Fix switch/case interaction with macros.
Daniel Jasper [Thu, 25 Jul 2013 11:31:57 +0000 (11:31 +0000)]
clang-format: Fix switch/case interaction with macros.

Before:
  #define OPERATION_CASE(name) \
    case OP_name:              \
    return operations::Operation##name

  switch (OpCode) {
      CASE(Add);
      CASE(Subtract);
    default:
      return operations::Unknown;
  }

After:
  #define OPERATION_CASE(name) \
    case OP_name:              \
      return operations::Operation##name;

  switch (OpCode) {
    CASE(Add);
    CASE(Subtract);
    default:
      return operations::Unknown;
  }

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

11 years agoUse memoization for has()-matcher.
Daniel Jasper [Thu, 25 Jul 2013 09:32:14 +0000 (09:32 +0000)]
Use memoization for has()-matcher.

In TUs with large classes, a matcher like

  methodDecl(ofClass(recordDecl(has(varDecl()))))

(finding all member functions of classes with static variables)
becomes unbearably slow otherwise.

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

11 years agoFix incorrect documentation generation for type matchers.
Manuel Klimek [Thu, 25 Jul 2013 06:05:50 +0000 (06:05 +0000)]
Fix incorrect documentation generation for type matchers.

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

11 years agoAvoid recursions when the parser finds out that it has too many brackets.
Rafael Espindola [Thu, 25 Jul 2013 02:11:20 +0000 (02:11 +0000)]
Avoid recursions when the parser finds out that it has too many brackets.

BalancedDelimiterTracker::diagnoseOverflow calls P.SkipUntil, and before this
patch P.SkipUnti is recursive, causing problems on systems with small stacks.
This patch fixes it by making P.SkipUnti non recursive when just looking for
eof.

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

11 years agoAdd another C++14 constexpr test case.
Richard Smith [Thu, 25 Jul 2013 01:53:54 +0000 (01:53 +0000)]
Add another C++14 constexpr test case.

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

11 years agoReplace the "NoFramePointerElimNonLeaf" target option with a function attribute.
Bill Wendling [Thu, 25 Jul 2013 00:32:41 +0000 (00:32 +0000)]
Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.

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

11 years agoDebug Info: Fine-tune the simple return expression location handling to
Adrian Prantl [Thu, 25 Jul 2013 00:23:42 +0000 (00:23 +0000)]
Debug Info: Fine-tune the simple return expression location handling to
only affect functions without a separate return block. This fixes the
linetable for void functions with cleanups and multiple returns.

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

11 years agotypo.
Adrian Prantl [Thu, 25 Jul 2013 00:23:37 +0000 (00:23 +0000)]
typo.

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

11 years agoDocumentation parsing: if typedef name is being declared
Fariborz Jahanian [Wed, 24 Jul 2013 22:58:51 +0000 (22:58 +0000)]
Documentation parsing: if typedef name is being declared
via a macro, try using declaration's starting location.
This is improvement over not having a valid location and
dropping comment altogether. // rdar://14348912

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

11 years agoSimplify code - no functionality change.
Eli Bendersky [Wed, 24 Jul 2013 22:20:49 +0000 (22:20 +0000)]
Simplify code - no functionality change.

getToolChain().getTriple().getArch() can be replaced by getToolChain().getArch()

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

11 years agoPartial revert of r185568.
Eli Bendersky [Wed, 24 Jul 2013 21:22:01 +0000 (21:22 +0000)]
Partial revert of r185568.

r186899 and r187061 added a preferred way for some architectures not to get
intrinsic generation for math builtins. So the code changes in r185568 can
now be undone (the test remains).

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

11 years agotypo.
Adrian Prantl [Wed, 24 Jul 2013 20:44:20 +0000 (20:44 +0000)]
typo.

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

11 years agoDebug Info: Fix an oversight of r186553. Ensure that the function prologue
Adrian Prantl [Wed, 24 Jul 2013 20:34:39 +0000 (20:34 +0000)]
Debug Info: Fix an oversight of r186553. Ensure that the function prologue
of an artificial function gets an artificial location as well.

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

11 years agoadd radar number to testcase.
Adrian Prantl [Wed, 24 Jul 2013 20:34:34 +0000 (20:34 +0000)]
add radar number to testcase.

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

11 years agoObjective-C migrator: some cleanup.
Fariborz Jahanian [Wed, 24 Jul 2013 19:18:37 +0000 (19:18 +0000)]
Objective-C migrator: some cleanup.
Expose static type of init/alloc/retain with
instance type as well. Ad-hoc cases are coming
next.

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

11 years agoAdd not to a command that is expected to fail.
Rafael Espindola [Wed, 24 Jul 2013 18:45:44 +0000 (18:45 +0000)]
Add not to a command that is expected to fail.

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

11 years agoObjectiveC migration: Method candidates for
Fariborz Jahanian [Wed, 24 Jul 2013 18:31:42 +0000 (18:31 +0000)]
ObjectiveC migration: Method candidates for
migrating to instancetype can have implicit 'id'
type too.

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

11 years agoPass -fno-math-builtin from the Clang driver to -cc1 for the l32 arch.
Eli Bendersky [Wed, 24 Jul 2013 18:20:14 +0000 (18:20 +0000)]
Pass -fno-math-builtin from the Clang driver to -cc1 for the l32 arch.

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

11 years agoRename feature test for lambda init-captures from cxx_generalized_capture to
Richard Smith [Wed, 24 Jul 2013 17:51:13 +0000 (17:51 +0000)]
Rename feature test for lambda init-captures from cxx_generalized_capture to
cxx_init_capture. "generalized" is neither descriptive nor future-proof. No
compatibility problems expected, since we've never advertised having this
feature.

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

11 years agoUpdate documentation to match current C++1y feature set.
Richard Smith [Wed, 24 Jul 2013 17:41:31 +0000 (17:41 +0000)]
Update documentation to match current C++1y feature set.

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

11 years agoMake test pass in Release builds, IR names don't get emitted there.
Benjamin Kramer [Wed, 24 Jul 2013 17:27:08 +0000 (17:27 +0000)]
Make test pass in Release builds, IR names don't get emitted there.

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

11 years agoUse ARM-style representation for C++ method pointers under PNaCl/Emscripten
Mark Seaborn [Wed, 24 Jul 2013 16:25:13 +0000 (16:25 +0000)]
Use ARM-style representation for C++ method pointers under PNaCl/Emscripten

Before this change, Clang uses the x86 representation for C++ method
pointers when generating code for PNaCl.  However, the resulting code
will assume that function pointers are 0 mod 2.  This assumption is
not safe for PNaCl, where function pointers could have any value
(especially in future sandboxing models).

So, switch to using the ARM representation for PNaCl code, which makes
no assumptions about the alignment of function pointers.

Since we're changing the "le32" target, this change also applies to
Emscripten.  The change is beneficial for Emscripten too.  Emscripten
has a workaround to make function pointers 0 mod 2.  This change would
allow the workaround to be removed.

See: https://code.google.com/p/nativeclient/issues/detail?id=3450

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

11 years agoSema: Minor const fixups and control flow tidying.
Benjamin Kramer [Wed, 24 Jul 2013 15:28:33 +0000 (15:28 +0000)]
Sema: Minor const fixups and control flow tidying.

No functionality change.

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

11 years agoAdd support for Adaptative matchers on the dynamic registry.
Samuel Benzaquen [Wed, 24 Jul 2013 14:48:01 +0000 (14:48 +0000)]
Add support for Adaptative matchers on the dynamic registry.

Summary:
Add support for Adaptative matchers on the dynamic registry.
Each adaptative matcher is created with a function template. We instantiate the function N times, one for each possible From type and apply the techniques used on argument overloaded and polymorphic matchers to add them to the registry.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1201

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

11 years agoclang-format: Initial (incomplete) support for the WebKit coding style.
Daniel Jasper [Wed, 24 Jul 2013 13:10:59 +0000 (13:10 +0000)]
clang-format: Initial (incomplete) support for the WebKit coding style.

This is far from implementing all the rules given by
http://www.webkit.org/coding/coding-style.html

The important new feature is the support for styles that don't have a
column limit. For such styles, clang-format will (at the moment) simply
respect the input's formatting decisions within statements.

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

11 years agoC++1y: track object lifetime during constexpr evaluation, and don't allow
Richard Smith [Wed, 24 Jul 2013 07:11:57 +0000 (07:11 +0000)]
C++1y: track object lifetime during constexpr evaluation, and don't allow
objects to be used once their lifetimes end. This completes the C++1y
constexpr extensions.

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

11 years agoUpdate docs.
Manuel Klimek [Wed, 24 Jul 2013 05:46:07 +0000 (05:46 +0000)]
Update docs.

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

11 years agoObjectiveC migration: more migration to
Fariborz Jahanian [Tue, 23 Jul 2013 23:55:55 +0000 (23:55 +0000)]
ObjectiveC migration: more migration to
instancetype of NSDictionary methods.

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

11 years agoObjectiveC migrator: start migrating to
Fariborz Jahanian [Tue, 23 Jul 2013 23:34:42 +0000 (23:34 +0000)]
ObjectiveC migrator: start migrating to
instancetype methods.

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

11 years agoObjC migrator: more knobs toward doing
Fariborz Jahanian [Tue, 23 Jul 2013 22:42:28 +0000 (22:42 +0000)]
ObjC migrator: more knobs toward doing
instancetype migration.

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

11 years ago[PowerPC64] Fix passing of single-vector-member structs to match ABI.
Bill Schmidt [Tue, 23 Jul 2013 22:15:57 +0000 (22:15 +0000)]
[PowerPC64] Fix passing of single-vector-member structs to match ABI.

The 64-bit PowerPC ELF ABI requires a struct that contains a single
vector member to be passed in a vector register as though the wrapping
struct were not present.  Instead we were passing this as a byval
struct.

The same logic was already present for floating-point arguments, so
this patch just extends the logic to handle vector types.  The new
test case verifies that clang coerces the parameter and annotates it
as inreg.

Thanks,
Bill

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

11 years agoRemove HelpText for -fno-diagnostics-show-note-include-stack
Hans Wennborg [Tue, 23 Jul 2013 21:17:14 +0000 (21:17 +0000)]
Remove HelpText for -fno-diagnostics-show-note-include-stack

The help text was wrong, and we already provide help text on the
option that actually changes anything, i.e. -fdiagnostics-show-note-include-stack.

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

11 years agoChanged "an macro" to "a macro" in diagnostic note.
Richard Trieu [Tue, 23 Jul 2013 21:06:45 +0000 (21:06 +0000)]
Changed "an macro" to "a macro" in diagnostic note.

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

11 years agoRemove support for CCC_ADD_ARGS. QA_OVERRIDE_GCC3_OPTIONS supersedes it.
Rafael Espindola [Tue, 23 Jul 2013 19:55:06 +0000 (19:55 +0000)]
Remove support for CCC_ADD_ARGS. QA_OVERRIDE_GCC3_OPTIONS supersedes it.

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

11 years agoRemoving a number of individual run lines and replacing them with single line test...
Aaron Ballman [Tue, 23 Jul 2013 19:37:19 +0000 (19:37 +0000)]
Removing a number of individual run lines and replacing them with single line test cases.  This reduces the number of test runs, provides the same coverage, and allows us to test that the attribute names are included in the diagnostic.

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

11 years agoObjC migrator: Define family of methods
Fariborz Jahanian [Tue, 23 Jul 2013 19:31:17 +0000 (19:31 +0000)]
ObjC migrator: Define family of methods
which are candidate for migrating to
'instancetype'. wip.

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

11 years agoAdded the attribute name to the err_attribute_wrong_number_arguments diagnostic for...
Aaron Ballman [Tue, 23 Jul 2013 19:30:11 +0000 (19:30 +0000)]
Added the attribute name to the err_attribute_wrong_number_arguments diagnostic for clarity; updated almost all of the affected test cases.

Thanks to Fariborz Jahanian for the suggestion!

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

11 years agoRemoved useless source loc field in UnresolvedUsingTypenameDecl node.
Enea Zaffanella [Tue, 23 Jul 2013 18:25:15 +0000 (18:25 +0000)]
Removed useless source loc field in UnresolvedUsingTypenameDecl node.

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

11 years agoAdd new diagnostic messages when too many arguments are presented to a
Richard Trieu [Tue, 23 Jul 2013 18:01:49 +0000 (18:01 +0000)]
Add new diagnostic messages when too many arguments are presented to a
function-like macro.  Clang will attempt to correct the arguments by detecting
braced initializer lists:

1) If possible, suggest parentheses around arguments
containing braced lists which will give the proper number of arguments.
2) If a braced list is detected at the start of a macro argument, it cannot be
corrected by parentheses.  Instead, just point out the location of these
braced lists.

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

11 years agoRemove the -ccc-echo option that is now unused.
Rafael Espindola [Tue, 23 Jul 2013 17:58:53 +0000 (17:58 +0000)]
Remove the -ccc-echo option that is now unused.

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

11 years ago[libclang] Expose the rest of the array types.
Argyrios Kyrtzidis [Tue, 23 Jul 2013 17:36:21 +0000 (17:36 +0000)]
[libclang] Expose the rest of the array types.

Patch by Che-Liang Chiou!

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

11 years agoGoing back to using getName for consistency.
Aaron Ballman [Tue, 23 Jul 2013 17:35:26 +0000 (17:35 +0000)]
Going back to using getName for consistency.

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

11 years agoExpand test/Driver/at_file.c test to check that PR16209 is fixed.
Hans Wennborg [Tue, 23 Jul 2013 17:26:56 +0000 (17:26 +0000)]
Expand test/Driver/at_file.c test to check that PR16209 is fixed.

It was fixed by r186603.

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

11 years agoRemove unused diagnostics.
Benjamin Kramer [Tue, 23 Jul 2013 16:18:53 +0000 (16:18 +0000)]
Remove unused diagnostics.

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