Commit Graph

56910 Commits

Author SHA1 Message Date
Daniel Jasper fca735cd58 clang-format: [js] Support ES6 module exports.
Patch by Martin Probst, thank you!

llvm-svn: 229865
2015-02-19 16:14:18 +00:00
Daniel Jasper 354aa51587 clang-format: [js] Support ES6 module imports.
Patch by Martin Probst.

llvm-svn: 229863
2015-02-19 16:07:32 +00:00
Daniel Jasper 6fa9ec7885 clang-format: [js] Do not fall through for JS structural elements.
Patch by Martin Probst. Thank you.

llvm-svn: 229862
2015-02-19 16:03:16 +00:00
Nathan Sidwell 5bb231c279 FIX PR 18432, default args, friends & late-parsed members.
Sema::MergeCXXFunctionDecl: propagate hasUnparsedDefaultArg to new decl.

Parser::HandleMemberFunctionDeclDelays: check hasUnparsedDefaultArg
flag.

Parser::ParseLexedMethodDeclaration: handle inherited unparsed default
arg case.

llvm-svn: 229852
2015-02-19 14:03:22 +00:00
Anton Yartsev 5b5c7cec08 [analyzer] Different handling of alloca().
+ separate bug report for "Free alloca()" error to be able to customize checkers responsible for this error.
+ Muted "Free alloca()" error for NewDelete checker that is not responsible for c-allocated memory, turned on for unix.MismatchedDeallocator checker.
+ RefState for alloca() - to be able to detect usage of zero-allocated memory by upcoming ZeroAllocDereference checker.
+ AF_Alloca family to handle alloca() consistently - keep proper family in RefState, handle 'alloca' by getCheckIfTracked() facility, etc.
+ extra tests.

llvm-svn: 229850
2015-02-19 13:36:20 +00:00
Yaron Keren bc5986fe6a Spelling correction.
llvm-svn: 229839
2015-02-19 11:21:11 +00:00
Daniel Jasper 22a3e79aaf Make -fmodules-decluse and -fmodules-strict-decluse compatible options.
They don't actually influence the result of the module compilation.

llvm-svn: 229834
2015-02-19 09:56:13 +00:00
David Majnemer 12d3783add Mark DR1940 as implemented
llvm-svn: 229829
2015-02-19 07:29:01 +00:00
David Majnemer 6440548434 Mark DR1947 as implemented
llvm-svn: 229828
2015-02-19 07:28:57 +00:00
David Majnemer 7da2302780 Mark DR1948 as implemented
llvm-svn: 229827
2015-02-19 07:28:55 +00:00
David Majnemer 54dc82e1d2 Mark DR1994 as a duplicate of DR529
llvm-svn: 229826
2015-02-19 07:28:52 +00:00
David Majnemer 2dbad01349 Mark DR1968 as implemented
llvm-svn: 229825
2015-02-19 07:28:49 +00:00
NAKAMURA Takumi 8f2085ed16 CXXNameMangler::mangleUnresolvedPrefix(): Prune an obsolete \param, according to r229809. [-Wdocumentation]
llvm-svn: 229823
2015-02-19 07:14:26 +00:00
David Majnemer cb34c67c2a Itanium ABI: Don't pass nullptr to a bool argument
llvm-svn: 229822
2015-02-19 05:51:14 +00:00
Larisse Voufo ee3c1b2a71 Update C++ implementation status page with recent changes w.r.t. to sized deallocation.
llvm-svn: 229818
2015-02-19 04:34:13 +00:00
Alexey Bataev 054829b1bd [MSVC] Improved lookup into dependent/non-dependent bases of dependent class
Patch improves lookup into dependendt bases of dependent class and adds lookup
into non-dependent bases.
Differential Revision: http://reviews.llvm.org/D7173

llvm-svn: 229817
2015-02-19 04:28:23 +00:00
Ben Langmuir 07236733be Revert adding hostname to module hash
I didn't realize how easily the hostname could change - for example just
changing wireless networks seems to prompt it in some cases.

