]> granicus.if.org Git - clang/log
clang
9 years agoImplement no_sanitize attribute.
Peter Collingbourne [Fri, 15 May 2015 18:33:32 +0000 (18:33 +0000)]
Implement no_sanitize attribute.

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

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

9 years agoCGAtomic.cpp: Fix bogus \brief(s). Did you mean "\param"? [-Wdocumentation]
NAKAMURA Takumi [Fri, 15 May 2015 13:47:52 +0000 (13:47 +0000)]
CGAtomic.cpp: Fix bogus \brief(s). Did you mean "\param"? [-Wdocumentation]

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

9 years agoLimit set of types instantiated in FindInstantiatedDecl.
Serge Pavlov [Fri, 15 May 2015 10:10:28 +0000 (10:10 +0000)]
Limit set of types instantiated in FindInstantiatedDecl.

Starting from r236426 FindInstantiatedDecl may instantiate types that
are referenced before definition. This change limit the set of types
that can be instantiated by this function.

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

9 years agoclang-format: Slightly change format decisions around macro annotations.
Daniel Jasper [Fri, 15 May 2015 09:58:11 +0000 (09:58 +0000)]
clang-format: Slightly change format decisions around macro annotations.

Before:
  bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
      GUARDED_BY(aaaaaaaaaaaa) = aaaaaaaaaaaaaaaaaaaaaaaaa;

After:
  bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(aaaaaaaaaaaa) =
      aaaaaaaaaaaaaaaaaaaaaaaaa;

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

9 years agoclang-format: Don't use column layout in lists that have separating
Daniel Jasper [Fri, 15 May 2015 09:41:59 +0000 (09:41 +0000)]
clang-format: Don't use column layout in lists that have separating
comments. At some point, we might to want to a layout with a different
number of columns instead, but at the moment, this causes more
confusion than it's worth.

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

9 years agoclang-format: Add missing space before ObjC selector.
Daniel Jasper [Fri, 15 May 2015 09:05:31 +0000 (09:05 +0000)]
clang-format: Add missing space before ObjC selector.

Before:
  [self aaaaa:(1 + 2)bbbbb:3];

After:
  [self aaaaa:(1 + 2) bbbbb:3];

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

9 years ago[OPENMP] Fixed bug in atomic update/capture/write constructs.
Alexey Bataev [Fri, 15 May 2015 08:36:34 +0000 (08:36 +0000)]
[OPENMP] Fixed bug in atomic update/capture/write constructs.

Fixed a bug with codegen for destination atomic l-value with padding and junk in this padding bytes.

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

9 years agoRevert r237385, "[CodeGen] Reuse stack space from unused function results"
NAKAMURA Takumi [Fri, 15 May 2015 03:49:05 +0000 (03:49 +0000)]
Revert r237385, "[CodeGen] Reuse stack space from unused function results"

It broke clang stage2, at least tblgen.

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

9 years agoRefactor: when exposing a definition in some module, provide listeners with the
Richard Smith [Fri, 15 May 2015 02:34:32 +0000 (02:34 +0000)]
Refactor: when exposing a definition in some module, provide listeners with the
module rather than requiring them to work it out themselves.

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

9 years agoAdd flag to enable native half type
Pirama Arumuga Nainar [Thu, 14 May 2015 23:44:18 +0000 (23:44 +0000)]
Add flag to enable native half type

Summary:
r235215 enables support in LLVM for legalizing f16 type in the IR.  AArch64
already had support for this.  r235215 and some backend patches brought support
for ARM, X86, X86-64, Mips and Mips64.

This change exposes the LangOption 'NativeHalfType' in the command line, so the
backend legalization can be used if desired.  NativeHalfType is enabled for
OpenCL (current behavior) or if '-fnative-half-type' is set.

Reviewers: olista01, steven_wu, ab

Subscribers: cfe-commits, srhines, aemerson

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

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

9 years agoFix Clang -Wsequence-point
David Blaikie [Thu, 14 May 2015 22:47:19 +0000 (22:47 +0000)]
Fix Clang -Wsequence-point

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

9 years agoInstrProf: Only disable coverage in built-in macros, not all system macros
Justin Bogner [Thu, 14 May 2015 22:14:10 +0000 (22:14 +0000)]
InstrProf: Only disable coverage in built-in macros, not all system macros

The issue I was trying to solve in r236547 was about built-in macros,
but I disabled coverage in all system macros. This is actually a bit
of overkill, and makes the display of coverage around system macros
degrade unnecessarily. Instead, limit this to builtins specifically.

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

9 years agoTweak availability checking to look through typedef declarations.
Ted Kremenek [Thu, 14 May 2015 22:07:25 +0000 (22:07 +0000)]
Tweak availability checking to look through typedef declarations.

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

