]> granicus.if.org Git - clang/log
clang
9 years agoReinstate r223753, reverted in r223759 due to breakage of clang-tools-extra.
Richard Smith [Wed, 10 Dec 2014 03:09:48 +0000 (03:09 +0000)]
Reinstate r223753, reverted in r223759 due to breakage of clang-tools-extra.
Original commit message:

[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.

For files named by -fmodule-map-file=, and files found by 'extern module'
directives, this flag specifies that we should resolve filenames relative to
the current working directory rather than relative to the directory in which
the module map file resides. This is aimed at fixing path handling, in
particular for relative -I paths, when building modules that represent
components of the current project (rather than libraries installed on the
current system, which the current project has as dependencies, where we'd
typically expect the module map files to be looked up implicitly).

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

9 years agoFixed the AST importer ot use redeclaration contexts properly.
Sean Callanan [Wed, 10 Dec 2014 03:09:41 +0000 (03:09 +0000)]
Fixed the AST importer ot use redeclaration contexts properly.

To ensure that we don't import duplicates, the ASTImporter often
checks the DeclContext for a Decl before importing it to see if
a Decl with the same name is already present.

This is problematic if the Decl is inside a transparent context
like an extern "C" block.  Lookup isn't allowed on such contexts,
and in fact they assert() if you do that.  So instead we look at
the redeclaration context -- the containing context that can be
used safely for these kinds of checks -- instead.

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

9 years agoDebugInfo: Correct location information for array accesses to elements of variable...
David Blaikie [Wed, 10 Dec 2014 01:34:25 +0000 (01:34 +0000)]
DebugInfo: Correct location information for array accesses to elements of variable array type.

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

9 years agoMade the ASTImporter resilient if it can't import
Sean Callanan [Wed, 10 Dec 2014 01:26:39 +0000 (01:26 +0000)]
Made the ASTImporter resilient if it can't import
SourceLocations.  LLDB rarely has the same files
mapped into the target AST context as the source
AST context, so the ASTImporter shouldn't expect
to see those files there.

This started to become a problem when importing
entities from modules -- these have proper source
locations, in contrast to all the ASTs LLDB
creates which have empty ones.

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

9 years agoDebugInfo: Fix another case of array access line information
David Blaikie [Wed, 10 Dec 2014 01:16:09 +0000 (01:16 +0000)]
DebugInfo: Fix another case of array access line information

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

9 years agoDebugInfo: Correct the location of array accesses
David Blaikie [Wed, 10 Dec 2014 01:03:48 +0000 (01:03 +0000)]
DebugInfo: Correct the location of array accesses

Especially relevant to ASan when dealing with complex expressions
containing multiple array accesses. See PR21737.

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

9 years agoMake sure that vec_perm is listed as a static function in altivec.h.
Eric Christopher [Wed, 10 Dec 2014 00:57:43 +0000 (00:57 +0000)]
Make sure that vec_perm is listed as a static function in altivec.h.

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

9 years agoTweak test case from r223842 to make it pass on Windows MSVC
Reid Kleckner [Wed, 10 Dec 2014 00:47:33 +0000 (00:47 +0000)]
Tweak test case from r223842 to make it pass on Windows MSVC

We can't mangle __complex yet, and there is no C1 emission.

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

9 years agocmake: Make SVNVersion.inc step depend on GetSVN.cmake.
Nico Weber [Wed, 10 Dec 2014 00:03:37 +0000 (00:03 +0000)]
cmake: Make SVNVersion.inc step depend on GetSVN.cmake.

This way, the step generating SVNVersion.inc gets rerun every time someone
changes GetSVN.cmake (which is the file that decides how the contents of
SVNVersion.inc look). This makes hacking on GetSVN.cmake a bit easier.

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

9 years agoUpdated the AST importer to support importing
Sean Callanan [Wed, 10 Dec 2014 00:00:37 +0000 (00:00 +0000)]
Updated the AST importer to support importing
LinkageSpecDecls.  This is relevant when LLDB
wants to import Decls from non-C++ modules,
since many declarations are in extern "C"
blocks.

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

9 years agoModified the Objective-C lexer and parser (only
Sean Callanan [Tue, 9 Dec 2014 23:47:56 +0000 (23:47 +0000)]
Modified the Objective-C lexer and parser (only
in debugger mode) to accept @import declarations
and pass them to the debugger.

In the preprocessor, accept import declarations
if the debugger is enabled, but don't actually
load the module, just pass the import path on to
the preprocessor callbacks.

In the Objective-C parser, if it sees an import
declaration in statement context (usual for LLDB),
ignore it and return a NullStmt.

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

9 years agoDebugInfo: Correct location of aggregate assignment
David Blaikie [Tue, 9 Dec 2014 23:33:26 +0000 (23:33 +0000)]
DebugInfo: Correct location of aggregate assignment

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

9 years agoAST: Don't assume two zero sized objects live at different addresses
David Majnemer [Tue, 9 Dec 2014 23:32:34 +0000 (23:32 +0000)]
AST: Don't assume two zero sized objects live at different addresses

Zero sized objects may overlap with each other or any other object.

This fixes PR21786.

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

9 years agoclang-format: Add a test for PR19603 which seems fixed (maybe by r221338?).
Nico Weber [Tue, 9 Dec 2014 23:22:35 +0000 (23:22 +0000)]
clang-format: Add a test for PR19603 which seems fixed (maybe by r221338?).

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

9 years agoObjective-C SDK modernizer. Modernize to use
Fariborz Jahanian [Tue, 9 Dec 2014 22:36:47 +0000 (22:36 +0000)]
Objective-C SDK modernizer. Modernize to use
property-dot-syntax when receiver is 'super'.
rdar://19140267

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

9 years agoDebugInfo: Correct location of initialization of auto __complex
David Blaikie [Tue, 9 Dec 2014 22:15:02 +0000 (22:15 +0000)]
DebugInfo: Correct location of initialization of auto __complex

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

9 years agoDebugInfo: Correct the location of initializations of auto.
David Blaikie [Tue, 9 Dec 2014 22:04:13 +0000 (22:04 +0000)]
DebugInfo: Correct the location of initializations of auto.

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

9 years agoDebugInfo: Correct location for compound complex assignment
David Blaikie [Tue, 9 Dec 2014 21:32:00 +0000 (21:32 +0000)]
DebugInfo: Correct location for compound complex assignment

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

9 years agoDebugInfo: Accurate location information for complex assignment
David Blaikie [Tue, 9 Dec 2014 21:10:43 +0000 (21:10 +0000)]
DebugInfo: Accurate location information for complex assignment

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

9 years agoDebugInfo: Emit the correct location for initialization of a complex variable
David Blaikie [Tue, 9 Dec 2014 20:52:24 +0000 (20:52 +0000)]
DebugInfo: Emit the correct location for initialization of a complex variable

Especially useful for sanitizer reports.

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

9 years agoFix a GCC error from r223803
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 19:22:40 +0000 (19:22 +0000)]
Fix a GCC error from r223803

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

9 years agoIR: Update clang for Metadata/Value split in r223802
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 18:39:32 +0000 (18:39 +0000)]
IR: Update clang for Metadata/Value split in r223802

