]> granicus.if.org Git - clang/log
clang
9 years agoInstantiate exception specifications when instantiating function types (other
Richard Smith [Wed, 17 Sep 2014 23:57:05 +0000 (23:57 +0000)]
Instantiate exception specifications when instantiating function types (other
than the type of a function declaration). We previously didn't instantiate
these at all! This also covers the pathological case where the only mention of
a parameter pack is within the exception specification; this gives us a second
way (other than alias templates) to reach the horrible state where a type
contains an unexpanded pack, but its canonical type does not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217995 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86, inline-asm] Check that the input size is correct for constraints R, q, Q,
Akira Hatanaka [Wed, 17 Sep 2014 23:35:14 +0000 (23:35 +0000)]
[X86, inline-asm] Check that the input size is correct for constraints R, q, Q,
S, D, A, y, x, f, t, and u.

This is a follow-up patch for r167717.

rdar://problem/11846140
rdar://problem/17476970

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217994 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoBasic: add support for ARM ACLE 6.5.1
Saleem Abdulrasool [Wed, 17 Sep 2014 14:50:27 +0000 (14:50 +0000)]
Basic: add support for ARM ACLE 6.5.1

Extend ARM ACLE support (Section 6.5.1) for AArch32.  Define __ARM_FP if
hardware floating point support is available as per the value defined by the
ACLE.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217957 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoBasic: use range-based for loops for ARM target
Saleem Abdulrasool [Wed, 17 Sep 2014 14:50:23 +0000 (14:50 +0000)]
Basic: use range-based for loops for ARM target

Tweak handleTargetFeature for the ARM(32) target to use range based for loops.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217956 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoBasic: whitespace fixup for ARM target info
Saleem Abdulrasool [Wed, 17 Sep 2014 14:50:19 +0000 (14:50 +0000)]
Basic: whitespace fixup for ARM target info

Fix whitespace.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217955 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't try to devirtualize non-virtual calls
Reid Kleckner [Tue, 16 Sep 2014 22:23:33 +0000 (22:23 +0000)]
Don't try to devirtualize non-virtual calls

We would end up marking the vtable of the derived class as used for no
reason. Because the call itself is qualified, it is never virtual, and
the vtable of the derived class isn't helpful. We would end up rejecting
code that MSVC accepts for no benefit.

See http://crbug.com/413478

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217910 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't try to use C5/D5 comdats in COFF.
Rafael Espindola [Tue, 16 Sep 2014 20:19:43 +0000 (20:19 +0000)]
Don't try to use C5/D5 comdats in COFF.

This should fix the mingw bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217897 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix forwarding -l to MSVC's link.exe
Reid Kleckner [Tue, 16 Sep 2014 19:22:00 +0000 (19:22 +0000)]
Fix forwarding -l to MSVC's link.exe

Translate -lfoo to -lfoo.lib while making sure that -lfoo.lib stays as
-lfoo.lib. Also, these arguments were being passed twice: once
explicitly via AddAllArgs, and again implicitly as linker inputs. Now
they are passed once.

Fixes PR20868.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217895 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Allow unbroken ::: in inline assembly.
Daniel Jasper [Tue, 16 Sep 2014 16:36:57 +0000 (16:36 +0000)]
clang-format: Allow unbroken ::: in inline assembly.

Before:
  asm volatile("nop" :: : "memory");

After:
  asm volatile("nop" ::: "memory");

Patch by Eugene Toder. Thank you.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217883 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Restructure and add missing tests.
Daniel Jasper [Tue, 16 Sep 2014 16:22:30 +0000 (16:22 +0000)]
clang-format: Restructure and add missing tests.

Patch by Jean-Philippe Dufraigne, Thank you!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217880 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd support for putting constructors and destructos in explicit comdats.
Rafael Espindola [Tue, 16 Sep 2014 15:18:21 +0000 (15:18 +0000)]
Add support for putting constructors and destructos in explicit comdats.

There are situations when clang knows that the C1 and C2 constructors
or the D1 and D2 destructors are identical. We already optimize some
of these cases, but cannot optimize it when the GlobalValue is
weak_odr.

The problem with weak_odr is that an old TU seeing the same code will
have a C1 and a C2 comdat with the corresponding symbols. We cannot
suddenly start putting the C2 symbol in the C1 comdat as we cannot
guarantee that the linker will not pick a .o with only C1 in it.

The solution implemented by GCC is to expand the ABI to have a comdat
whose name uses a C5/D5 suffix and always has both symbols. That is
what this patch implements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217874 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[sphinx cleanup]
Dan Liew [Tue, 16 Sep 2014 08:44:27 +0000 (08:44 +0000)]
[sphinx cleanup]
Fix warning introduced by r211098.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217864 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: use range based for loop
Saleem Abdulrasool [Tue, 16 Sep 2014 03:48:32 +0000 (03:48 +0000)]
Driver: use range based for loop

