Commit Graph

40786 Commits

Author SHA1 Message Date
Benjamin Kramer 9a9efbafa7 [Modules] Wrap the main ModuleManager visitor in a function_ref.
Avoids the awkward passing of an opaque void *UserData argument. No
functional change intended.

llvm-svn: 243213
2015-07-25 12:14:04 +00:00
David Majnemer bac941c4b1 [clang-cl] Add fallback support for /Zl
llvm-svn: 243207
2015-07-25 06:07:59 +00:00
David Majnemer 6cd35912c0 [CodeGen] Don't UBSan-ize the argument to __builtin_frame_address
__builtin_frame_address requires its argument to be a constant
expression which already implies that it cannot have undefined behavior.
However, we used EmitScalarExpr to emit the argument causing UBSan to
try to check for overflow.

Instead, use the constant expression emission system.

This fixes PR24256.

llvm-svn: 243206
2015-07-25 05:57:24 +00:00
Davide Italiano 922b702bf9 [SemaTemplate] Detect instantiation of unparsed exceptions.
This fixes the clang crash reported in PR24000.

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

llvm-svn: 243196
2015-07-25 01:19:32 +00:00
Akira Hatanaka 4e3c86fe99 [AArch64] Pass subtarget feature "+reserve-x18" instead of passing backend
option "-aarch64-reserve-x18".

This change is needed since backend options do not make it to the backend
when doing LTO and are not capable of changing the behavior of code-gen
passes on a per-function basis.

rdar://problem/21529937

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

llvm-svn: 243185
2015-07-25 00:18:00 +00:00
Duncan P. N. Exon Smith bd210e638a DI: Make getOrCreateLimitedType() return DICompositeType, NFC
Change `getOrCreateLimitedType()` to return a `DICompositeType` and
remove the casts from its callers.  Inside, I've strengthened a `cast`
from `DICompositeTypeBase`, but the casts in the callers already prove
that this is safe.  There should be no functionality change here.

llvm-svn: 243155
2015-07-24 20:34:41 +00:00
Yaron Keren e896939e54 Select the highest version of the mingw toolchain found using Generic_GCC::GCCVersion
similar to the way Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple works.

llvm-svn: 243153
2015-07-24 20:18:27 +00:00
Yaron Keren a749b1b2bd Base the sys-root/mingw/include path on sysroot and not on /usr.
Thanks to Richard Smith for pointing this out!

llvm-svn: 243144
2015-07-24 19:18:17 +00:00
Chih-Hung Hsieh 0b0eeaaaf6 Correct x86_64 Android fp128 mangled name
These changes are for Android x86_64 targets to be compatible with current Android g++.
https://llvm.org/bugs/show_bug.cgi?id=23897
Use 'g' and 'Cg' for "long double" and "long double _Complex" mangled type names.

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

llvm-svn: 243133
2015-07-24 18:12:54 +00:00
Duncan P. N. Exon Smith ac346ba5a1 DI: Make StaticDataMemberCache type-safe, NFC
Change `StaticDataMemberCache` to store references to `DIDerivedType`
directly, and remove now-unnecessary casts from the accessors.

llvm-svn: 243129
2015-07-24 18:05:58 +00:00
Chih-Hung Hsieh cda1cd5770 Test commit.
llvm-svn: 243125
2015-07-24 17:39:13 +00:00
Argyrios Kyrtzidis f0917ab7c1 [code-completion] Strip outer nullability annotations when completing method implementations.
The outer nullability is transferred from the declaration to the implementation so including them is redundant.
The inner ones are not transferred so they are kept to match the exact types. When we transfer the inner ones as well
adding them in the implementation will become redundant and we should strip those as well.

rdar://21737451