Match LLVM API changes from r223802.

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

9 years agoDon't actually generate code for testing the frontend's target cpu flag,
Chandler Carruth [Tue, 9 Dec 2014 15:52:55 +0000 (15:52 +0000)]
Don't actually generate code for testing the frontend's target cpu flag,
just verify. This should fix the bots where the x86 backend isn't built
into Clang. Sorry for the breakage.

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

9 years agoRe-work the Clang system for classifying Intel x86 CPUs to use their
Chandler Carruth [Tue, 9 Dec 2014 14:50:25 +0000 (14:50 +0000)]
Re-work the Clang system for classifying Intel x86 CPUs to use their
basic microarchitecture names, and add support (with tests) for parsing
all of the masic microarchitecture names for CPUs documented to be
accepted by GCC with -march. I didn't go back through the 32-bit-only
old microarchitectures, but this at least brings the recent architecture
names up to speed. This is essentially the follow-up to the LLVM commit
r223769 which did similar cleanups for the LLVM CPUs.

One particular benefit is that you can now use -march=westmere in Clang
and get the LLVM westmere processor which is a different ISA variant (!)
and so quite significant.

Much like with r223769, I would appreciate the Intel folks carefully
thinking about the macros defined, names used, etc for the atom chips
and newest primary x86 chips. The current patterns seem quite strange to
me, especially here in Clang.

Note that I haven't replicated the per-microarchitecture macro defines
provided by GCC. I'm really opposed to source code using these rather
than using ISA feature macros.

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

9 years agoRevert "[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1."
Duncan P. N. Exon Smith [Tue, 9 Dec 2014 06:35:37 +0000 (06:35 +0000)]
Revert "[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1."

