]> granicus.if.org Git - clang/log
clang
10 years agoRemove empty directory left after r207995.
Alexander Kornienko [Wed, 14 May 2014 11:34:48 +0000 (11:34 +0000)]
Remove empty directory left after r207995.

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

10 years ago[OPENMP] Fix warning in Release builds.
Alexey Bataev [Wed, 14 May 2014 10:40:54 +0000 (10:40 +0000)]
[OPENMP] Fix warning in Release builds.

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

10 years agoclang-format: Add clang-format-diff usage examples for SVN.
Daniel Jasper [Wed, 14 May 2014 09:36:11 +0000 (09:36 +0000)]
clang-format: Add clang-format-diff usage examples for SVN.

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

10 years agoclang-format: Add option to allow short blocks on a single line.
Daniel Jasper [Wed, 14 May 2014 09:33:35 +0000 (09:33 +0000)]
clang-format: Add option to allow short blocks on a single line.

With AllowShortBlocksOnASingleLine, clang-format allows:
  if (a) { return; }

Based on patch by Gonzalo BG, thank you!

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

10 years ago[ARM64]Fix the bug right shift uint64_t by 64 generates incorrect result.
Hao Liu [Wed, 14 May 2014 08:59:30 +0000 (08:59 +0000)]
[ARM64]Fix the bug right shift uint64_t by 64 generates incorrect result.

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

10 years agoSema::FindAllocationFunctions(): Fix \param. [-Wdocumentation]
NAKAMURA Takumi [Wed, 14 May 2014 08:07:56 +0000 (08:07 +0000)]
Sema::FindAllocationFunctions(): Fix \param. [-Wdocumentation]

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

10 years agoCreate a redeclaration when an elaborated type specifier
John McCall [Wed, 14 May 2014 07:54:17 +0000 (07:54 +0000)]
Create a redeclaration when an elaborated type specifier
resolves to an existing declaration if there are attributes
present.

This gives us something to apply the attributes to.

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

10 years agoDebugInfo: Avoid creating DILexicalScopeFiles when the filename in the current scope...
David Blaikie [Wed, 14 May 2014 00:29:00 +0000 (00:29 +0000)]
DebugInfo: Avoid creating DILexicalScopeFiles when the filename in the current scope has not changed.

This looks like the right way for this check to work, but there is
another semi-obvious bug, I would think: why is CurLoc not zero'd out
between functions? The possibility for it to bleed between them seems
problematic. (& indeed I caused tests to fail when I fixed this a
different way, by setting CurLoc to SourceLocation() and the end of
EmitFunctionEnd... )

The changes to debug-info-blocks.m are due to a mismatch between the
source manager's file naming and CGDebugInfo's default handling when no
-main-file-name is specified. This actually reveals somewhat of a bug in
the debug info when using source files from standard in, too. See the
comment in CGDebugInfo::CreateCompileUnit for more details.

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

10 years agoPush record return type classification into CGCXXABI
Reid Kleckner [Tue, 13 May 2014 22:05:45 +0000 (22:05 +0000)]
Push record return type classification into CGCXXABI

In the Microsoft C++ ABI, instance methods always return records
indirectly via the second hidden parameter.  This was implemented in
X86_32ABIInfo, but not WinX86_64ABIInfo.

Rather than exposing a handful of boolean methods in the CGCXXABI
interface, we can expose a single method that applies C++ ABI return
value classification rules.

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

10 years agoMake this test target independent.
Eric Christopher [Tue, 13 May 2014 20:16:43 +0000 (20:16 +0000)]
Make this test target independent.

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

10 years agoPR19729: Delete a bunch of bogus code in Sema::FindAllocationOverload. This
Richard Smith [Tue, 13 May 2014 19:56:21 +0000 (19:56 +0000)]
PR19729: Delete a bunch of bogus code in Sema::FindAllocationOverload. This
caused us to perform copy-initialization for the parameters of an allocation
function called by a new-expression multiple times, resulting in us rejecting
allocations that passed non-copyable parameters (and much worse things in
MSVC compat mode, where we potentially called this function multiple times).

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