llvm-svn: 243119
2015-07-24 17:00:19 +00:00
Mehdi Amini ca3cf9e6ff LLVM API Change: the Module always owns the DataLayout
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243115
2015-07-24 16:04:29 +00:00
Aaron Ballman 3e839decc9 Silence a "not all control paths return a value" warning from MSVC. Should also silence a -Wreturn-type warning. NFC intended.
llvm-svn: 243109
2015-07-24 12:47:27 +00:00
Aaron Ballman 41143bb573 Add an AST matcher, isFinal(), for testing whether a method or class declaration are marked final.
llvm-svn: 243107
2015-07-24 12:35:41 +00:00
Yaron Keren 8cb250ad9d Apparently some of the bots add .svn dirs inside the test/Driver/Inputs
directory structure. Try to make mingw toolchain resilient to such surprises.

llvm-svn: 243105
2015-07-24 11:01:45 +00:00
Yaron Keren 327675baa9 Add extensive tests for the mingw toolchain and remove trailing slash from Arch.
Address Richard Smith comments: remove the trailing seperator from the Arch
variable, implement six mingw_* trees under tools/clangtest/Driver/Inputs
and merge linux and Windows tests into a universal test that uses these trees.

llvm-svn: 243098
2015-07-24 08:50:15 +00:00
David Majnemer e2afb47d1e [clang-cl] Implement support for the /Zl flag
The flag allows users to specify that they do not want the object file
to have any implicit /defaultlib directives.

This fixes PR24236.

llvm-svn: 243097
2015-07-24 06:49:13 +00:00
David Majnemer 16a74704c9 [AST] Perform additional canonicalization for DependentSizedArrayType
We treated DependentSizedArrayTypes with the same element type but
differing size expressions as equivalently canonical.  This would lead
to bizarre behavior during template instantiation.

This fixes PR24212.

llvm-svn: 243093
2015-07-24 05:54:19 +00:00
Alex Denisov b7d8563973 Cleanup ObjCInterfaceDecl lookup for ObjC literals
llvm-svn: 243092
2015-07-24 05:09:40 +00:00
Piotr Padlewski a68a78751f Generating available_externally vtables for outline virtual functions
Generating available_externally vtables for optimizations purposes.
Unfortunatelly ItaniumABI doesn't guarantee that we will be able to
refer to virtual inline method by name.
But when we don't have any inline virtual methods, and key function is
not defined in this TU, we can generate that there will be vtable and
mark it as available_externally.

This is patch will help devirtualize better.
Differential Revision: http://reviews.llvm.org/D11441

llvm-svn: 243090
2015-07-24 04:04:49 +00:00
John McCall 1c78f085c3 Fix the equal-vector-size rule for reinterpret_casts in C++
to consider the storage size of the vector instead of its
sizeof.  In other words, ban <3 x int> to <4 x int> casts,
which produced invalid IR anyway.

Also, attempt to be a little more rigorous, or at least
explicit, about when enums are allowed in these casts.

rdar://21901132

llvm-svn: 243069
2015-07-23 23:54:07 +00:00
Justin Bogner 61bf8cb9af InstrProf: Don't extend coverage regions into the catch keyword
The catch keyword isn't really part of a region, so it's fairly
meaningless to extend into it. This was usually harmless, but it could
crash when catch blocks involved macros in strange ways.

llvm-svn: 243066
2015-07-23 23:24:21 +00:00
Duncan P. N. Exon Smith dccc30a7ef Sema: Avoid a stack overflow on large CFGs
Large CFGs cause `checkForFunctionCall()` to overflow its stack.  Break
the recursion by manually managing the call stack instead.

Patch by Vedant Kumar!

llvm-svn: 243039
2015-07-23 20:15:50 +00:00
Duncan P. N. Exon Smith f0eafc78e0 Sema: Split out helper from checkForFunctionCall(), NFC
Split out `hasRecursiveCallInPath()` from `checkForFunctionCall()` to
flatten nesting and clarify the code.  This also simplifies a follow-up
patch that refactors the other logic in `checkForFunctionCall()`.