Use a couple more range based for loops.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217857 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReject a slightly-sneaky way to perform a read of mutable state from within a
Richard Smith [Tue, 16 Sep 2014 01:24:02 +0000 (01:24 +0000)]
Reject a slightly-sneaky way to perform a read of mutable state from within a
constexpr function. Part of this fix is a tentative fix for an as-yet-unfiled
core issue (we're missing a prohibition against reading mutable members from
unions via a trivial constructor/assignment, since that doesn't perform an
lvalue-to-rvalue conversion on the members).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217852 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTests for DR581-600.
Richard Smith [Mon, 15 Sep 2014 22:56:03 +0000 (22:56 +0000)]
Tests for DR581-600.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217844 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPR19692: Add (passing) regression test.
Richard Smith [Mon, 15 Sep 2014 22:14:48 +0000 (22:14 +0000)]
PR19692: Add (passing) regression test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217836 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUnique_ptrify Preprocessor::PragmaHandlersBackup
David Blaikie [Mon, 15 Sep 2014 21:31:42 +0000 (21:31 +0000)]
Unique_ptrify Preprocessor::PragmaHandlersBackup

Follow up to r217656

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217829 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoObjective-C. Prevents a crash generating AST for a
Fariborz Jahanian [Mon, 15 Sep 2014 21:19:39 +0000 (21:19 +0000)]
Objective-C. Prevents a crash generating AST for a
a property assignment due to numerous user errors.
Cannot come up with a reasonable test case due to
array of user errors before the crash point.
rdar://17813651.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217825 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMajor rewrite of linking strategy for sanitizer runtimes on Linux.
Alexey Samsonov [Mon, 15 Sep 2014 19:58:40 +0000 (19:58 +0000)]
Major rewrite of linking strategy for sanitizer runtimes on Linux.

Change 1: we used to add static sanitizer runtimes at the
very beginning of the linker invocation, even before crtbegin.o, which
is gross and not correct in general. Fix this: now addSanitizerRuntimes()
adds all sanitizer-related link flags to the end of the linker invocation
being constructed. It means, that we should call this function in the
correct place, namely, before AddLinkerInputs() to make sure sanitizer
versions of library functions will be preferred.

Change 2: Put system libraries sanitizer libraries depend on at the
end of the linker invocation, where all the rest system libraries are
located. Respect --nodefaultlibs and --nostdlib flags. This is another way
to fix PR15823. Original fix landed in r215940 put "-lpthread" and friends
immediately after static ASan runtime, before the user linker inputs.
This caused significant slowdown in dynamic linker for large binaries
linked against thousands of shared objects. Instead, to mark system
libraries as DT_NEEDED we prepend them with "--no-as-needed" flag,
discarding the "-Wl,--as-needed" flag that could be provided by the user.

Otherwise, this change is a code cleanup. Instead of having a special method
for each sanitizer, we introduce a function collectSanitizerRuntimes() that
analyzes -fsanitize= flags and returns the set of static and shared
libraries that needs to be linked.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217817 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReduce code duplication a bit more. NFC.
Rafael Espindola [Mon, 15 Sep 2014 19:43:47 +0000 (19:43 +0000)]
Reduce code duplication a bit more. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217813 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReduce code duplication a bit more. NFC.
Rafael Espindola [Mon, 15 Sep 2014 19:34:18 +0000 (19:34 +0000)]
Reduce code duplication a bit more. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217811 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSimplify the code a bit, NFC.
Rafael Espindola [Mon, 15 Sep 2014 19:24:44 +0000 (19:24 +0000)]
Simplify the code a bit, NFC.

hasConstructorVariants is always true for MS and false for Itanium.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217809 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMove emitCXXStructor to CGCXXABI.
Rafael Espindola [Mon, 15 Sep 2014 19:20:10 +0000 (19:20 +0000)]
Move emitCXXStructor to CGCXXABI.

A followup patch will address the code duplication.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217807 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCreate a emitCXXStructor function and make the existing emitCXXConstructor and
Rafael Espindola [Mon, 15 Sep 2014 18:46:13 +0000 (18:46 +0000)]
Create a emitCXXStructor function and make the existing emitCXXConstructor and
emitCXXDestructor static helpers.

A next patch will make it a helper in CGCXXABI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217804 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse intrusive refcounted pointers to manage RopeRefCountString lifetime.
Benjamin Kramer [Mon, 15 Sep 2014 17:58:03 +0000 (17:58 +0000)]
Use intrusive refcounted pointers to manage RopeRefCountString lifetime.