This reverts commit r223753.  It broke the Green Dragon build for a few
hours:

  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/
  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/2259/consoleFull#43901905849ba4694-19c4-4d7e-bec5-911270d8a58c

I suspect `clang-tools-extra` just needs a follow-up for an API change,
but I'm not the right one to look into it.

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

9 years ago[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.
Richard Smith [Tue, 9 Dec 2014 03:20:04 +0000 (03:20 +0000)]
[modules] Add experimental -fmodule-map-file-home-is-cwd flag to -cc1.

For files named by -fmodule-map-file=, and files found by 'extern module'
directives, this flag specifies that we should resolve filenames relative to
the current working directory rather than relative to the directory in which
the module map file resides. This is aimed at fixing path handling, in
particular for relative -I paths, when building modules that represent
components of the current project (rather than libraries installed on the
current system, which the current project has as dependencies, where we'd
typically expect the module map files to be looked up implicitly).

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

9 years agoMS ABI: Add another test for PR20017
David Majnemer [Tue, 9 Dec 2014 01:36:45 +0000 (01:36 +0000)]
MS ABI: Add another test for PR20017

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

9 years agoDebugInfo: Correctly identify the location of C++ member initializer list elements
David Blaikie [Tue, 9 Dec 2014 00:32:22 +0000 (00:32 +0000)]
DebugInfo: Correctly identify the location of C++ member initializer list elements

This particularly helps the fidelity of ASan reports (which can occur
even in these examples - if, for example, one uses placement new over a
buffer of insufficient size - now ASan will correctly identify which
member's initialization went over the end of the buffer).

This doesn't cover all types of members - more coming.

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

9 years ago[modules] If the same .pcm file is imported via two different paths, don't
Richard Smith [Tue, 9 Dec 2014 00:14:36 +0000 (00:14 +0000)]
[modules] If the same .pcm file is imported via two different paths, don't
complain that the contained modules are defined twice.

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

9 years agoRevert "Driver: Objective-C should respect -fno-exceptions"
David Majnemer [Tue, 9 Dec 2014 00:12:30 +0000 (00:12 +0000)]
Revert "Driver: Objective-C should respect -fno-exceptions"

This reverts commit r223455.  It's been succesfully argued that
-fexceptions (at the driver level) is a misnomer and has little to do
with -fobjc-exceptions.

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

9 years agoAdd a test for MS-ABI this adjustment for virtual calls to member operators.
Nico Weber [Mon, 8 Dec 2014 23:25:55 +0000 (23:25 +0000)]
Add a test for MS-ABI this adjustment for virtual calls to member operators.

They too were fixed by r223185, despite the commit message saying otherwise.
Add a test that makes sure they don't regress.

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

9 years agoHandle possible TypoExprs in member initializers.
Kaelyn Takata [Mon, 8 Dec 2014 22:41:42 +0000 (22:41 +0000)]
Handle possible TypoExprs in member initializers.

Includes a new test case since none of the existing tests were hitting
this code path.

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

9 years agoDebugInfo: Ensure the store for an assignment is attributed to the beginning of the...
David Blaikie [Mon, 8 Dec 2014 21:48:57 +0000 (21:48 +0000)]
DebugInfo: Ensure the store for an assignment is attributed to the beginning of the assignment expression

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

9 years agoclang-format: Indent correctly in conditional expressions after return.
Daniel Jasper [Mon, 8 Dec 2014 21:28:31 +0000 (21:28 +0000)]
clang-format: Indent correctly in conditional expressions after return.

This only applies when not aligning after the return itself (which is
commonly done for C++.

Before:
  return aaaaaaaaaa
      ? bbbbbbbbbb(
             bbbbbb)  // This is indented relative to aaaaaaaaaa.
      : b;

After:
  return aaaaaaaaaa
      ? bbbbbbbbbb(
            bbbbbb)
      : b;

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

9 years agoFix isInstantiated and isInTemplateInstantiation to not recreate the matchers on...
Samuel Benzaquen [Mon, 8 Dec 2014 20:17:58 +0000 (20:17 +0000)]
Fix isInstantiated and isInTemplateInstantiation to not recreate the matchers on each call.

Summary:
Store the result matcher after the first call and reuse it later on.
Recreating the matchers just to use them once incurs in a lot of
unnecessary temporary memory allocations.
This change speeds up our clang-tidy benchmarks by ~2%.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

9 years agoclang-format: [Java] Always break after annotations of multiline decls.
Daniel Jasper [Mon, 8 Dec 2014 20:08:04 +0000 (20:08 +0000)]
clang-format: [Java] Always break after annotations of multiline decls.

Before:
  @Mock DataLoader loooooooooooooooooooooooader =
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
  @Mock
  DataLoader loooooooooooooooooooooooader =
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

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

9 years agoclang-format: Make clang-format-diff.py format java files.
Daniel Jasper [Mon, 8 Dec 2014 19:39:03 +0000 (19:39 +0000)]
clang-format: Make clang-format-diff.py format java files.

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

9 years agoInstrProf: Use LLVM's -instrprof pass for profiling
Justin Bogner [Mon, 8 Dec 2014 19:04:51 +0000 (19:04 +0000)]
InstrProf: Use LLVM's -instrprof pass for profiling

The logic for lowering profiling counters has been moved to an LLVM
pass. Emit the intrinsics rather than duplicating the whole pass in
clang.

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

9 years agoclang-format: Support commas in lambda return types.
Daniel Jasper [Mon, 8 Dec 2014 13:22:37 +0000 (13:22 +0000)]
clang-format: Support commas in lambda return types.

Before:
  auto next_pair = [](A * a) -> pair<A*, A*>{};

After:
  auto next_pair = [](A* a) -> pair<A*, A*>{};

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

9 years agoclang/test/Index/usrs.cpp: Appease targeting msvc.
NAKAMURA Takumi [Mon, 8 Dec 2014 10:20:33 +0000 (10:20 +0000)]
clang/test/Index/usrs.cpp: Appease targeting msvc.

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

9 years ago[libclang] Use same USR encoding for 'char' regardless of what the target considers...
Argyrios Kyrtzidis [Mon, 8 Dec 2014 09:09:05 +0000 (09:09 +0000)]
[libclang] Use same USR encoding for 'char' regardless of what the target considers the sign to be.

Should fix the clang-hexagon-elf bot.

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

9 years ago[libclang] Encode InjectedClassNameType in the USR.
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:43 +0000 (08:48 +0000)]
[libclang] Encode InjectedClassNameType in the USR.

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

9 years ago[libclang] Encode location info for anonymous embedded tag decls.
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:37 +0000 (08:48 +0000)]
[libclang] Encode location info for anonymous embedded tag decls.

Otherwise the USR will conflict with different embedded tag decls.

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

9 years ago[libclang] Use same USR encoding for 'class' as 'struct'.
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:33 +0000 (08:48 +0000)]
[libclang] Use same USR encoding for 'class' as 'struct'.

