Commit Graph

19137 Commits

Author SHA1 Message Date
Reid Kleckner a09e44c75d Fix declaring class template methods with an attributed typedef
This change unifies the logic for template instantiation of methods and
functions declared with typedefs.

It ensures that SubstFunctionType() always fills the Params out param
with non-null ParmVarDecls or returns null.

Reviewers: rsmith

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

llvm-svn: 187528
2013-07-31 21:00:18 +00:00
Hans Wennborg 1907610d4e 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

llvm-svn: 187527
2013-07-31 20:51:53 +00:00
Kaelyn Uhrain 957c8b1c70 A few small cleanups to r187504. Thanks to dblaikie for the assist.
llvm-svn: 187521
2013-07-31 20:16:17 +00:00
Kaelyn Uhrain 0c51de4ab1 Improve the diagnostic experience, including adding recovery, for
changing '->' to '.' when there is no operator-> defined for a class.

llvm-svn: 187504
2013-07-31 17:38:24 +00:00
Chandler Carruth cc512ed678 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.

llvm-svn: 187489
2013-07-31 11:14:13 +00:00
Chandler Carruth 8cf38db199 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.

llvm-svn: 187488
2013-07-31 10:54:11 +00:00
Chandler Carruth 8f8729446f Try only two slashes as that seems to be working elsewhere in this
testcase.

llvm-svn: 187487
2013-07-31 10:34:48 +00:00
Chandler Carruth d5bb1b511c 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.

llvm-svn: 187486
2013-07-31 10:02:58 +00:00
NAKAMURA Takumi 8cefa8275a clang/test/Driver/cross-linux.c is suppressed on win32 for now. Investigating.
llvm-svn: 187483
2013-07-31 04:56:19 +00:00
Richard Trieu 2ac682a671 Fix a crasher than manifests when typo correction suggests a function template.
llvm-svn: 187467
2013-07-31 00:48:10 +00:00
Chandler Carruth 7f8042c8f3 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.

llvm-svn: 187466
2013-07-31 00:37:07 +00:00
Aaron Ballman 9744ffd652 err_attribute_missing_parameter_name has been replaced by err_attribute_argument_type.
llvm-svn: 187420
2013-07-30 14:29:12 +00:00
Aaron Ballman 9d695091fd Replacing err_attribute_argument_not_int with err_attribute_not_type_attr
llvm-svn: 187419
2013-07-30 14:10:17 +00:00
Timur Iskhodzhanov df7e7fb642 Add MicrosoftVFTableContext to AST
llvm-svn: 187409
2013-07-30 09:46:19 +00:00
NAKAMURA Takumi 2c6cf7d54a clang/test/Driver/qa_override.c: Resurrect a part of r187376. It still requires the feature 'clang-driver' for cygming.
llvm-svn: 187405
2013-07-30 07:47:58 +00:00
Aaron Ballman 3bf758cd65 err_attribute_not_string has been subsumed by err_attribute_argument_type.
llvm-svn: 187400
2013-07-30 01:31:03 +00:00
Aaron Ballman be50eb86e6 Refactor some attributes to use checkFunctionOrMethodArgumentIndex instead of using custom logic. No functional changes intended.
llvm-svn: 187398
2013-07-30 00:48:57 +00:00
David Blaikie 4bc4751755 Remove assert header dependency in test
llvm-svn: 187387
2013-07-29 22:37:42 +00:00
Chandler Carruth 35e64ba03a 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. (!!!)

llvm-svn: 187376
2013-07-29 20:29:53 +00:00
Richard Smith 1235a8dac6 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'.

llvm-svn: 187374
2013-07-29 20:14:16 +00:00
Hans Wennborg 4a9ca978b0 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.

llvm-svn: 187366
2013-07-29 18:40:38 +00:00
David Blaikie 021221db7c Support for Thread Safety Analysis in C
Patch by Ethan Jackson.

llvm-svn: 187365
2013-07-29 18:24:03 +00:00
NAKAMURA Takumi c91dd312a4 clang/test/Driver/cl.c: Don't attempt slash switches on msys bash.
llvm-svn: 187337
2013-07-29 01:37:10 +00:00
Rafael Espindola 9f0da2f152 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