Users can always set their own local module cache path to avoid this.

This reverts commits r228592, 228594, 228601 and 228613.
rdar://19287368

llvm-svn: 229815
2015-02-19 04:03:57 +00:00
Justin Bogner 91f2e3c9c2 InstrProf: Always emit a coverage region for the condition of an if
When tools like llvm-cov show regions, it's much easier to understand
what's happening if the condition of an if shows a counter as well as
the body.

llvm-svn: 229813
2015-02-19 03:10:30 +00:00
Larisse Voufo 62d8aa5caf Fix a test case.
llvm-svn: 229812
2015-02-19 03:03:23 +00:00
Filipe Cabecinhas 54a2ba8b76 [Headers] Add tests for _mm256_insert_epi64 and fix its definition
Summary:
The definition for _mm256_insert_epi64 was taking an int, which would get
truncated before being inserted in the vector.

Original patch by Joshua Magee!

Reviewers: bruno, craig.topper

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7179

llvm-svn: 229811
2015-02-19 03:02:33 +00:00
David Majnemer b8014dd7c0 Itanium ABI: Properly qualify the destructor-name
We didn't have enough qualificaiton before the scope specifier and we
had too much qualification in the destructor name itself.

llvm-svn: 229809
2015-02-19 02:16:16 +00:00
Filipe Cabecinhas ec5d0e6423 Improve our handling of rtti/sanitize=vptr/sanitize=undefined
This patch removes the huge blob of code that is dealing with
rtti/exceptions/sanitizers and replaces it with:

A ToolChain function which, for a given set of Args, figures out if rtti
should be:
  - enabled
  - disabled implicitly
  - disabled explicitly

A change in the way SanitizerArgs figures out what sanitizers to enable
(or if it should error out, or warn);

And a check for exceptions/rtti interaction inside addExceptionArgs.

The RTTIMode algorithm is:
  - If -mkernel, -fapple-kext, or -fno-rtti are passed, rtti was disabled explicitly;
  - If -frtti was passed or we're not targetting the PS4, rtti is enabled;
  - If -fexceptions or -fcxx-exceptions was passed and we're targetting
    the PS4, rtti was enabled implicitly;
  - If we're targetting the PS4, rtti is disabled implicitly;
  - Otherwise, rtti is enabled;

Since the only flag needed to pass to -cc1 is -fno-rtti if we want to
disable it, there's no problem in saying rtti is enabled if we're
compiling C code, so we don't look at the input file type.

addExceptionArgs now looks at the RTTIMode and warns that rtti is being
enabled implicitly if targetting the PS4 and exceptions are on. It also
errors out if, targetting the PS4, -fno-rtti was passed, and exceptions
were turned on.

SanitizerArgs now errors out if rtti was disabled explicitly and the vptr
sanitizer was enabled implicitly, but just turns off vptr if rtti is
disabled but -fsanitize=undefined was passed.

Also fixed tests, removed duplicate name from addExceptionArgs comment,
and added one or two surrounding lines when running clang-format.
This changes test/Driver/fsanitize.c to make it not expect a warning when
passed -fsanitize=undefined -fno-rtti, but expect vptr to not be on.

Removed all users and definition of SanitizerArgs::sanitizesVptr().

Reviewers: samsonov

Subscribers: llvm-commits, samsonov, rsmith

Differential Revision: http://reviews.llvm.org/D7525

llvm-svn: 229801
2015-02-19 01:04:49 +00:00
Richard Smith 64ecacf6cb PR22566: a conversion from a floating-point type to bool is a narrowing conversion.
llvm-svn: 229792
2015-02-19 00:39:05 +00:00
Richard Smith 11152dd55f Allow errors on use of a private module header to be disabled, to better support incremental transition to modules.
llvm-svn: 229788
2015-02-19 00:10:28 +00:00
Jacques Pienaar fc27511223 clang-format: Space and triple angle braces.
Committing patch http://reviews.llvm.org/D6800.