Patch by Vedant Kumar!

llvm-svn: 243038
2015-07-23 20:11:47 +00:00
Renato Golin 830f0c4c46 [Compiler-RT] Remove dependency on libgcc_s/eh
Currently, for --rtlib=compiler-rt on GNU systems, we're assuming
that one has libgcc_s and libgcc_eh as low-level libraries, which
when used in conjunction with -lunwind or -lc++abi, breaks that
assumption.

My original fix was wrong, and this patch reverts it to prepare for
a new flag to choose the unwinder/C++ libraries. For the time being,
people can use "-lgcc_s -lgcc_eh" or "-lunwind -lc++abi" or any
combination they need explicitly.

llvm-svn: 243025
2015-07-23 17:24:41 +00:00
Asaf Badouh f6a58b6dff [X86][AVX512F] Add FP scalar intrinsics
intrinsics for: add/sub/mul/div/min/max in their FP scalar versions

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

llvm-svn: 243009
2015-07-23 12:13:32 +00:00
Asaf Badouh 7d99966e91 [X86][AVX512BW] add madd and maddubs intrinsics
Differential Revision: http://reviews.llvm.org/D11420

llvm-svn: 242986
2015-07-23 07:07:25 +00:00
Richard Smith 787c0e42e0 ArrayRef-ize a pointer/length pair.
llvm-svn: 242977
2015-07-23 00:53:59 +00:00
Hans Wennborg 0106479fa8 Downgrade error about adding 'dllimport' to used free function to warning (PR24215)
The code will still work as it can reference the function via its thunk.

llvm-svn: 242973
2015-07-22 23:54:51 +00:00
David Majnemer c28d46ea3c Move EHPersonality to CGCleanup
This makes it possible to use EHPersonality in other parts of CodeGen.

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

llvm-svn: 242971
2015-07-22 23:46:21 +00:00
David Majnemer 51fd8a020b [MS Compat] Allow _Atomic(Type) and 'struct _Atomic' to coexist
MSVC 2013 ships, as part of its STL implementation, a class named
'_Atomic'.  This is unfortunate because this keyword is in conflict with
the C11 keyword with the same name.  Our solution was to disable this
keyword when targeting MSVC 2013 and reenable it for 2015.

However, this makes it impossible for clang's headers to make use of
_Atomic.  This is problematic in the case of libc++ as it makes heavy
use of this keyword.

Let the keywordness of _Atomic float under certain circumstances:
the body of a class named _Atomic, or a class with a base specifier
named _Atomic, will not have the keyword variant of _Atomic for the
duration of the class body.  This is sufficient to allow us to correctly
handle _Atomic in the STL while permitting us to use _Atomic as a
keyword everywhere else.

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

llvm-svn: 242970
2015-07-22 23:46:18 +00:00
Richard Smith 16fe4d178e Fix dumb use-after-free bug introduced in r242868.
llvm-svn: 242960
2015-07-22 22:51:15 +00:00
David Majnemer 6a6589036b [MSVC Compatibility] Use a better predicate for __BOOL_DEFINED
Instead of using CPlusPlus, use Bool.  No functionality change is
intended, it just makes things a tad bit more clear.

llvm-svn: 242957
2015-07-22 22:36:26 +00:00
Hans Wennborg 4afe504980 Fix -Wextra-semi warnings.
Patch by Eugene Zelenko!

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

llvm-svn: 242931
2015-07-22 20:46:26 +00:00
Yaron Keren d030d11a24 Add cygwin x86_64 target.
Patch by Martell Malone!

http://reviews.llvm.org/D11349

llvm-svn: 242914
2015-07-22 17:38:19 +00:00
Samuel Antao 5b0688edfd [OpenMP] Make target data directive generate unexpected directive diagnostic.
llvm-svn: 242906
2015-07-22 16:02:46 +00:00
Reid Kleckner 0213a4756e [mingw] Add support for -rtlib option and -stdlib option to the mingw driver
Now clang should be able to use compiler-rt and libc++ on mingw.