'class' and 'struct' can be used interchangebly for forward references.
Use the same encoding otherwise we may get into a weird situation where the USR for the same
declaration is different based on whether the definition of the tag reference is visible or not.

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

9 years ago[libclang] Encode C++11 rvalue reference types in the USR.
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:27 +0000 (08:48 +0000)]
[libclang] Encode C++11 rvalue reference types in the USR.

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

9 years ago[libclang] Encode the C++11 method reference qualifier in the USR.
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:21 +0000 (08:48 +0000)]
[libclang] Encode the C++11 method reference qualifier in the USR.

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

9 years ago[libclang] Reflect in USR generation that 'signed char' and 'unsigned char' can overl...
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:17 +0000 (08:48 +0000)]
[libclang] Reflect in USR generation that 'signed char' and 'unsigned char' can overload a 'char' in C++, by giving them distinct encodings.

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

9 years ago[libclang] Function templates can be 'overloaded' by return type, so encode the retur...
Argyrios Kyrtzidis [Mon, 8 Dec 2014 08:48:11 +0000 (08:48 +0000)]
[libclang] Function templates can be 'overloaded' by return type, so encode the return type in the USR
and handle DependentNameType in order to be able to distinguish them.

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

9 years agoclang-format: Don't merge lines with comments.
Daniel Jasper [Sun, 7 Dec 2014 16:44:49 +0000 (16:44 +0000)]
clang-format: Don't merge lines with comments.