llvm-svn: 229783
2015-02-18 23:48:37 +00:00
Alexey Samsonov f29e3f0791 Remove support for building sanitizers from Makefile/autoconf build on Linux.
This is a re-application of r229554 restricted to Linux build only.
Apple still uses Makefile/autoconf to build Clang and sanitizers.

llvm-svn: 229755
2015-02-18 22:26:22 +00:00
Alexey Samsonov 3a433f62fb [docs] Recommend to use CMake for building sanitizers.
llvm-svn: 229754
2015-02-18 22:26:20 +00:00
Justin Bogner bf42cfd75f InstrProf: Rewrite most of coverage mapping generation in a simpler way
The coverage mapping generation code previously generated a large
number of redundant coverage regions and then tried to merge similar
ones back together. This then relied on some awkward heuristics to
prevent combining of regions that were importantly different but
happened to have the same count. The end result was inefficient and
hard to follow.

Now, we more carefully create the regions we actually want. This makes
it much easier to create regions at precise locations as well as
making the basic approach quite a bit easier to follow. There's still
a fair bit of complexity here dealing with included code and macro
expansions, but that's pretty hard to avoid without significantly
reducing the quality of data we provide.

I had to modify quite a few tests where the source ranges became more
precise or the old ranges seemed to be wrong anyways, and I've added
quite a few new tests since a large number of constructs didn't seem
to be tested before.

llvm-svn: 229748
2015-02-18 21:24:51 +00:00
Benjamin Kramer 60b6f4f02b Remove unused diagnostic.
llvm-svn: 229729
2015-02-18 19:30:34 +00:00
David Majnemer a16d4707bc Itanium ABI: Write a character instead of a string literal
No functional change intended.

llvm-svn: 229726
2015-02-18 19:08:14 +00:00
David Majnemer eed9c8bb44 Itanium ABI: Restore disabled tests which are correctly mangled
llvm-svn: 229725
2015-02-18 19:08:12 +00:00
David Majnemer f8c02e6bfb Itanium ABI: Properly mangle extern "C" template arguments
extern "C" declarations should be considered like global declarations
for mangling purposes.

Differential Revision: http://reviews.llvm.org/D7718

llvm-svn: 229724
2015-02-18 19:08:11 +00:00
Benjamin Kramer 33cd6dcf87 Driver: Fix use of dangling std::string temporary
What's going on here is that the ternary operator produces a std::string rvalue
that the StringRef points to. I'd hoped bugs like this were a thing of the past
with our asan testing but apparently this code path is only used when LLVM is
configured with a custom --with-c-include-dirs setting.

Unbreaks bootstrapping with GCC5 on Fedora (PR22625), patch by Jonathan Wakely!

llvm-svn: 229719
2015-02-18 18:45:54 +00:00
Meador Inge 34e79ed319 Sema: Allow 'constexpr' variables in range loops
This fixes PR22492, which is in response to CWG issue #1204.
Per the CWG issue 'contexpr' variables are now allowed in
for range loops.

llvm-svn: 229716
2015-02-18 18:34:59 +00:00
Daniel Jasper 3c42dba2dc clang-format: [JS] support AtScript style annotations for JS.
Based on Java annotation support and style.

Patch by Martin Probst.

llvm-svn: 229703
2015-02-18 17:17:15 +00:00
Daniel Jasper 8370908667 clang-format: [JS] Support classes.
This adds support for JavaScript class definitions (again following
TypeScript & AtScript style). This only required support for
visibility modifiers in JS, everything else was already working.

Patch by Martin Probst, thank you.

llvm-svn: 229701
2015-02-18 17:14:05 +00:00
Daniel Jasper b10bdff337 clang-format: [JS] Support type annotations.
This patch adds support for type annotations that follow TypeScript's,
Flow's, and AtScript's syntax style.

Patch by Martin Probst, thank you.
Review: http://reviews.llvm.org/D7721

llvm-svn: 229700
2015-02-18 17:09:53 +00:00
Zoran Jovanovic 26a1216a74 Change representation of member function pointers for MIPS targets
Differential Revision: http://reviews.llvm.org/D7148