Based on a patch by Martell Malone.

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

llvm-svn: 242905
2015-07-22 16:01:38 +00:00
Renato Golin a74bbc7b36 Pass -I options to integrates and external assemblers
Fixes PR21000.

Patch by Artem Belevich.

llvm-svn: 242904
2015-07-22 15:32:36 +00:00
Hubert Tong 27f0697308 [CONCEPTS] Add diagnostics: non-defining function; non-namespace scope
Summary:
Create diagnostic for function concept declaration which is not a
definition.

Create diagnostic for concept declaration which isn't in namespace
scope.

Create associated tests.

Reviewers: rsmith, faisalv, fraggamuffin, hubert.reinterpretcast

Subscribers: cfe-commits

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

Patch by Nathan Wilson!

llvm-svn: 242899
2015-07-22 13:32:36 +00:00
Richard Smith 33e0f7ef94 [modules] Stop performing PCM lookups for all identifiers when building with C++ modules. Instead, serialize a list of interesting identifiers and mark those ones out of date on module import. Avoiding the identifier lookups here gives a 20-30% speedup in builds with large numbers of modules. No functionality change intended.
llvm-svn: 242868
2015-07-22 02:08:40 +00:00
Richard Smith a7c535b3c1 [modules] Change module manager visitation order to be a bit more stable when
more modules are added: visit modules depth-first rather than breadth-first.
The visitation is still (approximately) oldest-to-newest, and still guarantees
that a module is visited before anything it imports, so modules that are
imported by others sometimes need to jump to a later position in the visitation
order when more modules are loaded, but independent module trees don't
interfere with each other any more.

llvm-svn: 242863
2015-07-22 01:28:05 +00:00
Davide Italiano f179e36e0e [Sema] Diagnose use of declaration correctly.
Before we skipped that for virtual functions not fully qualified (r81507).
This commit basically reverts this to the older behaviour, which seems
more consistent. We now also correctly consider ill-formed calls to deleted
member functions, which were silently passed before in some cases.
The review contains the whole discussion.

PR:		20268
Differential Revision:	 http://reviews.llvm.org/D11334

llvm-svn: 242857
2015-07-22 00:30:58 +00:00
Richard Smith a534a31c5e [modules] In C++, stop serializing and deserializing a list of declarations in
the identifier table. This is redundant, since the TU-scope lookups are also
serialized as part of the TU DeclContext, and wasteful in a number of ways. We
still emit the decls for PCH / preamble builds, since for those we want
identical results, not merely semantically equivalent ones.

llvm-svn: 242855
2015-07-21 23:54:07 +00:00
Daniel Jasper bcad06640b clang-format: Fix unary operator detection in for loops.
Before:
  for (;; * a = b) {}

After:
  for (;; *a = b) {}

llvm-svn: 242849
2015-07-21 22:51:00 +00:00
Aaron Ballman e4de1a51ec Use range-based for loops; NFC.
llvm-svn: 242846
2015-07-21 22:33:52 +00:00
Tim Northover 525c73ceb7 ARM: actually define __ARM_ARCH_7S__ for the armv7s slice
We ended up with the wrong predefine after the recent TargetParser shuffle, and
I accidentally solidified it with a test. This should fix it.

llvm-svn: 242841
2015-07-21 21:47:33 +00:00
Aaron Ballman 2bf2cadc00 Use a range-based for loop; NFC.
llvm-svn: 242836
2015-07-21 21:18:29 +00:00
Aaron Ballman d4a392c53e Replace some uses of Self.Context with the local variable C; NFC.
llvm-svn: 242835
2015-07-21 21:07:11 +00:00
David Blaikie fd7c2198e4 Fix GCC build due to shadowing
llvm-svn: 242826
2015-07-21 18:59:10 +00:00