]> granicus.if.org Git - clang/log
clang
10 years agoFix typos
Alp Toker [Mon, 16 Jun 2014 14:23:44 +0000 (14:23 +0000)]
Fix typos

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

10 years agoUse the ShowInSystemHeader bit consistently for all diagnostics
Alp Toker [Mon, 16 Jun 2014 13:56:47 +0000 (13:56 +0000)]
Use the ShowInSystemHeader bit consistently for all diagnostics

By describing system header suppressions directly in tablegen we eliminate
special cases in getDiagnosticSeverity().

Dropping the reliance on builtin diagnostic classes when mapping also gets us
closer to the goal of reusing the diagnostic machinery for custom diagnostics.

No change in functionality.

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

10 years agoclang/AST/OpenMPClause.h: Update \param VL. [-Wdocumentation]
NAKAMURA Takumi [Mon, 16 Jun 2014 09:33:34 +0000 (09:33 +0000)]
clang/AST/OpenMPClause.h: Update \param VL. [-Wdocumentation]

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

10 years ago[OPENMP] Initial support of 'reduction' clause
Alexey Bataev [Mon, 16 Jun 2014 07:08:35 +0000 (07:08 +0000)]
[OPENMP] Initial support of 'reduction' clause

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

10 years agoHide the concept of diagnostic levels from lex, parse and sema
Alp Toker [Sun, 15 Jun 2014 23:30:39 +0000 (23:30 +0000)]
Hide the concept of diagnostic levels from lex, parse and sema

The compilation pipeline doesn't actually need to know about the high-level
concept of diagnostic mappings, and hiding the final computed level presents
several simplifications and other potential benefits.

The only exceptions are opportunistic checks to see whether expensive code
paths can be avoided for diagnostics that are guaranteed to be ignored at a
certain SourceLocation.

This commit formalizes that invariant by introducing and using
DiagnosticsEngine::isIgnored() in place of individual level checks throughout
lex, parse and sema.

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

10 years agotest: add missed file in previous commit
Saleem Abdulrasool [Sun, 15 Jun 2014 18:48:41 +0000 (18:48 +0000)]
test: add missed file in previous commit

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

10 years agoPreprocessor: improve ACLE 6.4.1, 6.4.2 support
Saleem Abdulrasool [Sun, 15 Jun 2014 18:35:07 +0000 (18:35 +0000)]
Preprocessor: improve ACLE 6.4.1, 6.4.2 support

This improves conformance with ACLE 6.4.1.  Define additional macros that
indicate support for the ARM and Thumb instruction set architecture.  This
includes the following set of macros:

  __ARM_ARCH
  __ARM_ARCH_ISA_ARM
  __ARM_ARCH_ISA_THUMB
  __ARM_32BIT_STATE

These help identify the environment that the code is intended to execute on.

Adjust the handling for ACLE 6.4.2 to be more correct.  We would define the
profile as a free-standing token rather than a quoted single character.

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

10 years agoOne of our buildbot for FreeBSD does not support std::to_string.
Sylvestre Ledru [Sat, 14 Jun 2014 09:28:27 +0000 (09:28 +0000)]
One of our buildbot for FreeBSD does not support std::to_string.
Use stringstream instead to convert int to string

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

10 years agoList the function/method name in the index page of scan-build
Sylvestre Ledru [Sat, 14 Jun 2014 08:49:40 +0000 (08:49 +0000)]
List the function/method name in the index page of scan-build

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

10 years agoWith the option '-analyzer-config stable-report-filename=true',
Sylvestre Ledru [Sat, 14 Jun 2014 08:45:32 +0000 (08:45 +0000)]
With the option '-analyzer-config stable-report-filename=true',
instead of report-XXXXXX.html, scan-build/clang analyzer generate
report-<filename>-<function, method name>-<function position>-<id>.html.
(id = i++ for several issues found in the same function/method)

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

10 years agoFix a crash in Retain Count checker error reporting
Anna Zaks [Fri, 13 Jun 2014 23:47:38 +0000 (23:47 +0000)]
Fix a crash in Retain Count checker error reporting

Fixes a crash in Retain Count checker error reporting logic by handing
the allocation statement retrieval from a BlockEdge program point.

Also added a simple CFG dump routine for debugging.

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

10 years agoDocument Darwin-specific defaults.
Adrian Prantl [Fri, 13 Jun 2014 23:35:54 +0000 (23:35 +0000)]
Document Darwin-specific defaults.

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

