]> granicus.if.org Git - clang/log
clang
9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 years agoCodeGen: Don't form weak dllexport aliases
David Majnemer [Fri, 24 Oct 2014 22:05:27 +0000 (22:05 +0000)]
CodeGen: Don't form weak dllexport aliases

The MS linker cannot do anything interesting with these, it doesn't make
sense to emit them.

This fixes PR21373.

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

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

9 years agotest: correct an overzealous search-and-replace
Saleem Abdulrasool [Fri, 24 Oct 2014 21:23:49 +0000 (21:23 +0000)]
test: correct an overzealous search-and-replace

The temporary initialized is referenced as %0, not as the auto-release pool.
Fixes R+A tests.

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

9 years agoCodeGen: correct materialize temporary aggregates in ARC mode
Saleem Abdulrasool [Fri, 24 Oct 2014 20:23:43 +0000 (20:23 +0000)]
CodeGen: correct materialize temporary aggregates in ARC mode

Avoid an assertion when materializing a lifetime type aggregate temporary.  When
performing CodeGen for ObjC++, we could generate a lifetime-only aggregate
temporary by using an initializer list (which is effectively an array).  We
would reach through the temporary expression, fishing out the inner expression.
If this expression was a lifetime expression, we would attempt to emit this as a
scalar.  This would eventually result in an assertion as the emission would
eventually assert that the expression being emitted has a scalar evaluation
kind.

Add a case to handle the aggregate expressions.  Use the EmitAggExpr to emit the
aggregate expression rather than the EmitScalarInit.

Addresses PR21347.

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

9 years ago[modules] Support combining 'textual' with 'private'.
Richard Smith [Fri, 24 Oct 2014 20:23:01 +0000 (20:23 +0000)]
[modules] Support combining 'textual' with 'private'.

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

9 years agoItanium ABI: Template template parameters are usable as substitutions
David Majnemer [Fri, 24 Oct 2014 20:22:57 +0000 (20:22 +0000)]
Itanium ABI: Template template parameters are usable as substitutions

Template template parameters weren't added to the list of substitutions.
This would make the substitution map contain inaccurate mappings,
leading to Clang violating the Itanium ABI and breaking compatibility
with GCC.

This fixes PR21351.

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

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

9 years agoCodeGen: trivial conversion to range based loop
Saleem Abdulrasool [Fri, 24 Oct 2014 19:54:32 +0000 (19:54 +0000)]
CodeGen: trivial conversion to range based loop

Switch to a range-based for loop.  NFC.

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

9 years agotest: add -std=c++11
Saleem Abdulrasool [Fri, 24 Oct 2014 19:54:29 +0000 (19:54 +0000)]
test: add -std=c++11

This test uses C++11 features (r-value references) in ObjC++.  Add a -std=c++11
to silence a warning.  NFC.

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

9 years agoCodeGen: GLValue exprs in template parameters should have reference type
David Majnemer [Fri, 24 Oct 2014 19:49:04 +0000 (19:49 +0000)]
CodeGen: GLValue exprs in template parameters should have reference type

This fixes a corner-case where __uuidof as a template argument would
result in us trying to emit a GLValue as an RValue.  This would lead to
a crash down the road.

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

9 years agoFix windows-cross.c test on my machine
Reid Kleckner [Fri, 24 Oct 2014 17:55:29 +0000 (17:55 +0000)]
Fix windows-cross.c test on my machine

I suspect it will need a custom sysroot to pass reliably elsewhere.

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

9 years agoAdd frontend support for __vectorcall
Reid Kleckner [Fri, 24 Oct 2014 17:42:17 +0000 (17:42 +0000)]
Add frontend support for __vectorcall

Wire it through everywhere we have support for fastcall, essentially.

This allows us to parse the MSVC "14" CTP headers, but we will
miscompile them because LLVM doesn't support __vectorcall yet.

Reviewed By: Aaron Ballman

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

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

9 years agoUse enumerators instead of hardcoded integers when processing macro names.
Serge Pavlov [Fri, 24 Oct 2014 17:31:32 +0000 (17:31 +0000)]
Use enumerators instead of hardcoded integers when processing macro names.

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

9 years ago[Modules] Free modules that failed signature verification.
Benjamin Kramer [Fri, 24 Oct 2014 16:31:42 +0000 (16:31 +0000)]
[Modules] Free modules that failed signature verification.

The control flow and ownership is weird enough so unique_ptr doesn't help here :(

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

9 years ago[mips] Mark aggregate arguments passed in registers with the inreg attribute
Daniel Sanders [Fri, 24 Oct 2014 15:30:16 +0000 (15:30 +0000)]
[mips] Mark aggregate arguments passed in registers with the inreg attribute

Summary:
This allows us to easily identify them in the backend which in turn allows us
to handle them correctly for big-endian targets (where they must be shifted
into the upper bits of the register).

