Commit Graph

57107 Commits

Author SHA1 Message Date
Manuel Klimek 27ee25f738 Make -Wuninitialized warn on pointer-to-member and comma operators.
`isTrackedVar` has been updated to also track records.
`DeclRefExpr`s appearing on the left side of a comma operator are
ignored, while those appearing on the right side are classified as
`Use`.

Patch by Enrico Pertoso.

llvm-svn: 231068
2015-03-03 14:54:25 +00:00
Manuel Klimek 2d29340095 Make sure we initialize all values in WhitespaceManager::Change.
llvm-svn: 231067
2015-03-03 14:21:48 +00:00
Daniel Jasper 0391e55650 clang-format: Fix access to uninitialized memory.
With incomplete code, we aren't guaranteed to generated changes for
every token. In that case, we need to assume that even the very first
change can continue a preprocessor directive and initialize values
accordingly.

llvm-svn: 231066
2015-03-03 13:59:49 +00:00
Daniel Jasper 34d761d893 Revert r231008 (and dependent r231019).
As Chandler responded on the initial commit, just directly setting the
triple through -Xclang option to the driver creates havoc on other
platforms. The driver test should specifically go into test/Driver and
test the cc1 commandline itself.

llvm-svn: 231063
2015-03-03 10:02:53 +00:00
Argyrios Kyrtzidis f0b4cd1ed3 [ASTUnit] Fix crash when trying to load a module file via ASTUnit::LoadFromASTFile.
rdar://19997358

llvm-svn: 231060
2015-03-03 08:04:19 +00:00
David Majnemer fba75df599 Sema: Caught exception objects should be unqualified
The exception object should be unqualified.  Using a qualified exception
object results in the wrong copy constructor getting called when the
catch handler executes.

llvm-svn: 231054
2015-03-03 04:38:34 +00:00
Nico Weber a3ef8cad11 Remove obsolete FIXME. override on definitions is fine.
llvm-svn: 231053
2015-03-03 03:31:15 +00:00
David Majnemer d09a51c299 Sema: Properly initialize the thrown exception object
We would create the exception object with the wrong qualifiers, ensuring
that the wrong copy constructor would get called.

llvm-svn: 231049
2015-03-03 01:50:05 +00:00
Alexey Samsonov 042e51823b [Sanitizers] Remove duplication in sanitizer group definition. NFC.
There is no need to list sanitizers in both "UndefinedTrap" and
"Undefined" groups - it turns out using one group in a defintion
of another group "just works".

llvm-svn: 231040
2015-03-03 00:14:32 +00:00
Matthias Braun dae4bac847 Fix typo in my last commit.
llvm-svn: 231039
2015-03-03 00:12:08 +00:00
Fariborz Jahanian 7b012d3728 [SDK modernizer] Patch to fix type of the typed enums when
migrating to NS_ENUM typedef. rdar://19994496

llvm-svn: 231036
2015-03-02 23:58:02 +00:00
Reid Kleckner 1bc469f0fc Remove shell requirement from test/Modules/explicit-build-relpath.cpp
It only relies on 'cd', which the internal shell has now.

llvm-svn: 231031
2015-03-02 22:55:01 +00:00
Reid Kleckner 83fb85c8f0 Revert bad change from r231029
llvm-svn: 231030
2015-03-02 22:50:09 +00:00
Reid Kleckner acbd23adf1 Remove shell requirements from tests that use 'cd'
Modules and Tooling tests in particular tend to want to change the cwd,
so we were missing test coverage in this area on Windows. It should now
be easier to write such portable tests.

llvm-svn: 231029
2015-03-02 22:42:58 +00:00
Hans Wennborg e215594013 clang-cl: Correctly ignore /openmp- (PR22748)
llvm-svn: 231026
2015-03-02 22:09:05 +00:00
Sanjoy Das edadecbe66 Fix test case.
r230921 broke backend-optimization-failure.cpp: after
r230921, LLVM no longer emits an expression to compute 'Length - 1'
and this perturbs LoopSimplify enough to emit the warning on line 10
instead of line 9.  This is a review request to fix the test case once
I re-land r230921.

llvm-svn: 231020
2015-03-02 21:47:47 +00:00
Fariborz Jahanian 6d2cd611bb Attempt to fix buildbot.
llvm-svn: 231019
2015-03-02 21:46:17 +00:00
Matthias Braun e0fc8cabda Improve robustness of dependency-generation-crash.c test.
The test wants to provoke a failure when opening the output file.
Using chmod 0 on the output file does not work reliably on all
filesystems or when running the test as root.
Change the test to use a nonexistant directory instead.

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