10 years agoA non-trivial array-fill expression isn't necessarily a CXXConstructExpr. It
Richard Smith [Fri, 13 Jun 2014 23:04:49 +0000 (23:04 +0000)]
A non-trivial array-fill expression isn't necessarily a CXXConstructExpr. It
could be an InitListExpr that runs constructors in C++11 onwards. Fixes a
recent regression (introduced in r210091).

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

10 years agoMake these two words equally bold.
Adrian Prantl [Fri, 13 Jun 2014 21:31:55 +0000 (21:31 +0000)]
Make these two words equally bold.

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

10 years agoCopy the documentation of -fstandalone-debug from the man page to the user
Adrian Prantl [Fri, 13 Jun 2014 21:12:31 +0000 (21:12 +0000)]
Copy the documentation of -fstandalone-debug from the man page to the user
manual.

rdar://problem/17307006

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

10 years agoAdd support for the /EP argument to clang-cl
Hans Wennborg [Fri, 13 Jun 2014 20:59:54 +0000 (20:59 +0000)]
Add support for the /EP argument to clang-cl

This maps the /EP argument to both -E and -P.

Patch by Ehsan Akhgari!

Differential Reviion: http://reviews.llvm.org/D4133

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

10 years agoFix test for release builds.
Tim Northover [Fri, 13 Jun 2014 20:00:38 +0000 (20:00 +0000)]
Fix test for release builds.

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

10 years agoAtomics: emit "cmpxchg weak" where possible
Tim Northover [Fri, 13 Jun 2014 19:43:04 +0000 (19:43 +0000)]
Atomics: emit "cmpxchg weak" where possible

Most builtins date from before the "cmpxchg weak" was a gleam in the
C++ committee's eye, so fortunately not much needs to change. But a
few of them *do* acknowledge that failure is possible.

For these, we'll emit the usual cartesian product of cmpxchg
operations if we can't statically determine weakness.  CodeGen can
sort it out later if the function gets inlined.

The only other non-trivial aspect of this is (I think) that we emit
the scalar expression for "IsWeak" once, at the beginning, and
propagate its value through the successive blocks. There's not much in
it, but it's slightly more consistent with the existing handling of
FailureOrder.

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

10 years ago[PPC64LE] Run some existing Altivec tests on powerpc64le as well
Bill Schmidt [Fri, 13 Jun 2014 18:30:06 +0000 (18:30 +0000)]
[PPC64LE] Run some existing Altivec tests on powerpc64le as well

There are several Altivec tests that formerly ran only on big-endian
targets (and in some cases only on 32-bit targets).  It is useful to
verify these on little-endian targets as well.

While testing these, I discovered a typo in <altivec.h>.  This is also
fixed by this patch.

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

10 years agoAdds a Pragma spelling for attributes to tablegen and makes use of it for loop
Tyler Nowicki [Fri, 13 Jun 2014 17:57:25 +0000 (17:57 +0000)]
Adds a Pragma spelling for attributes to tablegen and makes use of it for loop
hint attributes. Includes tests for pragma printing and for attribute order
which is incorrectly reversed by ParsedAttributes.

Reviewed by Aaron Ballman

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

10 years agoRemove top-level Clang -fsanitize= flags for optional ASan features.
Alexey Samsonov [Fri, 13 Jun 2014 17:53:44 +0000 (17:53 +0000)]
Remove top-level Clang -fsanitize= flags for optional ASan features.

Init-order and use-after-return modes can currently be enabled
by runtime flags. use-after-scope mode is not really working at the
moment.

The only problem I see is that users won't be able to disable extra
instrumentation for init-order and use-after-scope by a top-level Clang flag.
But this instrumentation was implicitly enabled for quite a while and
we didn't hear from users hurt by it.

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Fri, 13 Jun 2014 17:20:50 +0000 (17:20 +0000)]
Update for llvm api change.

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

10 years agoFirst commit. Modified FIXME comment.
Tyler Nowicki [Fri, 13 Jun 2014 17:15:27 +0000 (17:15 +0000)]
First commit. Modified FIXME comment.

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

10 years agoIR-change: cmpxchg operations now return { iN, i1 }.
Tim Northover [Fri, 13 Jun 2014 14:24:59 +0000 (14:24 +0000)]
IR-change: cmpxchg operations now return { iN, i1 }.

This is a minimal fix for clang. I'll soon add support for generating
weak variants when requested, but that's not really necessary for the
LLVM change in isolation.

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