10 years agoAdd a requires for the arm-registered-target needed by this test as
Eric Christopher [Tue, 13 May 2014 19:52:18 +0000 (19:52 +0000)]
Add a requires for the arm-registered-target needed by this test as
well.

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

10 years agoAdd __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind
Joerg Sonnenberger [Tue, 13 May 2014 18:58:36 +0000 (18:58 +0000)]
Add __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind
instructions.

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

10 years agoTest preprocessor defines for NetBSD/ARM.
Joerg Sonnenberger [Tue, 13 May 2014 18:58:00 +0000 (18:58 +0000)]
Test preprocessor defines for NetBSD/ARM.

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

10 years agoUpdate for llvm API change.
Rafael Espindola [Tue, 13 May 2014 18:45:53 +0000 (18:45 +0000)]
Update for llvm API change.

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

10 years agoFix the AST printer for attributed statements so that it does not print duplicate...
Aaron Ballman [Tue, 13 May 2014 16:12:14 +0000 (16:12 +0000)]
Fix the AST printer for attributed statements so that it does not print duplicate attribute introducers. Eg) [[clang::fallthrough]] instead of  [[[[clang::fallthrough]]]]

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

10 years agoUpdated the test case to show that no diagnostics are expected, and not require emitt...
Aaron Ballman [Tue, 13 May 2014 15:14:59 +0000 (15:14 +0000)]
Updated the test case to show that no diagnostics are expected, and not require emitting the AST until after the AST printing for statement attributes is updated.

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

10 years agoNo longer triggering a checked iterator assert on Windows when using std::copy while...
Aaron Ballman [Tue, 13 May 2014 14:55:01 +0000 (14:55 +0000)]
No longer triggering a checked iterator assert on Windows when using std::copy while deserializing attributed statements with more than one attribute.

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

10 years agoDefine the InterlockedCompareExchange64 intrinsic on 32-bits too
Timur Iskhodzhanov [Tue, 13 May 2014 13:59:05 +0000 (13:59 +0000)]
Define the InterlockedCompareExchange64 intrinsic on 32-bits too

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

10 years agotry to make test/Driver/masm.c work with the hexagon bot
Nico Weber [Tue, 13 May 2014 11:30:01 +0000 (11:30 +0000)]
try to make test/Driver/masm.c work with the hexagon bot

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

10 years agoDrop AST's version of ARMCXXABI, it doesn't differ from the Itanium base
Joerg Sonnenberger [Tue, 13 May 2014 11:20:16 +0000 (11:20 +0000)]
Drop AST's version of ARMCXXABI, it doesn't differ from the Itanium base
class.

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

10 years agoSupport -masm= flag for x86 targets.
Nico Weber [Tue, 13 May 2014 11:11:24 +0000 (11:11 +0000)]
Support -masm= flag for x86 targets.

`clang -S -o - file.c -masm=att` will write assembly to stdout in at&t syntax
(the default), `-masm=intel` will instead output intel style asm.

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

10 years agoclang-format: Don't break in the middle of ">>".
Daniel Jasper [Tue, 13 May 2014 08:01:47 +0000 (08:01 +0000)]
clang-format: Don't break in the middle of ">>".

Before:
  zzzzzzzzzz = bbbbbbbbbbbbbbbbb >
               > aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
  zzzzzzzzzz
      = bbbbbbbbbbbbbbbbb
        >> aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa);

This fixes llvm.org/PR19731.

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

10 years agoMS ABI: Tighten RTTI mangling
David Majnemer [Tue, 13 May 2014 06:57:43 +0000 (06:57 +0000)]
MS ABI: Tighten RTTI mangling

r208661 contained WIP code, commit the *actual* manglings.

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

10 years agoFixed a few tests and moved a comment to its proper place
Filipe Cabecinhas [Tue, 13 May 2014 05:21:11 +0000 (05:21 +0000)]
Fixed a few tests and moved a comment to its proper place

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

10 years agoPatched clang to emit x86 blends as shufflevectors.
Filipe Cabecinhas [Tue, 13 May 2014 02:37:02 +0000 (02:37 +0000)]
Patched clang to emit x86 blends as shufflevectors.

Summary:
Most of the clang header patch by Simon Pilgrim @ SCEE.
Also fixed (or added) clang tests for these intrinsics.