9 years agoRevert "Detect uses of mismatching forms of 'new' and 'delete'"
Diego Novillo [Thu, 14 May 2015 20:57:48 +0000 (20:57 +0000)]
Revert "Detect uses of mismatching forms of 'new' and 'delete'"

This reverts commit 742dc9b6c9686ab52860b7da39c3a126d8a97fbc.

This is generating multiple segfaults in our internal builds.
Test case coming up shortly.

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

9 years agoTesting for the fix for bug 23429.
Nemanja Ivanovic [Thu, 14 May 2015 20:02:24 +0000 (20:02 +0000)]
Testing for the fix for bug 23429.

Follow-up to commit for revision 236848.
Just a test case for the macro definition under the right CPU/Arch.
One combination was actually missed in the initial fix:
  - powerpc64-unknown-unknown -mcpu=pwr8 (rather than -mcpu=power8).

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

9 years ago[CodeGen] Reuse stack space from unused function results
Sergey Dmitrouk [Thu, 14 May 2015 19:58:03 +0000 (19:58 +0000)]
[CodeGen] Reuse stack space from unused function results

Summary:
Space on stack allocated for unused structures returned by functions was unused
even when it's lifetime didn't intersect with lifetime of any other objects that
could use the same space.

The test added also checks for named and auto objects.  It seems to make sense
to have this all in one place.

Reviewers: aadg, rsmith, rjmccall, rnk

Reviewed By: rnk

Subscribers: asl, cfe-commits

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

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

9 years agoDR295: cv-qualifiers on function types are ignored in C++.
Richard Smith [Thu, 14 May 2015 19:10:42 +0000 (19:10 +0000)]
DR295: cv-qualifiers on function types are ignored in C++.

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

9 years agoUpdate cxx_dr_status to latest issues list.
Richard Smith [Thu, 14 May 2015 19:07:47 +0000 (19:07 +0000)]
Update cxx_dr_status to latest issues list.

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

9 years agoRemove unused function HasPICArg().
Ikhlas Ajbar [Thu, 14 May 2015 17:42:20 +0000 (17:42 +0000)]
Remove unused function HasPICArg().

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

9 years ago[ARM] Fix of architecture naming typo
Vladimir Sukharev [Thu, 14 May 2015 16:39:01 +0000 (16:39 +0000)]
[ARM] Fix of architecture naming typo

Inspired by James Greenhalgh's catch

Subscribers: cfe-commits

Relates to: http://reviews.llvm.org/rL237349

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

9 years agoDetect uses of mismatching forms of 'new' and 'delete'
Ismail Pazarbasi [Thu, 14 May 2015 16:14:57 +0000 (16:14 +0000)]
Detect uses of mismatching forms of 'new' and 'delete'

Emit warning when operand to `delete` is allocated with `new[]` or
operand to `delete[]` is allocated with `new`.

Reviewers: rtrieu, jordan_rose, rsmith

Subscribers: majnemer, cfe-commits

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

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

9 years agoFactor out SmallDataThreshold
Ikhlas Ajbar [Thu, 14 May 2015 13:52:08 +0000 (13:52 +0000)]
Factor out SmallDataThreshold

This patch factors out SmallDataThreshold code.

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

9 years ago[ARM] Add v8.1a architecture
Vladimir Sukharev [Thu, 14 May 2015 08:25:18 +0000 (08:25 +0000)]
[ARM] Add v8.1a architecture

Add support for ARMv8.1a architecture.

Briefly it is described on http://community.arm.com/groups/processors/blog/2014/12/02/the-armv8-a-architecture-and-its-ongoing-development

Reviewers:  jmolloy, rengolin

Subscribers: cfe-commits

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

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

9 years ago[AArch64 ACLE] Allow to define poly64_t as 'unsigned long long' on LLP64 system.
Kevin Qin [Thu, 14 May 2015 08:18:05 +0000 (08:18 +0000)]
[AArch64 ACLE] Allow to define poly64_t as 'unsigned long long' on LLP64 system.

This fixes PR23414 as well.

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

9 years agoclang/test/Frontend/dependency-gen-escaping.c: Appease win32 hosts. Investigating.
NAKAMURA Takumi [Thu, 14 May 2015 07:37:35 +0000 (07:37 +0000)]
clang/test/Frontend/dependency-gen-escaping.c: Appease win32 hosts. Investigating.

FIXME: Do we really emit single \ or escaped \\ along the context with -fms-compatibility -MG?

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

9 years agoRevert r237339 as sanitizer-ppc64-linux1 does not like it.
Yaron Keren [Thu, 14 May 2015 06:53:31 +0000 (06:53 +0000)]
Revert r237339 as sanitizer-ppc64-linux1 does not like it.
Complains:

/home/buildbots/sanitizerslave1/sanitizer-ppc64-1/build/llvm/tools/clang/tools/c-index-test/c-index-test.c:829:30: error: format specifies type 'long' but the argument has type 'long long' [-Werror,-Wformat]
                     I, TAK, clang_Cursor_getTemplateArgumentValue(Cursor, I));
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm not sure now how this should be fixed. %lld is non-standard
and not accepted by mingw on Windows while PRId64 is bad for this bot.

Is long long longer than 64 bits here? if not, why is PRId64
incompatible with it? something seems wrong.

Probably all the datatypes should be replaced to unsigned or uint64_t
depending upin requirements instead of the non standard long long.

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

9 years ago[MS ABI] Add support for /Zc:sizedDealloc
David Majnemer [Thu, 14 May 2015 05:55:00 +0000 (05:55 +0000)]
[MS ABI] Add support for /Zc:sizedDealloc

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

9 years agoReplace non-standard %lld printf usage with PRId64.
Yaron Keren [Thu, 14 May 2015 05:40:50 +0000 (05:40 +0000)]
Replace non-standard %lld printf usage with PRId64.

See also r180024.

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

9 years agoFix buildbots
David Majnemer [Thu, 14 May 2015 05:24:59 +0000 (05:24 +0000)]
Fix buildbots

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

9 years ago[MS ABI] __declspec(thread) behaves like thread_local in MSVC 2015
David Majnemer [Thu, 14 May 2015 05:19:23 +0000 (05:19 +0000)]
[MS ABI] __declspec(thread) behaves like thread_local in MSVC 2015

MSVC 2015 changed __declspec(thread) to make it behave like C++11's
thread_local keyword instead of acting similarly to __thread.

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

9 years ago[AST] hasAttr followed by getAttr isn't efficient
David Majnemer [Thu, 14 May 2015 05:19:20 +0000 (05:19 +0000)]
[AST] hasAttr followed by getAttr isn't efficient

Just use getAttr because we are interested in the attribute's contents.

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

9 years ago[clang-cl] Add /Qvec and /Qvec- to control vectorization
David Majnemer [Thu, 14 May 2015 05:19:17 +0000 (05:19 +0000)]
[clang-cl] Add /Qvec and /Qvec- to control vectorization

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

9 years agoclang/test/Frontend/dependency-gen-escaping.c: Tweak r237296, to let '/' and '\\...
NAKAMURA Takumi [Thu, 14 May 2015 04:25:54 +0000 (04:25 +0000)]
clang/test/Frontend/dependency-gen-escaping.c: Tweak r237296, to let '/' and '\\' distinguishd, to unbreak "--host=linux --target=msvc".

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

9 years agoGeneralize future keyword compat diagnostics.
Richard Smith [Thu, 14 May 2015 04:00:59 +0000 (04:00 +0000)]
Generalize future keyword compat diagnostics.

This, in preparation for the introduction of more new keywords in the
implementation of the C++ language, generalizes the support for future keyword
compat diagnostics (e.g., diag::warn_cxx11_keyword) by extending the
applicability of the relevant property in IdentifierTable with appropriate
renaming.

Patch by Hubert Tong!

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

9 years ago[modules] Rearrange preprocessor module visibility handling, no observable change...
Richard Smith [Thu, 14 May 2015 02:25:44 +0000 (02:25 +0000)]
[modules] Rearrange preprocessor module visibility handling, no observable change intended.

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

9 years agoAdd missing #include, found by modules build.
Richard Smith [Thu, 14 May 2015 01:08:58 +0000 (01:08 +0000)]
Add missing #include, found by modules build.

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

9 years ago[modules] Work around PR23521 to fix -O0 modules bootstrap.
Richard Smith [Thu, 14 May 2015 01:08:08 +0000 (01:08 +0000)]
[modules] Work around PR23521 to fix -O0 modules bootstrap.

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

9 years ago[modules] Fix a #include cycle when building a module for our builtin headers.
Richard Smith [Thu, 14 May 2015 00:45:20 +0000 (00:45 +0000)]
[modules] Fix a #include cycle when building a module for our builtin headers.

xmmintrin.h includes emmintrin.h and vice versa if SSE2 is enabled. We break
this cycle for a modules build, and instead make the xmmintrin.h module
re-export the immintrin.h module. Also included is a fix for an assert in the
serialization code if a module exports another module that was declared later
in the same module map.

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

9 years agoFix a #include cycle in the libclang headers. "Eventually" is now.
Richard Smith [Thu, 14 May 2015 00:22:12 +0000 (00:22 +0000)]
Fix a #include cycle in the libclang headers. "Eventually" is now.

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

9 years agoBreak \# in a depfile the same way as gcc.
Paul Robinson [Wed, 13 May 2015 22:33:50 +0000 (22:33 +0000)]
Break \# in a depfile the same way as gcc.

Backslash followed by # in a filename should have both characters
escaped, if you do it the way GNU Make wants.  GCC doesn't, so we do
it the way GCC does rather than the way GNU Make wants.

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