10 years agoTests: use CHECK-LABEL to help debugging failures
Tim Northover [Fri, 13 Jun 2014 14:24:48 +0000 (14:24 +0000)]
Tests: use CHECK-LABEL to help debugging failures

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

10 years agoDo not store duplicate parents when memoization data is available.
Samuel Benzaquen [Fri, 13 Jun 2014 13:31:40 +0000 (13:31 +0000)]
Do not store duplicate parents when memoization data is available.

Summary:
Do not store duplicate parents when memoization data is available.
This does not solve the duplication problem, but ameliorates it.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

10 years agoclang-format: [JS] Understand named function literals.
Daniel Jasper [Fri, 13 Jun 2014 07:02:04 +0000 (07:02 +0000)]
clang-format: [JS] Understand named function literals.

Before:
  return {a: function SomeFunction(){// ...
                                     return 1;
  }
  }
  ;

After:
  return {
    a: function SomeFunction() {
      // ...
      return 1;
    }
  };

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

10 years agoMS ABI: Fix inheritance model calculation in CRTP
David Majnemer [Fri, 13 Jun 2014 06:43:46 +0000 (06:43 +0000)]
MS ABI: Fix inheritance model calculation in CRTP

CRTP-like patterns involve a class which inherits from another class
using itself as a template parameter.

However, the base class itself may try to create a pointer-to-member
which involves the derived class.  This is problematic because we
may not have finished parsing the most derived classes' base specifiers
yet.

It turns out that MSVC simply uses the unspecified inheritance model
instead of doing anything fancy.

This fixes PR19987.

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

10 years agoMissed a space at the end of the line.
Brad Smith [Fri, 13 Jun 2014 03:53:07 +0000 (03:53 +0000)]
Missed a space at the end of the line.

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

10 years agoUse dwarf-2 by default on OpenBSD and FreeBSD.
Brad Smith [Fri, 13 Jun 2014 03:35:37 +0000 (03:35 +0000)]
Use dwarf-2 by default on OpenBSD and FreeBSD.

The Tools.cpp part of the patch partially based on a patch from
FreeBSD's LLVM tree.

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

10 years agoExtend AST dump to include 'used' and 'referenced' flags, and put 'invalid' flag...
Richard Smith [Fri, 13 Jun 2014 02:24:47 +0000 (02:24 +0000)]
Extend AST dump to include 'used' and 'referenced' flags, and put 'invalid' flag in the right place.

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

10 years agoRecover from missing 'typename' in sizeof(T::InnerType)
Reid Kleckner [Thu, 12 Jun 2014 23:03:48 +0000 (23:03 +0000)]
Recover from missing 'typename' in sizeof(T::InnerType)

Summary:
'sizeof' is a UnaryExprOrTypeTrait, and it can contain either a type or
an expression.  This change threads a RecoveryTSI parameter through the
layers between TransformUnaryExprOrTypeTrait the point at which we look
up the type.  If lookup finds a single type result after instantiation,
we now build TypeSourceInfo for it just like a normal transformation
would.

This fixes the last error in the hello world ATL app that I've been
working with, and it now links and runs with clang.  Please try it and
file bugs!

Reviewers: rsmith

Subscribers: cfe-commits

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

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

10 years agoRemove stale part of comment.
Eli Bendersky [Thu, 12 Jun 2014 22:47:08 +0000 (22:47 +0000)]
Remove stale part of comment.

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

10 years agoCheck the access of operator delete from the destructor context
Reid Kleckner [Thu, 12 Jun 2014 22:39:12 +0000 (22:39 +0000)]
Check the access of operator delete from the destructor context

Previously we would do the access check from the context of
MarkVTableUsed.

Also update this test to C++11, since that is typically used with the MS
C++ ABI.

Fixes PR20005.

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

10 years agoThe Clang C API does not require C++. Thanks to Jordan Rose for pointing out this...
Richard Smith [Thu, 12 Jun 2014 22:09:11 +0000 (22:09 +0000)]
The Clang C API does not require C++. Thanks to Jordan Rose for pointing out this error!

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

10 years agos/pr2007/20007/ in a test
Reid Kleckner [Thu, 12 Jun 2014 21:46:38 +0000 (21:46 +0000)]
s/pr2007/20007/ in a test

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

10 years agoPrefix another use of error_code.
Rafael Espindola [Thu, 12 Jun 2014 21:36:35 +0000 (21:36 +0000)]
Prefix another use of error_code.

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

10 years agoTweak documentation.
Nico Weber [Thu, 12 Jun 2014 21:15:10 +0000 (21:15 +0000)]
Tweak documentation.

