Commit Graph

33040 Commits

Author SHA1 Message Date
Daniel Jasper 16fc754216 clang-format: Fix indenting corner case with comment and else.
Before:
  if (a) {
    f();
  }
      // or else ..
      else {
    g();
  }

After:
  if (a) {
    f();
  }
  // or else ..
  else {
    g();
  }

llvm-svn: 193684
2013-10-30 14:04:10 +00:00
Daniel Jasper 9885784d67 clang-format: Fix whitespaces in include directives.
Before (clang-format wouldn't change):
  #include  "a.h"
  #include<a>

After:
  #include "a.h"
  #include <a>

This fixes llvm.org/PR16151.

llvm-svn: 193683
2013-10-30 13:54:53 +00:00
Timur Iskhodzhanov 0201432a5e Make thunk this/return adjustment ABI-specific. Also, fix the return adjustment when using -cxx-abi microsoft
Reviewed at http://llvm-reviews.chandlerc.com/D2026

llvm-svn: 193679
2013-10-30 11:55:43 +00:00
Daniel Jasper 580da27616 clang-format: fix for \r\r\n produced in multiline block comments
Patch by Christopher Olsen. Thank you!

llvm-svn: 193678
2013-10-30 07:36:40 +00:00
Akira Hatanaka babd67e6ce [mips] Delete unused functions.
llvm-svn: 193674
2013-10-30 02:38:17 +00:00
Richard Smith 3876cc88ac PR17731: When determining whether a tag and a non-tag were declared in the same
scope, be careful about function-scope declarations (which are not declared in
their semantic context).

llvm-svn: 193671
2013-10-30 01:02:04 +00:00
Warren Hunt 7c55e7ef0e Minor efficiency refactor related to 193661. No functional change.
llvm-svn: 193665
2013-10-30 00:14:55 +00:00
Warren Hunt dbbc5dfd12 Fixing code gen to handle microsoft layouts for which size % alignment
!= 0

llvm-svn: 193661
2013-10-29 23:49:26 +00:00
Chris Wailes 9385f9f7c3 Changed tests_typestate to test_typestate for consistency.
llvm-svn: 193648
2013-10-29 20:28:41 +00:00
Evgeniy Stepanov 4ae68468cd Add -lm to sanitizer link arguments.
We'll need to intercept a few function in libm.

llvm-svn: 193644
2013-10-29 19:48:47 +00:00
Akira Hatanaka 618b29813a [mips] Align the stack to 16-bytes for -mfp64.
llvm-svn: 193640
2013-10-29 19:00:35 +00:00
Akira Hatanaka ddd6634340 [mips] Use the distance between the current argument's starting address and
the previous argument's ending address to compute the type of the padding
argument.

No intended functionality change.

llvm-svn: 193638
2013-10-29 18:41:15 +00:00
Akira Hatanaka 9064e36551 [mips] Move setDescriptionString to base class MipsTargetInfoBase and call it
at the end of handleTargetFeatures.

No intended functionality change.

llvm-svn: 193636
2013-10-29 18:30:33 +00:00
Tom Stellard 08ded12ffb R600: Add Sea Islands GPUs
llvm-svn: 193622
2013-10-29 16:38:29 +00:00
Daniel Jasper dd978ae0e1 clang-format: Option to control spacing in template argument lists.
Same as SpacesInParentheses, this option allows adding a space inside
the '<' and '>' of a template parameter list.

Patch by Christopher Olsen.

This fixes llvm.org/PR17301.

llvm-svn: 193614
2013-10-29 14:52:02 +00:00
Samuel Benzaquen f34ac3ed2c Resubmit "Refactor DynTypedMatcher into a value type class, just like Matcher<T>."
Summary: This resubmits r193100, plus a fix for a breakage with MSVC.

Reviewers: klimek, rnk

CC: cfe-commits, revane

Differential Revision: http://llvm-reviews.chandlerc.com/D2005

llvm-svn: 193613
2013-10-29 14:37:15 +00:00
Timur Iskhodzhanov 66f4381b39 Fix an assertion when handling a custom case of virtual inheritance; also reduce code duplication
llvm-svn: 193610
2013-10-29 14:13:45 +00:00
Tim Northover 58d2bb12ff ARM: fix AST for __builtin_arm_strex call
The AST was constructed so that this builtin returned the default BoolTy and
since I'd opted for custom SemaChecking, I should have set it properly at that
point.

This caused an assertion failure when the types didn't match up with what we
generated. This makes it return an IntTy, which is as good as anything.

llvm-svn: 193606
2013-10-29 12:32:58 +00:00
Daniel Jasper edc5f09175 clang-format: Fix overloaded operator for global-scoped conversions.
Before:
  operator::A();

After:
  operator ::A();

llvm-svn: 193605
2013-10-29 12:24:23 +00:00
Chandler Carruth da797048d9 Teach the driver to not try to use 'lib32' multilib spellings on ARM
which doesn't use that multilib. As a consequence, fix Clang's support
for cross compiling environments that were relying on this quirk to
ensure the correct library search path ordering.

This also re-instates the new test cases from Rafael's r193528 for
cross-compiling to ARM on Ubuntu 13.10 without any of the changes to the
existing test cases (they were no longer needed).

This solution was the result of a lot of IRC debugging and trying to
understand *exactly* what quirk was being relied upon. It took some time
for me to figure out that it was the use of 'lib32' is a multilib that
was throwing a wrench in the works.

In case you are thinking that its silly to use a multilib of 'lib' at
all, entertainingly, GCC does so as well (you can see it with the
.../lib/../lib/crt1.o pattern it uses), and the 2-phase sequence of
search paths (multilib followed by non-multilib) has observable (if
dubious) consequences. =/ Yuck.

llvm-svn: 193601
2013-10-29 10:27:30 +00:00
Bernard Ogden 18b5701a68 ARM: Add -m[no-]crc to dis/enable CRC subtargetfeature from clang
Allow users to disable or enable CRC subtarget feature.

Differential Revision: http://llvm-reviews.chandlerc.com/D2037

llvm-svn: 193600
2013-10-29 09:47:51 +00:00
Chandler Carruth 4952448b56 Doh, got this turned around. This is in fact the consistent ordering.
llvm-svn: 193596
2013-10-29 08:57:33 +00:00
Chandler Carruth 8677d92c9c Clean up the deeply misleading name of the "MultiLibSuffix". This is
actually a MIPS-only hack to shim in random ABI directory suffixes in
numerous places throughout the toolchain's path search. It shouldn't
appear to be anything more general or useful.

llvm-svn: 193595
2013-10-29 08:53:03 +00:00
Alp Toker a23d26607e Use Rewriter::overwriteChangedFiles() directly
This replaces the custom code in RefactoringTool::saveRewrittenFiles() which
lacked atomic file saving and error diagnostics, resolving an old FIXME from
r157331.

Landing this time with the proper return code, plus a very unhelpful comment
cleared up.

Rubber-stamped by Manuel Klimek.

llvm-svn: 193594
2013-10-29 08:32:41 +00:00
Alp Toker 7c3ba222e0 Revert "Use Rewriter::overwriteChangedFiles() directly"
This wasn't ready for prime time yet, seems to break tools-extra.

This reverts commit r193590.

llvm-svn: 193592
2013-10-29 07:56:03 +00:00
Alp Toker 4a9284b36a Use Rewriter::overwriteChangedFiles() directly
The old code in RefactoringTool::saveRewrittenFiles() lacked
atomic moves and diagnostics and had FIXME to this effect.

Rubber-stamped by Manuel Klimek.

llvm-svn: 193590
2013-10-29 07:47:49 +00:00
Chandler Carruth 9b6ce9317f Cleanup comments and braces. No functionality changed, just trying to
record what is *actually* going on here as the comments existing in the
code are confusing at best, and in places outright misleading.

The API is even more misleading. Yay.

llvm-svn: 193577
2013-10-29 02:27:56 +00:00
Rafael Espindola a839855b56 Revert "Support cross linking to arm on ubuntu."
This reverts commit r193528 (and fixes).

It broke Chandler's setup.

llvm-svn: 193554
2013-10-28 23:14:34 +00:00
Richard Smith a3feee2ad6 Allow a new syntax in a module requires-declaration:
requires ! feature

The purpose of this is to allow (for instance) the module map for /usr/include
to exclude <tgmath.h> and <complex.h> when building in C++ (these headers are
instead provided by the C++ standard library in this case, and the glibc C
<tgmath.h> header would otherwise try to include <complex.h>, resulting in a
module cycle).

llvm-svn: 193549
2013-10-28 22:18:19 +00:00
Richard Smith 426a47bddb Fix a parser crash when there are #pragmas in a context which requires a single
statement (after a case label, if, etc). Patch by Olivier Goffart!

llvm-svn: 193545
2013-10-28 22:04:30 +00:00
Rafael Espindola cdd2c0044d Support cross linking to arm on ubuntu.
With this patch we correctly determine that ubuntu's ARM tree is not biarch
and use "lib" istead of "lib32".

Without this patch the search inside the arm tree for the crt files was failing
and we would end up trying to use the i686 ones in lib32.

llvm-svn: 193528
2013-10-28 18:52:30 +00:00
NAKAMURA Takumi a67c9c32aa StaticAnalyzer/Checkers/DynamicTypePropagation.cpp: Fix in comments. 80-col and an utf8 char.
llvm-svn: 193513
2013-10-28 04:14:33 +00:00
JF Bastien 1334d0aedf Define [U]LLONG_{MIN,MAX} for C++11, add tests.
Add tests for limits.h, not just [U]LLONG_{MIN,MAX}.

llvm-svn: 193506
2013-10-27 19:00:49 +00:00
Timur Iskhodzhanov 07e6eff8fa Fix the inconsistent order of parameters in the GetVBaseOffsetFromVBPtr definition and declaration
llvm-svn: 193505
2013-10-27 17:10:27 +00:00
Daniel Jasper a1ea4cbb80 clang-format: Fix ObjC method exprs with variadic parameters.
Before:
  _versionLabel.text = [
    NSString stringWithFormat:NSLocalizedString(@"version: %@", @"Label"),
    [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"]
  ];

After:
  _versionLabel.text =
      [NSString stringWithFormat:NSLocalizedString(@"version: %@", @"Label"),
          [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"]];

This fixed llvm.org/PR17695.

llvm-svn: 193475
2013-10-26 17:00:22 +00:00
David Majnemer 6bedcfa79f Sema: Emit a nicer diagnostic when IndirectFieldDecls show up inappropriately in non-type template arguments
llvm-svn: 193462
2013-10-26 06:12:44 +00:00
David Majnemer 3ae0bfa244 Sema: Correctly build pointer-to-member arguments from a template argument with an IndirectFieldDecl
We only considered FieldDecl and CXXMethodDecl as appropriate which
would cause us to believe the IndirectFieldDecl corresponded to an
argument of it's field type instead of a pointer-to-member type.

This fixes PR17696.

llvm-svn: 193461
2013-10-26 05:02:13 +00:00
Jordan Rose e692cfa330 [analyzer] Don't emit an "Assuming x is <OP> y" if it's not a comparison op.
We could certainly be more precise in many of our diagnostics, but before we
were printing "Assuming x is && y", which is just ridiculous.

<rdar://problem/15167979>

llvm-svn: 193455
2013-10-26 01:16:26 +00:00
Fariborz Jahanian 7196487de9 ObjectiveC arc. Warn when an implicitly 'strong' property
is redeclared as 'weak' in class extension.
// rdar://15304886

llvm-svn: 193453
2013-10-26 00:35:39 +00:00
Fariborz Jahanian 39d9042281 Minor performance improvement to not do unnecessary work
in my last patch. // rdar://14989999

llvm-svn: 193441
2013-10-25 22:04:47 +00:00
Fariborz Jahanian 5e3429c395 ObjectiveC: under -Wunused-property-ivar warn if property's
backing warning is not used in one of its accessor methods.
// rdar://14989999

llvm-svn: 193439
2013-10-25 21:44:50 +00:00
Rafael Espindola 1a3605cdbe I am about to change llvm::MemoryBuffer::getFile take take a Twine. Change
clang first so that the build still works.

llvm-svn: 193428
2013-10-25 19:00:49 +00:00
Rafael Espindola 0d2cbc0bd8 Just detect a distro as being fedora or not.
We don't have any checks that depend on the version of fedora, so we can
simplify.

llvm-svn: 193423
2013-10-25 18:09:41 +00:00
Rafael Espindola b625016a8d Merge two adjacent ifs.
llvm-svn: 193419
2013-10-25 17:06:04 +00:00
Jordan Rose 5565941eff Add -Wstring-plus-char, which warns when adding char literals to C strings.
Specifically, this warns when a character literal is added (using '+') to a
variable with type 'char *' (or any other pointer to character type). Like
-Wstring-plus-int, there is a fix-it to change "foo + 'a'" to "&foo['a']"
iff the character literal is on the right side of the string.

Patch by Anders Rönnholm!

llvm-svn: 193418
2013-10-25 16:52:00 +00:00
Chris Wailes 2dc8c4283b Used OwningPtr to clean up some memory management in Consumed.cpp.
llvm-svn: 193414
2013-10-25 15:33:28 +00:00
Daniel Jasper 33b909c5f3 clang-format: Adapt line break penalties for LLVM style.
Specifically make clang-format less eager to break after the opening
parenthesis of a function call.

Before:
  aaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
  aaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
                        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

Apparently that is preferable. This penalties are adapted
conservatively, we might have to increase them a little bit further.

llvm-svn: 193410
2013-10-25 14:29:37 +00:00
David Majnemer 9adc361008 Sema: Do not allow lambda expressions to appear inside of constant expressions
We would previously not diagnose this which would lead to crashes (on
very strange code).

This fixes PR17675.

llvm-svn: 193397
2013-10-25 09:12:52 +00:00
Benjamin Kramer 273670aaaa Remove dead variables.
llvm-svn: 193395
2013-10-25 07:40:50 +00:00
Rafael Espindola b093885696 Consider used attributes in hidden decls.
Without this patch we would warn and fail to output the function in the test.

llvm-svn: 193388
2013-10-25 01:28:12 +00:00
Richard Trieu ef64e94d5c Simplify and refactor the uninitialized field warning.
Change the uninitialized field warnings so that field initializers are checked
inside the constructor.  Previously, in class initializers were checked
separately.  Running one set of checks also simplifies the logic for preventing
duplicate warnings.  Added new checks to warn when an uninitialized field is
used in base class initialization.  Also fixed misspelling of uninitialized
and moved all code for this warning together.

llvm-svn: 193386
2013-10-25 00:56:00 +00:00
Faisal Vali 2b3a301ead Refactor: Extract specializing the generic lambda call operator during conversion to fptr deduction into its own function.
No functionality change.

All clang regression tests pass.

Thanks!

llvm-svn: 193383
2013-10-24 23:40:02 +00:00
Mark Lacey e73f362e2e Remove unused CodeGenOptions from CodeGenTypes.
llvm-svn: 193376
2013-10-24 22:08:55 +00:00
Bernard Ogden da13af380a Add driver support for FP, SIMD and crypto defaults.
Although we wire up a bit for v8fp for macro setting
purposes, we don't set a macro yet. Need to ask list
about that.

Change-Id: Ic9819593ce00882fbec72757ffccc6f0b18160a0
llvm-svn: 193367
2013-10-24 18:32:51 +00:00
Bernard Ogden 58a05cff97 Clean up char/numeric comparisons in ARM getTargetDefines
Change-Id: Ie07228411b68252adcd5cf80b27ccd2eb3b031d9
llvm-svn: 193366
2013-10-24 18:32:44 +00:00
Bernard Ogden a58ef057b9 Set appropriate FPU default for Linux on v8
Change-Id: If9b649c92e7196e3e791948545dc80901a0761eb
llvm-svn: 193365
2013-10-24 18:32:41 +00:00
Bernard Ogden 021d7dacd0 Teach clang driver about Cortex-A53 and Cortex-A57.
Adds some Cortex-A53 strings where they were missing before.
Cortex-A57 is entirely new to clang.

Doesn't touch code only used by Darwin, in consequence of which
one of the A53 lines has been removed.

Change-Id: I5edb58f6eae93947334787e26a8772c736de6483
llvm-svn: 193364
2013-10-24 18:32:36 +00:00
Fariborz Jahanian 42d495539a ObjectiveC IRGen. Replace _objc_empty_vtable pointer in Objective-C
class metadata for certain deployment targets. // rdar://14802916

llvm-svn: 193359
2013-10-24 17:40:28 +00:00
Daniel Jasper 472da8644e clang-format: Properly reset nested AnnotatedLine structure.
This fixes llvm.org/PR17682.

Without this patch, the following code leads to invalid reads/writes:
  DEBUG({
    return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
  });
  #if a
  #else
  #endif

Because of the #if-#else structure, the code is formatted and annotated
twice and becauce of the nested block, the annotated lines form a
hierarchical structure. This structure was not properly reset between
runs.

llvm-svn: 193352
2013-10-24 15:23:11 +00:00
Chris Wailes 44930884b7 Replaced duplicate code with calls to forwardInfo.
Also made move constructor handling safer.

llvm-svn: 193347
2013-10-24 14:28:17 +00:00
Daniel Jasper 7c72d9fef2 clang-format: Be more conservative about column layout formatting.
Specifically, if a braced list has at least one nested braced list,
format it either all on one line or in one column (i.e. one item per
line).

This seems in general to be an improvement as the structure of nested
braced lists can make a tightly packed outer braced list hard to read.

llvm-svn: 193345
2013-10-24 14:14:49 +00:00
Tim Northover 901dee4d28 ARM-Darwin: Use the *-*-darwin-eabi triple for v6m & v7m archs
These arch arguments are used for embedded targets (obviously) which need a
different calling convention to iOS.

llvm-svn: 193328
2013-10-24 10:48:50 +00:00
Daniel Jasper b596fb2be2 clang-format: Cleanup array initializer and dict initializer formatting.
Significant changes:
- Also recognize these literals with missing "@" for robustness.
- Reorganize tests.

llvm-svn: 193325
2013-10-24 10:31:50 +00:00
Manuel Klimek 1f76c4e810 Use the same SourceManager for ModuleMaps and compilations.
This allows using virtual file mappings on the original SourceManager to
map in virtual module.map files. Without this patch, the ModuleMap
search will find a module.map file (as the FileEntry exists in the
FileManager), but will be unable to get the content from the
SourceManager (as ModuleMap previously created its own SourceManager).

Two problems needed to be fixed which this patch exposed:

1. Storing the inferred module map
When writing out a module, the ASTWriter stores the names of the files
in the main source manager; when loading the AST again, the ASTReader
errs out if such a file is found missing, unless it is overridden.
Previously CompilerInstance's compileModule method would store the
inferred module map to a temporary file; the problem with this approach
is that now that the module map is handled by the main source manager,
the ASTWriter stores the name of the temporary module map as source to
the compilation; later, when the module is loaded, the temporary file
has already been deleted, which leads to a compilation error. This patch
changes the inferred module map to instead inject a virtual file into
the source manager. This both saves some disk IO, and works with how the
ASTWriter/ASTReader handle overridden source files.

2. Changing test input in test/Modules/Inputs/*
Now that the module map file is handled by the main source manager, the
VerifyDiagnosticConsumer will not ignore diagnostics created while
parsing the module map file. The module test test/Modules/renamed.m uses
-I test/Modules/Inputs and triggers recursive loading of all module maps
in test/Modules/Inputs, some of which had conflicting names, thus
leading errors while parsing the module maps. Those diagnostics already
occur on trunk, but before this patch they would not break the test, as
they were ignored by the VerifyDiagnosticConsumer. This patch thus
changes the module maps that have been recently introduced which broke
the invariant of compatible modules maps in test/Modules/Inputs.

llvm-svn: 193314
2013-10-24 07:51:24 +00:00
Benjamin Kramer e90c975dbc Remove dead recursive function.
llvm-svn: 193313
2013-10-24 07:39:30 +00:00
Richard Smith 37a45ddfbd Support GNU attributes in alias-declarations now that GCC has implemented them
and we know where they go.

llvm-svn: 193297
2013-10-24 01:21:09 +00:00
Richard Smith 66e7168f8d PR17666: Instead of allowing an initial identifier argument in any attribute
which we don't think can't have one, only allow it in the tiny number of
attributes which opts into this weird parse rule.

I've manually checked that the handlers for all these attributes can in fact
cope with an identifier as the argument. This is still somewhat terrible; we
should move more fully towards picking the parsing rules based on the
attribute, and make the Parse -> Sema interface more type-safe.

llvm-svn: 193295
2013-10-24 01:07:54 +00:00
Faisal Vali 66605d40a7 Fix an instantiation bug with nested generic lambdas and conversion to fptrs.
This patch fixes the typelocs of the conversion-operator and the conversion-operator-name and adds the parameters of the call operator to the FunctionProtoTypeLoc of the respective entities. Thus, when the template declarations (conversion operators) undergo deduction and instantiation/transformation/substitution - they add themselves to the local instantiation scope if needed.

This patch supports the following:

auto L = [](auto b) {
  return [](auto a) ->decltype(a) { return a; };
};
int (*fp)(int) = L(8);

Richard LGTM'd this patch: http://llvm-reviews.chandlerc.com/D1831

Thanks!

llvm-svn: 193294
2013-10-24 01:05:22 +00:00
Warren Hunt 55d8e82f86 Implements 64 bit microsoft record layout and adds lit tests to cover
it.  Also removes all of the microsoft C++ ABI related code from the 
itanium layout builder.

Differential Revision: http://llvm-reviews.chandlerc.com/D2003

llvm-svn: 193290
2013-10-23 23:53:07 +00:00
David Majnemer c85ed7e4a2 Parse: Disable delayed template parsing for constexpr functions
Commit r191484 treated constexpr function templates as normal function
templates with respect to delaying their parsing.  However, this is
unnecessarily restrictive because there is no compatibility concern with
constexpr, MSVC doesn't support it.

Instead, simply disable delayed template parsing for constexpr function
templates.  This largely reverts the changes made in r191484 but keeps
it's unit test.

This fixes PR17661.

llvm-svn: 193274
2013-10-23 21:31:20 +00:00
David Majnemer 0eb8bbdeab AST: Mangle fields in anonymous structs/unions
The Itanium mangler couldn't cope with mangling an IndirectFieldDecl.
Instead, mangle the field the IndirectFieldDecl refers to.

Further, give IndirectFieldDecl no linkage just like FieldDecl.

N.B. Decl.cpp:getLVForNamespaceScopeDecl tried to calculate linkage for
data members of anonymous structs/unions.  However, this seems
impossible so turn it into an assertion.

llvm-svn: 193269
2013-10-23 20:52:43 +00:00
Manman Ren c94122e05b Intrinsics: fix extract & insert when index is out of bound.
Now, all extract & insert intrinsics should have the correct and operation
to ignore higher bits.

rdar://15250497

llvm-svn: 193267
2013-10-23 20:33:14 +00:00
Jordan Rose bb61c8cc73 [analyzer] Generate a LazyCompoundVal when loading from a union-typed region.
This ensures that variables accessible through a union are invalidated when
the union value is passed to a function. We still don't fully handle union
values, but this should at least quiet some false positives.

PR16596

llvm-svn: 193265
2013-10-23 20:08:55 +00:00
Rafael Espindola e4865d2836 A decl never becomes unused. Make that explicit in the API.
llvm-svn: 193248
2013-10-23 16:46:34 +00:00
Faisal Vali c1a6dc4907 Refactor out the circular reference to LambdaExpr in CXXRecordDecl.
A prior commit of this patch was reverted because it was within the blamelist's purview of a failing test.  The failure of that test has been addressed here: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091546.html.  Therefore I am recommitting this patch (all tests pass on windows, except for the usual modules & index suspects that never pass on my box).

Some background: Both Doug and Richard had asked me in Chicago to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl.
 
In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier. 

No change in functionality.

This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested): 
http://llvm-reviews.chandlerc.com/D1856

Thanks!

llvm-svn: 193246
2013-10-23 16:10:50 +00:00
Faisal Vali 2cba133818 And Again: Teach TreeTransform how to transform nested generic lambdas.
A previous attempt http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090049.html resulted in PR 17476, and was reverted,

The original TransformLambdaExpr (pre generic-lambdas) transformed the TypeSourceInfo of the Call operator in its own instantiation scope via TransformType.  This resulted in the parameters of the call operator being mapped to their transformed counterparts in an instantiation scope that would get popped off.
Then a call to TransformFunctionParameters would add the parameters and their transformed mappings (but newly created ones!) to the current instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476.

The new approach seems cleaner. We only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created.   

Another attempt caused a test to fail (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091533.html) and also had to be reverted - my apologies - in my haste, i did not run all the tests - argh!

Now all the tests seem to pass - but a Fixme has been added - since I suspect Richard will find the fix a little inelegant ;) I shall try and work on a more elegant fix once I have had a chance to discuss with Richard or Doug at a later date.

Hopefully the third time;s a charm *fingers crossed*

This does not yet include capturing.

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784

llvm-svn: 193230
2013-10-23 06:44:28 +00:00
Rafael Espindola 09b00e34fa Revert r193223 and r193216.
They were causing CodeGenCXX/mangle-exprs.cpp to fail.

Revert "Remove the circular reference to LambdaExpr in CXXRecordDecl."

Revert "Again: Teach TreeTransform and family how to transform generic lambdas nested within templates and themselves."

llvm-svn: 193226
2013-10-23 04:12:23 +00:00
Faisal Vali 632fba3cb2 Remove the circular reference to LambdaExpr in CXXRecordDecl.
Both Doug and Richard had asked me to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl.

No change in functionality. 

In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier. 

This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested): 
http://llvm-reviews.chandlerc.com/D1856

Thanks!

llvm-svn: 193223
2013-10-23 02:59:27 +00:00
Richard Smith fd8634a09d Make UsingShadowDecls redeclarable. This fixes some visibility problems with
modules.

With this fixed, I no longer see any test regressions in the libc++ test suite
when enabling a single-module module.map for libc++ (other than issues with my
system headers).

llvm-svn: 193219
2013-10-23 02:17:46 +00:00
Faisal Vali 6eac881f66 Again: Teach TreeTransform and family how to transform generic
lambdas nested within templates and themselves.

A previous attempt http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090049.html resulted in PR 17476, and was reverted,


The original TransformLambdaExpr (pre generic-lambdas) transformed the TypeSourceInfo of the Call operator in its own instantiation scope via TransformType.  This resulted in the parameters of the call operator being mapped to their transformed counterparts in an instantiation scope that would get popped off.
Then a call to TransformFunctionParameters would add the parameters and their transformed mappings (but newly created ones!) to the current instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476.

The new approach seems cleaner. We only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created.   

This does not yet include capturing.

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784

llvm-svn: 193216
2013-10-23 00:51:58 +00:00
Richard Smith 15fc7df535 Teach AST dumper to dump the containing module and hidden flag for declarations.
llvm-svn: 193210
2013-10-22 23:50:38 +00:00
Jordan Rose 69d0aed6f1 CFG: Properly print delegating initializer CFG elements.
...rather than segfaulting.

Patch by Enrico P!

llvm-svn: 193208
2013-10-22 23:19:47 +00:00
Alp Toker dd551fc3ae Retain previous language linkage of friend function declarations
With this extension, friend function declarations will retain the language
linkage specified for previous declarations instead of emitting an error
diagnostic.

The feature is known to be compatible with GCC and MSVC and permits a
language to be specified indirectly where it cannot otherwise be written
directly in class scope.

Work is ongoing to improve linkage spec diagnostics.

Fixes PR17337.

Reviewed by Richard Smith.

llvm-svn: 193206
2013-10-22 22:53:01 +00:00
Richard Smith 6b53e224eb Split -fsanitize=bounds to -fsanitize=array-bounds (for the frontend-inserted
check using the ubsan runtime) and -fsanitize=local-bounds (for the middle-end
check which inserts traps).

Remove -fsanitize=local-bounds from -fsanitize=undefined. It does not produce
useful diagnostics and has false positives (PR17635), and is not a good
compromise position between UBSan's checks and ASan's checks.

Map -fbounds-checking to -fsanitize=local-bounds to restore Clang's historical
behavior for that flag.

llvm-svn: 193205
2013-10-22 22:51:04 +00:00
David Majnemer 3ac84e6ae8 Sema: Allow IndirectFieldDecl to appear in a non-type template argument
We would not identify pointer-to-member construction in a non-type
template argument if it was either a FieldDecl or a CXXMethodDecl.
However, this would incorrectly reject declarations that were injected
via an IndirectFieldDecl (e.g. a field inside of an anonymous union).

This fixes PR17657.

llvm-svn: 193203
2013-10-22 21:56:38 +00:00
Rafael Espindola 77c60085af Consider hidden decls for isUsed checks.
This fixes pr17624.

A FIXME from Richard Smith:

It seems to me that the root cause is that a per-Decl 'used' flag doesn't
really make much sense in the way we use it now. I think we should either track
whether that particular declaration is used (with isUsed scanning the entire
redecl chain), or we should only have one flag for the entire redeclaration
chain (perhaps by always looking at the flag on either the most recent decl or
the canonical decl). Modeling it as "is this declaration or any previous
declaration used" is weird, and requires contortions like the loop at the end
of Sema::MarkFunctionReferenced.

llvm-svn: 193202
2013-10-22 21:56:29 +00:00
Rafael Espindola d53ffa0a70 Treat aliases as definitions.
This fixes pr17639.

Before this patch clang would consider

void foo(void) __attribute((alias("__foo")));

a declaration. It now correctly handles it as a definition.

Initial patch by Alp Toker. I added support for variables.

llvm-svn: 193200
2013-10-22 21:39:03 +00:00
Rafael Espindola 208b5c0fa5 New fix for pr17535.
This is a fixed version of r193161. In order to handle

    void foo() __attribute__((alias("bar")));
    void bar() {}
    void zed() __attribute__((alias("foo")));

it is not enough to delay aliases to the end of the TU, we have to do two
passes over them to find if they are defined or not.

This can be implemented by producing alias as we go and just doing the second
pass at the end. This has the advantage that other parts of clang that were
expecting alias to be processed in order don't have to be changed.

This patch also handles cyclic aliases.

llvm-svn: 193188
2013-10-22 19:26:13 +00:00
Manman Ren be38b9e15f _mm_extract_epi16: use "& 7" when index is out of bound.
This is in line with implementation of _mm_extract_pi16.
rdar://15250497

llvm-svn: 193187
2013-10-22 19:24:42 +00:00
Timur Iskhodzhanov 827365ea8f Use GEPs correctly when adjusting this in MicrosoftCXXABI
Reviewed at http://llvm-reviews.chandlerc.com/D1977

llvm-svn: 193176
2013-10-22 18:15:24 +00:00
Chandler Carruth b3b8ea8007 Revert r193073 and the attempt to fix it in r193170.
This patch wasn't reviewed, and isn't correctly preserving the behaviors
relied upon by QT. I don't have a direct example of fallout, but it
should go through the standard code review process. For example, it
should never have removed the QT test case that was added when fixing
those users.

llvm-svn: 193174
2013-10-22 18:07:04 +00:00
Serge Pavlov 65d9468435 Reenable 'break' in 'for' specifier to allow compilation of QT macro 'foreach'
This is a fix to PR17649, caused by fix in r193073. QT uses 'break' statement
to implement their 'foreach' macro. To enable build of QT, this fix reenables
break but only in 'for' statement specifier and only in the third expression.

llvm-svn: 193170
2013-10-22 17:14:47 +00:00
Daniel Jasper b8f6168218 clang-format: Fix ObjC literal indentation in Google style.
Style guide demands a two-space indent.

Before:
  NSArray *arguments = @[
      kind == kUserTicket ? @"--user-store" : @"--system-store",
      @"--print-tickets",
      @"--productid",
      @"com.google.Chrome"
  ];

After:
  NSArray *arguments = @[
    kind == kUserTicket ? @"--user-store" : @"--system-store",
    @"--print-tickets",
    @"--productid",
    @"com.google.Chrome"
  ];

llvm-svn: 193168
2013-10-22 15:45:58 +00:00
Daniel Jasper 1db6c38687 clang-format: Improve formatting of ObjC array literals.
Before:
  NSArray *arguments =
      @[ kind == kUserTicket ? @"--user-store" : @"--system-store",
         @"--print-tickets", @"--productid", @"com.google.Chrome" ];
After:
  NSArray *arguments = @[
      kind == kUserTicket ? @"--user-store" : @"--system-store",
      @"--print-tickets",
      @"--productid",
      @"com.google.Chrome"
  ];

This fixes llvm.org/PR15231.

llvm-svn: 193167
2013-10-22 15:30:28 +00:00
Rafael Espindola 69f531065c Use early return. No functionality change.
llvm-svn: 193166
2013-10-22 15:18:22 +00:00
Timur Iskhodzhanov 8b14242fe5 Drop the unneeded VBase field from MethodInfo in the VFTableBuilder class
llvm-svn: 193164
2013-10-22 14:50:20 +00:00
Rafael Espindola 6956d58722 Revert "This patch causes clang to reject alias attributes that point to undefined names. For example, with this patch we now reject"
This reverts commit r193161.

It broke

void foo() __attribute__((alias("bar")));
void bar() {}
void zed() __attribute__((alias("foo")));

Looks like we have to fix pr17639 first :-(

llvm-svn: 193162
2013-10-22 14:23:09 +00:00
Rafael Espindola 0fad0d7724 This patch causes clang to reject alias attributes that point to undefined
names. For example, with this patch we now reject

void f1(void) __attribute__((alias("g1")));

This patch is implemented in CodeGen. It is quiet a bit simpler and more
compatible with gcc than implementing it in Sema. The downside is that the
errors only fire during -emit-llvm.

llvm-svn: 193161
2013-10-22 13:51:06 +00:00
Alp Toker 5f6b8acf1d Fix comment typo
llvm-svn: 193154
2013-10-22 09:00:49 +00:00
Manuel Klimek f6fd3d3fcf Remove incorrect assert.
If we run into the second preprocessor branch chain, the first branch
chain might have already set the maximum branch count on that level to
something > 0.

Fixes PR17645.

llvm-svn: 193153
2013-10-22 08:27:19 +00:00
Daniel Jasper 97da9178ce Allow a header to be part of multiple modules.
This patch changes two things:

a) Allow a header to be part of multiple modules. The reasoning is that
in existing codebases that have a module-like build system, the same
headers might be used in several build targets. Simple reasons might be
that they defined different classes that are declared in the same
header. Supporting a header as a part of multiple modules will make the
transistion easier for those cases. A later step in clang can then
determine whether the two modules are actually compatible and can be
merged and error out appropriately. The later check is similar to what
needs to be done for template specializations anyway.

b) Allow modules to be stored in a directory tree separate from the
headers they describe.

Review: http://llvm-reviews.chandlerc.com/D1951
llvm-svn: 193151
2013-10-22 08:09:47 +00:00
David Majnemer 766e259e38 Sema: Do not allow template declarations inside local classes
Summary:
Enforce the rule in C++11 [temp.mem]p2 that local classes cannot have
member templates.

This fixes PR16947.

N.B.  C++14 has slightly different wording to afford generic lambdas
declared inside of functions.

Fun fact:  Some formulations of local classes with member templates
would cause clang to crash during Itanium mangling, such as the
following:

void outer_mem() {
  struct Inner {
    template <typename = void>
    struct InnerTemplateClass {
      static void itc_mem() {}
    };
  };
  Inner::InnerTemplateClass<>::itc_mem();
}

Reviewers: eli.friedman, rsmith, doug.gregor, faisalv

Reviewed By: doug.gregor

CC: cfe-commits, ygao

Differential Revision: http://llvm-reviews.chandlerc.com/D1866

llvm-svn: 193144
2013-10-22 04:14:18 +00:00
Reid Kleckner 9171f02528 Revert "Refactor DynTypedMatcher into a value type class, just like Matcher<T>."
This reverts commit r193100.

It was failing to compile with MSVC 2012 while instantiating
llvm::Optional<DynTypedMatcher>.

llvm-svn: 193123
2013-10-21 22:26:36 +00:00
Yaron Keren 9fb7e9065f Fix string assignment, David Blaikie suggestion.
llvm-svn: 193116
2013-10-21 20:07:37 +00:00
Samuel Benzaquen f46e5f1c9a Refactor DynTypedMatcher into a value type class, just like Matcher<T>.
Summary:
Refactor DynTypedMatcher into a value type class, just like Matcher<T>.
This simplifies its usage and removes the virtual hierarchy from Matcher<T>.
It also enables planned changes to replace MatcherInteface<T>.
Too many instantiaions of this class hierarchy has been causing Registry.cpp.o to bloat in size and number of symbols.

Reviewers: klimek

CC: cfe-commits, revane

Differential Revision: http://llvm-reviews.chandlerc.com/D1661

llvm-svn: 193100
2013-10-21 18:40:51 +00:00
Benjamin Kramer b2ccade343 Driver: Various string-related cleanups.
Also fixes some funky formatting.

llvm-svn: 193079
2013-10-21 12:33:55 +00:00
Silviu Baranga e5690463e2 Set the default hardware division features for ARM cpus. Also set it as default for A32 armv8.
llvm-svn: 193075
2013-10-21 10:59:33 +00:00
Silviu Baranga f9671dd09d Add the __ARM_ARCH_EXT_IDIV__ predefine. It is set to 1 if we have hardware divide in the mode that we are compiling in (depending on the target features), not defined if we don't. Should be compatible with the GCC conterpart. Also adding a -hwdiv option to overide the default behavior.
llvm-svn: 193074
2013-10-21 10:54:53 +00:00
Serge Pavlov 6652921d5a Fix to PR8880 (clang dies processing a for loop).
Due to statement expressions supported as GCC extension, it is possible
to put 'break' or 'continue' into a loop/switch statement but outside its
body, for example:

    for ( ; ({ if (first) { first = 0; continue; } 0; }); )

Such usage must be diagnosed as an error, GCC rejects it. To recognize
this and similar patterns the flags BreakScope and ContinueScope are
temporarily turned off while parsing condition expression.

Differential Revision: http://llvm-reviews.chandlerc.com/D1762

llvm-svn: 193073
2013-10-21 09:34:44 +00:00
Manuel Klimek 88033d7a97 Fixes PR17617: Crash on joining short if statements.
Now that we iterate on the formatting multiple times when we
have chains of preprocessor branches, we need to correctly reset
the token's previous and next pointer for the first / last token.

llvm-svn: 193071
2013-10-21 08:11:15 +00:00
Daniel Jasper ac42b75195 Expose -fmodule-name and -fmodule-map-file as driver options.
Review: http://llvm-reviews.chandlerc.com/D1974
llvm-svn: 193069
2013-10-21 06:34:34 +00:00
Justin Bogner 5353513058 Lex: Don't restrict legal UCNs when preprocessing assembly
The C and C++ standards disallow using universal character names to
refer to some characters, such as basic ascii and control characters,
so we reject these sequences in the lexer. However, when the
preprocessor isn't being used on C or C++, it doesn't make sense to
apply these restrictions.

Notably, accepting these characters avoids issues with unicode escapes
when GHC uses the compiler as a preprocessor on haskell sources.

Fixes rdar://problem/14742289

llvm-svn: 193067
2013-10-21 05:02:28 +00:00
David Majnemer 2b2512141f Sema: Explain our deviation from the standard by referencing the, now open, LWG issue.
llvm-svn: 193062
2013-10-21 00:25:32 +00:00
Peter Collingbourne b453cd64a7 Implement function type checker for the undefined behavior sanitizer.
This uses function prefix data to store function type information at the
function pointer.

Differential Revision: http://llvm-reviews.chandlerc.com/D1338

llvm-svn: 193058
2013-10-20 21:29:19 +00:00
Peter Collingbourne f7ef3fd810 Revert r193022 and r193048. They broke the ubsan test suite.
llvm-svn: 193057
2013-10-20 21:29:13 +00:00
Alp Toker 67b47ac0a7 Fix crash in cleanup attr handling
ResolveSingleFunctionTemplateSpecialization() returns 0 and doesn't emit diags
unless the expression has template-ids, so we must null check the result.

Also add a better diag noting which overloads are causing the problem.

Reviewed by Aaron Ballman.

llvm-svn: 193055
2013-10-20 18:48:56 +00:00
Daniel Jasper d46e07e26e clang-format: Better understand Lambda poarameters.
Before:
  auto PointerBinding = [](const char * S) {};

After:
  auto PointerBinding = [](const char *S) {};

This fixes llvm.org/PR17618.

llvm-svn: 193054
2013-10-20 18:15:30 +00:00
Daniel Jasper dcd5da1fd9 clang-format: Fix formatting of nested blocks after comment.
Before:
  DEBUG({ // Comment that used to confuse clang-format.
  fdafas();
  });
Before:
  DEBUG({ // Comments are now fine.
    fdafas();
  });

This fixed llvm.org/PR17619.

llvm-svn: 193051
2013-10-20 17:28:32 +00:00
Daniel Jasper 2d0cd49787 clang-format: Support case ranges.
Before (note the missing space before "..." which can lead to compile
errors):
  switch (x) {
    case 'A'... 'Z':
    case 1... 5:
        break;
  }

After:
  switch (x) {
    case 'A' ... 'Z':
    case 1 ... 5:
        break;
  }

llvm-svn: 193050
2013-10-20 16:56:16 +00:00
Daniel Jasper d489dd342b clang-format: Improve formatting of ObjC dict literals.
Before:
  NSDictionary *d = @{ @"nam" : NSUserNam(), @"dte" : [NSDate date],
                       @"processInfo" : [NSProcessInfo processInfo]
  };

After:
  NSDictionary *d = @{
    @"nam" : NSUserNam(),
    @"dte" : [NSDate date],
    @"processInfo" : [NSProcessInfo processInfo]
  };

llvm-svn: 193049
2013-10-20 16:45:46 +00:00
Benjamin Kramer 80b5a9d2d0 Driver: libubsan_cxx depends on libubsan. Preserve the topological ordering, some linkers depend on it.
llvm-svn: 193048
2013-10-20 12:34:18 +00:00
Benjamin Kramer 1d5d634c82 Forgot some references to misspelled enums.
llvm-svn: 193047
2013-10-20 11:53:20 +00:00
Benjamin Kramer 2501f14197 Miscellaneous speling fixes.
llvm-svn: 193046
2013-10-20 11:47:15 +00:00
David Majnemer ad51f1bc70 Sema: Diagnose global replacement functions declared as inline
This fixes PR17591.

N.B. This actually goes beyond what the standard mandates by requiring
the restriction to hold for declarations instead of definitions.  This
is believed to be a defect in the standard and an LWG issue has been
submitted.

llvm-svn: 193044
2013-10-20 05:40:29 +00:00
Rafael Espindola 7b56f6c3c2 Simplify some implementations of get*Decl.
* NamedDecl and CXXMethodDecl were missing getMostRecentDecl.
* The const version can just forward to the non const.
* getMostRecentDecl can use cast instead of cast_or_null.

This then removes some casts from the callers.

llvm-svn: 193039
2013-10-19 16:55:03 +00:00
Rafael Espindola cb444fe739 Reduce indentation with an early exit.
llvm-svn: 193028
2013-10-19 02:28:17 +00:00
Rafael Espindola 3f9e4442c8 Add isFirstDecl to DecBase too and use it instead of getPreviousDecl() == 0.
Redeclarable already had a isFirstDecl, but it was missing from DeclBase.

llvm-svn: 193027
2013-10-19 02:13:21 +00:00
Rafael Espindola 0d3da83c12 Fix typo.
llvm-svn: 193026
2013-10-19 02:06:23 +00:00
Rafael Espindola 4450301eaf Simplify FunctionDecl::getBody.
llvm-svn: 193025
2013-10-19 01:37:17 +00:00
Nick Lewycky 2492169aee When building ubsan, link in ubsan parts first and sanitizer-common second, to
pick up the common bits ubsan actually needs. Also remove whole-archive when we
aren't trying to re-export the symbols.

llvm-svn: 193022
2013-10-19 00:27:23 +00:00
Kaelyn Uhrain 8aa8da85ca Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.
Now that CorrectTypo knows how to correctly search classes for typo
correction candidates, there is no good reason to only replace an
existing CXXScopeSpecifier if it refers to a namespace. While the actual
enablement was a matter of changing a single comparison, the fallout
from enabling the functionality required a lot more code changes
(including my two previous commits).

llvm-svn: 193020
2013-10-19 00:05:00 +00:00
Kaelyn Uhrain f7b63e3e18 Be smarter about deciding to add a leading '::' to a
NestedNameSpecifier that replaces an existing specifier.

llvm-svn: 193019
2013-10-19 00:04:52 +00:00
Kaelyn Uhrain 5315a4631b Merge NamespaceSpecifierSet's AddNamespace and AddRecord as they are
essentially the same.

llvm-svn: 193018
2013-10-19 00:04:49 +00:00
DeLesley Hutchins 8121866bdb Consumed analysis: fix assert failure.
llvm-svn: 193010
2013-10-18 23:11:49 +00:00
Hans Wennborg 9c1659b5b7 clang-cl: diagnose setting asm listing filename with multiple inputs
llvm-svn: 193006
2013-10-18 22:49:04 +00:00
Richard Smith 92304e0013 Fix crash if a submodule @imports another submodule from the same module. The
test also adds FIXMEs for a number of places where imports and includes of
submodules don't work very well.

llvm-svn: 193005
2013-10-18 22:48:20 +00:00
Fariborz Jahanian 4ba4a5b02e ObjectiveC. Added support for methods annotated with format_arg
attributes when such methods are actually envoked in message
expression. // rdar://15242010

llvm-svn: 193003
2013-10-18 21:20:34 +00:00
Ariel J. Bernal 3255134ac5 Reverted r192992 broke windows and freebsd builds.
llvm-svn: 192997
2013-10-18 19:48:31 +00:00
DeLesley Hutchins 0bd25897ef Consumed analysis: assume that non-const reference parameters are initially
in the "uknown" state.  Patch by chris.wailes@gmail.com.  Reviewed by delesley.

llvm-svn: 192995
2013-10-18 19:25:18 +00:00
Ariel J. Bernal 4dc53c20fc This patch fixes replacements that are not applied when relative paths are
specified.

In particular it makes sure that  relative paths for non-virtual files aren't
made absolute.
Added unittest.

llvm-svn: 192992
2013-10-18 18:38:24 +00:00
DeLesley Hutchins 11a66c1240 Consumed analysis: All the return_typestate parameter to be attached to the
default constructor.  Patch by chris.wailes@gmail.com, reviewed by delesley.

llvm-svn: 192991
2013-10-18 18:36:21 +00:00
Daniel Jasper fbc057ea73 clang-format: Be more aggressive on incorrect code.
Before, clang-format would not adjust leading indents if it found a
structural error (e.g. unmatched {}). It seems, however, that
clang-format has gotten good enough at parsing the code structure that
this hurts in almost all cases. Commonly, while writing code, it is
very useful to be able to correclty indent incomplete if statements or
for loops.

In case this leads to errors that we don't anticipate, we need to find
out and fix those.

This fixed llvm.org/PR17594.

llvm-svn: 192988
2013-10-18 17:20:57 +00:00
Daniel Jasper 2436fe95ea clang-format: Don't force linebreak between return and multiline string.
This looks ugly and leads to llvm.org/PR17590.

Before (with AlwaysBreakBeforeMultilineStrings):
  return
      "aaaa"
      "bbbb";

After:
  return "aaaa"
         "bbbb";

llvm-svn: 192984
2013-10-18 16:47:55 +00:00
Daniel Jasper d8c36d09b1 Make clang-format slightly more willing to break before trailing annotations.
Specifically, prefer breaking before trailing annotations over breaking
before the first parameter.

Before:
  void ffffffffffffffffffffffff(
      int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) OVERRIDE;

After:
  void ffffffffffffffffffffffff(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                                int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      OVERRIDE;

llvm-svn: 192983
2013-10-18 16:34:40 +00:00
Hans Wennborg 5a366fb4dc Add another MinGW header include path
llvm-svn: 192982
2013-10-18 15:48:58 +00:00
Daniel Jasper cc3114d876 clang-format: Improve formatting of templated builder-type calls.
Before:
  aaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaa().aaaaaaaaaaaaaaaaa().has<
      bbbbbbbbbbbbbbbbbbbbb>();

After:
  aaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaa()
      .aaaaaaaaaaaaaaaaaaaaaaaaaa()
      .has<bbbbbbbbbbbbbbbbbbbbb>();

llvm-svn: 192981
2013-10-18 15:23:06 +00:00
Chad Rosier 3c03dee1d1 [AArch64] Add support for NEON scalar extract narrow instructions.
llvm-svn: 192971
2013-10-18 14:03:36 +00:00
Simon Atanasyan 2c97a81e81 [Mips] Define __mips_fpr and _MIPS_FPSET macros.
llvm-svn: 192969
2013-10-18 13:13:53 +00:00
Daniel Jasper 6633ab8ad9 clang-format: Make continuation indent width configurable.
Patch by Kim Gräsman. Thank you!

llvm-svn: 192964
2013-10-18 10:38:14 +00:00
Richard Smith 3d8e97eda2 C++ modules: don't lose track of a 'namespace std' that is imported from a module.
llvm-svn: 192951
2013-10-18 06:54:39 +00:00