]> granicus.if.org Git - clang/log
clang
10 years agoRemove CastKind typedef from CastExpr since CastKind is in the clang namespace.
Craig Topper [Fri, 31 Oct 2014 06:57:10 +0000 (06:57 +0000)]
Remove CastKind typedef from CastExpr since CastKind is in the clang namespace.

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

10 years agoRemove a couple typedefs for things in the clang namespace with the same name. Remove...
Craig Topper [Fri, 31 Oct 2014 06:57:07 +0000 (06:57 +0000)]
Remove a couple typedefs for things in the clang namespace with the same name. Remove a typedef that matches an identical one in the clang namespace.

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

10 years ago[AArch64]Add 2 intrinsics vmov_n_p64/vmovq_n_p64, the alias for vdup_n_p64/vdup_n_p64.
Hao Liu [Fri, 31 Oct 2014 02:41:37 +0000 (02:41 +0000)]
[AArch64]Add 2 intrinsics vmov_n_p64/vmovq_n_p64, the alias for vdup_n_p64/vdup_n_p64.
As this change is too small, commit it directly.

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

10 years ago[modules] When a .pcm file is explicitly built separately from the translation
Richard Smith [Fri, 31 Oct 2014 02:28:58 +0000 (02:28 +0000)]
[modules] When a .pcm file is explicitly built separately from the translation
unit, allow the -O settings of the two compilations to differ.

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

10 years agoMake QualType::dump() produce a useful dump of the structure of the type,
Richard Smith [Fri, 31 Oct 2014 01:17:45 +0000 (01:17 +0000)]
Make QualType::dump() produce a useful dump of the structure of the type,
rather than simply pretty-printing it.

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

10 years agoASTDumper.cpp: Appease g++, for now.
NAKAMURA Takumi [Fri, 31 Oct 2014 00:30:37 +0000 (00:30 +0000)]
ASTDumper.cpp: Appease g++, for now.

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

10 years agoRename 'DarwinStaticLib' to 'DarwinLibName'
Kuba Brecka [Fri, 31 Oct 2014 00:08:57 +0000 (00:08 +0000)]
Rename 'DarwinStaticLib' to 'DarwinLibName'

The former name doesn't make sense, we are using this parameter for both .a and .dylib libraries.

No functional change.

http://reviews.llvm.org/D6040

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

10 years agoRefactor tree printing in AST dumping.
Richard Smith [Thu, 30 Oct 2014 21:02:37 +0000 (21:02 +0000)]
Refactor tree printing in AST dumping.

Instead of manually maintaining a flag indicating whether we're about to print
out the last child of the parent node (to determine whether we print "`" or
"|"), capture a callable to print that child and defer printing it until we
either see a next child or finish the parent.

No functionality change intended.

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

10 years agoGet rid of SanitizerOptions::Disabled global. NFC.
Alexey Samsonov [Thu, 30 Oct 2014 19:33:44 +0000 (19:33 +0000)]
Get rid of SanitizerOptions::Disabled global. NFC.

SanitizerOptions is not even a POD now, so having global variable of
this type, is not nice. Instead, provide a regular constructor and clear()
method, and let each CodeGenFunction has its own copy of SanitizerOptions
it uses.

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

10 years ago[analyzer] Updated tests for ZeroAllocDereference checker.
Anton Yartsev [Thu, 30 Oct 2014 15:16:26 +0000 (15:16 +0000)]
[analyzer] Updated tests for ZeroAllocDereference checker.

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

10 years agoUpdate contact person in Open Projects webpage for copy-paste detection. From Per...
Daniel Marjamaki [Thu, 30 Oct 2014 12:44:33 +0000 (12:44 +0000)]
Update contact person in Open Projects webpage for copy-paste detection. From Per Viberg to Daniel Marjamäki.

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

10 years ago[autoconf] Add clangToolingCore.a to Makefile(s) for static build w/o libclang.dll.
NAKAMURA Takumi [Thu, 30 Oct 2014 10:31:29 +0000 (10:31 +0000)]
[autoconf] Add clangToolingCore.a to Makefile(s) for static build w/o libclang.dll.

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