std::shared_ptr<char []> would be even nicer, but shared_ptr doesn't work
with arrays :(

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217798 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agounique_ptrify ChainedDiagnosticConsumer's ctor parameters
David Blaikie [Mon, 15 Sep 2014 17:50:10 +0000 (17:50 +0000)]
unique_ptrify ChainedDiagnosticConsumer's ctor parameters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217793 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTeach Clang how to use response files when calling other tools
Reid Kleckner [Mon, 15 Sep 2014 17:45:39 +0000 (17:45 +0000)]
Teach Clang how to use response files when calling other tools

Patch by Rafael Auler!

This patch addresses PR15171 and teaches Clang how to call other tools
with response files, when the command line exceeds system limits. This
is a problem for Windows systems, whose maximum command-line length is
32kb.

I introduce the concept of "response file support" for each Tool object.
A given Tool may have full support for response files (e.g. MSVC's
link.exe) or only support file names inside response files, but no flags
(e.g. Apple's ld64, as commented in PR15171), or no support at all (the
default case). Therefore, if you implement a toolchain in the clang
driver and you want clang to be able to use response files in your
tools, you must override a method (getReponseFileSupport()) to tell so.

I designed it to support different kinds of tools and
internationalisation needs:

- VS response files ( UTF-16 )
- GNU tools ( uses system's current code page, windows' legacy intl.
  support, with escaped backslashes. On unix, fallback to UTF-8 )
- Clang itself ( UTF-16 on windows, UTF-8 on unix )
- ld64 response files ( only a limited file list, UTF-8 on unix )

With this design, I was able to test input file names with spaces and
international characters for Windows. When the linker input is large
enough, it creates a response file with the correct encoding. On a Mac,
to test ld64, I temporarily changed Clang's behavior to always use
response files regardless of the command size limit (avoiding using huge
command line inputs). I tested clang with the LLVM test suite (compiling
benchmarks) and it did fine.

Test Plan: A LIT test that tests proper response files support. This is
tricky, since, for Unix systems, we need a 2MB response file, otherwise
Clang will simply use regular arguments instead of a response file. To
do this, my LIT test generate the file on the fly by cloning many -DTEST
parameters until we have a 2MB file. I found out that processing 2MB of
arguments is pretty slow, it takes 1 minute using my notebook in a debug
build, or 10s in a Release build. Therefore, I also added "REQUIRES:
long_tests", so it will only run when the user wants to run long tests.

In the full discussion in
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130408/171463.html,
Rafael Espindola discusses a proper way to test
llvm::sys::argumentsFitWithinSystemLimits(), and, there, Chandler
suggests to use 10 times the current system limit (20MB resp file), so
we guarantee that the system will always use response file, even if a
new linux comes up that can handle a few more bytes of arguments.
However, by testing with a 20MB resp file, the test takes long 8 minutes
just to perform a silly check to see if the driver will use a response
file. I found it to be unreasonable. Thus, I discarded this approach and
uses a 2MB response file, which should be enough.

Reviewers: asl, rafael, silvas

Reviewed By: silvas

Subscribers: silvas, rnk, thakis, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217792 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix memory leak of raw_ostreams in LogDiagnosticPrinter handling.
David Blaikie [Mon, 15 Sep 2014 17:30:56 +0000 (17:30 +0000)]
Fix memory leak of raw_ostreams in LogDiagnosticPrinter handling.

This is another case of conditional ownership (in this case a raw
reference, plus a boolean to indicate whether the referenced object
should be deleted). While it's not ideal, I prefer to make the ownership
explicit with a unique_ptr than using a boolean flag (though it does
make the reference and the unique_ptr redundant in the sense that they
both refer to the same memory). At some point we might write a reusable
conditional ownership pointer (a stateful custom deleter for a unique_ptr
may be appropriate).

Based on a patch from a patch by Anton Yartsev.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217791 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd -fseh-exceptions for MinGW-w64
Reid Kleckner [Mon, 15 Sep 2014 17:19:16 +0000 (17:19 +0000)]
Add -fseh-exceptions for MinGW-w64

This adds a flag called -fseh-exceptions that uses the native Windows
.pdata and .xdata unwind mechanism to throw exceptions. The other EH
possibilities are DWARF and SJLJ exceptions.

Patch by Martell Malone!

Reviewed By: asl, rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217790 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPretty print attributes associated with record declarations.
Aaron Ballman [Mon, 15 Sep 2014 16:45:30 +0000 (16:45 +0000)]
Pretty print attributes associated with record declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217784 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoObjective-C SDK modernizer. Do not modernize an enum
Fariborz Jahanian [Mon, 15 Sep 2014 16:41:47 +0000 (16:41 +0000)]
Objective-C SDK modernizer. Do not modernize an enum
which already has the underlying interger type specification.
// rdar://1826225

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217783 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdding some FIXMEs to the attribute emitter code regarding whether pretty printing...
Aaron Ballman [Mon, 15 Sep 2014 16:16:14 +0000 (16:16 +0000)]
Adding some FIXMEs to the attribute emitter code regarding whether pretty printing enumerators should use quoted string literals, or identifiers. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217781 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWhen pretty printing attributes that have enumeration arguments, print the enumerator...
Aaron Ballman [Mon, 15 Sep 2014 15:14:13 +0000 (15:14 +0000)]
When pretty printing attributes that have enumeration arguments, print the enumerator identifier (as a string literal) instead of the internal enumerator integral value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217771 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEdit: Do not extend a removal to include trailing whitespace if we're at the end
Benjamin Kramer [Mon, 15 Sep 2014 11:47:10 +0000 (11:47 +0000)]
Edit: Do not extend a removal to include trailing whitespace if we're at the end
of the file.

This would run past the end of the buffer. Sadly I don't have a great way to
test it, the only way to trigger the bug is having a removal fix it at the end
of the file, which none of our current warnings can generate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217766 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] Add ACLE predefines: maxmin, rounding and h/w integer division
James Molloy [Mon, 15 Sep 2014 11:25:38 +0000 (11:25 +0000)]
[ARM] Add ACLE predefines: maxmin, rounding and h/w integer division