9 years agoMake GNUInline consistent with whether we use traditional GNU inline semantics.
Peter Collingbourne [Wed, 13 May 2015 22:07:22 +0000 (22:07 +0000)]
Make GNUInline consistent with whether we use traditional GNU inline semantics.

Previously we were setting LangOptions::GNUInline (which controls whether we
use traditional GNU inline semantics) if the language did not have the C99
feature flag set. The trouble with this is that C++ family languages also
do not have that flag set, so we ended up setting this flag in C++ modes
(and working around it in a few places downstream by also checking CPlusPlus).

The fix is to check whether the C89 flag is set for the target language,
rather than whether the C99 flag is cleared. This also lets us remove most
CPlusPlus checks. We continue to test CPlusPlus when deciding whether to
pre-define the __GNUC_GNU_INLINE__ macro for consistency with GCC.

There is a change in semantics in two other places
where we weren't checking both CPlusPlus and GNUInline
(FunctionDecl::doesDeclarationForceExternallyVisibleDefinition and
FunctionDecl::isInlineDefinitionExternallyVisible), but this change seems to
put us back into line with GCC's semantics (test case: test/CodeGen/inline.c).

While at it, forbid -fgnu89-inline in C++ modes, as GCC doesn't support it,
it didn't have any effect before, and supporting it just makes things more
complicated.

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

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

9 years agoFix dependency file escaping.
Paul Robinson [Wed, 13 May 2015 21:18:15 +0000 (21:18 +0000)]
Fix dependency file escaping.