llvm-svn: 187330
2013-07-28 17:13:24 +00:00
Rafael Espindola 5150f2f558 Avoid crashing if a directory has no pch files.
Should fix some of the bots that have assertions disabled.

llvm-svn: 187329
2013-07-28 13:23:37 +00:00
Hans Wennborg 944780974e 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.

llvm-svn: 187295
2013-07-27 06:19:03 +00:00
Hans Wennborg 6ddc6901ef 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

llvm-svn: 187280
2013-07-27 00:23:45 +00:00
Eli Friedman 3fd26b8514 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.

llvm-svn: 187276
2013-07-26 23:47:47 +00:00
Richard Smith 1836e60023 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.

llvm-svn: 187275
2013-07-26 23:45:07 +00:00
Richard Smith fff926670b 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'.
llvm-svn: 187266
2013-07-26 22:53:54 +00:00
Adrian Prantl ca64c3e136 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

llvm-svn: 187240
2013-07-26 20:42:57 +00:00
Argyrios Kyrtzidis b534d3a0ef [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

llvm-svn: 187230
2013-07-26 18:38:12 +00:00
Argyrios Kyrtzidis 17ff2e577f [frontend] '-frewrite-includes' should not ignore headers included from command-line.
rdar://14556182

llvm-svn: 187207
2013-07-26 15:32:04 +00:00
Rafael Espindola 98bbc0241b Add not to a command that is expected to fail.
llvm-svn: 187203
2013-07-26 14:10:55 +00:00
Pavel Labath e4e308625a Fix tests on targets that don't support thread_local
This also reverts r187197.

llvm-svn: 187199
2013-07-26 12:50:30 +00:00
Rafael Espindola 81d648827f Add a triple. Should fix the windows bots.
llvm-svn: 187197
2013-07-26 12:40:55 +00:00
Pavel Labath cf878bbe65 [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

llvm-svn: 187196
2013-07-26 11:50:42 +00:00
NAKAMURA Takumi ead9b7de86 Rework r187192, to tweak expressions to be tolerant of DOSish paths. XFAILs can be removed.
llvm-svn: 187194
2013-07-26 10:13:27 +00:00
NAKAMURA Takumi 23f1e88b0f clang/test/Driver/linux-header-search.cpp: Add XFAILs, for now. I'll fix them later.
llvm-svn: 187192
2013-07-26 08:28:35 +00:00
Eli Friedman e701520ab3 Fix test for Release builds.
Attempt 2.  Sorry about the noise.

llvm-svn: 187183
2013-07-26 02:04:44 +00:00
Bill Schmidt 778d387684 [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.

llvm-svn: 187180
2013-07-26 01:36:11 +00:00
Eli Friedman db8ea01c43 Fix test for Release builds.
llvm-svn: 187178
2013-07-26 01:21:11 +00:00
Eli Friedman efe9fa62f5 Tighten type-checking for vector attributes.
Based on patch by Yunzhong Gao.

llvm-svn: 187176
2013-07-26 00:53:47 +00:00
Eli Friedman bf44f366a1 Fix gcc search for cross-compiler on Ubuntu 13.04.
Just more craziness to find crtbegin.o etc.

Patch by Stephen Kelly.

llvm-svn: 187175
2013-07-26 00:53:40 +00:00
Eli Friedman f24bd3bdba 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.

llvm-svn: 187174
2013-07-26 00:53:29 +00:00
Eli Friedman ab09187553 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. :)

llvm-svn: 187172
2013-07-26 00:06:45 +00:00
Eli Friedman 602577569d Move friend warning into CXX11 warning group.
Also, fix the wording to reflect this.

llvm-svn: 187171
2013-07-26 00:06:39 +00:00
Richard Smith 0e5d7b8c6b 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.

llvm-svn: 187167
2013-07-25 23:08:39 +00:00
David Blaikie 9260ed6c06 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.

llvm-svn: 187156
2013-07-25 21:19:01 +00:00
Rafael Espindola 9d910f9ac3 Remove the mblaze backend from clang.
Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html

llvm-svn: 187143
2013-07-25 18:42:13 +00:00