Before:
  int f() { // comment return 42; }

After:
  int f() { // comment
    return 42;
  }

This fixes llvm.org/PR21769.

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

9 years agoAdd some file content to avoid test failures on content-addressed file systems.
Richard Smith [Sat, 6 Dec 2014 22:12:07 +0000 (22:12 +0000)]
Add some file content to avoid test failures on content-addressed file systems.

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

9 years agoAdd test file missed from r223561.
Richard Smith [Sat, 6 Dec 2014 22:11:06 +0000 (22:11 +0000)]
Add test file missed from r223561.

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

9 years agoRename a couple of preprocessor symbols to be more descriptive. NFC.
Paul Robinson [Sat, 6 Dec 2014 05:06:37 +0000 (05:06 +0000)]
Rename a couple of preprocessor symbols to be more descriptive. NFC.
Review feedback from recent changes to GetSVN.cmake.

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

9 years ago[modules] If we import a module, and we've seen a module map that describes the
Richard Smith [Sat, 6 Dec 2014 03:21:08 +0000 (03:21 +0000)]
[modules] If we import a module, and we've seen a module map that describes the
module, use the path from the module map file in preference to the path from
the .pcm file when resolving relative paths in the .pcm file. This allows
diagnostics (and .d output) to give relative paths if the module was found via
a relative path.

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

9 years agoNo memcpy for copy ctor with -fsanitize-address-field-padding=1
Kostya Serebryany [Sat, 6 Dec 2014 01:23:08 +0000 (01:23 +0000)]
No memcpy for copy ctor with -fsanitize-address-field-padding=1

Summary:
When -fsanitize-address-field-padding=1 is present
don't emit memcpy for copy constructor.
Thanks Nico for the extra test case.

Test Plan: regression tests

Reviewers: thakis, rsmith

Reviewed By: rsmith

Subscribers: rsmith, cfe-commits

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

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

9 years agoPR21217: Slightly more eagerly load -fmodule-map-file= files and provide
Richard Smith [Sat, 6 Dec 2014 01:13:41 +0000 (01:13 +0000)]
PR21217: Slightly more eagerly load -fmodule-map-file= files and provide
diagnostics if they don't exist. Based on a patch by John Thompson!

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

9 years agoAdditional safety for the root cause of regression in r223443; make the module
Richard Smith [Sat, 6 Dec 2014 00:09:19 +0000 (00:09 +0000)]
Additional safety for the root cause of regression in r223443; make the module
map path more canonical before hashing it. No functionality change.

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

9 years ago[modules] Instead of storing absolute paths in a .pcm file, store the path to
Richard Smith [Fri, 5 Dec 2014 22:42:13 +0000 (22:42 +0000)]
[modules] Instead of storing absolute paths in a .pcm file, store the path to
the root of the module and use paths relative to that directory wherever
possible. This is a step towards allowing explicit modules to be relocated
without being rebuilt, which is important for some kinds of distributed builds,
for good paths in diagnostics, and for appropriate .d output.

This is a recommit of r223443, reverted in r223465; when joining together
imported file paths, we now use the system's separator rather than always
using '/'. This avoids path mismatches between the original module build and
the module user on Windows (at least, in some cases). A more comprehensive
fix will follow.

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

9 years agoASTDumper: print whether a function is constexpr
Hans Wennborg [Fri, 5 Dec 2014 22:38:57 +0000 (22:38 +0000)]
ASTDumper: print whether a function is constexpr

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

9 years agoSpecify the name of the generated header only once. NFC.
Paul Robinson [Fri, 5 Dec 2014 22:32:49 +0000 (22:32 +0000)]
Specify the name of the generated header only once. NFC.
This will also simplify a private patch that we have.

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

9 years agoMake DiagnosticErrorTrap work even if SuppressAllDiagnostics is enabled.
Richard Smith [Fri, 5 Dec 2014 21:52:58 +0000 (21:52 +0000)]
Make DiagnosticErrorTrap work even if SuppressAllDiagnostics is enabled.
Patch by Brad King!

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

9 years agoWorkaround attribute ordering issue with kernel only attributes
Matt Arsenault [Fri, 5 Dec 2014 18:03:58 +0000 (18:03 +0000)]
Workaround attribute ordering issue with kernel only attributes

Placing the attribute after the kernel keyword would incorrectly
reject the attribute, so use the smae workaround that other
kernel only attributes use.

Also add a FIXME because there are two different phrasings now
for the same error, althoug amdgpu_num_[sv]gpr uses a consistent one.

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

9 years agoUse else if when checking multiple attributes.
Matt Arsenault [Fri, 5 Dec 2014 18:03:55 +0000 (18:03 +0000)]
Use else if when checking multiple attributes.

Only one of these can really match.

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

9 years agoAmending r223468 with this documentation change.
Aaron Ballman [Fri, 5 Dec 2014 17:11:49 +0000 (17:11 +0000)]
Amending r223468 with this documentation change.

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

9 years agoFix Typos in include/clang-c/Index.h
Chad Rosier [Fri, 5 Dec 2014 15:50:44 +0000 (15:50 +0000)]
Fix Typos in include/clang-c/Index.h
Phabricator revision: http://reviews.llvm.org/D6507

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

9 years agoModify __has_attribute so that it only looks for GNU-style attributes. Removes the...
Aaron Ballman [Fri, 5 Dec 2014 15:24:55 +0000 (15:24 +0000)]
Modify __has_attribute so that it only looks for GNU-style attributes. Removes the ability to look for generic attributes and keywords via this macro, which has the potential to be a breaking change. However, since there is __has_cpp_attribute and __has_declspec_attribute, and given the limited usefulness of querying a generic attribute name regardless of syntax, this seems like the correct path forward.

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

9 years agoAdded a new preprocessor macro: __has_declspec_attribute. This can be used as a way...
Aaron Ballman [Fri, 5 Dec 2014 15:05:29 +0000 (15:05 +0000)]
Added a new preprocessor macro: __has_declspec_attribute. This can be used as a way to determine whether Clang supports a __declspec spelling for a given attribute, similar to  __has_attribute and __has_cpp_attribute.

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

9 years agoTemporarily reverting r223443 due to bot breakage.
Aaron Ballman [Fri, 5 Dec 2014 14:52:04 +0000 (14:52 +0000)]
Temporarily reverting r223443 due to bot breakage.

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

9 years agoFix a warning with generating the attribute documentation; NFC.
Aaron Ballman [Fri, 5 Dec 2014 14:11:39 +0000 (14:11 +0000)]
Fix a warning with generating the attribute documentation; NFC.

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

9 years agoclang-format: Support NS_OPTIONS, CF_ENUM and CF_OPTIONS.
Daniel Jasper [Fri, 5 Dec 2014 10:42:21 +0000 (10:42 +0000)]
clang-format: Support NS_OPTIONS, CF_ENUM and CF_OPTIONS.

This fixes llvm.org/PR21756.

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

9 years agoDriver: Objective-C should respect -fno-exceptions
David Majnemer [Fri, 5 Dec 2014 08:56:55 +0000 (08:56 +0000)]
Driver: Objective-C should respect -fno-exceptions

Clang attempted to replicate a GCC bug: -fobjc-exceptions forces
-fexceptions to be enabled.  However, this has unintended effects and
other awkard side effects that Clang doesn't "correctly" ape (e.g. it's
impossible to turn off C++ exceptions in ObjC++ mode).