Patch by Assad Hashmi!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217760 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Basic support for Java.
Daniel Jasper [Mon, 15 Sep 2014 11:21:46 +0000 (11:21 +0000)]
clang-format: Basic support for Java.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217759 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Add option to break before non-assignment operators.
Daniel Jasper [Mon, 15 Sep 2014 11:11:00 +0000 (11:11 +0000)]
clang-format: Add option to break before non-assignment operators.

This will allow:
  int aaaaaaaaaaaaaa =
      bbbbbbbbbbbbbb
      + ccccccccccccccc;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217757 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake test/Driver hermetic
JF Bastien [Sun, 14 Sep 2014 23:42:15 +0000 (23:42 +0000)]
Make test/Driver hermetic

Summary:
The includes shouldn't be there, use the compiler's built-in types/macros instead.

This is a follow-up to r217694, as discussed in:
  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140908/114669.html

Test Plan: ninja check-clang

Reviewers: nlewycky, thakis, echristo, chandlerc

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217743 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCheck delegating constructors for using uninitialized fields.
Richard Trieu [Fri, 12 Sep 2014 22:47:58 +0000 (22:47 +0000)]
Check delegating constructors for using uninitialized fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217716 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-cl: Warn when a /TC or /TP argument is unused
Ehsan Akhgari [Fri, 12 Sep 2014 21:44:24 +0000 (21:44 +0000)]
clang-cl: Warn when a /TC or /TP argument is unused

Test Plan: The patch includes a test case.

Reviewers: hansw

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217710 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't print 'NULL TYPE' when dumping a delegating constructor.
Richard Trieu [Fri, 12 Sep 2014 21:20:53 +0000 (21:20 +0000)]
Don't print 'NULL TYPE' when dumping a delegating constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217707 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAllow protocols to be just declared.
Rafael Espindola [Fri, 12 Sep 2014 20:14:20 +0000 (20:14 +0000)]
Allow protocols to be just declared.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217704 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agopatch to add missing warning on sizeof wrong parameter
Fariborz Jahanian [Fri, 12 Sep 2014 18:44:36 +0000 (18:44 +0000)]
patch to add missing warning on sizeof wrong parameter
for __builtin___strlcpy_chk/__builtin___strlcat_chk.
Patch by Jacques Fortier with monir change by me and
addition of test. rdar://18259539

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217700 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-cl: Don't treat linker input files differently when /TP or /TC is specified.
Ehsan Akhgari [Fri, 12 Sep 2014 18:15:10 +0000 (18:15 +0000)]
clang-cl: Don't treat linker input files differently when /TP or /TC is specified.

Summary: This fixes http://llvm.org/PR20923.

Test Plan: This patch includes an automated test.

Reviewers: hansw

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217699 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoNo need to use PNaCl's calling convention since PNaCl now uses a separate approach...
JF Bastien [Fri, 12 Sep 2014 17:52:51 +0000 (17:52 +0000)]
No need to use PNaCl's calling convention since PNaCl now uses a separate approach for calling conventions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217696 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix copy/paste for test, the triple should be le64-unknown-unknown
JF Bastien [Fri, 12 Sep 2014 17:52:49 +0000 (17:52 +0000)]
Fix copy/paste for test, the triple should be le64-unknown-unknown

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217695 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd support for le64.
JF Bastien [Fri, 12 Sep 2014 17:52:47 +0000 (17:52 +0000)]
Add support for le64.

Summary:
le64 is a generic little-endian 64-bit processor, mimicking le32.

Also see the associated LLVM change.

Test Plan: make check-all

Reviewers: dschuff

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217694 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Improve line breaks at function calls.
Daniel Jasper [Fri, 12 Sep 2014 16:35:28 +0000 (16:35 +0000)]
clang-format: Improve line breaks at function calls.