When writing a dependency (.d) file, if space or # is immediately
preceded by one or more backslashes, escape the backslashes as well as
the space or # character. Otherwise leave backslash alone.
This straddles the fence between BSD Make (which does no escaping at
all, and does not support space or # in filespecs) and GNU Make (which
does support escaping, but will fall back to the filespec as-written
if the escaping doesn't match an existing file).

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

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

9 years agoMade considerable updates to the documentation explaining how to add a new attribute...
Aaron Ballman [Wed, 13 May 2015 18:06:48 +0000 (18:06 +0000)]
Made considerable updates to the documentation explaining how to add a new attribute to clang. Cleans up some of the existing wording, as well as adding new information and better explanations.

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

9 years agoSilence Visual C++ warning C4189: 'Result' : local variable is initialized but not...
Yaron Keren [Wed, 13 May 2015 17:56:46 +0000 (17:56 +0000)]
Silence Visual C++ warning C4189: 'Result' : local variable is initialized but not referenced.

Sadly, LLVM_ATTRIBUTE_UNUSED does nothing with Visual C++ which means
we'll have to workaround such cases again and again.

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

9 years agoclang-format: Improve nested block / lambda indentation when wrapping
Daniel Jasper [Wed, 13 May 2015 16:09:21 +0000 (16:09 +0000)]
clang-format: Improve nested block / lambda indentation when wrapping
before binary/ternary operators.

Basically, it doesn't seem right to indent a nested block aligned to a
binary or ternary operator.

Before:
  int i = aaaaaa ? 1  //
                 : [] {
                   return 2;  //
                 }();
  llvm::errs() << "number of twos is "
               << std::count_if(v.begin(), v.end(), [](int x) {
                 return x == 2;  // force break
               });

After:
  int i = aaaaaa ? 1  //
                 : [] {
                     return 2;  //
                   }();
  llvm::errs() << "number of twos is "
               << std::count_if(v.begin(), v.end(), [](int x) {
                    return x == 2;  // force break
                  });

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

9 years agoclang-format: Fix incorrect */& classification.
Daniel Jasper [Wed, 13 May 2015 12:54:30 +0000 (12:54 +0000)]
clang-format: Fix incorrect */& classification.

Before:
  void f() { f(new a(), c *d); }

After:
  void f() { f(new a(), c * d); }

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

9 years agoclang-format: Fix semicolon less macro-detection.
Daniel Jasper [Wed, 13 May 2015 11:35:53 +0000 (11:35 +0000)]
clang-format: Fix semicolon less macro-detection.

It was fooled by the comment.

Before:
  SOME_UNRELATED_MACRO
      /*static*/ int i;

After:
  SOME_UNRELATED_MACRO
  /*static*/ int i;

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

9 years agoclang-format: [ObjC] Further improve wrapping of methods calls without inputs.
Daniel Jasper [Wed, 13 May 2015 10:23:03 +0000 (10:23 +0000)]
clang-format: [ObjC] Further improve wrapping of methods calls without inputs.

Before:
  [aaaaaaaaaaaaaaaaaaaaaaa
      .aaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa];

After:
  [aaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaa[aaaaaaaaaaaaaaaaaaaaa]
      aaaaaaaaaaaaaaaaaaaaaa];

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

9 years ago[OPENMP] Fixed codegen for firstprivate variables, also marked as lastprivate.
Alexey Bataev [Wed, 13 May 2015 10:23:02 +0000 (10:23 +0000)]
[OPENMP] Fixed codegen for firstprivate variables, also marked as lastprivate.

In some rare cases shared copies of lastprivate/firstprivate variables were not updated after the loop directive.

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

9 years agoclang-format: [ObjC] Make IndentWrappedFunctionNames work with ObjC functions
Daniel Jasper [Wed, 13 May 2015 09:38:25 +0000 (09:38 +0000)]
clang-format: [ObjC] Make IndentWrappedFunctionNames work with ObjC functions

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

9 years agoclang-format: Prefer formatting local lambdas like functions.
Daniel Jasper [Wed, 13 May 2015 08:47:16 +0000 (08:47 +0000)]
clang-format: Prefer formatting local lambdas like functions.

Before:
  auto my_lambda =
      [](const string &some_parameter) { return some_parameter.size(); };

After:
  auto my_lambda = [](const string &some_parameter) {
    return some_parameter.size();
  };

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

9 years agoclang-format: Support column layout with comment after {.
Daniel Jasper [Wed, 13 May 2015 08:16:00 +0000 (08:16 +0000)]
clang-format: Support column layout with comment after {.

Before:
  vector<int> iiiiiiiiiiiiiii = {                      //
      11111111112222222222333333333334444444444, //
      1111111112222222223333333333444444444,     //
      111111112222222233333333344444444};

After:
  vector<int> iiiiiiiiiiiiiii = {                      //
      11111111112222222222333333333334444444444, //
      111111111,  222222222,  3333333333,  444444444,  //
      11111111,   22222222,   333333333,   44444444};

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

9 years agoHave '__have_extension(cxx_variadic_templates)' return true for any C++ standard.
Eric Fiselier [Tue, 12 May 2015 22:37:23 +0000 (22:37 +0000)]
Have '__have_extension(cxx_variadic_templates)' return true for any C++ standard.

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

9 years agoAdd missing #includes, found by modules build.
Richard Smith [Tue, 12 May 2015 21:48:00 +0000 (21:48 +0000)]
Add missing #includes, found by modules build.

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

9 years agoAdd a new error for unexpected semi-colon before closing delimiter.
Richard Trieu [Tue, 12 May 2015 21:36:35 +0000 (21:36 +0000)]
Add a new error for unexpected semi-colon before closing delimiter.

Previously, if a semi-colon is unexpectedly added before a closing ')', ']' or
'}', two errors and one note would emitted, and the parsing would get confused
to which scope it was in.  This change consumes the semi-colon, recovers
parsing better, and emits only one error with a fix-it.

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

9 years agoInstrProf: Update name of compiler-rt routine for setting filename
Justin Bogner [Tue, 12 May 2015 21:23:16 +0000 (21:23 +0000)]
InstrProf: Update name of compiler-rt routine for setting filename

Patch by Teresa Johnson.

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

9 years agoclang-format AllocateTarget. NFC
Douglas Katzman [Tue, 12 May 2015 21:18:10 +0000 (21:18 +0000)]
clang-format AllocateTarget. NFC

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

9 years agoList Alexey Bataev as code owner for Clang's OpenMP support, as discussed offline.
Richard Smith [Tue, 12 May 2015 20:29:41 +0000 (20:29 +0000)]
List Alexey Bataev as code owner for Clang's OpenMP support, as discussed offline.

Thanks for all your hard work getting us OpenMP feature-complete, Alexey!

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

9 years agoFixed double-free in case of module loading error.
Artem Belevich [Tue, 12 May 2015 17:44:15 +0000 (17:44 +0000)]
Fixed double-free in case of module loading error.

GetOutputStream() owns the stream it returns pointer to and the
pointer should never be freed by us. When we fail to load and exit
early, unique_ptr still holds the pointer and frees it which leads to
compiler crash when CompilerInstance attempts to free it again.

Added regression test for failed bitcode linking.

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

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

9 years agoChanged renaming of local symbols by inserting a dot vefore the numeric suffix
Sunil Srivastava [Tue, 12 May 2015 16:48:43 +0000 (16:48 +0000)]
Changed renaming of local symbols by inserting a dot vefore the numeric suffix
details in http://reviews.llvm.org/D9483
goes with llvm checkin r237150

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

9 years agoFix clang-format build from the solution; the underlying path has changed to include...
Manuel Klimek [Tue, 12 May 2015 14:41:39 +0000 (14:41 +0000)]
Fix clang-format build from the solution; the underlying path has changed to include the VS directory structure.

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

9 years agoRemove superfluous SmallString cast.
Yaron Keren [Tue, 12 May 2015 12:47:05 +0000 (12:47 +0000)]
Remove superfluous SmallString cast.

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

9 years agoFix misleading parameter name for PPCallbacks::FileSkipped.
Nikola Smiljanic [Tue, 12 May 2015 11:48:05 +0000 (11:48 +0000)]
Fix misleading parameter name for PPCallbacks::FileSkipped.

Patch thanks to Vladimir Voskresensky.

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

9 years agoclang-format: Make member introduced in r237108 const.
Daniel Jasper [Tue, 12 May 2015 11:14:06 +0000 (11:14 +0000)]
clang-format: Make member introduced in r237108 const.

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

9 years agoChange TargetParser enum names to avoid macro conflicts (clang)
Renato Golin [Tue, 12 May 2015 10:34:10 +0000 (10:34 +0000)]
Change TargetParser enum names to avoid macro conflicts (clang)

sys/time.h on Solaris (and possibly other systems) defines "SEC" as "1"
using a cpp macro.  The result is that this fails to compile.

Fixes https://llvm.org/PR23482

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

9 years agoclang-format: Fix */& detection for lambdas in macros.
Daniel Jasper [Tue, 12 May 2015 10:20:32 +0000 (10:20 +0000)]
clang-format: Fix */& detection for lambdas in macros.

Before:
  #define MACRO() [](A * a) { return 1; }

After:
  #define MACRO() [](A *a) { return 1; }

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

9 years agoclang-format: Fix hanging nested blocks in macros.
Daniel Jasper [Tue, 12 May 2015 10:16:02 +0000 (10:16 +0000)]
clang-format: Fix hanging nested blocks in macros.

Before:
  #define MACRO()                     \
    Debug(aaa, /* force line break */ \
          {                           \
      int i;                          \
      int j;                          \
          })

After:
  #define MACRO()                     \
    Debug(aaa, /* force line break */ \
          {                           \
            int i;                    \
            int j;                    \
          })

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

9 years agoRefactor clang-format's formatter.
Manuel Klimek [Tue, 12 May 2015 09:23:57 +0000 (09:23 +0000)]
Refactor clang-format's formatter.

Summary:
a) Pull out a class LevelIndentTracker whose responsibility is to keep track
   of the indent of levels across multiple annotated lines.
b) Put all responsibility for merging lines into the LineJoiner; make the
   LineJoiner iterate over the lines so we never operate on a line that might
   be merged later; this makes the interface safer to use.
c) Move formatting of the end-of-file whitespace into formatFirstToken.