Instead, -f[no]objc-exceptions and -f[no]cxx-exceptions now have an
identical relationship with -f[no]exceptions.

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

9 years agoDriver: Cleanup -fexceptions behavior
David Majnemer [Fri, 5 Dec 2014 08:11:58 +0000 (08:11 +0000)]
Driver: Cleanup -fexceptions behavior

No functionality change is intended, just a cleanup of the logic clang
uses to determine what -fexceptions/-fno-exceptions ends up doing.

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

9 years ago[OPENMP] Test for 'omp barrier' directive
Alexey Bataev [Fri, 5 Dec 2014 04:10:27 +0000 (04:10 +0000)]
[OPENMP] Test for 'omp barrier' directive

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

9 years ago[OPENMP] Codegen for 'omp barrier' directive.
Alexey Bataev [Fri, 5 Dec 2014 04:09:23 +0000 (04:09 +0000)]
[OPENMP] Codegen for 'omp barrier' directive.
Adds generation of call to "i32 kmpc_cancel_barrier(ident_t *, i32)" libcall for explicitly specified barriers (OMP_IDENT_BARRIER_EXPL flag is added to "flags" field of "ident_t" structure).
Also this patch replaces all calls to "kmpc_barrier" function by calls of "__kmpc_cancel_barrier" function which provides additional functionality for OpenMP 4.0.
Also, library specific enum OpenMPLocationFlags moved to private section of CGOpenMPRuntime class to make it more independent from library implementation.
Differential Revision: http://reviews.llvm.org/D6447

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

9 years ago[modules] Instead of storing absolute paths in a .pcm file, store the path to
Richard Smith [Fri, 5 Dec 2014 02:33:27 +0000 (02:33 +0000)]
[modules] Instead of storing absolute paths in a .pcm file, store the path to
the root of the module and use paths relative to that directory wherever
possible. This is a step towards allowing explicit modules to be relocated
without being rebuilt, which is important for some kinds of distributed builds,
for good paths in diagnostics, and for appropriate .d output.

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