Before:
  EXPECT_CALL(SomeObject, SomeFunction(Parameter)).Times(2).WillRepeatedly(
      Return(SomeValue));

After:
  EXPECT_CALL(SomeObject, SomeFunction(Parameter))
      .Times(2)
      .WillRepeatedly(Return(SomeValue));

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217687 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd a previously-missing test case for return adjustment vs pure virtual methods
Timur Iskhodzhanov [Fri, 12 Sep 2014 15:21:44 +0000 (15:21 +0000)]
Add a previously-missing test case for return adjustment vs pure virtual methods

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217686 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ASan/Win] Fix PR20918 -- SEH handler doesn't work with the MD runtime
Timur Iskhodzhanov [Fri, 12 Sep 2014 14:01:30 +0000 (14:01 +0000)]
[ASan/Win] Fix PR20918 -- SEH handler doesn't work with the MD runtime

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217679 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate the test case after r217673
Timur Iskhodzhanov [Fri, 12 Sep 2014 13:47:44 +0000 (13:47 +0000)]
Update the test case after r217673

Sorry, committing to multiple repos at once is hard...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217677 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ASan/Win] Rename asan_win_uar_thunk.lib to asan_win_dynamic_runtime_thunk.lib
Timur Iskhodzhanov [Fri, 12 Sep 2014 13:21:02 +0000 (13:21 +0000)]
[ASan/Win] Rename asan_win_uar_thunk.lib to asan_win_dynamic_runtime_thunk.lib

It turned out that we have to bridge more stuff between the executable
and the ASan RTL DLL than just __asan_option_detect_stack_use_after_return.
See PR20918 for more details.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217673 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFixing a -Woverflow warning from GCC by using a more natural datatype for this operat...
Aaron Ballman [Fri, 12 Sep 2014 12:42:15 +0000 (12:42 +0000)]
Fixing a -Woverflow warning from GCC by using a more natural datatype for this operation. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217670 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEvery code owner should be reachable via email, so add one for
Joerg Sonnenberger [Fri, 12 Sep 2014 08:05:51 +0000 (08:05 +0000)]
Every code owner should be reachable via email, so add one for
Douglas Gregor and Ted Kremenek.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217658 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse unique_ptr for ScratchBuf and PragmaHandlers in the preprocessor.
Craig Topper [Fri, 12 Sep 2014 05:19:24 +0000 (05:19 +0000)]
Use unique_ptr for ScratchBuf and PragmaHandlers in the preprocessor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217656 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMS ABI: The latest VC "14" CTP implements deleted virtual functions
David Majnemer [Fri, 12 Sep 2014 04:38:08 +0000 (04:38 +0000)]
MS ABI: The latest VC "14" CTP implements deleted virtual functions

Deleted virtual functions get _purecall inserted into the vftable.
Earlier CTPs would simply stick nullptr in there.

N.B.  MSVC can't handle deleted virtual functions which require return
adjusting thunks, they give an error that a deleted function couldn't be
called inside of a compiler generated function.  We get this correct by
making the thunk have a __purecall entry as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217654 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMS ABI: Use the correct this arg when generating implict copy ctor
David Majnemer [Thu, 11 Sep 2014 23:05:02 +0000 (23:05 +0000)]
MS ABI: Use the correct this arg when generating implict copy ctor

We assumed that the incoming this argument would be the last argument.

However, this is not true under the MS ABI.

This fixes PR20897.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217642 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThread Safety Analysis: Avoid infinite recursion in an operator<<
Justin Bogner [Thu, 11 Sep 2014 19:44:04 +0000 (19:44 +0000)]
Thread Safety Analysis: Avoid infinite recursion in an operator<<

r217556 introduced an operator<<(std::ostream &, StringRef) that seems
to self recurse on some systems, because str.data(), which is a char *,
was being implicitly converted back to StringRef in overload
resolution.

This manifested as SemaCXX/warn-thread-safety-analysis.cpp timing out
in release builds and overflowing the stack in debug builds. One of
the failing systems that saw this is here:

  http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/4636

Using ostream's write method instead of operator<< should get the bots
going again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217621 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoObjective-C. Under a special flag, -Wcstring-format-directive,
Fariborz Jahanian [Thu, 11 Sep 2014 19:13:23 +0000 (19:13 +0000)]
Objective-C. Under a special flag, -Wcstring-format-directive,
off by default, issue a warning if %s directive is used
in formart argument of a function/method declared as
__attribute__((format(CF/NSString, ...)))
To complete rdar://18182443

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217619 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-cl: Add support for the /o option for object files, executables, and preprocess...
Ehsan Akhgari [Thu, 11 Sep 2014 18:16:21 +0000 (18:16 +0000)]
clang-cl: Add support for the /o option for object files, executables, and preprocessor output