LLVM tests to make sure we get the blend instruction out of these
shufflevectors are at http://reviews.llvm.org/D3600

Reviewers: eli.friedman, craig.topper, rafael

Subscribers: cfe-commits

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

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

10 years agoRefactor to avoid explicitly listing all the different flavours of redeclarable
Richard Smith [Tue, 13 May 2014 01:15:00 +0000 (01:15 +0000)]
Refactor to avoid explicitly listing all the different flavours of redeclarable
declarations, and duplicating code between them.

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

10 years agoMS ABI: Preliminary RTTI mangling
David Majnemer [Tue, 13 May 2014 00:44:44 +0000 (00:44 +0000)]
MS ABI: Preliminary RTTI mangling

Implement what we currently believe is the mangling scheme for RTTI
data.  Tests will be added in a later commit which actually generate
RTTI data.

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

10 years agoRefactor and fix a latent bug (found by inspection) where an external AST
Richard Smith [Tue, 13 May 2014 00:34:43 +0000 (00:34 +0000)]
Refactor and fix a latent bug (found by inspection) where an external AST
source that provides a declaration from a hidden module would not have the
visibility of the produced definition checked. This might matter if an
external source chose to import a new module to provide an extra definition,
but is not observable with our current external sources.

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

10 years agoRemove unused PP variable NumIncluded
Will Wilson [Mon, 12 May 2014 21:26:54 +0000 (21:26 +0000)]
Remove unused PP variable NumIncluded

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

10 years ago[ASan] Fixup for r208610: link in asan_cxx library on Windows
Alexey Samsonov [Mon, 12 May 2014 20:20:20 +0000 (20:20 +0000)]
[ASan] Fixup for r208610: link in asan_cxx library on Windows

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

10 years agoclang-cl: accept -mllvm and -fsanitize_blacklist
Hans Wennborg [Mon, 12 May 2014 18:59:00 +0000 (18:59 +0000)]
clang-cl: accept -mllvm and -fsanitize_blacklist

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

10 years ago[ASan] Split static ASan runtime in two parts: asan and asan_cxx.
Alexey Samsonov [Mon, 12 May 2014 18:39:51 +0000 (18:39 +0000)]
[ASan] Split static ASan runtime in two parts: asan and asan_cxx.

asan_cxx containts replacements for new/delete operators, and should
only be linked in C++ mode. We plan to start building this part
with exception support to make new more standard-compliant.

See https://code.google.com/p/address-sanitizer/issues/detail?id=295
for more details.

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

10 years ago[scan-build] Pass --sysroot through for both compilation and linking.
Jordan Rose [Mon, 12 May 2014 17:04:44 +0000 (17:04 +0000)]
[scan-build] Pass --sysroot through for both compilation and linking.

PR19704

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

10 years agoclang-format: [JS] Basic support for escape sequences in regex literals.
Daniel Jasper [Mon, 12 May 2014 11:29:50 +0000 (11:29 +0000)]
clang-format: [JS] Basic support for escape sequences in regex literals.

Before:
  var regex = /\\/ g; // This isn't even recognized as regex.

After:
  var regex = /\\/g; // It now is.

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

10 years agoclang/test/CXX/drs/dr4xx.cpp: Use env(1) to satisfy lit internal runner.
NAKAMURA Takumi [Mon, 12 May 2014 10:16:20 +0000 (10:16 +0000)]
clang/test/CXX/drs/dr4xx.cpp: Use env(1) to satisfy lit internal runner.

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

10 years ago[Driver] Do not lose already detected set of toolchain's multilibs while
Simon Atanasyan [Mon, 12 May 2014 07:37:51 +0000 (07:37 +0000)]
[Driver] Do not lose already detected set of toolchain's multilibs while
iterating over different library path suffixes and different library versions.

To find the most appropriate library for the given command line flags we
iterate over a set of disk paths. Before probe each path the already
detected set of multilibs are cleared. If the set of paths contains
existing paths which do not satisfy command line flags or do not contain
necessary libraries and object files at all we might lose found multilibs.

The patch updates variables which hold detected multilibs if we really find
a new multilib matches command line flags.

The patch reviewed by Jon Roelofs.

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