10 years agoRemove the last couple uses of the ExprArg(just Expr*) typedef in Parser.
Craig Topper [Thu, 30 Oct 2014 05:30:05 +0000 (05:30 +0000)]
Remove the last couple uses of the ExprArg(just Expr*) typedef in Parser.

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

10 years agoRemove some duplicate functions from the Parser class. Identical functions already...
Craig Topper [Thu, 30 Oct 2014 05:17:10 +0000 (05:17 +0000)]
Remove some duplicate functions from the Parser class. Identical functions already exist in the clang namespace from Sema/Ownership.h.

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

10 years ago[CMake] Prune redundant libdeps.
NAKAMURA Takumi [Thu, 30 Oct 2014 01:37:44 +0000 (01:37 +0000)]
[CMake] Prune redundant libdeps.

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

10 years ago[CMake] Add dependencies on clangToolingCore.
NAKAMURA Takumi [Thu, 30 Oct 2014 00:44:01 +0000 (00:44 +0000)]
[CMake] Add dependencies on clangToolingCore.

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

10 years ago[CMake] clangToolingCore requires clangLex.
NAKAMURA Takumi [Thu, 30 Oct 2014 00:43:44 +0000 (00:43 +0000)]
[CMake] clangToolingCore requires clangLex.

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

10 years agoclang-format: Format line if invoked on the trailing newline.
Daniel Jasper [Wed, 29 Oct 2014 23:40:50 +0000 (23:40 +0000)]
clang-format: Format line if invoked on the trailing newline.

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

10 years agoSink a #include while we're here. NFC.
Hans Wennborg [Wed, 29 Oct 2014 22:49:58 +0000 (22:49 +0000)]
Sink a #include while we're here. NFC.

Format.h doesn't use stack.

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

10 years agoclang-format: Cut more clangAST dependencies.
Daniel Jasper [Wed, 29 Oct 2014 22:42:53 +0000 (22:42 +0000)]
clang-format: Cut more clangAST dependencies.

Hopefully fixing windows builds.

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

10 years agoTrim some includes. NFC.
Hans Wennborg [Wed, 29 Oct 2014 22:13:46 +0000 (22:13 +0000)]
Trim some includes. NFC.

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

10 years agoFollow-up to r216619: use isCXXCLassMember() instead of trying to
Hans Wennborg [Wed, 29 Oct 2014 21:20:57 +0000 (21:20 +0000)]
Follow-up to r216619: use isCXXCLassMember() instead of trying to
check the context ourselves when selectively allowing late-added
dll attributes on unused free functions and variables (PR20746)

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

10 years agoRefactor libTooling to reduce required dependencies.
Daniel Jasper [Wed, 29 Oct 2014 18:55:09 +0000 (18:55 +0000)]
Refactor libTooling to reduce required dependencies.

This moves classes for storing and applying replacements to separate
files. These classes specifically are used by clang-format which doesn't
have any other dependencies on clangAST. Thereby, the size of
clang-format's binary can be cut roughly in half and its build time sped
up.

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

10 years agoEnable display of compiler diagnostics in clang-tidy.
Alexander Kornienko [Wed, 29 Oct 2014 17:28:51 +0000 (17:28 +0000)]
Enable display of compiler diagnostics in clang-tidy.

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

10 years agotest: generalise the test matching
Saleem Abdulrasool [Wed, 29 Oct 2014 16:53:16 +0000 (16:53 +0000)]
test: generalise the test matching

The value names may change in different builds, use pattern based tests.

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

10 years agoclang-format: [JS] Support more regex literals.
Daniel Jasper [Wed, 29 Oct 2014 16:51:38 +0000 (16:51 +0000)]
clang-format: [JS] Support more regex literals.

