Commit Graph

46874 Commits

Author SHA1 Message Date
Craig Topper ad5ccc2d75 Remove more odd code that tries to account for an off by 1 problem in vec3 shuffles that doesn't really exist.
llvm-svn: 187561
2013-08-01 06:59:29 +00:00
Craig Topper b9b7ea697b Fix to handle all non-power-of-2 vector sizes in the mask form of _builtin_shuffle_vector.
Previously a 2-bit mask was used to mask each element of a vec6 mask before doing the extracts instead of 3-bit mask necessary to cover 0-5. vec3 was the only non-power-of-2 that worked correctly because a +1 conditionally added before calculating floor(log2(elements)).

llvm-svn: 187560
2013-08-01 06:42:40 +00:00
David Majnemer a4f7c7a600 Sema: Diagnose explicitly bound unresolved member expressions decaying into pointers to function type
We would disallow the case where the overloaded member expression is
coming from an address-of operator but we wouldn't issue any diagnostics
when the overloaded member expression comes by way of a function to
pointer decay cast.

Clang's implementation of DR61 is now seemingly complete.

llvm-svn: 187559
2013-08-01 06:13:59 +00:00
Craig Topper 0ed37bd525 Remove broken and unnecessary vec3 handling from VisitShuffleVectorExpr.
llvm-svn: 187558
2013-08-01 04:51:48 +00:00
David Majnemer 23252a3672 Parse: Don't consider attributes of broken member declarators
ParseCXXClassMemberDeclaration was trying to use the result of
ActOnCXXMemberDeclarator to attach it to some late parsed attributes.

However when failures arise, we have no decl to attach to which
eventually leads us to a NULL pointer dereference.

While we are here, clean up the code a bit.

Fixes PR16765

llvm-svn: 187557
2013-08-01 04:22:55 +00:00
Richard Smith b71782b7e5 Fix assert when instantiating a default argument of a template defined in a
module.

llvm-svn: 187556
2013-08-01 04:12:04 +00:00
Hans Wennborg 39afc19fc2 Remove the SUPPORT_ALIASARGS define
It is not needed after LLVM r187546.

llvm-svn: 187550
2013-08-01 00:12:13 +00:00
Daniel Jasper 552f4a7e27 clang-format: Make alignment of trailing comments optional ..
.. in order to support WebKit style properly.

llvm-svn: 187549
2013-07-31 23:55:15 +00:00
Hans Wennborg 28c96319c8 Make -m[no-]pascal-strings an alias of -f[no]pascal-strings in the .td file
This way we don't have to translate it manually in Clang::ConstructJob.

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

llvm-svn: 187547
2013-07-31 23:39:13 +00:00
Fariborz Jahanian 3a25d0d593 ObjectiveC ARC: finishing off issuing error when
retainable pointer is passed to an audited CF function
expecting CF type. // rdar://14569171

llvm-svn: 187543
2013-07-31 23:19:34 +00:00
Daniel Jasper 65ee347285 clang-format: Add more options to namespace indentation.
With this patch, clang-format can be configured to:
* not indent in namespace at all (former behavior).
* indent in namespace as in other blocks.
* indent only in inner namespaces (as required by WebKit style).

Also fix alignment of access specifiers in WebKit style.

Patch started by Marek Kurdej. Thank you!

llvm-svn: 187540
2013-07-31 23:16:02 +00:00
Hans Wennborg 212e7ec772 Option parsing tables: pick up AliasArgs from the OPTION macro.
This depends on LLVM r187537.

The SUPPORT_ALIASARGS macro will be removed once all option parsing
clients have been updated.

llvm-svn: 187538
2013-07-31 23:07:21 +00:00
Fariborz Jahanian 25eef19b48 ObjectiveC ARC: Do not issue bridge cast diagnostic when
passing a retainable object arg to a CF audited function
expecting a CF object type. Issue a normal type mismatch
diagnostic. This is wip // rdar://14569171

llvm-svn: 187532
2013-07-31 21:40:51 +00:00
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
Fariborz Jahanian 48d94c8d76 ObjectiveC arc: minor refactoring in my last patch
to avoid future false positives. // rdar://14569171

llvm-svn: 187509
2013-07-31 18:39:08 +00:00
Fariborz Jahanian 131996b169 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

llvm-svn: 187508
2013-07-31 18:21:45 +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
Fariborz Jahanian 374089e7b8 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 

llvm-svn: 187503
2013-07-31 17:12:26 +00:00
Hans Wennborg ec99382b54 Fix a comment.
llvm-svn: 187502
2013-07-31 16:57:56 +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
Aaron Ballman 080cad730a Fixing an unused variable warning.
llvm-svn: 187474
2013-07-31 02:20:22 +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
Richard Smith 629ff3628a Fix read of uninitialized enum value in test, caught by UBSan. No functionality
change, other than removal of undefined behavior.

llvm-svn: 187465
2013-07-31 00:26:46 +00:00
Daniel Jasper 62c0ac0acf 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() {}

llvm-svn: 187458
2013-07-30 22:37:19 +00:00
Chandler Carruth 0ae39aaefd 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.

llvm-svn: 187427
2013-07-30 17:57:09 +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 0979e9e130 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.
llvm-svn: 187401
2013-07-30 01:44:15 +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
Alexander Kornienko 6d8cf83a4d Simplified SourceManager::translateLineCol a bit.
Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits

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

llvm-svn: 187386
2013-07-29 22:26:10 +00:00
Rafael Espindola 073ff10138 Update for llvm api change.
llvm-svn: 187379
2013-07-29 21:26:52 +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
Rafael Espindola 74ca78ed9b Convert a use of status with llvm::sys::fs::getUniqueID.
llvm-svn: 187367
2013-07-29 18:43:40 +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
Rafael Espindola e4777f4638 Convert a use of stat with sys::fs::status.
llvm-svn: 187364
2013-07-29 18:22:23 +00:00
Rafael Espindola ee30546c00 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!

llvm-svn: 187359
2013-07-29 15:47:24 +00:00
Craig Topper baca389e28 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.

llvm-svn: 187344
2013-07-29 06:47:04 +00:00