1. Having "get started", "get involved", and "hacking" makes it hard to find
   how to send patches, so add a link from "get involved" to "hacking".
2. Remove an almost 5 year old note on the test running meachanism changing
   soon.
3. Let "hacking" link to the LLVM developer policy.

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

10 years agoObjective-C ARC. Blocks that strongly capture themselves
Fariborz Jahanian [Thu, 12 Jun 2014 20:57:14 +0000 (20:57 +0000)]
Objective-C ARC. Blocks that strongly capture themselves
to call themselves will get the warning:
"Capturing <itself> strongly in this block is likely to
lead to a retain cycle". Cut down on the amount of noise
by noticing that user at some point sets the captured variable
to null in order to release it (and break the cycle).
// rdar://16944538

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

10 years agoRefer to error_code with the std prefix.
Rafael Espindola [Thu, 12 Jun 2014 20:37:59 +0000 (20:37 +0000)]
Refer to error_code with the std prefix.

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

10 years agoMS ABI: Fix forming pointers to members of a base class
Reid Kleckner [Thu, 12 Jun 2014 19:49:17 +0000 (19:49 +0000)]
MS ABI: Fix forming pointers to members of a base class

Previously we would calculate the inheritance model of a class when
requiring a pointer to member type of that class to be complete.  The
inheritance model is used to figure out how many fields are used by the
member pointer.

However, once we require a pointer to member of a derived class type to
be complete, we can form pointers to members of bases without
calculating the inheritance model for those bases.  This was causing
crashes on this simple test case:

  struct A {
    void f();
    void f(int);
  };
  struct B : public A {};
  void g() { void (B::*a)() = &B::f; }

Now we calculate the inheritance models of all base classes when
completing a member pointer type.

Fixes PR2007.

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

10 years agoPermit -Wswitch coverage for enumerations.
Saleem Abdulrasool [Thu, 12 Jun 2014 19:33:26 +0000 (19:33 +0000)]
Permit -Wswitch coverage for enumerations.

Thanks to David Blakie and Richard Smith for pointing out that we can retain the
-Wswitch coverage while avoiding the warning from GCC by pushing the unreachable
outside of the switch!

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

10 years agoBasic: fix warnings from GCC
Saleem Abdulrasool [Thu, 12 Jun 2014 17:43:37 +0000 (17:43 +0000)]
Basic: fix warnings from GCC

tools/clang/lib/Basic/DiagnosticIDs.cpp: In function â€˜clang::DiagnosticIDs::Level toLevel(clang::diag::Severity)’:
tools/clang/lib/Basic/DiagnosticIDs.cpp:382:1: warning: control reaches end of non-void function [-Wreturn-type]

tools/clang/lib/Format/Format.cpp: In member function â€˜virtual std::string clang::format::ParseErrorCategory::message(int) const’:
tools/clang/lib/Format/Format.cpp:282:1: warning: control reaches end of non-void function [-Wreturn-type]

Add a default cases that asserts that we handle the severity, parse error.

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

10 years agoInclude system_error directly.
Rafael Espindola [Thu, 12 Jun 2014 17:19:42 +0000 (17:19 +0000)]
Include system_error directly.

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

10 years agoMore tests for // rdar://17259812
Fariborz Jahanian [Thu, 12 Jun 2014 16:55:43 +0000 (16:55 +0000)]
More tests for // rdar://17259812

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

10 years agoObjective-C. Use isObjCRetainableType in my last
Fariborz Jahanian [Thu, 12 Jun 2014 16:12:30 +0000 (16:12 +0000)]
Objective-C. Use isObjCRetainableType in my last
patch. NFC.

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

10 years agoExplicitly initialize all fields to avoid -Wmissing-field-initializers warning.
Eli Bendersky [Thu, 12 Jun 2014 15:47:57 +0000 (15:47 +0000)]
Explicitly initialize all fields to avoid -Wmissing-field-initializers warning.

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

10 years agoReplace llvm::error_code with std::error_code.
Rafael Espindola [Thu, 12 Jun 2014 14:02:15 +0000 (14:02 +0000)]
Replace llvm::error_code with std::error_code.

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

10 years agoAllow lowercase messages in this test again.
Rafael Espindola [Thu, 12 Jun 2014 12:40:04 +0000 (12:40 +0000)]
Allow lowercase messages in this test again.

I misunderstood where the message was being converted.

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

10 years agoFix msvc unittest build.
Rafael Espindola [Thu, 12 Jun 2014 11:35:17 +0000 (11:35 +0000)]
Fix msvc unittest build.

