Hans Wennborg [Wed, 31 Jul 2013 20:51:53 +0000 (20:51 +0000)]
clang-cl: add the /c, /W0 and /W1 options
This adds a few more clang-cl options. It also exposes two core clang
options to the clang-cl mode: we need to be able to claim --driver_mode
so it doesn't show up as unused in cl mode, and we need -### for tests.
Differential Revision: http://llvm-reviews.chandlerc.com/D1232
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187527
91177308-0d34-0410-b5e6-
96231b3b80d8
Kaelyn Uhrain [Wed, 31 Jul 2013 20:16:17 +0000 (20:16 +0000)]
A few small cleanups to r187504. Thanks to dblaikie for the assist.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187521
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 31 Jul 2013 18:39:08 +0000 (18:39 +0000)]
ObjectiveC arc: minor refactoring in my last patch
to avoid future false positives. // rdar://
14569171
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187509
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 31 Jul 2013 18:21:45 +0000 (18:21 +0000)]
ObjectiveC arc: Introduce a new initialization kind
for parameters passed to CF audited functions
to be used for better diagnostics. Current set but
unused. // rdar://
14569171
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187508
91177308-0d34-0410-b5e6-
96231b3b80d8
Kaelyn Uhrain [Wed, 31 Jul 2013 17:38:24 +0000 (17:38 +0000)]
Improve the diagnostic experience, including adding recovery, for
changing '->' to '.' when there is no operator-> defined for a class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187504
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 31 Jul 2013 17:12:26 +0000 (17:12 +0000)]
ObjectiveC arc: Move check for type conversions in arc
out of ImpCastExprToType and to the caller site
as appropriate. This is in prep. to do more work for
// rdar://
14569171
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187503
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 31 Jul 2013 16:57:56 +0000 (16:57 +0000)]
Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187502
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 31 Jul 2013 11:14:13 +0000 (11:14 +0000)]
With help from chapuni on IRC, I think this is right now. =] The issue
is that the command is quoted differently from the arguments. The
command has '\' and the argument has '\\'. This is made unclear because
FileCheck escapes the single matched '\' when it prints the contents of
the variable, thus fooling me into thinking it had matched '\\' as
intended. The solution is to bind the gcc_install variable in the
argument list rather than out of the command. To do so we also have to
be a bit more careful so that we don't get stray other things into the
'.*' regex.
Also, because of the argument difference, '\\\\' is the correct
formulation before crtbegin, go back to that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187489
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 31 Jul 2013 10:54:11 +0000 (10:54 +0000)]
Run an experiment to try to understand the windows failure better by
replacing one variable with the regex. This won't fix anything, but will
hopefully shed light on the nature of the failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187488
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 31 Jul 2013 10:34:48 +0000 (10:34 +0000)]
Try only two slashes as that seems to be working elsewhere in this
testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187487
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 31 Jul 2013 10:02:58 +0000 (10:02 +0000)]
Re-enable the cross-linux test on windows after making it tolerant of
the path separator used when locating crtbegin.o.
I'll watch the bots to see if there are other issues lurking here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187486
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 31 Jul 2013 04:56:19 +0000 (04:56 +0000)]
clang/test/Driver/cross-linux.c is suppressed on win32 for now. Investigating.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187483
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 31 Jul 2013 02:20:22 +0000 (02:20 +0000)]
Fixing an unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187474
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Wed, 31 Jul 2013 00:48:10 +0000 (00:48 +0000)]
Fix a crasher than manifests when typo correction suggests a function template.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187467
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 31 Jul 2013 00:37:07 +0000 (00:37 +0000)]
Find a better compromise with the default library search paths used by
Clang when linking and using a GCC installation from a GCC
cross-compiler.
This was desired already by two special case platforms (Android and
Mips), and turns out to be generally (if frustratingly) true. I've added
a substantial comment to the code clarifying the underlying assumptions
of doing actual cross compiles with Clang (or GCC for that matter!) and
help avoid further confusion here.
The end result is to realize that fully general form of PR12478 cannot
be resolved while we support existing cross-compiling GCC toolchains,
and linking with them (namely, linking against their libgcc and
libstdc++ installs). GCC installs these target libraries under
a target-specific prefix but one that may not be available within the
actual sysroot in use. When linking in this world, GCC works and Clang
should as well, but caveat emptor: DSOs from this tree must be
replicated and rpath-fixed to be found at runtime within the sysroot.
I've extended the cross compile test cases to cover these issues by
pointing them at a sysroot and actually checking the library search
paths.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187466
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 31 Jul 2013 00:26:46 +0000 (00:26 +0000)]
Fix read of uninitialized enum value in test, caught by UBSan. No functionality
change, other than removal of undefined behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187465
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 30 Jul 2013 22:37:19 +0000 (22:37 +0000)]
clang-format: Improve detection of templates.
Before:
template <typename... Types>
typename enable_if < 0<sizeof...(Types)>::type Foo() {}
After:
template <typename... Types>
typename enable_if<0 < sizeof...(Types)>::type Foo() {}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187458
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 30 Jul 2013 17:57:09 +0000 (17:57 +0000)]
Start keeping track of what work was done to detect a GCC installation
on the system, and report it when running the driver in verbose mode.
Without this it is essentially impossible to understand why a particular
GCC toolchain is used by Clang for libstdc++, libgcc, etc.
This also required threading a hook through the toolchain layers for
a specific toolchain implementation to print custom information under
'clang -v'. The naming here isn't spectacular. Suggestions welcome.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187427
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 30 Jul 2013 14:29:12 +0000 (14:29 +0000)]
err_attribute_missing_parameter_name has been replaced by err_attribute_argument_type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187420
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 30 Jul 2013 14:10:17 +0000 (14:10 +0000)]
Replacing err_attribute_argument_not_int with err_attribute_not_type_attr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187419
91177308-0d34-0410-b5e6-
96231b3b80d8
Timur Iskhodzhanov [Tue, 30 Jul 2013 09:46:19 +0000 (09:46 +0000)]
Add MicrosoftVFTableContext to AST
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187409
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 30 Jul 2013 07:47:58 +0000 (07:47 +0000)]
clang/test/Driver/qa_override.c: Resurrect a part of r187376. It still requires the feature 'clang-driver' for cygming.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187405
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 30 Jul 2013 01:44:15 +0000 (01:44 +0000)]
Added the notion of Type and TargetSpecific attributes to the clang tablegen. In turn, this fixes a mistake with Ptr32, Ptr64, UPtr and SPtr attribtues generating AST nodes that are never actually used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187401
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 30 Jul 2013 01:31:03 +0000 (01:31 +0000)]
err_attribute_not_string has been subsumed by err_attribute_argument_type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187400
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 30 Jul 2013 00:48:57 +0000 (00:48 +0000)]
Refactor some attributes to use checkFunctionOrMethodArgumentIndex instead of using custom logic. No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187398
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 29 Jul 2013 22:37:42 +0000 (22:37 +0000)]
Remove assert header dependency in test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187387
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Mon, 29 Jul 2013 22:26:10 +0000 (22:26 +0000)]
Simplified SourceManager::translateLineCol a bit.
Reviewers: rsmith
Reviewed By: rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1183
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187386
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 29 Jul 2013 21:26:52 +0000 (21:26 +0000)]
Update for llvm api change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187379
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 29 Jul 2013 20:29:53 +0000 (20:29 +0000)]
Make this test not try to write on object file and test all of the
output rather than just part of it.
Also, remove the frighteningly ancient comment about not working with
the gcc-driver. (!!!)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187376
91177308-0d34-0410-b5e6-
96231b3b80d8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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