Fix bugs that became obvious after the refactoring:
1. We would not format lines with offsets correctly inside nested blocks if
   only the outer expression was affected:
   int x = s({ // clang-format only this line
     class X {
       public:
    // ^ this starts at the non-modified indnent level; previously we would
    //   not fix this, now we correctly outdent it.
       void f();
     };
   });
2. We would incorrectly align comments across lines that do not have comments
   for lines with nested blocks:
   int expression; // with comment
   int x = s({
     int y; // comment
     int z; // we would incorrectly align this comment with the comment on
            // 'expression'
   });

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

9 years ago[OPENMP] Allow using of threadprivate variables as loop-control variables in lop...
Alexey Bataev [Tue, 12 May 2015 09:02:07 +0000 (09:02 +0000)]
[OPENMP] Allow using of threadprivate variables as loop-control variables in lop based directives.

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

9 years ago[OPENMP] Fixed support for 'schedule' clause with non-constant chunk size.
Alexey Bataev [Tue, 12 May 2015 08:35:28 +0000 (08:35 +0000)]
[OPENMP] Fixed support for 'schedule' clause with non-constant chunk size.

'schedule' clause for combined directives requires additional processing. Special helper variable is generated, that is captured in the outlined parallel region for 'parallel for' region. This captured variable is used to store chunk expression from the 'schedule' clause in this 'parallel for' region.

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

9 years agoDriver: Fix a -Wshadow issue from r237091
Justin Bogner [Tue, 12 May 2015 06:30:48 +0000 (06:30 +0000)]
Driver: Fix a -Wshadow issue from r237091

The MachO toolchain has an isTargetIOSBased method, but it isn't
virtual so it isn't very meaningful to call it. After thinking about
this, I guess that putting this logic in the MachO class is a bit of a
layering violation anyway. Do this more like how we handle
AddLinkRuntimeLibArgs instead.

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

9 years agoRe-apply "Driver: Make profiling flags work with -nostdlib on Darwin"
Justin Bogner [Tue, 12 May 2015 05:44:36 +0000 (05:44 +0000)]
Re-apply "Driver: Make profiling flags work with -nostdlib on Darwin"

This time without a stray "true" in an argument list.

This reverts r237077, restoring r237074.

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

9 years agorevert r237081 -- bad idea (-lcrypt may not be present)
Kostya Serebryany [Tue, 12 May 2015 03:10:42 +0000 (03:10 +0000)]
revert r237081 -- bad idea (-lcrypt may not be present)

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