10 years agodisable asan's detect_stack_use_after_return when running CXX/drs/dr4xx.cpp (temporar...
Kostya Serebryany [Mon, 12 May 2014 07:05:16 +0000 (07:05 +0000)]
disable asan's detect_stack_use_after_return when running CXX/drs/dr4xx.cpp (temporary workaround for PR19722); This should make the asan bootstrap bot green again

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

10 years ago[C++11] Use 'nullptr'. AST edition.
Craig Topper [Mon, 12 May 2014 05:36:57 +0000 (05:36 +0000)]
[C++11] Use 'nullptr'. AST edition.

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

10 years ago[OPENMP] Removed unnecessary enums from OpenMP constructs
Alexey Bataev [Mon, 12 May 2014 04:23:46 +0000 (04:23 +0000)]
[OPENMP] Removed unnecessary enums from OpenMP constructs

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

10 years agoRevert "Revert "Another try at making MSVC happy again.""
Alp Toker [Sun, 11 May 2014 23:06:26 +0000 (23:06 +0000)]
Revert "Revert "Another try at making MSVC happy again.""

This didn't work out either.

Discussion at:
  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140505/105302.html

This reverts commit r208513.

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

10 years agoRevert "Another try at making MSVC happy again."
Alp Toker [Sun, 11 May 2014 22:12:18 +0000 (22:12 +0000)]
Revert "Another try at making MSVC happy again."

Prospective revert to see if r208512 helped the MSVC build.

This reverts commit r208497.

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

10 years agoMake DiagnosticsEngine non-copyable
Alp Toker [Sun, 11 May 2014 22:10:52 +0000 (22:10 +0000)]
Make DiagnosticsEngine non-copyable

Also provide an out-of-line dtor for CompilerInvocation.

Cleanup work that may help reduce header inclusion for IntrusiveRefCntPtr.

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

10 years agoPR19713: Don't warn on unused static inline functions, even if the 'inline' was
Richard Smith [Sun, 11 May 2014 21:25:24 +0000 (21:25 +0000)]
PR19713: Don't warn on unused static inline functions, even if the 'inline' was
implied by 'constexpr'.

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

10 years agoDriver: Don't leak the -Xarch argument when its use is incorrect.
Nico Weber [Sun, 11 May 2014 17:27:13 +0000 (17:27 +0000)]
Driver: Don't leak the -Xarch argument when its use is incorrect.

(LLVM's lib/Option looks like it might appreciate being hit with the
std::unique_ptr stick.)

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

10 years agoc-index-test: Don't leak diagnostic category text.
Nico Weber [Sun, 11 May 2014 17:16:59 +0000 (17:16 +0000)]
c-index-test: Don't leak diagnostic category text.

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

10 years agoParameter/argument terminology fixes
Alp Toker [Sun, 11 May 2014 16:06:11 +0000 (16:06 +0000)]
Parameter/argument terminology fixes

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

10 years agoConsolidate single void paramter checking
Alp Toker [Sun, 11 May 2014 16:05:55 +0000 (16:05 +0000)]
Consolidate single void paramter checking

Also correct argument/parameter terminology.

No change in functionality.

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

10 years agoAnother try at making MSVC happy again.
Benjamin Kramer [Sun, 11 May 2014 16:03:08 +0000 (16:03 +0000)]
Another try at making MSVC happy again.

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

10 years agoPut back raw_ostream.h include.
Benjamin Kramer [Sun, 11 May 2014 10:41:20 +0000 (10:41 +0000)]
Put back raw_ostream.h include.

Some configurations of MSVC get horribly confused by the forward declaration
and explode.

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

10 years agoSilence warning in Release builds. This function is only used in an assert.
Benjamin Kramer [Sun, 11 May 2014 09:31:47 +0000 (09:31 +0000)]
Silence warning in Release builds. This function is only used in an assert.

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

10 years agoCodeGen: support dll{ex,im}port on WoA
Saleem Abdulrasool [Sun, 11 May 2014 01:31:57 +0000 (01:31 +0000)]
CodeGen: support dll{ex,im}port on WoA