Summary:
cl.exe recognizes /o as a deprecated and undocumented option similar to
/Fe.  This patch adds support for this option to clang-cl for /Fe, /Fo
and /Fi.  It also ensures that the last option among /o and /F* wins,
if both specified.

This is required at least for building autoconf based software, since
autoconf uses -o to specify the executable output.

This fixes http://llvm.org/PR20894.

Test Plan: The patch includes automated tests.

Reviewers: rnk

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217615 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse the simpler version of llvm::sys::fs::exists.
Rafael Espindola [Thu, 11 Sep 2014 18:10:13 +0000 (18:10 +0000)]
Use the simpler version of llvm::sys::fs::exists.

In all these cases it looks like the intention was to handle error in a similar
way to the file not existing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217614 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate C++ status page to reflect that Clang 3.5 has released.
Richard Smith [Thu, 11 Sep 2014 17:30:32 +0000 (17:30 +0000)]
Update C++ status page to reflect that Clang 3.5 has released.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217609 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate DR status list to reflect that Clang 3.5 has been released.
Richard Smith [Thu, 11 Sep 2014 17:29:13 +0000 (17:29 +0000)]
Update DR status list to reflect that Clang 3.5 has been released.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217608 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTests for DR573-580.
Richard Smith [Thu, 11 Sep 2014 17:28:14 +0000 (17:28 +0000)]
Tests for DR573-580.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217606 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMerge GetAddrOfCXXConstructor and GetAddrOfCXXDonstructor. NFC.
Rafael Espindola [Thu, 11 Sep 2014 15:42:06 +0000 (15:42 +0000)]
Merge GetAddrOfCXXConstructor and GetAddrOfCXXDonstructor. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217598 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix bug 20892 - clang-format does not handle C-style comments
Roman Kashitsyn [Thu, 11 Sep 2014 14:47:20 +0000 (14:47 +0000)]
Fix bug 20892 - clang-format does not handle C-style comments

Summary:
http://llvm.org/bugs/show_bug.cgi?id=20892

Add support of C-style formatting enabling/disabling directives. Now the following two styles are supported:

  // clang-format on
  /* clang-format on */

The flexibility in comments (support of extra spaces and/or slashes, etc.) is deliberately avoided to simplify search in large code bases.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, curdeius, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217588 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAvoid some unnecessary SmallVector copies.
Benjamin Kramer [Thu, 11 Sep 2014 14:13:49 +0000 (14:13 +0000)]
Avoid some unnecessary SmallVector copies.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217586 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoNULL->nullptr
Alexander Musman [Thu, 11 Sep 2014 08:10:57 +0000 (08:10 +0000)]
NULL->nullptr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217573 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a couple of -Wsign-compare warnings introduced in r217556
Justin Bogner [Thu, 11 Sep 2014 03:37:42 +0000 (03:37 +0000)]
Fix a couple of -Wsign-compare warnings introduced in r217556

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217569 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThread Safety Analysis: major update to thread safety TIL.
DeLesley Hutchins [Wed, 10 Sep 2014 22:12:52 +0000 (22:12 +0000)]
Thread Safety Analysis: major update to thread safety TIL.
Numerous changes, including:
  * Changed the way variables and instructions are handled in basic blocks to
    be more efficient.
  * Eliminated SExprRef.
  * Simplified futures.
  * Fixed documentation.
  * Compute dominator and post dominator trees.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217556 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMore test for "void *" argument as index of a dictionary literal.
Fariborz Jahanian [Wed, 10 Sep 2014 22:12:13 +0000 (22:12 +0000)]
More test for "void *" argument as index of a dictionary literal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217555 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove a couple of fixed paths that snuck into my test from 217550
Ben Langmuir [Wed, 10 Sep 2014 21:41:43 +0000 (21:41 +0000)]
Remove a couple of fixed paths that snuck into my test from 217550

I forgot to fix these again the second time I copy-and-pasted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217552 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAvoid a couple of assertions when preprocessing with modules
Ben Langmuir [Wed, 10 Sep 2014 21:29:41 +0000 (21:29 +0000)]
Avoid a couple of assertions when preprocessing with modules

1. We were hitting the NextIsPrevious assertion because we were trying
to merge decl chains that were independent of each other because we had
no Sema object to allow them to find existing decls. This is fixed by
delaying loading the "preloaded" decls until Sema is available.

2. We were trying to get identifier info from an annotation token, which
asserts.  The fix is to special-case the module annotations in the
preprocessed output printer.