llvm-svn: 231009
2015-03-02 20:44:09 +00:00
Fariborz Jahanian 4c616d4df5 [SDK modernizer]. Patch fixes driver's lack of
recognition of mernizer's -objcmt-migrate-property-dot-syntax
option. rdar://19994452

llvm-svn: 231008
2015-03-02 20:43:32 +00:00
Filipe Cabecinhas 1f72a0006c Add -fexceptions for targets where it isn't the default.
It still tests that objc++-cpp-output turns on -fcxx-exceptions and
-fobjc-exceptions by being a c++ and objc(++) file.

llvm-svn: 230992
2015-03-02 19:11:53 +00:00
Bob Wilson b111ec94b3 Add clang support for Objective-C application extensions.
This adds the -fapplication-extension option, along with the
ios_app_extension and macosx_app_extension availability attributes.
Patch by Ted Kremenek

llvm-svn: 230989
2015-03-02 19:01:14 +00:00
Filipe Cabecinhas 5c5c00b7da Add -frtti and -fexceptions to tests that assume these are on.
Summary:
We now have targets that don't enable rtti/exceptions by default, and the
ASTMatchers tests are assuming that these features are on (e.g: They use
dynamic_cast or try).

Reviewers: klimek, thakis, djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 230984
2015-03-02 18:49:37 +00:00
Benjamin Kramer 83b1bf3a27 CodeGen: Fix passing of classes with only one AVX vector member in AVX registers
isSingleElementStruct was a bit too tight in its definition of struct
so we got a mismatch between classify() and the actual code generation.
To make matters worse the code in GetByteVectorType still defaulted to
<2 x double> if it encountered a type it didn't know, making this a
silent miscompilation (PR22753).

Completely remove the "preferred type" stuff from GetByteVectorType and
make it fail an assertion if someone tries to use it with a type not
suitable for a vector register.

llvm-svn: 230971
2015-03-02 16:09:24 +00:00
Benjamin Kramer 39ccabe500 Replace loop with equivalent ArrayRef function. NFC.
llvm-svn: 230949
2015-03-02 11:57:06 +00:00
Daniel Jasper e662316994 clang-format: Prefer wrapping a lambda's body over the lambda's return type.
Before:
  aaaaaaaaaaaaaaaaaaaaaa(
      [](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa)
          -> aaaaaaaaaaaaaaaaaaaaa { return aaaaaaaaaaaaaaaaa; });

After:
  aaaaaaaaaaaaaaaaaaaaaa(
      [](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa) -> aaaaaaaaaaaaaaaaaaaaa {
        return aaaaaaaaaaaaaaaaa;
      });

llvm-svn: 230942
2015-03-02 10:35:13 +00:00
Nico Weber f609839244 Fix ObjCInterfaceDecl::getCategoryMethod() and give it a caller. No behavior change.
llvm-svn: 230928
2015-03-02 01:12:28 +00:00
Peter Collingbourne d251b0a60e DebugInfo: Give externally defined types a size and alignment where
possible. Fixes PR22736.

llvm-svn: 230914
2015-03-01 22:07:04 +00:00
Benjamin Kramer 33335df819 Add missing include.
llvm-svn: 230910
2015-03-01 21:36:40 +00:00
Daniel Jasper bea1ab46d9 clang-format: Always align */& in multi-var DeclStmts.
Seems like the most consistent thing to do and in multi-var DeclStmts,
it is especially important to point out that the */& bind to the
identifier.

llvm-svn: 230903
2015-03-01 18:55:26 +00:00
Benjamin Kramer e0ca6e1375 Sema: Remove stray static
This is a real bug if the code path is ever used with different pointer
sizes in the same process.

llvm-svn: 230893
2015-03-01 18:09:50 +00:00
Richard Smith 8825f280e1 Add change accidentally missed from r230840.
llvm-svn: 230843
2015-02-28 09:58:41 +00:00
Filipe Cabecinhas d0dc529da3 Add PS4's autolink syntax to autolink.m's CHECK lines.
llvm-svn: 230841
2015-02-28 07:35:07 +00:00
Richard Smith c3a532576c [modules] Avoid adding a redecl chain to the 'pending out of date' list as the
very first step in updating it.

llvm-svn: 230840
2015-02-28 05:57:02 +00:00
Richard Smith 37bd29a5e6 Give better diagnostics when -fmodule-file= finds a bad file: if the file is
found indirectly, explain how we got there, and distinguish between 'file not
found' and 'file found but invalid'.