Add ARM support for dllexport and dllimport attributes.  This is a relatively
conservative change.  The alternative is to entirely drop the architecture
requirement.  The dllimport and dllexport attributes are not restricted to any
architecture, simply to platforms that support this attribute (currently
Windows).

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

10 years agoWrap at 80 columns. No code change.
Nico Weber [Sun, 11 May 2014 01:04:02 +0000 (01:04 +0000)]
Wrap at 80 columns. No code change.

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

10 years agoFollow-up to r208481: Free all default arguments, not just the first one.
Nico Weber [Sun, 11 May 2014 00:28:16 +0000 (00:28 +0000)]
Follow-up to r208481: Free all default arguments, not just the first one.

Also add test coverage for this case.  Found by Richard Smith!

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

10 years agoDon't leak CXStrings for replacement fix-its in c-index-test.
Nico Weber [Sat, 10 May 2014 23:56:43 +0000 (23:56 +0000)]
Don't leak CXStrings for replacement fix-its in c-index-test.

The loop body used to contain a switch statement; it looks like r96685 replaced
that with an if/else if/else but accidentally left one of the three break
statements from the switch behind, skipping the clang_disposeString() call
for replacements (and the rest of the loop too, which apparently doesn't make
a differences for the test cases we have).

r96685: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100215/027754.html

This too might possibly the last leak in clang (PR19521).

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

10 years agoTry to bring the 32 bit buildbots back to life.
Benjamin Kramer [Sat, 10 May 2014 20:57:56 +0000 (20:57 +0000)]
Try to bring the 32 bit buildbots back to life.

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

10 years agoDon't leak default arg tokens on invalid destructors or conversion functions.
Nico Weber [Sat, 10 May 2014 19:23:28 +0000 (19:23 +0000)]
Don't leak default arg tokens on invalid destructors or conversion functions.

Fixes PR19689, and possibly the last leak in clang (PR19521). PR19689 contains
a few suggestions on how to make the default argument token code a bit more
solid, these changes can possibly be landed in follow-ups.

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

10 years agoAdd test coverage for invalid conversion functions with default args.
Nico Weber [Sat, 10 May 2014 19:15:24 +0000 (19:15 +0000)]
Add test coverage for invalid conversion functions with default args.

This currently leaks memory (PR19689) but wasn't covered by tests, so LSan
couldn't find it.

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

10 years agoWrap to 80 columns. No behavior change.
Nico Weber [Sat, 10 May 2014 17:43:15 +0000 (17:43 +0000)]
Wrap to 80 columns. No behavior change.

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

10 years agoObjective-C ARC. Add support for toll-free bridge
Fariborz Jahanian [Sat, 10 May 2014 17:40:11 +0000 (17:40 +0000)]
Objective-C ARC. Add support for toll-free bridge
type ,and bridge attribute, checking with static_cast.
// rdar://16756639

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

10 years agoAnalyzer: Make helper function static.
Benjamin Kramer [Sat, 10 May 2014 17:13:34 +0000 (17:13 +0000)]
Analyzer: Make helper function static.

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

10 years agoDecouple ExprCXX.h and DeclCXX.h and clean up includes a bit.
Benjamin Kramer [Sat, 10 May 2014 16:31:55 +0000 (16:31 +0000)]
Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.

Required pulling LambdaExpr::Capture into its own header.
No functionality change.

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

10 years agoAdd FIXME describing the limitation of using column info to disambiguate inlining.
David Blaikie [Sat, 10 May 2014 02:44:57 +0000 (02:44 +0000)]
Add FIXME describing the limitation of using column info to disambiguate inlining.

Also tidy up, simplify, and extend the test coverage to demonstrate the
limitations. This test should now fail if the bugs are fixed (&
hopefully whoever ends up in this situation sees the FIXMEs and realizes
that the test needs to be updated to positively test their change that
has fixed some or all of these issues).

I do wonder whether I could demonstrate breakage without a macro here,
but any way I slice it I can't think of a way to get two calls to the
same function on the same line/column in non-macro C++ - implicit
conversions happen at the same location as an explicit function, but
you'd never get an implicit conversion on the result of an explicit call
to the same implicit conversion operator (since the value is already
converted to the desired result)...

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