9 years agoadd -lcrypto to clang and clang-format fuzzers (lib/Fuzzer will soon require it)
Kostya Serebryany [Tue, 12 May 2015 01:29:04 +0000 (01:29 +0000)]
add -lcrypto to clang and clang-format fuzzers (lib/Fuzzer will soon require it)

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

9 years agoRemove the code that pulled soft float attributes out of the feature
Eric Christopher [Tue, 12 May 2015 01:26:21 +0000 (01:26 +0000)]
Remove the code that pulled soft float attributes out of the feature
strings and remove the setting of TargetOptions::UseSoftFloat to
match the code change in llvm r237079.

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

9 years agoRevert "Driver: Make profiling flags work with -nostdlib on Darwin"
Justin Bogner [Tue, 12 May 2015 01:04:33 +0000 (01:04 +0000)]
Revert "Driver: Make profiling flags work with -nostdlib on Darwin"

This revert r237074. These tests are failing all over the place.

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

9 years agoDriver: Make profiling flags work with -nostdlib on Darwin
Justin Bogner [Tue, 12 May 2015 00:31:33 +0000 (00:31 +0000)]
Driver: Make profiling flags work with -nostdlib on Darwin

Compiler-rt's Profiling library isn't part of the stdlib, so -nostdlib
shouldn't prevent it from being linked. This makes Darwin behave like
other toolchains, and link in the profile runtime irrespective of
-nostdlib, since the resulting program can't be run unless you link
this.

I've also added a test to show that other toolchains already behave
like this.

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

9 years agoAllow empty assembly string literal with -fno-gnu-inline-asm
Steven Wu [Tue, 12 May 2015 00:16:37 +0000 (00:16 +0000)]
Allow empty assembly string literal with -fno-gnu-inline-asm

Empty assembly string will not introduce assembly code in the output
binary and it is often used as a trick in the header to disable
optimizations. It doesn't conflict with the purpose of the option so it
is allowed with -fno-gnu-inline-asm flag.

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

9 years agoUpdate initialization of a class variable and comment.
Eric Christopher [Tue, 12 May 2015 00:04:20 +0000 (00:04 +0000)]
Update initialization of a class variable and comment.

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

9 years agoTypo fix: s/initialzier/initializer/ in a doc comment.
James Dennett [Mon, 11 May 2015 23:25:54 +0000 (23:25 +0000)]
Typo fix: s/initialzier/initializer/ in a doc comment.

No functional change.

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

9 years agoPR20625: Instantiate static constexpr member function of a local struct in a function...
Richard Smith [Mon, 11 May 2015 23:09:06 +0000 (23:09 +0000)]
PR20625: Instantiate static constexpr member function of a local struct in a function template earlier.

This is necessary in order to allow the use of a constexpr member function, or
a member function with deduced return type, of a local class within a
surrounding instantiated function template specialization.

Patch by Michael Park!

This re-commits r236063, which was reverted in r236134, along with a fix for a
delayed template parsing bug that was exposed by this change.

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

9 years agoMove sanitizer parser and group expander from Driver to Basic.
Peter Collingbourne [Mon, 11 May 2015 21:39:20 +0000 (21:39 +0000)]
Move sanitizer parser and group expander from Driver to Basic.

No functional change.

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

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

9 years agoUnify sanitizer kind representation between the driver and the rest of the compiler.
Peter Collingbourne [Mon, 11 May 2015 21:39:14 +0000 (21:39 +0000)]
Unify sanitizer kind representation between the driver and the rest of the compiler.

No functional change.

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

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

9 years agoAllow AsmLabel with -fno-gnu-inline-asm
Steven Wu [Mon, 11 May 2015 21:14:09 +0000 (21:14 +0000)]
Allow AsmLabel with -fno-gnu-inline-asm

Summary:
AsmLabel is heavily used in system level and firmware to redirect
function and access platform specific labels. They are also extensively
used in system headers which makes this option unusable for many
users. Since AsmLabel doesn't introduce any assembly code into the
output binary, it shouldn't be considered as inline-asm.

Reviewers: bob.wilson, rnk

Reviewed By: rnk

Subscribers: cfe-commits

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

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

9 years ago[cuda] Fixed test case failure on s390x
Artem Belevich [Mon, 11 May 2015 18:35:58 +0000 (18:35 +0000)]
[cuda] Fixed test case failure on s390x

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

9 years agoRevert "Allow -target= and --target options"
Richard Barton [Mon, 11 May 2015 17:05:05 +0000 (17:05 +0000)]
Revert "Allow -target= and --target options"

After mailing list discussion on 11-13 March we would prefer to stick to a
single spelling of the long option.

This reverts commit 30035fe1a7c759c89ee62eb46efce6b3790fcc08.

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