Depends on D5961

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: cfe-commits, theraven

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

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

9 years ago[mips] Promote all integral/enumeration types to the GPR width
Daniel Sanders [Fri, 24 Oct 2014 14:42:42 +0000 (14:42 +0000)]
[mips] Promote all integral/enumeration types to the GPR width

Summary:
Ensure all integral/enumeration types are appropriately annotated with
signext/zeroext. In particular, i32 now has these attributes when using the
N32/N64 ABI. This paves the way for accurately representing the way the
N32/N64 ABI's promotes integer arguments to i64.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: cfe-commits, theraven

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

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

9 years agoFix initializing TypeOfTypeLoc
Olivier Goffart [Fri, 24 Oct 2014 13:52:55 +0000 (13:52 +0000)]
Fix initializing TypeOfTypeLoc

This fixes a crash in the RecursiveASTVisitor on such code
 __typeof__(struct F*) var[invalid];

The UnderlyingTInfo of a TypeOfTypeLoc was left uninitialized when
created from ASTContext::getTrivialTypeSourceInfo
This lead to a crash in RecursiveASTVisitor when trying to access it.

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

9 years agoASTMatchers: Peel off a layer of indirection from true matcher. NFC.
Benjamin Kramer [Fri, 24 Oct 2014 13:29:21 +0000 (13:29 +0000)]
ASTMatchers: Peel off a layer of indirection from true matcher. NFC.

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

9 years agoASTMatchers: for-rangify loops. No functionality change.
Benjamin Kramer [Fri, 24 Oct 2014 13:29:15 +0000 (13:29 +0000)]
ASTMatchers: for-rangify loops. No functionality change.

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

9 years agoAdd arguments() to CXXConstructExpr so the same interface as with CallExpr can be...
Benjamin Kramer [Fri, 24 Oct 2014 13:29:07 +0000 (13:29 +0000)]
Add arguments() to CXXConstructExpr so the same interface as with CallExpr can be used.

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

9 years agoReport when a function-try-block does not return a value on all control paths. Fixed...
Aaron Ballman [Fri, 24 Oct 2014 13:19:19 +0000 (13:19 +0000)]
Report when a function-try-block does not return a value on all control paths. Fixed PR14620.

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

9 years ago[Thumb] Clang thinks "char" is signed when using a thumb triple
Oliver Stannard [Fri, 24 Oct 2014 11:28:47 +0000 (11:28 +0000)]
[Thumb] Clang thinks "char" is signed when using a thumb triple

'char' is unsigned on all ARM and Thumb architectures. Clang gets this
right for ARM, and for thumb when using and arm triple and the -mthumb
option, but gets it wrong for thumb triples. This fixes that.

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

9 years ago[CMake] clangRewrite: Roll back clangAST in libdeps, due to clang::Stmt::printPretty().
NAKAMURA Takumi [Fri, 24 Oct 2014 08:44:01 +0000 (08:44 +0000)]
[CMake] clangRewrite: Roll back clangAST in libdeps, due to clang::Stmt::printPretty().

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

9 years agoDriver: add missed file from previous commit
Saleem Abdulrasool [Fri, 24 Oct 2014 03:24:33 +0000 (03:24 +0000)]
Driver: add missed file from previous commit

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

9 years agoDriver: add CrossWindowsToolChain
Saleem Abdulrasool [Fri, 24 Oct 2014 03:13:37 +0000 (03:13 +0000)]
Driver: add CrossWindowsToolChain

This is a very basic toolchain.  It supports cross-compiling Windows (primarily
inspired by the WoA target).  It is meant to use clang with the LLVM IAS and a
binutils ld-compatible interface for the linker (eventually to be lld).  It does
not perform any "standard" GCC lookup, nor does it perform any special
adjustments given that it is expected to be used in an environment where the
user is using MSVCRT (and as such Visual Studio headers) and the Windows SDK.
The primary runtime library is expected to be compiler-rt and the C++
implementation to be libc++.

It also expects that a sysroot has been setup given the usual Unix semantics
(standard C headers in /usr/include, all the import libraries available in
/usr/lib).  It also expects that an entry point stub is present in /usr/lib
(crtbegin.obj for executables, crtbeginS.obj for shared libraries).

The entry point stub is responsible for running any GNU constructors.

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

9 years agoAdd a new -fmerge-functions -cc1 flag that enables function merging.
Nick Lewycky [Fri, 24 Oct 2014 00:49:29 +0000 (00:49 +0000)]
Add a new -fmerge-functions -cc1 flag that enables function merging.

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

9 years agoDon't emit strong vtable definitions for imported classes with key functions (PR21355)
Hans Wennborg [Thu, 23 Oct 2014 22:40:46 +0000 (22:40 +0000)]
Don't emit strong vtable definitions for imported classes with key functions (PR21355)

Clang would previously assert on the following code when targeting MinGW:

  struct __declspec(dllimport) S {
      virtual ~S();
  };
  S::~S() {}