10 years agoStop all the Decl classes poking at Redeclarable's data member directly, and make...
Richard Smith [Sat, 10 May 2014 01:17:36 +0000 (01:17 +0000)]
Stop all the Decl classes poking at Redeclarable's data member directly, and make getNextRedeclaration follow the pattern of its friends getPreviousDecl and getMostRecentDecl.

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

10 years agoMS ABI: Pass 'sret' as the second parameter of instance methods
Reid Kleckner [Fri, 9 May 2014 22:46:15 +0000 (22:46 +0000)]
MS ABI: Pass 'sret' as the second parameter of instance methods

Summary:
MSVC always passes 'sret' after 'this', unlike GCC.  This required
changing a number of places in Clang that assumed the sret parameter was
always first in LLVM IR.

This fixes win64 MSVC ABI compatibility for methods returning structs.

Reviewers: rsmith, majnemer

Subscribers: cfe-commits

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

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

10 years agoDon't leak the CXStoredDiagnostics returned by clang_codeCompleteGetDiagnostic()
Nico Weber [Fri, 9 May 2014 22:33:11 +0000 (22:33 +0000)]
Don't leak the CXStoredDiagnostics returned by clang_codeCompleteGetDiagnostic()

r144269 changed clang_disposeDiagnostic() to be a no-op, but didn't update
code completion diagnostics.  Let CXCodeCompleteResults store all diagnostics
returned by clang_codeCompleteGetDiagnostic() and then free them up in
clang_disposeCodeCompleteResults().

Code completion diagnostics referred to data stored in CXCodeCompleteResults
before already, so it wasn't possible to refer to the results of
clang_codeCompleteGetDiagnostic() after clang_disposeCodeCompleteResults()
before this change already -- hence this should be a safe, backwards-compatible
change.

Leak found by LSan, fixes PR19690.

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

10 years agoDon't emit -Wnon-virtual-dtor on final classes, since it's not a problem there.
David Blaikie [Fri, 9 May 2014 22:02:28 +0000 (22:02 +0000)]
Don't emit -Wnon-virtual-dtor on final classes, since it's not a problem there.

The base class is the culprit/risk here - a sealed/final derived class
with virtual functions and a non-virtual dtor can't accidentally be
polymorphically destroyed (if the base class's dtor is protected - which
also suppresses this warning).

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

10 years agoPR19698, PR19674: enable __has_feature checks for cxx_generic_lambdas and
Richard Smith [Fri, 9 May 2014 21:08:59 +0000 (21:08 +0000)]
PR19698, PR19674: enable __has_feature checks for cxx_generic_lambdas and
cxx_decltype_auto, and fix documentation of cxx_generic_lambdas and
cxx_init_captures to specify the right feature-check name.

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

10 years agoObjective-C. Reduce false positive warnings with -Wselector by issuing warning
Fariborz Jahanian [Fri, 9 May 2014 19:51:39 +0000 (19:51 +0000)]
Objective-C. Reduce false positive warnings with -Wselector by issuing warning
only when named selector is declared in TU and it is not declared in a system
header. rdar://16600230

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

10 years agoAmending r208439 to remove buildLExpr; this code isn't strictly required yet, and...
Aaron Ballman [Fri, 9 May 2014 18:44:48 +0000 (18:44 +0000)]
Amending r208439 to remove buildLExpr; this code isn't strictly required yet, and fixes a dead code warning.

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

10 years agoAdd the ability to use logical expressions for capability attributes. This is to...
Aaron Ballman [Fri, 9 May 2014 18:26:23 +0000 (18:26 +0000)]
Add the ability to use logical expressions for capability attributes. This is to allow requirements to be expressed not just in terms of lists, but in terms of logical expressions. Eg)

void foo(void) __attribute__((requires_capability((FlightControl || Worker) && !Logger)));

This is WIP code.

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

10 years agoDon't leak MacroArgs when using code completion, PR19688.
Nico Weber [Fri, 9 May 2014 18:09:42 +0000 (18:09 +0000)]
Don't leak MacroArgs when using code completion, PR19688.

MacroArgs are owned by TokenLexer, and when a TokenLexer is destroyed, it'll
call its MacroArgs's destroy() method.  destroy() only appends the MacroArg to
Preprocessor's MacroArgCache list, and Preprocessor's destructor then calls
deallocate() on all MacroArgs in that list.  This method then ends up freeing
the MacroArgs's memory.