Looks like msvc has an asymmetrical operator ==.

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

10 years agoDiagnosticsEngine: update severity setters to new terminology
Alp Toker [Thu, 12 Jun 2014 11:13:52 +0000 (11:13 +0000)]
DiagnosticsEngine: update severity setters to new terminology

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

10 years agoComplete the switch from mappings to declarative diagnostic severities
Alp Toker [Thu, 12 Jun 2014 10:15:20 +0000 (10:15 +0000)]
Complete the switch from mappings to declarative diagnostic severities

This begins to address cognitive dissonance caused by treating the Note
diagnostic level as a severity in the diagnostic engine.

No change in functionality.

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

10 years agoUse StringRef to simplify code. No functional change.
Craig Topper [Thu, 12 Jun 2014 05:32:35 +0000 (05:32 +0000)]
Use StringRef to simplify code. No functional change.

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

10 years agoUse ArrayRef in some function parameters instead of a pointer and count. No functiona...
Craig Topper [Thu, 12 Jun 2014 05:32:27 +0000 (05:32 +0000)]
Use ArrayRef in some function parameters instead of a pointer and count. No functional change.

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

10 years agoAdd a std:: prefix in cases where ADL would have failed on windows.
Rafael Espindola [Thu, 12 Jun 2014 03:53:36 +0000 (03:53 +0000)]
Add a std:: prefix in cases where ADL would have failed on windows.

This is in preparation for removing make_error_code from the llvm namespace.

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

10 years agoFix typo.
Rafael Espindola [Thu, 12 Jun 2014 03:31:26 +0000 (03:31 +0000)]
Fix typo.

Thanks to Alp Toker for noticing.

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

10 years agoGive clang-format its own error category.
Rafael Espindola [Thu, 12 Jun 2014 02:50:04 +0000 (02:50 +0000)]
Give clang-format its own error category.

The posix errno values are probably to the best thing to use for
describing parse errors.

This should also fix the mingw build.

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

10 years agoDriver: use more range-based for loops
Saleem Abdulrasool [Thu, 12 Jun 2014 02:08:04 +0000 (02:08 +0000)]
Driver: use more range-based for loops

Mechanical change converting some of the simpler for loops into range-based for
loops.  NFC.

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

10 years agoUse generic_category from the std namespace.
Rafael Espindola [Thu, 12 Jun 2014 01:59:06 +0000 (01:59 +0000)]
Use generic_category from the std namespace.

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

10 years agoErrno should use generic_category.
Rafael Espindola [Thu, 12 Jun 2014 00:57:40 +0000 (00:57 +0000)]
Errno should use generic_category.

Sorry, no testcase, just noticed while trying to remove llvm's system_error.h

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

10 years ago[modules] Add first-draft module maps for Clang. These don't cover everything
Richard Smith [Thu, 12 Jun 2014 00:32:32 +0000 (00:32 +0000)]
[modules] Add first-draft module maps for Clang. These don't cover everything
yet, but they're enough for a clean bootstrap (with a few local patches that
are yet to be committed).

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

10 years agoPR19966: don't crash/assert when __underlying_type is applied to an incomplete
Richard Smith [Thu, 12 Jun 2014 00:01:45 +0000 (00:01 +0000)]
PR19966: don't crash/assert when __underlying_type is applied to an incomplete
enumeration type. I've also filed a LWG issue pointing out that this should be
ill-formed.

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

10 years agoAccomodate for message differences on windows.
Rafael Espindola [Wed, 11 Jun 2014 23:53:06 +0000 (23:53 +0000)]
Accomodate for message differences on windows.

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

10 years agoDon't inherit dllimport to inline move assignment operators
Hans Wennborg [Wed, 11 Jun 2014 22:44:39 +0000 (22:44 +0000)]
Don't inherit dllimport to inline move assignment operators

Current MSVC versions don't have move assignment operators, so we
can't rely on them being available in the dll. If we have the
definition, we can just use that directly. This breaks pointer
equality, but should work fine otherwise.

When there is an MSVC version that supports move assignment,
we can key this off the -fmsc-ver option.

http://reviews.llvm.org/D4105

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

10 years agoDon't slice SemaDiagnosticBuilder
Reid Kleckner [Wed, 11 Jun 2014 21:57:15 +0000 (21:57 +0000)]
Don't slice SemaDiagnosticBuilder

I wasn't able to figure out how to emit this diagnostic from a SFINAE
context, so I don't have a test.

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