9 years agoHave the driver and the target code agree on what the default ABI
Eric Christopher [Fri, 5 Dec 2014 01:06:59 +0000 (01:06 +0000)]
Have the driver and the target code agree on what the default ABI
is for each machine. Fix up darwin tests that were testing for
aapcs on armv7-ios when the actual ABI is apcs.

Should be no user visible change without -cc1.

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

9 years ago[analyzer] Eliminated endless loop.
Anton Yartsev [Fri, 5 Dec 2014 00:59:07 +0000 (00:59 +0000)]
[analyzer] Eliminated endless loop.

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

9 years agoUse isOSBinFormatMachO() instead of comparing the object format
Eric Christopher [Fri, 5 Dec 2014 00:22:48 +0000 (00:22 +0000)]
Use isOSBinFormatMachO() instead of comparing the object format
against an enum.

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

9 years agoParse qualifiers after comma in declarator lists as a Microsoft extension
Nico Rieck [Thu, 4 Dec 2014 23:31:08 +0000 (23:31 +0000)]
Parse qualifiers after comma in declarator lists as a Microsoft extension

MSVC parses and ignores these with a warning.

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

9 years agoRecognize __unaligned keyword after type specifier
Nico Rieck [Thu, 4 Dec 2014 23:30:25 +0000 (23:30 +0000)]
Recognize __unaligned keyword after type specifier

The __unaligned keyword can appear after a struct definition:

  struct foo {...} __unaligned *x;

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

9 years agoAdding a FIXME to the code, based on a discussion in IRC; NFC.
Aaron Ballman [Thu, 4 Dec 2014 22:45:31 +0000 (22:45 +0000)]
Adding a FIXME to the code, based on a discussion in IRC; NFC.

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

9 years agoSilence warning: "NOMINMAX" redefined.
Yaron Keren [Thu, 4 Dec 2014 21:46:50 +0000 (21:46 +0000)]
Silence warning: "NOMINMAX" redefined.

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

9 years agoAdd attributes for AMDGPU register limits.
Matt Arsenault [Thu, 4 Dec 2014 20:38:18 +0000 (20:38 +0000)]
Add attributes for AMDGPU register limits.

This is a performance hint that can be applied to kernels
to attempt to limit the number of used registers.

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

9 years agoclang-format: [JS] Don't put top-level dict literals on a single line.
Daniel Jasper [Thu, 4 Dec 2014 16:07:17 +0000 (16:07 +0000)]
clang-format: [JS] Don't put top-level dict literals on a single line.

These are often used for enums which apparently are easier to read if
formatted with one element per line.

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

9 years agoFix PR21684 - Ellipsis following an 'auto' parameter sans name/ID
Faisal Vali [Thu, 4 Dec 2014 12:40:21 +0000 (12:40 +0000)]
Fix PR21684 - Ellipsis following an 'auto' parameter sans name/ID
should indicate a c++ parameter pack not a c-variadic.

int i = [](auto...) { return 0; }(); // OK now.

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

9 years agoMake getInsertArgumentAdjuster insert extra arguments to the end by default.
Alexander Kornienko [Thu, 4 Dec 2014 11:00:56 +0000 (11:00 +0000)]
Make getInsertArgumentAdjuster insert extra arguments to the end by default.

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

9 years agoclang-format: More restrictively classify import declarations.
Daniel Jasper [Thu, 4 Dec 2014 08:57:27 +0000 (08:57 +0000)]
clang-format: More restrictively classify import declarations.

Before:
  import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
  import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa,
                       aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

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

9 years ago[OPENMP] Codegen for 'omp master' directive
Alexey Bataev [Thu, 4 Dec 2014 07:23:53 +0000 (07:23 +0000)]
[OPENMP] Codegen for 'omp master' directive
Patch adds 2 library functions to OpenMPRuntime class - int32 kmpc_master(ident_t *, int32 gtid) and void kmpc_end_master(ident_t *, int32 gtid);
For 'omp master' directive the next code is generated:

if (__kmpc_master(loc, gtid)) {
    <Associated structured block>;
      __kmpc_end_master(log, gtid);
}

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

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

9 years agoAlways emit kernel arg info for SPIR.
Sameer Sahasrabuddhe [Thu, 4 Dec 2014 05:30:58 +0000 (05:30 +0000)]
Always emit kernel arg info for SPIR.

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

Currently, kernel argument metadata is omitted unless the
"-cl-kernel-arg-info" option is specified. But the SPIR 1.2 spec
requires that all metadata except kernel_arg_name should always be
emitted, and kernel_arg_name is only emitted when
"-cl-kernel-arg-info" is specified.