Fixed in a single commit because when you hit 1 you almost invariably
hit 2 as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217550 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 10 Sep 2014 21:27:41 +0000 (21:27 +0000)]
Update for llvm api change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217547 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoOnly override the target architecture on -m32 and friends if it is
Joerg Sonnenberger [Wed, 10 Sep 2014 21:25:37 +0000 (21:25 +0000)]
Only override the target architecture on -m32 and friends if it is
actually different. Fixes a surprising link error with nodejs on rpi,
where armv6-netbsd-eabihf turned into armv5e-netbsd-eabihf, which
doesn't lacks the necessary VFP support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217546 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoObjective-C. Accept 'nil' as indexing argument to
Fariborz Jahanian [Wed, 10 Sep 2014 20:55:31 +0000 (20:55 +0000)]
Objective-C. Accept 'nil' as indexing argument to
dictionary literals since the API which implements
them accepts it too.  // rdar://18254621

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217543 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMS ABI: Emit dynamic initializers for selectany globals in comdat-associative section...
Hans Wennborg [Wed, 10 Sep 2014 19:28:48 +0000 (19:28 +0000)]
MS ABI: Emit dynamic initializers for selectany globals in comdat-associative sections (PR20889)

This prevents initializers for comdat-folded globals from running multiple times.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217534 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoObjective-C arc. Fixes a crash when issuing diagnostic for
Fariborz Jahanian [Wed, 10 Sep 2014 18:23:34 +0000 (18:23 +0000)]
Objective-C arc. Fixes a crash when issuing diagnostic for
passing parameter to an audited CF API. rdar://18222007

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217530 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[sphinx cleanup]
Dan Liew [Wed, 10 Sep 2014 17:26:21 +0000 (17:26 +0000)]
[sphinx cleanup]
Fix sphinx warning introduced by r217501.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217524 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRecognize .lib files as linker input explicitly
Ehsan Akhgari [Wed, 10 Sep 2014 17:15:00 +0000 (17:15 +0000)]
Recognize .lib files as linker input explicitly

Summary:
Currently, this is done implicitly in Driver::BuildInputs by considering
any invalid input type as linker input.

Test Plan: I don't think this behavior is observable for the reason stated above.

Reviewers: hansw

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217522 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd a test for an operator access decl.
Nico Weber [Wed, 10 Sep 2014 17:03:37 +0000 (17:03 +0000)]
Add a test for an operator access decl.

In Parser::ParseCXXClassMemberDeclaration(), it was possible to change
      isAccessDecl = NextToken().is(tok::kw_operator);
to
      isAccessDecl = false;
and no tests would fail. Now there's coverage for this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217519 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agotypo
Sanjay Patel [Wed, 10 Sep 2014 16:59:01 +0000 (16:59 +0000)]
typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217517 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Fix pthread lock tests so that the API comes from a system header.
Jordan Rose [Wed, 10 Sep 2014 16:17:42 +0000 (16:17 +0000)]
[analyzer] Fix pthread lock tests so that the API comes from a system header.

...and verify that a global mutex in user code can be used without warnings.

Patch by Aleksei Sidorin!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217515 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Add option to allow short case labels on a single line.
Daniel Jasper [Wed, 10 Sep 2014 13:11:45 +0000 (13:11 +0000)]
clang-format: Add option to allow short case labels on a single line.

On a single line:
  switch (a) {
  case 1: x = 1; return;
  case 2: x = 2; return;
  default: break;
  }

Not on a single line:
  switch (a) {
  case 1:
    x = 1;
    return;
  case 2:
    x = 2;
    return;
  default:
    break;
  }

This partly addresses llvm.org/PR16535. In the long run, we probably want to
lay these out in columns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217501 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCodeGen: Use a fixed alignment for vtables.
Benjamin Kramer [Wed, 10 Sep 2014 12:50:59 +0000 (12:50 +0000)]
CodeGen: Use a fixed alignment for vtables.

Pointer-sized alignment is sufficient as we only ever read single values
from the table. Otherwise we'd bump the alignment to 16 bytes in the
backend if the vtable is larger than 16 bytes. This is great for
structures that are accessed with vector instructions or copied around, but
that's simply not the case for vtables.

Shrinks the data segment of a Release x86_64 clang by 0.3%. The wins are
larger for i386 and code bases that use vtables more often than we do.

This matches the behavior of GCC 5.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217495 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert over-eager unique_ptr conversion.
Benjamin Kramer [Wed, 10 Sep 2014 09:35:49 +0000 (09:35 +0000)]
Revert over-eager unique_ptr conversion.

This test wants to observe PPCallbacks after they have been moved into the
preprocessor. That doesn't work if the pointer has been moved away.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217481 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUnique_ptrify PPCallbacks ownership.
Craig Topper [Wed, 10 Sep 2014 04:53:53 +0000 (04:53 +0000)]
Unique_ptrify PPCallbacks ownership.