10 years agoFix the VS2012 build.
Hans Wennborg [Wed, 11 Jun 2014 21:24:13 +0000 (21:24 +0000)]
Fix the VS2012 build.

It didn't handle the in-class member initializer and compound literal.

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

10 years agoObjective-C. Accept '__attribute__((__ns_returns_retained__))'
Fariborz Jahanian [Wed, 11 Jun 2014 21:22:53 +0000 (21:22 +0000)]
Objective-C. Accept '__attribute__((__ns_returns_retained__))'
for function/methods returning block in MRR mode as well.
// rdar://17259812

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

10 years agoRemove dev/null redirect and x86 backend requirement from new test.
Bob Wilson [Wed, 11 Jun 2014 20:19:07 +0000 (20:19 +0000)]
Remove dev/null redirect and x86 backend requirement from new test.

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

10 years agoAdd missing "non-constant" diagnostic for a member call on a temporary of
Richard Smith [Wed, 11 Jun 2014 19:53:12 +0000 (19:53 +0000)]
Add missing "non-constant" diagnostic for a member call on a temporary of
non-literal class type.

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

10 years agoclang-cl: accept the /C option with /P (PR19978)
Hans Wennborg [Wed, 11 Jun 2014 19:44:53 +0000 (19:44 +0000)]
clang-cl: accept the /C option with /P (PR19978)

(It's also allowed with /EP, but we haven't implemented that option yet.)

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

10 years agoRun new test with -fsyntax-only.
Bob Wilson [Wed, 11 Jun 2014 19:34:14 +0000 (19:34 +0000)]
Run new test with -fsyntax-only.

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

10 years agoThe automated server-side process isn't quite right yet, so this is a newly-generated...
Aaron Ballman [Wed, 11 Jun 2014 19:11:24 +0000 (19:11 +0000)]
The automated server-side process isn't quite right yet, so this is a newly-generated attribute reference. Tanya is looking into the server process when she gets the chance.

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

10 years agoObjective-C. More tests for both bridging attributes and
Fariborz Jahanian [Wed, 11 Jun 2014 19:10:46 +0000 (19:10 +0000)]
Objective-C. More tests for both bridging attributes and
a fix to make it work when CFStructs have no definition.
// rdar://17238954.

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

10 years agoUse std::error_code instead of llvm::error_code.
Rafael Espindola [Wed, 11 Jun 2014 19:05:55 +0000 (19:05 +0000)]
Use std::error_code instead of llvm::error_code.

This is an update for a llvm api change.

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

10 years agoAdd some comments to TypoCorrectionConsumer.
Kaelyn Takata [Wed, 11 Jun 2014 18:33:46 +0000 (18:33 +0000)]
Add some comments to TypoCorrectionConsumer.

Also move the constructor for NamespaceSpecifierSet out of line to
improve the class' readability. I meant to do these two things while
cleaning up the previous TypoCorrectionConsumer changes and have them
folded into those changes.

No functionality changed.

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

10 years agoSink SpecifierInfo into the only class that uses it.
Kaelyn Takata [Wed, 11 Jun 2014 18:07:08 +0000 (18:07 +0000)]
Sink SpecifierInfo into the only class that uses it.

SpecifierInfo is not used outside of NamespaceSpecifierSet except
indirectly through NamespaceSpecifierSet's iterator, so clean up the
code a bit by moving SpecifierInfo into NamespaceSpecifierSet. Also drop
SpecifierInfo's trivial yet verbose constructor since brace
initiialization is sufficient in the only two places the constructor was
being explicitly called.

No functionality changed.

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

10 years agoMake a couple of helper classes private to TypoCorrectionConsumer.
Kaelyn Takata [Wed, 11 Jun 2014 18:07:05 +0000 (18:07 +0000)]
Make a couple of helper classes private to TypoCorrectionConsumer.

The SpecifierInfo and NamespaceSpecifierSet are now only used by
TypoCorrectionConsumer, so treat them as the implementation details of
TypoCorrectionConsumer that they are. Also make NamespaceSpecifierSet's
method names more style guide compliant.

No functionality changed.

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

10 years agoClean up the TypoCorrectionConsumer's interface a bit.
Kaelyn Takata [Wed, 11 Jun 2014 18:07:03 +0000 (18:07 +0000)]
Clean up the TypoCorrectionConsumer's interface a bit.

No functionality changed.

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

10 years agoMove TypoCorrection filtering into the TypoCorrectionConsumer and make it incremental.
Kaelyn Takata [Wed, 11 Jun 2014 18:07:01 +0000 (18:07 +0000)]
Move TypoCorrection filtering into the TypoCorrectionConsumer and make it incremental.