9 years ago[Sparc] Add support for 'sparcel' to clang.
Douglas Katzman [Mon, 11 May 2015 15:21:44 +0000 (15:21 +0000)]
[Sparc] Add support for 'sparcel' to clang.

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

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

9 years agoclang-format: Support aligning ObjC string literals.
Daniel Jasper [Mon, 11 May 2015 15:15:48 +0000 (15:15 +0000)]
clang-format: Support aligning ObjC string literals.

Before:
  NSString s = @"aaaa"
      @"bbbb";

After:
  NSString s = @"aaaa"
               @"bbbb";

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

9 years agoDisable __has_cpp_attribute when not compiling in C++ mode. As this feature test...
Aaron Ballman [Mon, 11 May 2015 14:09:50 +0000 (14:09 +0000)]
Disable __has_cpp_attribute when not compiling in C++ mode. As this feature test macro only supports C++ style attributes, it doesn't apply to code compiled as C code, and can lead to diagnostics when given a scoped attribute.

This addresses PR23435.

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

9 years agoclang-format: Appease the buildbots by including climits.
Daniel Jasper [Mon, 11 May 2015 13:52:13 +0000 (13:52 +0000)]
clang-format: Appease the buildbots by including climits.

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

9 years agoclang-format: Improve column layout.
Daniel Jasper [Mon, 11 May 2015 13:35:40 +0000 (13:35 +0000)]
clang-format: Improve column layout.

Specifically, calculate the deviation between the shortest and longest
element (which is used to prevent excessive whitespace) per column, not
overall. This automatically handles the corner cases of a single column
and a single row so that the actualy implementation becomes simpler.

Before:
  vector<int> x = {1,
                   aaaaaaaaaaaaaaaaaaaaaa,
                   2,
                   bbbbbbbbbbbbbbbbbbbbbb,
                   3,
                   cccccccccccccccccccccc};

After:
  vector<int> x = {1, aaaaaaaaaaaaaaaaaaaaaa,
                   2, bbbbbbbbbbbbbbbbbbbbbb,
                   3, cccccccccccccccccccccc};

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

9 years agoclang-format: Don't merge subsequent lines into _asm blocks.
Daniel Jasper [Mon, 11 May 2015 11:59:46 +0000 (11:59 +0000)]
clang-format: Don't merge subsequent lines into _asm blocks.

Before:
  _asm {
  } int i;

After:
  _asm {
  }
  int i;

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

9 years agoclang-format: [JS] Clean up export declaration parsing.
Daniel Jasper [Mon, 11 May 2015 09:14:50 +0000 (09:14 +0000)]
clang-format: [JS] Clean up export declaration parsing.

NFC intended.

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

9 years agoAVX-512: Changed CC parameter in "cmp" intrinsic
Elena Demikhovsky [Mon, 11 May 2015 09:03:41 +0000 (09:03 +0000)]
AVX-512: Changed CC parameter in "cmp" intrinsic
from i8 to i32 according to the Intel Spec

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

9 years agoclang-format: [JS] Parse exported functions as free-standing.
Daniel Jasper [Mon, 11 May 2015 09:03:10 +0000 (09:03 +0000)]
clang-format: [JS] Parse exported functions as free-standing.

Before:
  export function foo() {} export function bar() {}

After:
  export function foo() {
  }
  export function bar() {
  }

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

9 years agoRefactor MacroInfo so range for loops can be used to iterate its tokens.
Daniel Marjamaki [Mon, 11 May 2015 08:25:54 +0000 (08:25 +0000)]
Refactor MacroInfo so range for loops can be used to iterate its tokens.

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

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

9 years agoRefactor the formatter of clang-format.
Manuel Klimek [Mon, 11 May 2015 08:21:35 +0000 (08:21 +0000)]
Refactor the formatter of clang-format.

Pull various parts of the UnwrappedLineFormatter into their own
abstractions. NFC.

There are two things left for subsequent changes (to keep this
reasonably small)
- the UnwrappedLineFormatter now has a bad name
- the UnwrappedLineFormatter::format function is still too large

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

9 years agoGive isCompatibleWithMSVC a better interface
David Majnemer [Mon, 11 May 2015 03:57:49 +0000 (03:57 +0000)]
Give isCompatibleWithMSVC a better interface

We now use an enum which maps the marketing name (almost always a year)
to the major version number.

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

9 years ago[MS ABI] Import move assignment operators
David Majnemer [Mon, 11 May 2015 03:00:22 +0000 (03:00 +0000)]
[MS ABI] Import move assignment operators

MSVC 2015 changed behavior from 2013; it imports move assignment
operators.

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

9 years agoFix indentation problem introduced in r236964. NFC
Jonathan Roelofs [Mon, 11 May 2015 02:13:24 +0000 (02:13 +0000)]
Fix indentation problem introduced in r236964. NFC

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