Unique_ptr creation stil needs to be moved earlier at some of the call sites.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217474 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't crash on access decls with invalid scope specifier, PR20887.
Nico Weber [Wed, 10 Sep 2014 00:59:37 +0000 (00:59 +0000)]
Don't crash on access decls with invalid scope specifier, PR20887.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217472 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoObjective-C. Under a special flag, -Wcstring-format-directive,
Fariborz Jahanian [Tue, 9 Sep 2014 23:10:54 +0000 (23:10 +0000)]
Objective-C. Under a special flag, -Wcstring-format-directive,
off by default, issue a warning if %s directive is used in
certain CF/NS formatting APIs, to assist user in deprecating
use of such %s in these APIs. rdar://18182443

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217467 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTeach the analyzer that __builtin_assume_aligned returns its first argument.
Jordan Rose [Tue, 9 Sep 2014 21:42:16 +0000 (21:42 +0000)]
Teach the analyzer that __builtin_assume_aligned returns its first argument.

Patch by Daniel Fahlgren!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217461 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Support regex literals with trailing escaped slash.
Daniel Jasper [Tue, 9 Sep 2014 14:37:39 +0000 (14:37 +0000)]
clang-format: [JS] Support regex literals with trailing escaped slash.

Before:
  var regex = / a\//; int i;

After:
  var regex = /a\//;
  int i;

This required pushing the Lexer into its wrapper class and generating a
new one in this specific case. Otherwise, the sequence get lexed as a
//-comment. This is hacky, but I don't know a better way (short of
supporting regex literals in the Lexer).

Pushing the Lexer down seems to make all the call sites simpler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217444 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTooling: Ignore file names in tooling::deduplicate.
Benjamin Kramer [Tue, 9 Sep 2014 13:53:29 +0000 (13:53 +0000)]
Tooling: Ignore file names in tooling::deduplicate.

This was horribly broken due to how the sort predicate works. We would
report a conflict for files with a replacement in the same position but
different names if the length differed. Just ignore paths as this is often
what the user wants. Files can occur with different names (due to symlinks
or relative paths) and we don't ever want to do the same edit in one file
twice.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217439 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAllow empty statements in naked functions in addition to ASM statements
Ehsan Akhgari [Tue, 9 Sep 2014 02:49:40 +0000 (02:49 +0000)]
Allow empty statements in naked functions in addition to ASM statements

Summary: This fixes PR20883.

Test Plan: The patch includes an automated test.

Reviewers: hansw

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217413 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix PCHs that import more than one module
Ben Langmuir [Mon, 8 Sep 2014 20:36:26 +0000 (20:36 +0000)]
Fix PCHs that import more than one module

We were passing < to std::unique, but it expects ==. Since the input is
sorted, we were always trimming it to one entry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217402 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReport source location of returns_nonnull attribute in UBSan reports.
Alexey Samsonov [Mon, 8 Sep 2014 20:17:19 +0000 (20:17 +0000)]
Report source location of returns_nonnull attribute in UBSan reports.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217400 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoImplement nonnull-attribute sanitizer
Alexey Samsonov [Mon, 8 Sep 2014 17:22:45 +0000 (17:22 +0000)]
Implement nonnull-attribute sanitizer

Summary:
This patch implements a new UBSan check, which verifies
that function arguments declared to be nonnull with __attribute__((nonnull))
are actually nonnull in runtime.

To implement this check, we pass FunctionDecl to CodeGenFunction::EmitCallArgs
(where applicable) and if function declaration has nonnull attribute specified
for a certain formal parameter, we compare the corresponding RValue to null as
soon as it's calculated.

Test Plan: regression test suite

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits, rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217389 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove a parameter that has been unused since r188481. No behavior change.
Nico Weber [Mon, 8 Sep 2014 16:26:36 +0000 (16:26 +0000)]
Remove a parameter that has been unused since r188481. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217386 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake FileEntry::getName() valid across calls to FileManager::getFile()
Ben Langmuir [Mon, 8 Sep 2014 16:15:54 +0000 (16:15 +0000)]
Make FileEntry::getName() valid across calls to FileManager::getFile()

Because we may change the name of a FileEntry inside getFile, the name
returned by FileEntry::getName() could be destroyed.  This was causing a
use-after-free when searching the HeaderFileInfo on-disk hashtable for a
module or pch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217385 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd a comment for something that confused me.
Nico Weber [Mon, 8 Sep 2014 16:11:15 +0000 (16:11 +0000)]
Add a comment for something that confused me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217384 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoHandle constructors and destructors a bit more uniformly in CodeGen.
Rafael Espindola [Mon, 8 Sep 2014 16:01:27 +0000 (16:01 +0000)]
Handle constructors and destructors a bit more uniformly in CodeGen.

There were code paths that are duplicated for constructors and destructors just
because we have both CXXCtorType and CXXDtorsTypes.

This patch introduces an unified enum and reduces code deplication a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217383 91177308-0d34-0410-b5e6-96231b3b80d8