The only external/visible functional change that fell out of this
refactoring is that there was one less case where the typo caching
and/or counting didn't work properly. The result is that a test case
had to be moved from typo-correction.cpp to typo-correction-pt2.cpp
to avoid the hard-coded limit on per file/TU typo correction attempts.

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

10 years agoMove a few classes to be before TypoCorrectionConsumer.
Kaelyn Takata [Wed, 11 Jun 2014 18:06:56 +0000 (18:06 +0000)]
Move a few classes to be before TypoCorrectionConsumer.

This is in preparation for moving TypoCorrection filtering
into the TypoCorrectionConsumer, to separate out some of the purely
mechanical churn. It also makes some of the method names in
NamespaceSpecifierSet be more style guide compliant.

No functionality changed.

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

10 years agoAdd loop unroll pragma support
Eli Bendersky [Wed, 11 Jun 2014 17:56:26 +0000 (17:56 +0000)]
Add loop unroll pragma support

http://reviews.llvm.org/D4089

Patch by Mark Heffernan.

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

10 years agoObjective-C. Patch to handle bridge attribute warnings
Fariborz Jahanian [Wed, 11 Jun 2014 16:52:44 +0000 (16:52 +0000)]
Objective-C. Patch to handle bridge attribute warnings
correctly when both NSAttributedString and
NSMutableAttributedString are specified on the same
CFStruct via different typedefs. // rdar://17238954

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

10 years ago[PPC64LE] Fix vec_sld and vec_vsldoi for little endian
Bill Schmidt [Wed, 11 Jun 2014 15:48:46 +0000 (15:48 +0000)]
[PPC64LE] Fix vec_sld and vec_vsldoi for little endian

The vec_sld and vec_vsldoi interfaces perform a left-shift on vector
arguments for both big and little endian.  However, because they rely
on the vec_perm interface which is endian-dependent, the permutation
vector needs to be reversed for LE to get the proper shift direction.

I've added some extra testing for these interfaces for LE in the
builtins-ppc-altivec.c.

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

10 years agoclang-format: Fix pointer/reference detection after decltype.
Daniel Jasper [Wed, 11 Jun 2014 07:35:16 +0000 (07:35 +0000)]
clang-format: Fix pointer/reference detection after decltype.

Before:
  [](const decltype(*a) & value) {}

After:
  [](const decltype(*a)& value) {}

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

10 years agoMS ABI: Only class templates get complex nullptr pointer-to-member-functions
David Majnemer [Wed, 11 Jun 2014 07:08:37 +0000 (07:08 +0000)]
MS ABI: Only class templates get complex nullptr pointer-to-member-functions

r210637 regressed CodeGenCXX/mangle-ms-templates-memptrs.cpp because it
did not believe that there is a distinction between class templates and
function templates.

Sadly, there is.  Function templates should behave in a compatible
manner with MSVC.

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

10 years agoMS ABI: Mangle null pointer-to-member-functions compatibly
David Majnemer [Wed, 11 Jun 2014 04:55:08 +0000 (04:55 +0000)]
MS ABI: Mangle null pointer-to-member-functions compatibly

Summary:
Previously, we would mangle nullptr pointer-to-member-functions in class
templates with a mangling we invented because contemporary versions of
MSVC would crash when trying to compile such code.

However, VS "14" can successfully compile these sorts of template
instantiations.  This commit updates our mangling to be compatible with
theirs.

Reviewers: rnk

Reviewed By: rnk

Subscribers: cfe-commits

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

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

10 years agoCodeGen: Correct linkage of thread_local for OS X
David Majnemer [Wed, 11 Jun 2014 04:08:55 +0000 (04:08 +0000)]
CodeGen: Correct linkage of thread_local for OS X

The backing store of thread local variables is internal for OS X and all
accesses must go through the thread wrapper.

However, individual TUs may have inlined through the thread wrapper.
To fix this, give the thread wrapper functions WeakAnyLinkage.  This
prevents them from getting inlined into call-sites.

This fixes PR19989.

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

10 years ago[AArch64] Add default features for CPUs on AArch64 target.
Kevin Qin [Wed, 11 Jun 2014 01:42:16 +0000 (01:42 +0000)]
[AArch64] Add default features for CPUs on AArch64 target.