llvm-svn: 230839
2015-02-28 03:09:52 +00:00
Richard Smith 36befcee75 [modules] Deduplicate when merging lists of template specializations from imported modules.
llvm-svn: 230834
2015-02-28 01:45:19 +00:00
Richard Smith 91c18de755 Rework our handling of key functions. We used to track a complete list of all
dynamic classes in the translation unit and check whether each one's key
function is defined when we got to the end of the TU (and when we got to the
end of each module). This is really terrible for modules performance, since it
causes unnecessary deserialization of every dynamic class in every compilation.

We now use a much simpler (and, in a modules build, vastly more efficient)
system: when we see an out-of-line definition of a virtual function, we check
whether that function was in fact its class's key function. (If so, we need to
emit the vtable.)

llvm-svn: 230830
2015-02-28 01:01:56 +00:00
Saleem Abdulrasool cd187f033e DebugInfo: hoist definition into global context when needed
When generating debug info for a static inline member which is initialized for
the DLLExport storage class, hoist the definition into a non-composite type
context. Otherwise, we would trigger an assertion when generating the DIE for
the associated global value as the debug context has a type association. This
addresses PR22669.

Thanks to David Blakie for help in coming up with a solution to this!

llvm-svn: 230816
2015-02-28 00:13:13 +00:00
Richard Smith 509fc85b4e [modules] When writing out a list of specializations for a template, if we have
undeserialized specializations (because we merged an imported declaration of
the same template since we last added one), don't bother reading in the
specializations themselves just so we can write out their IDs again.

llvm-svn: 230805
2015-02-27 23:05:10 +00:00
David Blaikie a953f2825b Update Clang tests to handle explicitly typed load changes in LLVM.
llvm-svn: 230795
2015-02-27 21:19:58 +00:00
Richard Smith 78bea7395f [modules] Avoid the possibility of a redeclaration chain not being marked 'up
to date' after it gets updated.

llvm-svn: 230789
2015-02-27 20:14:19 +00:00
David Blaikie 218b783192 Update Clang tests to handle explicitly typed gep changes in LLVM.
llvm-svn: 230783
2015-02-27 19:18:17 +00:00
Nico Weber 6bdd9b0608 Reland __leave tests (r230717 and r230720, reverted in r230740).
The only change is that line 266 changed from
    // CHECK:  br label %[[except]]
to
    // CHECK:  br label %[[except:[^ ]*]]

llvm-svn: 230764
2015-02-27 16:40:43 +00:00
Renato Golin 9ba392351e Add __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind instructions.
Equally to NetBSD, Bitrig will be using .eh_frame unwinding on ARM.

Patch by Patrick Wildt.

llvm-svn: 230763
2015-02-27 16:35:48 +00:00
Tom Stellard fded50f2f9 AMDGCN: Define cl_khr_fp64 when compiling OpenCL programs
llvm-svn: 230761
2015-02-27 15:10:19 +00:00
Aaron Ballman 152ad170b8 Silence an MSVC warning about not all control paths returning a value; NFC.
llvm-svn: 230754
2015-02-27 13:55:58 +00:00
Daniel Jasper 308062bd0d clang-format: Make trailing commas in array inits force one per line.
Before:
  NSArray *array = @[ @"a", @"a", ];

After:
  NSArray *array = @[
    @"a",
    @"a",
  ];

llvm-svn: 230741
2015-02-27 08:41:05 +00:00
Daniel Jasper 7fe82ad80b Revert r230717 (and subsequent r230720).
The tests keeps failing on build bots:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/2355/testReport/junit/Clang/CodeGen/exceptions_seh_leave_c/

llvm-svn: 230740
2015-02-27 08:16:32 +00:00
Craig Topper b1bc5cf4bc [X86] Remove pblendw and pblendd builtins that aren't being used by the intrinsic headers.
llvm-svn: 230738
2015-02-27 06:54:25 +00:00
Alexey Bataev b832926176 [OPENMP] Codegen for "#pragma omp atomic write"
For global reg lvalue - use regular store through global register.
For simple lvalue - use simple atomic store.
For bitfields, vector element, extended vector elements - the original value of the whole storage (for vector elements) or of some aligned value (for bitfields) is atomically read, the part of this value for the given lvalue is modified and then use atomic compare-and-exchange operation to try to atomically write modified value (if it was not modified).
Also, changes in this patch fix the bug for '#pragma omp atomic read' applied to extended vector elements.
Differential Revision: http://reviews.llvm.org/D7369

llvm-svn: 230736
2015-02-27 06:33:30 +00:00
Richard Smith 4a7e390c12 [modules] Don't write out name lookup table entries merely because the module
happened to query them; only write them out if something new was added.

llvm-svn: 230727
2015-02-27 03:40:09 +00:00