Because ~S is a key function and the class is dllimport, we would try to emit a
strong definition of the vtable, with dllimport - which is a conflict. We
should not emit strong vtable definitions for imported classes.

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

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

9 years agoDriver: Include driver diagnostics when we --serialize-diagnostics
Justin Bogner [Thu, 23 Oct 2014 22:20:11 +0000 (22:20 +0000)]
Driver: Include driver diagnostics when we --serialize-diagnostics

Currently, when --serialize-diagnostics is passed this only includes
the diagnostics from clang -cc1, and driver diagnostics are
dropped. This causes issues for tools that use the serialized
diagnostics, since stderr is lost and these diagnostics aren't seen at
all.

We handle this by merging the diagnostics from the CC1 process and the
driver diagnostics into a single file when the driver invokes CC1.

Fixes rdar://problem/10585062

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

9 years ago[modules] Simplify reading of INPUT_FILE_OFFSETS record and make it robust against...
Richard Smith [Thu, 23 Oct 2014 22:18:29 +0000 (22:18 +0000)]
[modules] Simplify reading of INPUT_FILE_OFFSETS record and make it robust against changes to record order.

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

9 years agoFactor out common checks from module map deserialization. No functionality change.
Richard Smith [Thu, 23 Oct 2014 22:12:14 +0000 (22:12 +0000)]
Factor out common checks from module map deserialization. No functionality change.

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

9 years agoclang-format: Fix incorrect space after "<".
Daniel Jasper [Thu, 23 Oct 2014 20:22:22 +0000 (20:22 +0000)]
clang-format: Fix incorrect space after "<".

Before:
  bool a = 2 <::SomeFunction();

After:
  bool a = 2 < ::SomeFunction();

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

9 years agoRemove code duplication and cut dependency from clangRewrite on
Daniel Jasper [Thu, 23 Oct 2014 19:47:36 +0000 (19:47 +0000)]
Remove code duplication and cut dependency from clangRewrite on
clangAST.

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

9 years agopatch to issue warning on comparing parameters with
Fariborz Jahanian [Thu, 23 Oct 2014 19:00:10 +0000 (19:00 +0000)]
patch to issue warning on comparing parameters with
nonnull attribute when comparison is always
true/false. Patch by Steven Wu with few fixes and minor
refactoring and adding tests by me. rdar://18712242

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

9 years agoAdd a "signature" to AST files to verify that they haven't changed
Ben Langmuir [Thu, 23 Oct 2014 18:05:36 +0000 (18:05 +0000)]
Add a "signature" to AST files to verify that they haven't changed

Since the order of the IDs in the AST file (e.g. DeclIDs, SelectorIDs)
is not stable, it is not safe to load an AST file that depends on
another AST file that has been rebuilt since the importer was built,
even if "nothing changed". We previously used size and modtime to check
this, but I've seen cases where a module rebuilt quickly enough to foil
this check and caused very hard to debug build errors.

To save cycles when we're loading the AST, we just generate a random
nonce value and check that it hasn't changed when we load an imported
module, rather than actually hash the whole file.

This is slightly complicated by the fact that we need to verify the
signature inside addModule, since we might otherwise consider that a
mdoule is "OutOfDate" when really it is the importer that is out of
date. I didn't see any regressions in module load time after this
change.

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

9 years agoDebugInfo: Correctly describe the lexical decl context of static member variable...
David Blaikie [Thu, 23 Oct 2014 16:39:49 +0000 (16:39 +0000)]
DebugInfo: Correctly describe the lexical decl context of static member variable definitions.

The previous IR representation used the non-lexical decl context, which
placed the definitions in the same scope as the declarations (ie: within
the class) - this was hidden by the fact that LLVM currently doesn't
respect the context of global variable definitions at all, and always
puts them at the top level (as direct children of the compile_unit).
Having the correct lexical scope improves source fidelity and simplify
backend global variable emission (with changes coming shortly).

Doing something similar for non-member global variables would help
simplify/cleanup things further (see FIXME in the commit) and provide
similar source fidelity benefits to the final debug info.

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

9 years agoRevert accidentally-committed files in r220460.
Richard Smith [Thu, 23 Oct 2014 02:02:31 +0000 (02:02 +0000)]
Revert accidentally-committed files in r220460.

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

9 years agoRefactor implementation of 'exclude header'.
Richard Smith [Thu, 23 Oct 2014 02:01:19 +0000 (02:01 +0000)]
Refactor implementation of 'exclude header'.

This was not a real header role, and was never exposed to clients of ModuleMap.
Remove the enumeration value for it and track it as marking the header as
'known' rather than creating an extra KnownHeader entry that *every single*
client ignores.

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

9 years agoFix covered-switch warning.
Richard Smith [Thu, 23 Oct 2014 01:03:45 +0000 (01:03 +0000)]
Fix covered-switch warning.

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