For ARM target, we can use CRYPTO and CRC features if we select
cortex-a57 by '-mcpu', but for AArch64 target, it doesn't work
unless adding with '-mfpu=crypto-neon-fp-armv8'. To keep consistency
between front-end and back-end and get end-users more easier to use,
we'd better add default feature for CPUs on AArch64 target as well.

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

10 years agoEnsure test/Misc/win32-macho.c doesn't try to write to the source tree
David Blaikie [Wed, 11 Jun 2014 00:50:07 +0000 (00:50 +0000)]
Ensure test/Misc/win32-macho.c doesn't try to write to the source tree

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

10 years agoPR19993: don't assert/crash if a static data member is initialized by '= delete;'.
Richard Smith [Wed, 11 Jun 2014 00:49:52 +0000 (00:49 +0000)]
PR19993: don't assert/crash if a static data member is initialized by '= delete;'.

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

10 years agoPR19996: don't crash if -Wuninitialized sees a c++1y lambda init-capture.
Richard Smith [Wed, 11 Jun 2014 00:31:00 +0000 (00:31 +0000)]
PR19996: don't crash if -Wuninitialized sees a c++1y lambda init-capture.

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

10 years agoAllow lookup into dependent bases in more places under -fms-compatibility
Reid Kleckner [Wed, 11 Jun 2014 00:01:28 +0000 (00:01 +0000)]
Allow lookup into dependent bases in more places under -fms-compatibility

We currently allow unqualified lookup for instance methods but not
static methods because we can't recover with a semantic 'this->'
insertion.

ATL headers have static methods that do unqualified lookup into
dependent base classes.  The pattern looks like:

  template <typename T> struct Foo : T {
    static int *getBarFromT() { return Bar; }
  };

Now we recover as if the user had written:

  template <typename T> struct Foo : T {
    static int *getBarFromT() { return Foo::Bar; }
  };

... which will eventually look up Bar in T at instantiation time.

Now we emit a diagnostic in both cases, and delay lookup in other
contexts where 'this' is available and refers to a class with dependent
bases.

Reviewed by: rsmith

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

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

10 years agoTeach __alignof__ to look through arrays before performing the
Richard Smith [Tue, 10 Jun 2014 23:43:44 +0000 (23:43 +0000)]
Teach __alignof__ to look through arrays before performing the
preferred-alignment transformations. Corrects alignof(T[]) to return
alignof(T) in all cases, as required by relevant standards.

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

10 years agoRelated to PR19992: when the GNU alignof-expression extension is applied to an
Richard Smith [Tue, 10 Jun 2014 23:34:28 +0000 (23:34 +0000)]
Related to PR19992: when the GNU alignof-expression extension is applied to an
expression of array-of-unknown-bound type, don't try to complete the array
bound, and return the alignment of the element type rather than 1.

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

10 years agoRecover from missing typenames on template args for MSVC compatibility
Reid Kleckner [Tue, 10 Jun 2014 23:29:48 +0000 (23:29 +0000)]
Recover from missing typenames on template args for MSVC compatibility

While matching a non-type template argument against a known template
type parameter we now modify the AST's TemplateArgumentLoc to assume the
user wrote typename.  Under -fms-compatibility, we downgrade our
diagnostic from an error to an extwarn.

Reviewed by: rsmith

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

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

10 years agoRevert "Clang changes to support LLVM removal of runtime multithreading"
Zachary Turner [Tue, 10 Jun 2014 23:17:11 +0000 (23:17 +0000)]
Revert "Clang changes to support LLVM removal of runtime multithreading"

This reverts r210601.

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

10 years agoClang changes to support LLVM removal of runtime multithreading
Zachary Turner [Tue, 10 Jun 2014 23:02:10 +0000 (23:02 +0000)]
Clang changes to support LLVM removal of runtime multithreading
support (llvm revision r210600).

Reviewers: rnk

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

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

10 years ago*Really* fix DOS newlines introduced in r210330
Reid Kleckner [Tue, 10 Jun 2014 21:35:24 +0000 (21:35 +0000)]
*Really* fix DOS newlines introduced in r210330

r210369 didn't quite catch all of them.

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

10 years agoTry to fix clang-hexagon-elf failure by requiring x86 support for this test.
Bob Wilson [Tue, 10 Jun 2014 21:15:17 +0000 (21:15 +0000)]
Try to fix clang-hexagon-elf failure by requiring x86 support for this test.

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

10 years agoPR19992: alignof is permitted on an array of unknown bound.
Richard Smith [Tue, 10 Jun 2014 21:11:26 +0000 (21:11 +0000)]
PR19992: alignof is permitted on an array of unknown bound.

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