Patch ported by Ryan Burn from the Khronos SPIR generator.
https://github.com/KhronosGroup/SPIR

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

9 years agoCodeGen: refactor ARM builtin handling
Saleem Abdulrasool [Thu, 4 Dec 2014 04:52:37 +0000 (04:52 +0000)]
CodeGen: refactor ARM builtin handling

Create a helper function to construct a value for the ARM hint intrinsic
rather than inling the construction.  In order to avoid the use of the sentinel
value, inline the use of intrinsic instruction retrieval.  NFC.

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

9 years agoCMake: try to actually fix the regexes for setting HOST_LINK_VERSION this time (PR21268)
Hans Wennborg [Thu, 4 Dec 2014 01:59:58 +0000 (01:59 +0000)]
CMake: try to actually fix the regexes for setting HOST_LINK_VERSION this time (PR21268)

The regex should not accept an empty version number.

The previous attempt at r223106 failed, and the build was still erroring:

  CMake Error at tools/clang/CMakeLists.txt:269 (string):
    string sub-command REGEX, mode REPLACE regex "[^0-9]*([0-9.]*).*" matched
    an empty string.

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

9 years agoAdd test for __umulh
Reid Kleckner [Wed, 3 Dec 2014 23:52:26 +0000 (23:52 +0000)]
Add test for __umulh

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

9 years agoImplement __umulh with __int128 arithmetic
Reid Kleckner [Wed, 3 Dec 2014 23:36:14 +0000 (23:36 +0000)]
Implement __umulh with __int128 arithmetic

Use the same approach as _umul128, but just return the high half.

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

9 years ago[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, clang part
Kostya Serebryany [Wed, 3 Dec 2014 23:27:45 +0000 (23:27 +0000)]
[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, clang part

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

9 years agoCUDA host device code with two code paths
Reid Kleckner [Wed, 3 Dec 2014 21:53:36 +0000 (21:53 +0000)]
CUDA host device code with two code paths

Summary:
Allow CUDA host device functions with two code paths using __CUDA_ARCH__
to differentiate between code path being compiled.

For example:
  __host__ __device__ void host_device_function(void) {
  #ifdef __CUDA_ARCH__
    device_only_function();
  #else
    host_only_function();
  #endif
  }

Patch by Jacques Pienaar.

Reviewed By: rnk

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

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

9 years agoCast vtable address points to i32 (...)** to enable more globalopt
Reid Kleckner [Wed, 3 Dec 2014 21:00:21 +0000 (21:00 +0000)]
Cast vtable address points to i32 (...)** to enable more globalopt

We currently use i32 (...)** as the type of the vptr field in the LLVM
struct type. LLVM's GlobalOpt prefers any bitcasts to be on the side of
the data being stored rather than on the pointer being stored to.

Reviewers: majnemer

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

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

9 years agoTeach EvaluatedExprVisitor that the condition and unselected branches of a
Richard Smith [Wed, 3 Dec 2014 21:00:20 +0000 (21:00 +0000)]
Teach EvaluatedExprVisitor that the condition and unselected branches of a
_Generic expression are unevaluated.

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

9 years agoMake ArgumentsAdjuster an std::function.
Alexander Kornienko [Wed, 3 Dec 2014 17:53:02 +0000 (17:53 +0000)]
Make ArgumentsAdjuster an std::function.

Reviewers: klimek

Reviewed By: klimek

Subscribers: klimek, cfe-commits

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

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

9 years agoFix isThreadModelSupported()'s comment. NFC
Jonathan Roelofs [Wed, 3 Dec 2014 17:04:52 +0000 (17:04 +0000)]
Fix isThreadModelSupported()'s comment. NFC

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

9 years agoclang-format: Fix fake parentheses placement with comments.
Daniel Jasper [Wed, 3 Dec 2014 14:02:59 +0000 (14:02 +0000)]
clang-format: Fix fake parentheses placement with comments.

Before:
  return (a > b
          // comment1
      // comment2
      || c);

After:
  return (a > b
      // comment1
      // comment2
      || c);

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

9 years agoclang-format: Fix expression parser not closing stuff at end of stmt.
Daniel Jasper [Wed, 3 Dec 2014 13:20:49 +0000 (13:20 +0000)]
clang-format: Fix expression parser not closing stuff at end of stmt.

Uncovered by a Java test case:

Before:
  public some.package.Type someFunction( // comment
      int parameter) {}

After:
  public some.package.Type someFunction( // comment
                          int parameter) {}

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