In a code completion context, Parser::cutOffParsing() gets called when a code
completion token is hit, which changes the type of the current token to
tok::eof.  eof tokens aren't always ConsumeToken()ed, so
Preprocessor::HandleEndOfFile() isn't always called, and that function is
responsible for popping the macro stack.

Due to this, Preprocessor::CurTokenLexer can be non-NULL when
~Preprocessor runs.  It's a unique_ptr, so it ended up being destructed after
~Preprocessor completed, and its MacroArgs thus got added to the freelist after
the code freeing things on the freelist had already completed.  The fix is to
explicitly call reset() before the freelist processing happens.  (See the bug
for more notes.)

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

10 years agoThreadSafetyAnalysis: Don't crash when trying to analyze objc methods.
Benjamin Kramer [Fri, 9 May 2014 17:08:01 +0000 (17:08 +0000)]
ThreadSafetyAnalysis: Don't crash when trying to analyze objc methods.

The thread safety analysis isn't very useful in ObjC (you can't annotate
ObjC classes or methods) but we can still analyze the actual code and
show violations in usage of C/C++ functions.

Fixes PR19541, which does not use thread safety attributes but crashes
with -Weverything.

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

10 years agoPacify bots again - turns out my checkout was slightly polluted when I was reverting...
James Molloy [Fri, 9 May 2014 16:28:56 +0000 (16:28 +0000)]
Pacify bots again - turns out my checkout was slightly polluted when I was reverting a olista01s change, and this pollution made it upstream during the revert checkin :/ Sorryemacs -nw lib/CodeGen/CodeGenModule.cpp

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

10 years agoReapply r208417 (olista01 'ARM: HFAs must be passed in consecutive registers'). Bots...
James Molloy [Fri, 9 May 2014 16:21:39 +0000 (16:21 +0000)]
Reapply r208417 (olista01 'ARM: HFAs must be passed in consecutive registers'). Bots are now pacified.

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

10 years agoRevert r208417 (olista01 'ARM: HFAs must be passed in consecutive registers'). This...
James Molloy [Fri, 9 May 2014 16:17:09 +0000 (16:17 +0000)]
Revert r208417 (olista01 'ARM: HFAs must be passed in consecutive registers'). This is a followon commit from r208413 which broke the LLVM bots.

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

10 years agoARM: HFAs must be passed in consecutive registers
Oliver Stannard [Fri, 9 May 2014 15:14:56 +0000 (15:14 +0000)]
ARM: HFAs must be passed in consecutive registers

This is the clang counterpart to 208413, which ensures that Homogeneous
Floating-point Aggregates are passed in consecutive registers on ARM.

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

10 years agoclang-format: Fix bug introduced by r208392.
Daniel Jasper [Fri, 9 May 2014 13:11:16 +0000 (13:11 +0000)]
clang-format: Fix bug introduced by r208392.

Also run clang-format over clang-format's files.

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

10 years agoclang-format: [JS] Allow up to 3 empty lines in Google's JS style.
Daniel Jasper [Fri, 9 May 2014 10:28:58 +0000 (10:28 +0000)]
clang-format: [JS] Allow up to 3 empty lines in Google's JS style.

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

10 years agoclang-format: [JS] Fix spacing in dict literals.
Daniel Jasper [Fri, 9 May 2014 10:26:08 +0000 (10:26 +0000)]
clang-format: [JS] Fix spacing in dict literals.

Before:
  someVariable = {'a':[{}]};

After:
  someVariable = {'a': [{}]};

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

10 years agoPermit duplicate explicit class instantiations if MSVCCompat is enabled
Will Wilson [Fri, 9 May 2014 09:52:13 +0000 (09:52 +0000)]
Permit duplicate explicit class instantiations if MSVCCompat is enabled

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

10 years agoRevised wording for diagnostics in r208299
Ismail Pazarbasi [Fri, 9 May 2014 09:49:29 +0000 (09:49 +0000)]
Revised wording for diagnostics in r208299

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