llvm-svn: 229680
2015-02-18 15:21:35 +00:00
Daniel Sanders 933f0a04d3 Fix test/CodeGen/atomic_ops.c failure on clang-cmake-mips builder (and others).
Not all targets generate 'store atomic' instructions for
'_Atomic(_Complex int)'. Some targets use the __atomic_store builtin instead. 

This commit makes the test accept either one.

llvm-svn: 229676
2015-02-18 15:08:37 +00:00
Daniel Jasper c0b7c80fe6 Prevent use after free caused by accessing a member into a dense set.
The member gets invalidated as elements are added to the dense set. Directly
access the underlying pointer instead. Not sure how to create a test case for
this :-(. Maybe Richard can help.

llvm-svn: 229673
2015-02-18 14:13:46 +00:00
Bradley Smith d86d670e85 [ARM] Add missing M/R class CPUs
Add some of the missing M and R class Cortex CPUs, namely:

Cortex-M0+ (called Cortex-M0plus for GCC compatibility)
Cortex-M1
SC000
SC300
Cortex-R5

llvm-svn: 229661
2015-02-18 10:34:48 +00:00
David Majnemer 7ff7eb706a Itanium ABI: Mangle <mangled-name> according to the ABI
We attempted to be compatible with GCC's buggy mangling for templates
with a declaration for a template argument.

However, we weren't completely successful in copying their bug in cases
like:
  char foo;
  template <char &C> decltype(C) f() { return foo; };
  template char &f<foo>();

Instead, just follow the ABI specification.  This fixes PR22621.

llvm-svn: 229644
2015-02-18 07:47:09 +00:00
Nico Weber 4486d61c03 Port r163224 to C++.
The motivation is to fix a crash on

  struct S {} s;
  Foo S::~S() { s.~S(); }

What was happening here was that S::~S() was marked as invalid since its
return type is invalid, and as a consequence CheckFunctionDeclaration() wasn't
called and S::~S() didn't get merged into S's implicit destructor.  This way,
the class ended up with two destructors, which confused the overload printer
when it suddenly had to print two possible destructors for `s.~S()`.

In addition to fixing the crash, this change also seems to improve diagnostics
in a few other places, see test changes.

Crash found by SLi's bot.

llvm-svn: 229639
2015-02-18 05:19:40 +00:00
Nico Weber 6b05f386c8 Wrap to 80 columns. No behavior change.
llvm-svn: 229637
2015-02-18 04:53:03 +00:00
Saleem Abdulrasool b47d606e17 Sema: partially address post-commit comments
Un-parameterize the warning as there is exactly one attribute added in C++14.
Partially addresses post-commit review comments from Richard Smith.

llvm-svn: 229636
2015-02-18 04:33:26 +00:00
David Majnemer 5927e7b681 CodeGen: Relax a FileCheck line for SystemZ
llvm-svn: 229617
2015-02-18 02:28:15 +00:00
David Majnemer be52539650 Sema: size_t is available in C when -fms-compatibility is enabled
llvm-svn: 229616
2015-02-18 02:28:13 +00:00
David Majnemer a88b359fdc Itanium ABI: Improve our mangling of <destructor-name>
Our mangling of <destructor-name> wasn't quite right: we'd introduce
mangling substitutions where one shouldn't be possible.  We also didn't
correctly handle the case where the destroyed type was not dependent but
still a TemplateSpecializationType.

N.B. There isn't a mangling for a template-template parameter showing up
as the destroyed type.  We do the 'obvious' thing and mangle the index
of the parameter.

llvm-svn: 229615
2015-02-18 02:28:01 +00:00
Larisse Voufo e990a3f60c Rename flags and options to match current naming: from -fdef-sized-delete to -fdefine-sized-deallocation, and from DefaultSizedDelete to DefineSizedDeallocation.
llvm-svn: 229597
2015-02-18 01:04:10 +00:00
Anton Yartsev e5c0c14213 [analyzer] Refactoring: clarified the way the proper check kind is chosen.
llvm-svn: 229593
2015-02-18 00:39:06 +00:00