Previously a regex-literal containing "/*" would through clang-format
off, e.g.:
  var regex = /\/*$/;

Would lead to none of the following code to be formatted.

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

10 years agoCodeGen: add __readfsdword builtin
Saleem Abdulrasool [Wed, 29 Oct 2014 16:35:41 +0000 (16:35 +0000)]
CodeGen: add __readfsdword builtin

The Windows NT SDK uses __readfsdword and declares it as a compiler provided
builtin (#pragma intrinsic(__readfsword).  Because intrin.h is not referenced
by winnt.h, it is not possible to provide an out-of-line definition for the
intrinsic.  Provide a proper compiler builtin definition.

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

10 years agoFix warning in Altivec code when building with GCC 4.8.2 on Ubuntu 14.04.
Jay Foad [Wed, 29 Oct 2014 14:42:12 +0000 (14:42 +0000)]
Fix warning in Altivec code when building with GCC 4.8.2 on Ubuntu 14.04.

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

10 years agoPass aggregates on the stack without splitting in NVPTX.
Eli Bendersky [Wed, 29 Oct 2014 13:43:21 +0000 (13:43 +0000)]
Pass aggregates on the stack without splitting in NVPTX.

Following the NVVM IR specifications, arguments of aggregate type should be
passed on the stack without splitting (byval).

http://reviews.llvm.org/D6020

Patch by Jacques Pienaar.

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

10 years agoclang/lib/AST/Decl.cpp: Tweak isVLATypeCapturingAllowed() for -Asserts. [-Wunused...
NAKAMURA Takumi [Wed, 29 Oct 2014 13:27:44 +0000 (13:27 +0000)]
clang/lib/AST/Decl.cpp: Tweak isVLATypeCapturingAllowed() for -Asserts. [-Wunused-function]

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

10 years ago[PowerPC ABI] Bug 21398 - Consider C++ base classes in HA classification
Ulrich Weigand [Wed, 29 Oct 2014 13:23:20 +0000 (13:23 +0000)]
[PowerPC ABI] Bug 21398 - Consider C++ base classes in HA classification

As discussed in bug 21398, PowerPC ABI code needs to consider C++ base
classes when classifying a class as homogeneous aggregate (or not) for
ABI purposes.

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

10 years agoclang/test/CodeGen/captured-statements-nested.c: Tweak for -Asserts.
NAKAMURA Takumi [Wed, 29 Oct 2014 13:21:52 +0000 (13:21 +0000)]
clang/test/CodeGen/captured-statements-nested.c: Tweak for -Asserts.

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

10 years agoImproved capturing variable-length array types in CapturedStmt.
Alexey Bataev [Wed, 29 Oct 2014 12:21:55 +0000 (12:21 +0000)]
Improved capturing variable-length array types in CapturedStmt.
An updated implemnentation of VLA types capturing based on previously committed solution for Lambdas.
This version captures the whole VLA type instead of particular variables which are part of VLA size expression and allows to use previusly calculated size of VLA type in captured regions. Required for OpenMP.
Differential Revision: http://reviews.llvm.org/D5099

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

10 years agoUse enumerators instead of hardcoded integers when we decide if keyword is enabled.
Serge Pavlov [Wed, 29 Oct 2014 10:59:18 +0000 (10:59 +0000)]
Use enumerators instead of hardcoded integers when we decide if keyword is enabled.

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

10 years agoDon't capture DeclRefExpr::getNameInfo().getInfo(). It returns reference in temporary...
NAKAMURA Takumi [Wed, 29 Oct 2014 08:11:47 +0000 (08:11 +0000)]
Don't capture DeclRefExpr::getNameInfo().getInfo(). It returns reference in temporary object.

DeclarationNameInfo::getInfo() returns reference, but DeclRefExpr::getNameInfo() returns temporary DeclarationNameInfo().

It triggered a local crash for me.

  Failing Tests (1):
      Clang :: SemaTemplate/instantiate-overload-candidates.cpp

  Assertion failed!
  Program: bin\clang.EXE
  File: clang/lib/Basic/SourceManager.cpp, Line 822
  Expression: 0 && "Invalid SLocOffset or bad function choice"

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

10 years agoObjective-C modern rewriter. Patch to fix a rewriting bug
Fariborz Jahanian [Tue, 28 Oct 2014 23:46:58 +0000 (23:46 +0000)]
Objective-C modern rewriter. Patch to fix a rewriting bug
rewriting an Objective-C block. Patch by Ryan Govostes.
rdar://18799145

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

10 years agoThe dllimport.cpp test was gating some checks on #ifndef MSABI,
Hans Wennborg [Tue, 28 Oct 2014 22:15:55 +0000 (22:15 +0000)]
The dllimport.cpp test was gating some checks on #ifndef MSABI,
but MSABI was never defined in the test. It seems we are erroring
on code that we should be accepting when compiling for MSVC compatibility.

This should make the test less confusing until PR21406 is fixed.

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

10 years agoObjective-C remove an unused enumerator which causes
Fariborz Jahanian [Tue, 28 Oct 2014 20:21:33 +0000 (20:21 +0000)]
Objective-C remove an unused enumerator which causes
warning in a switch statement.

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

10 years agoclang-format: Improve && detection as binary operator.
Daniel Jasper [Tue, 28 Oct 2014 18:28:22 +0000 (18:28 +0000)]
clang-format: Improve && detection as binary operator.

Before:
  template <class T,
            class = typename ::std::enable_if<
                ::std::is_array<T>{}&& ::std::is_array<T>{}>::type>
  void F();

After:
  template <class T,
            class = typename ::std::enable_if<
                ::std::is_array<T>{} && ::std::is_array<T>{}>::type>
  void F();

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

10 years agoObjective-C. revert patch for rdar://17554063.
Fariborz Jahanian [Tue, 28 Oct 2014 18:28:16 +0000 (18:28 +0000)]
Objective-C. revert patch for rdar://17554063.

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

10 years agoclang-format: Fix test.
Daniel Jasper [Tue, 28 Oct 2014 18:18:02 +0000 (18:18 +0000)]
clang-format: Fix test.

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

10 years agoclang-format: Improve && detection as binary operators.
Daniel Jasper [Tue, 28 Oct 2014 18:11:52 +0000 (18:11 +0000)]
clang-format: Improve && detection as binary operators.

Before:
  template <class T, class = typename std::enable_if<std::is_integral<
                         T>::value &&(sizeof(T) > 1 || sizeof(T) < 8)>::type>
  void F();

After:
  template <class T, class = typename std::enable_if<
                         std::is_integral<T>::value &&
                         (sizeof(T) > 1 || sizeof(T) < 8)>::type>
  void F();

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

10 years agoActually remove this test entirely.
Fariborz Jahanian [Tue, 28 Oct 2014 17:32:36 +0000 (17:32 +0000)]
Actually remove this test entirely.

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

10 years ago[Objective-C]. revert r220740,r220727
Fariborz Jahanian [Tue, 28 Oct 2014 17:26:21 +0000 (17:26 +0000)]
[Objective-C]. revert r220740,r220727

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

10 years agoclang-format: Improve function declaration detection.
Daniel Jasper [Tue, 28 Oct 2014 17:06:04 +0000 (17:06 +0000)]
clang-format: Improve function declaration detection.

Before:
  ReturnType MACRO
      FunctionName() {}

After:
  ReturnType MACRO
  FunctionName() {}

This fixes llvm.org/PR21404.

I wonder what the motivation for that if-condition was. But as no test
breaks, ...

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

10 years agoPR17730: Add test that we don't crash on this testcase. (The bug is already fixed.)
Richard Smith [Tue, 28 Oct 2014 17:00:19 +0000 (17:00 +0000)]
PR17730: Add test that we don't crash on this testcase. (The bug is already fixed.)

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

10 years agoclang-format: Update generated documentation with new flag.
Daniel Jasper [Tue, 28 Oct 2014 16:56:37 +0000 (16:56 +0000)]
clang-format: Update generated documentation with new flag.

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

10 years agoPR21367: Don't accept rvalue references as an extension in C++98 mode if we're in...
Richard Smith [Tue, 28 Oct 2014 16:55:02 +0000 (16:55 +0000)]
PR21367: Don't accept rvalue references as an extension in C++98 mode if we're in a new-type-id or conversion-type-id, since those things can legitimately be followed by a binary && operator.

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

10 years agoclang-format: [ObjC] Add separate flag to control indentation in blocks
Daniel Jasper [Tue, 28 Oct 2014 16:53:38 +0000 (16:53 +0000)]
clang-format: [ObjC] Add separate flag to control indentation in blocks

Apparently, people are very much divided on what the "correct"
indentation is. So, best to give them a choice.

The new flag is called ObjCBlockIndentWidth and the default is now set
to the same value as IndentWidth for the pre-defined styles.

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

10 years agoExtend test to check that -D flags do not leak across module boundaries.
Richard Smith [Tue, 28 Oct 2014 16:30:57 +0000 (16:30 +0000)]
Extend test to check that -D flags do not leak across module boundaries.

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

10 years agoclang-format: Fix test after recent flag change.
Daniel Jasper [Tue, 28 Oct 2014 16:29:56 +0000 (16:29 +0000)]
clang-format: Fix test after recent flag change.

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

10 years ago[modules] Allow -I, -D, -W flags to change between building a module and
Richard Smith [Tue, 28 Oct 2014 16:24:08 +0000 (16:24 +0000)]
[modules] Allow -I, -D, -W flags to change between building a module and
explicitly using the resulting .pcm file. Unlike for an implicit module build,
we don't need nor want to require these flags to match between the module
and its users.

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

10 years agoclang-format: Don't put functions on a single line in Google's Java
Daniel Jasper [Tue, 28 Oct 2014 16:15:52 +0000 (16:15 +0000)]
clang-format: Don't put functions on a single line in Google's Java
style.

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

10 years agoAdd valueDecl() matcher.
Samuel Benzaquen [Tue, 28 Oct 2014 13:33:58 +0000 (13:33 +0000)]
Add valueDecl() matcher.

Summary: Add valueDecl() matcher.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

10 years agoclang/test/Modules/explicit-build.cpp: Tweak to meet win32's backslash.
NAKAMURA Takumi [Tue, 28 Oct 2014 11:34:29 +0000 (11:34 +0000)]
clang/test/Modules/explicit-build.cpp: Tweak to meet win32's backslash.

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

10 years agoFix warning text: lower -> higher
Richard Trieu [Tue, 28 Oct 2014 04:37:34 +0000 (04:37 +0000)]
Fix warning text: lower -> higher

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

10 years agoDriver: remove a stray s that propagated in cross-windows
Saleem Abdulrasool [Tue, 28 Oct 2014 03:15:02 +0000 (03:15 +0000)]
Driver: remove a stray s that propagated in cross-windows

The option is '--allow-multiple-definition' not '--allow-multiple-definitions'.

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

10 years agoUpdate for LLVM API change.
Rafael Espindola [Tue, 28 Oct 2014 00:29:51 +0000 (00:29 +0000)]
Update for LLVM API change.

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

10 years agoImprove on the diagnostic in my last patch and change warning
Fariborz Jahanian [Mon, 27 Oct 2014 23:41:04 +0000 (23:41 +0000)]
Improve on the diagnostic in my last patch and change warning
to error. rdar://18768214.

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

10 years agoRemove unused variable.
Richard Smith [Mon, 27 Oct 2014 23:25:15 +0000 (23:25 +0000)]
Remove unused variable.

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

10 years agoUse the newer/simple API for passing a diagnostic handler to the IR linker.
Rafael Espindola [Mon, 27 Oct 2014 23:02:34 +0000 (23:02 +0000)]
Use the newer/simple API for passing a diagnostic handler to the IR linker.

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

10 years ago[modules] Load .pcm files specified by -fmodule-file lazily.
Richard Smith [Mon, 27 Oct 2014 23:01:16 +0000 (23:01 +0000)]
[modules] Load .pcm files specified by -fmodule-file lazily.

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

10 years agoObjective-C ARC [qoi]. Issue diagnostic if __bridge casting
Fariborz Jahanian [Mon, 27 Oct 2014 22:33:06 +0000 (22:33 +0000)]
Objective-C ARC [qoi]. Issue diagnostic if __bridge casting
to C type a collection literal. rdar://18768214

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

10 years agoFrontend: Don't include stdin in the dependency list for an object file
David Majnemer [Mon, 27 Oct 2014 22:31:50 +0000 (22:31 +0000)]
Frontend: Don't include stdin in the dependency list for an object file

GCC doesn't do this and it semes weird to include a file that we can't
open.

This fixes PR21362.

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

10 years agoTry to appease the C++ gods
Hans Wennborg [Mon, 27 Oct 2014 22:28:50 +0000 (22:28 +0000)]
Try to appease the C++ gods

Looks like some builds were not happy with the potentially-throwing move
constructor that was added in r220723, and reached for the implicitly
deleted copy constructor instead.

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

10 years agoGive TypoExprState a move constructor and assignment operator to appease MSVC build
Hans Wennborg [Mon, 27 Oct 2014 21:50:49 +0000 (21:50 +0000)]
Give TypoExprState a move constructor and assignment operator to appease MSVC build

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

10 years agoFix segfault in hasDeclContext for nodes that have no decl context.
Samuel Benzaquen [Mon, 27 Oct 2014 20:58:44 +0000 (20:58 +0000)]
Fix segfault in hasDeclContext for nodes that have no decl context.

Summary:
Some declarations do not have a declaration context, like TranslationUnitDecl.
Fix hasDeclContext() to not segfault on these nodes.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

10 years agoFrontend: Define __EXCEPTIONS if -fexceptions is passed
David Majnemer [Mon, 27 Oct 2014 20:02:19 +0000 (20:02 +0000)]
Frontend: Define __EXCEPTIONS if -fexceptions is passed

GCC defines __EXCEPTIONS, regardless of language mode, if -fexceptions
is passed.  We should do the same.

This fixes PR21358.

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

10 years agoDo not insert asan paddings after fields that have flexible arrays.
Kostya Serebryany [Mon, 27 Oct 2014 19:34:10 +0000 (19:34 +0000)]
Do not insert asan paddings after fields that have flexible arrays.

Summary:
We should avoid a tail padding not only if the last field
has zero size but also if the last field is a struct with a flexible array.

If/when http://reviews.llvm.org/D5478 is committed,
this will also handle the case of structs with zero-sized arrays.

Reviewers: majnemer, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

10 years agoc++11 patch to issue warning on missing 'override' on
Fariborz Jahanian [Mon, 27 Oct 2014 19:11:51 +0000 (19:11 +0000)]
c++11 patch to issue warning on missing 'override' on
overriding methods. Patch review by Richard Smith.
rdar://18295240

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

10 years agoWire up LookupMemberExpr to use the new TypoExpr.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:46 +0000 (18:07 +0000)]
Wire up LookupMemberExpr to use the new TypoExpr.

This includes adding the new TypoExpr-based lazy typo correction to
LookupMemberExprInRecord as an alternative to the existing eager typo
correction.

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

10 years agoAdd a callback for recovering using a typo correction.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:42 +0000 (18:07 +0000)]
Add a callback for recovering using a typo correction.

Also keep track of the stack of Exprs visited during the tree transform
so the callback can be passed the parent of the TypoExpr.

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

10 years agoAdd simple way for a CorrectionCandidateCallback to reject exact
Kaelyn Takata [Mon, 27 Oct 2014 18:07:40 +0000 (18:07 +0000)]
Add simple way for a CorrectionCandidateCallback to reject exact
matches of the typo.

Also be more proactive about checking a correction's visibility so that
a correction requiring a module import can be distinguished from the
original typo even if it looks identical. Otherwise the correction will
be excluded and the diagnostic about needing the module import won't be
emitted.

Note that no change was made to checkCorrectionVisibility other than
moving where it is at in SemaLookup.cpp.

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

10 years agoStart adding the infrastructure for handling TypoExprs.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:37 +0000 (18:07 +0000)]
Start adding the infrastructure for handling TypoExprs.

Part of the infrastructure is a map from a TypoExpr to the Sema-specific
state needed to correct it, along with helpers to ease dealing with the
state.

The the typo count is propagated up the stack of
ExpressionEvaluationContextRecords when one is popped off of to
avoid accidentally dropping TypoExprs on the floor. For example,
the attempted correction of g() in test/CXX/class/class.mem/p5-0x.cpp
happens with an ExpressionEvaluationContextRecord that is popped off
the stack prior to ActOnFinishFullExpr being called and the tree
transform for TypoExprs being run.

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

10 years agoHave TypoCorrectionConsumer remember the TypoCorrections it returned.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:34 +0000 (18:07 +0000)]
Have TypoCorrectionConsumer remember the TypoCorrections it returned.

Two additional methods are provided: one to return the current
correction (the last correction returned by getNextCorrection), and one
to "reset" the state so that getNextCorrection will return the previous
corrections before returning any new corrections.

Also ensure that all TypoCorrections have valid source ranges.

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

10 years agoPass around CorrectionCandidateCallbacks as unique_ptrs so
Kaelyn Takata [Mon, 27 Oct 2014 18:07:29 +0000 (18:07 +0000)]
Pass around CorrectionCandidateCallbacks as unique_ptrs so
TypoCorrectionConsumer can keep the callback around as long as needed.

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

10 years agoAdd the initial TypoExpr AST node for delayed typo correction.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:20 +0000 (18:07 +0000)]
Add the initial TypoExpr AST node for delayed typo correction.

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

10 years agoMove TypoCorrectionConsumer into a header.
Kaelyn Takata [Mon, 27 Oct 2014 18:07:13 +0000 (18:07 +0000)]
Move TypoCorrectionConsumer into a header.

This makes it available outside of SemaLookup.cpp, as
needed for the forthcoming TypoExpr AST node which will
keep a TypoCorrectionConsumer that provides the possible
typo corrections for that TypoExpr.

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

10 years agoclang-format: Don't break after very short return types.
Daniel Jasper [Mon, 27 Oct 2014 17:13:59 +0000 (17:13 +0000)]
clang-format: Don't break after very short return types.

Before:
  void
  SomeFunction(int parameter);

After:
  void SomeFunction(
      int parameter);

(Unless AlwaysBreakAfterDefinitionReturnType after type is set).

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

10 years agoclang-format: improve vim integration docs
Saleem Abdulrasool [Mon, 27 Oct 2014 17:13:33 +0000 (17:13 +0000)]
clang-format: improve vim integration docs

Improve the documentation for vim integration of clang-format.  Prefer the use
of <c-o> to do the normal mode command execution to avoid side-effects of the
escape and re-insertion (cursor movement).  Tweak the macros to use a double
return to avoid having to manually return control to the editor from the
subprocess.

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

10 years agoclang-format: Fix bad merging of lines in nested blocks.
Daniel Jasper [Mon, 27 Oct 2014 16:31:46 +0000 (16:31 +0000)]
clang-format: Fix bad merging of lines in nested blocks.

Before:
  SomeFunction([]() {
  #define A a
    return 43; });

After:
  SomeFunction([]() {
  #define A a
    return 43;
  });

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

10 years agoSpeed up clang-tidy when profiling in on.
Samuel Benzaquen [Mon, 27 Oct 2014 15:22:59 +0000 (15:22 +0000)]
Speed up clang-tidy when profiling in on.

Summary:
Speed up clang-tidy when profiling in on.
It makes profiling runs twice as fast by reusing the time samples between the
different actions.
It also joins together the sampling of different matchers of the same check.

Reviewers: alexfh

Subscribers: klimek, cfe-commits

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

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

10 years agoAllow thread sanitizer in clang driver on FreeBSD
Viktor Kutuzov [Mon, 27 Oct 2014 13:51:25 +0000 (13:51 +0000)]
Allow thread sanitizer in clang driver on FreeBSD
http://reviews.llvm.org/D5999

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

10 years agoclang-format: [Proto] Change formatting text-formatted options.
Daniel Jasper [Mon, 27 Oct 2014 13:25:59 +0000 (13:25 +0000)]
clang-format: [Proto] Change formatting text-formatted options.

Before:
  optional Type type = 1 [(mutate_options) = {vital : true
                                              abc : false}];

After:
  optional Type type = 1 [(mutate_options) = {
    vital : true
    abc : false
  }];

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

10 years agoPrune CRLF.
NAKAMURA Takumi [Mon, 27 Oct 2014 12:37:26 +0000 (12:37 +0000)]
Prune CRLF.

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

10 years agoRevert rL220675 due to failures on check-clang
Viktor Kutuzov [Mon, 27 Oct 2014 12:33:10 +0000 (12:33 +0000)]
Revert rL220675 due to failures on check-clang

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

10 years agoAllow thread sanitizer in clang driver on FreeBSD
Viktor Kutuzov [Mon, 27 Oct 2014 11:26:01 +0000 (11:26 +0000)]
Allow thread sanitizer in clang driver on FreeBSD
Differential Revision: http://reviews.llvm.org/D5994

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

10 years agoFix unicode chars into ascii in comment lines.
NAKAMURA Takumi [Mon, 27 Oct 2014 08:08:18 +0000 (08:08 +0000)]
Fix unicode chars into ascii in comment lines.

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

10 years agoFix 80-column and other odd formatting.
Eric Christopher [Sun, 26 Oct 2014 23:40:33 +0000 (23:40 +0000)]
Fix 80-column and other odd formatting.

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

10 years agoMake VFS and FileManager match the current MemoryBuffer API.
Benjamin Kramer [Sun, 26 Oct 2014 22:44:13 +0000 (22:44 +0000)]
Make VFS and FileManager match the current MemoryBuffer API.

This eliminates converting back and forth between the 3 formats and
gives us a more homogeneous interface.

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

10 years agoModuleMap.cpp: fix Windows build, take 2
Hans Wennborg [Sun, 26 Oct 2014 20:00:53 +0000 (20:00 +0000)]
ModuleMap.cpp: fix Windows build, take 2

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

10 years agoModuleMap.cpp: fix VS2012 build
Hans Wennborg [Sun, 26 Oct 2014 19:39:46 +0000 (19:39 +0000)]
ModuleMap.cpp: fix VS2012 build

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

10 years agoDelete unused method and clangAST dependency it required.
Daniel Jasper [Sun, 26 Oct 2014 14:26:55 +0000 (14:26 +0000)]
Delete unused method and clangAST dependency it required.

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

10 years agoModuleMap::addHeader(): Appease msc17.
NAKAMURA Takumi [Sun, 26 Oct 2014 13:12:35 +0000 (13:12 +0000)]
ModuleMap::addHeader(): Appease msc17.

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

10 years agoDriver: reduce search logic duplication
Saleem Abdulrasool [Sat, 25 Oct 2014 23:33:21 +0000 (23:33 +0000)]
Driver: reduce search logic duplication

Refactor the path search into a helper function to avoid duplicating the path
handling for the search.  NFC.

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

10 years agotest: attempt to make test more hermetic
Saleem Abdulrasool [Sat, 25 Oct 2014 20:49:12 +0000 (20:49 +0000)]
test: attempt to make test more hermetic

Add a fake linker in to a sysroot to use for testing the driver's tool
invocation.  Should make the test behave similarly on all platforms.  Addresses
review comments from Reid Kleckner from SVN r220546.

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

10 years agoDriver: assume that all architectures are supported for libstc++
Saleem Abdulrasool [Sat, 25 Oct 2014 20:48:35 +0000 (20:48 +0000)]
Driver: assume that all architectures are supported for libstc++

Rather than asserting that the target is unsupported, make a guess at what the
tree for a port would look like and use that for the search path.

Addresses review comments from Ried Kleckner for SVN r220547.

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

10 years agoLex: Fix an invalid access into a SmallString
David Majnemer [Sat, 25 Oct 2014 11:40:40 +0000 (11:40 +0000)]
Lex: Fix an invalid access into a SmallString

We would crash because we used operator[] to access past the end of a
SmallString.  This occured because our token had length zero.

Instead, form the pointer using .data() and arithmetic.  This is safe
because this forms a one-past-the-end pointer and it is only used to
compare with another one-past-the-end pointer.

This fixes PR21379.

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

10 years agoUpdate for LLVM api change.
Rafael Espindola [Sat, 25 Oct 2014 04:06:14 +0000 (04:06 +0000)]
Update for LLVM api change.

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

10 years agoMake this test a bit stricter by checking clang's output too.
Rafael Espindola [Sat, 25 Oct 2014 01:51:19 +0000 (01:51 +0000)]
Make this test a bit stricter by checking clang's output too.

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