10 years agoAdd support for partial jump scope checking
Alp Toker [Fri, 9 May 2014 08:40:10 +0000 (08:40 +0000)]
Add support for partial jump scope checking

This lets us diagnose and perform more complete semantic analysis when faced
with errors in the function body or declaration.

By recovering here we provide more consistent diagnostics, particularly during
interactive editing.

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

10 years ago[C++11] Use 'nullptr'.
Craig Topper [Fri, 9 May 2014 08:15:10 +0000 (08:15 +0000)]
[C++11] Use 'nullptr'.

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

10 years agoDon't repeat function name in comment.
Rafael Espindola [Fri, 9 May 2014 01:34:38 +0000 (01:34 +0000)]
Don't repeat function name in comment.

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

10 years agoWrap to 80 columns, no code change.
Nico Weber [Fri, 9 May 2014 01:00:48 +0000 (01:00 +0000)]
Wrap to 80 columns, no code change.

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

10 years agoDon't indent in namespaces.
Rafael Espindola [Fri, 9 May 2014 00:57:59 +0000 (00:57 +0000)]
Don't indent in namespaces.

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

10 years agoSimplify the code a bit by using linkage predicates.
Rafael Espindola [Fri, 9 May 2014 00:43:37 +0000 (00:43 +0000)]
Simplify the code a bit by using linkage predicates.

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

10 years agoFix filename in file header comment more.
Nico Weber [Fri, 9 May 2014 00:42:08 +0000 (00:42 +0000)]
Fix filename in file header comment more.

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

10 years agoFix filename in file header comment.
Nico Weber [Fri, 9 May 2014 00:39:59 +0000 (00:39 +0000)]
Fix filename in file header comment.

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

10 years agoDon't indent inside namespaces.
Rafael Espindola [Fri, 9 May 2014 00:26:20 +0000 (00:26 +0000)]
Don't indent inside namespaces.

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

10 years agoFix link target.
Richard Smith [Fri, 9 May 2014 00:20:01 +0000 (00:20 +0000)]
Fix link target.

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

10 years agoUse auto to avoid duplicating the type.
Rafael Espindola [Fri, 9 May 2014 00:08:36 +0000 (00:08 +0000)]
Use auto to avoid duplicating the type.

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

10 years agoSwitch Wmodule-build to a remark
Ben Langmuir [Thu, 8 May 2014 22:36:02 +0000 (22:36 +0000)]
Switch Wmodule-build to a remark

On reflection, this is better despite the missing command-line handling
bits for remarks.  Making this a remark makes it much clearer that
this is purely informational and avoids the negative connotations of a
'warning'.

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

10 years agoFix an outdated comment.
Richard Smith [Thu, 8 May 2014 22:32:00 +0000 (22:32 +0000)]
Fix an outdated comment.

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

10 years ago[Driver] Range-based loop simplification.
Simon Atanasyan [Thu, 8 May 2014 19:32:46 +0000 (19:32 +0000)]
[Driver] Range-based loop simplification.

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

10 years agoRemove -Wnon-modular-include
Ben Langmuir [Thu, 8 May 2014 18:09:29 +0000 (18:09 +0000)]
Remove -Wnon-modular-include

But keep -Wnon-modular-include-in-[framework-]module

This warning is too noisy and doesn't really indicate a problem for most
people.  Even though it would only really affect people using
-Weverything, that seems bad so remove it.

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

10 years agoCodeGen: fix code model mapping
Saleem Abdulrasool [Thu, 8 May 2014 16:28:48 +0000 (16:28 +0000)]
CodeGen: fix code model mapping

Large is CodeModel::Model::Large, not CodeModel::Model::Medium.  Thanks to
majnemer for pointing out the typo!  Its unclear how to test the mapped value in
the compiler, the tests already cover the driver side.

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

10 years agoSimplify a few cast<>s.
Rafael Espindola [Thu, 8 May 2014 15:44:45 +0000 (15:44 +0000)]
Simplify a few cast<>s.

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

10 years agoCleanup setFunctionDefinitionAttributes.
Rafael Espindola [Thu, 8 May 2014 15:26:12 +0000 (15:26 +0000)]
Cleanup setFunctionDefinitionAttributes.

Use more specific type, update comments and name style.

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