]> granicus.if.org Git - clang/log
clang
10 years agoclang-format: Fix corner case working around one-per-line dict literals.
Daniel Jasper [Wed, 21 May 2014 13:26:58 +0000 (13:26 +0000)]
clang-format: Fix corner case working around one-per-line dict literals.

Before:
  var object_literal_with_long_name = {
    a: 'aaaaaaaaaaaaaaaaaa', b: 'bbbbbbbbbbbbbbbbbb'
  };

After:
  var object_literal_with_long_name = {
    a: 'aaaaaaaaaaaaaaaaaa',
    b: 'bbbbbbbbbbbbbbbbbb'
  };

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

10 years agoclang-format: Fix incorrect macro call detection.
Daniel Jasper [Wed, 21 May 2014 13:08:17 +0000 (13:08 +0000)]
clang-format: Fix incorrect macro call detection.

In:
  struct A {
    A()
        noexcept(....) {}
  };

'A()' is not a macro call.
This fixes llvm.org/PR19814.

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

10 years agoclang-format: [JS] Support different function literal style.
Daniel Jasper [Wed, 21 May 2014 12:51:23 +0000 (12:51 +0000)]
clang-format: [JS] Support different function literal style.

Before:
  goog.array.forEach(array, function() {
                              doSomething();
                              doSomething();
                            },
                     this);

After:
  goog.array.forEach(array, function() {
    doSomething();
    doSomething();
  }, this);

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

10 years agoMake global named registers internal variables
Renato Golin [Wed, 21 May 2014 10:40:27 +0000 (10:40 +0000)]
Make global named registers internal variables

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

10 years agoDeclVisitor is not used here.
Yaron Keren [Wed, 21 May 2014 09:02:49 +0000 (09:02 +0000)]
DeclVisitor is not used here.

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

10 years agoPreprocessor: support defined() with operator names for MS compatibility
Alp Toker [Wed, 21 May 2014 06:13:51 +0000 (06:13 +0000)]
Preprocessor: support defined() with operator names for MS compatibility

Also flesh out missing tests, improve diagnostic QOI and fix a couple of corner
cases found in the process.

Fixes PR10606.

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

10 years ago[C++11] Use 'nullptr'. Parser edition.
Craig Topper [Wed, 21 May 2014 06:02:52 +0000 (06:02 +0000)]
[C++11] Use 'nullptr'. Parser edition.

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

10 years ago[C++11] Use 'nullptr'. CodeGen edition.
Craig Topper [Wed, 21 May 2014 05:09:00 +0000 (05:09 +0000)]
[C++11] Use 'nullptr'. CodeGen edition.

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

10 years agoutils/CmpDriver: add brief documentation to indicate what this does
Alp Toker [Wed, 21 May 2014 02:08:10 +0000 (02:08 +0000)]
utils/CmpDriver: add brief documentation to indicate what this does

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

10 years agoSourceManager: Use setMainFileID() consistently
Alp Toker [Wed, 21 May 2014 01:12:41 +0000 (01:12 +0000)]
SourceManager: Use setMainFileID() consistently

Eliminate createMainFileID() / createMainFileIDForMemBuffer() utility
functions. These didn't add much convenience and conflated two distinct
operations.

This change makes things easier to follow by providing a consistent interface
and getting rid of a bunch of cast-to-voids.

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

10 years ago[objcmt] Make sure we don't edit the return type to add 'instancetype' if the return...
Argyrios Kyrtzidis [Wed, 21 May 2014 00:24:20 +0000 (00:24 +0000)]
[objcmt] Make sure we don't edit the return type to add 'instancetype' if the return type is already that.

rdar://16961577

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

10 years agoUpdate for paired llvm commit with AsmVerbose.
Eric Christopher [Wed, 21 May 2014 00:00:03 +0000 (00:00 +0000)]
Update for paired llvm commit with AsmVerbose.

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

10 years agoRemove test. Replacing it with a backend test with the optimized IR.
Eric Christopher [Wed, 21 May 2014 00:00:01 +0000 (00:00 +0000)]
Remove test. Replacing it with a backend test with the optimized IR.

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

10 years agolibclang: Give each VirtualFileOverlay unit test its own name
Justin Bogner [Tue, 20 May 2014 23:52:11 +0000 (23:52 +0000)]
libclang: Give each VirtualFileOverlay unit test its own name

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

10 years agoMake this test emit llvm IR rather than assembly.
Eric Christopher [Tue, 20 May 2014 23:23:51 +0000 (23:23 +0000)]
Make this test emit llvm IR rather than assembly.

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

10 years agoVirtualFileSystem: Fix false positives in YAMLVFSWriter::containedIn
Justin Bogner [Tue, 20 May 2014 22:12:58 +0000 (22:12 +0000)]
VirtualFileSystem: Fix false positives in YAMLVFSWriter::containedIn

Checking if a path starts with another path isn't sufficient for
determining if one is contained within the heirarchy of the other.
We need to ensure that the substring ends at a directory boundary.

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

10 years agoReduce string duplication
Alp Toker [Tue, 20 May 2014 22:03:47 +0000 (22:03 +0000)]
Reduce string duplication

If we're so keen on saving a dynamic allocation to add the trailing space, we
might as well do it in style.

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

10 years agoRAV reunification: merge Lambda body visitation to DRAV
Alp Toker [Tue, 20 May 2014 22:03:39 +0000 (22:03 +0000)]
RAV reunification: merge Lambda body visitation to DRAV

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

10 years agoRAV reunification: merge DISPATCH_STMT() macro back to standard RAV
Alp Toker [Tue, 20 May 2014 22:03:27 +0000 (22:03 +0000)]
RAV reunification: merge DISPATCH_STMT() macro back to standard RAV

Also add the missing undef in both files.

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

10 years agoRAV reunification: merge r190728
Alp Toker [Tue, 20 May 2014 22:03:18 +0000 (22:03 +0000)]
RAV reunification: merge r190728

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

10 years agoVirtualFileSystem: Add YAMLVFSWriter to generate VFS mapping files
Justin Bogner [Tue, 20 May 2014 21:43:27 +0000 (21:43 +0000)]
VirtualFileSystem: Add YAMLVFSWriter to generate VFS mapping files

This moves the logic to write a JSON VFS mapping from the C api into
VirtualFileSystem, so that we can use it internally.

No functional change.

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

10 years agoUpdate for llvm change to avoid having global flag setting in TargetMachine.
Eric Christopher [Tue, 20 May 2014 21:25:41 +0000 (21:25 +0000)]
Update for llvm change to avoid having global flag setting in TargetMachine.

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

10 years agoCleaning up some range-based for loops so that the automatic type deduction is more...
Aaron Ballman [Tue, 20 May 2014 19:47:14 +0000 (19:47 +0000)]
Cleaning up some range-based for loops so that the automatic type deduction is more explicit about pointers and const. Did some minor drive-by const correctness fixes and identifier updates as well. No functional changes.

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

10 years agoRevert r209231, "Update AttributeReference.rst."
Peter Collingbourne [Tue, 20 May 2014 19:38:07 +0000 (19:38 +0000)]
Revert r209231, "Update AttributeReference.rst."

According to Aaron, this is being generated on the server now.

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

10 years agoUpdate AttributeReference.rst.
Peter Collingbourne [Tue, 20 May 2014 19:27:39 +0000 (19:27 +0000)]
Update AttributeReference.rst.

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

10 years agoFix testcase from r209228
Duncan P. N. Exon Smith [Tue, 20 May 2014 19:20:23 +0000 (19:20 +0000)]
Fix testcase from r209228

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

10 years agoGlobalValue: Testcase for hidden visibility and local linkage
Duncan P. N. Exon Smith [Tue, 20 May 2014 19:04:31 +0000 (19:04 +0000)]
GlobalValue: Testcase for hidden visibility and local linkage

This is a testcase for r209227, a change in LLVM that automatically sets
visibility to default when the linkage is changed to local (rather than
asserting).

What this testcase triggers is hard to reproduce otherwise:  the
`GlobalValue` is created (with non-local linkage), the visibility is set
to hidden, and then the linkage is set to local.

PR19760

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

10 years agoFixed spelling.
Yaron Keren [Tue, 20 May 2014 18:23:05 +0000 (18:23 +0000)]
Fixed spelling.

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

10 years agoAdd a check for tautological bitwise comparisons to -Wtautological-compare.
Jordan Rose [Tue, 20 May 2014 17:31:11 +0000 (17:31 +0000)]
Add a check for tautological bitwise comparisons to -Wtautological-compare.

This catches issues like:

if ((x & 8) == 4) { ... }
if ((x | 4) != 3) { ... }

Patch by Anders Rönnholm!

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

10 years agoMake the wording for the flatten docs a little clearer.
Peter Collingbourne [Tue, 20 May 2014 17:30:03 +0000 (17:30 +0000)]
Make the wording for the flatten docs a little clearer.

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

10 years agoFix testcase for case.
Eric Christopher [Tue, 20 May 2014 17:15:31 +0000 (17:15 +0000)]
Fix testcase for case.

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

10 years agoImplement the flatten attribute.
Peter Collingbourne [Tue, 20 May 2014 17:12:51 +0000 (17:12 +0000)]
Implement the flatten attribute.

This is a GNU attribute that causes calls within the attributed function
to be inlined where possible. It is implemented by giving such calls the
alwaysinline attribute.

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

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

10 years agoClean up language and grammar.
Eric Christopher [Tue, 20 May 2014 17:10:39 +0000 (17:10 +0000)]
Clean up language and grammar.

Based on a patch by jfcaron3@gmail.com!
PR19806

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

10 years agoclang/test/SemaCXX/err_init_conversion_failed.cpp: Tweak for i686-msvc.
NAKAMURA Takumi [Tue, 20 May 2014 15:44:42 +0000 (15:44 +0000)]
clang/test/SemaCXX/err_init_conversion_failed.cpp: Tweak for i686-msvc.

For targeting i686-msvc, declarations are seen as thiscall like;

  void (template_test::S::*)(const int &) __attribute__((thiscall))
  void (template_test::S::*)(int) __attribute__((thiscall))

It didn't affect x86_64-msvc.

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

10 years agoNone of these attributes require FunctionTemplate to be explicitly listed as part...
Aaron Ballman [Tue, 20 May 2014 14:10:53 +0000 (14:10 +0000)]
None of these attributes require FunctionTemplate to be explicitly listed as part of their subject definition. FunctionTemplateDecls are not what the attribute appertains to in the first place -- it attaches to the underlying FunctionDecl.

The attribute emitter was using FunctionTemplate to map the diagnostic to "functions or methods", but that isn't a particularly clear diagnostic in these cases anyway (since they do not apply to ObjC methods). Updated the attribute emitter to remove custom logic for FunctionTemplateDecl, and updated the test cases for the change in diagnostic wording.

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

10 years agoclang-format: [JS] Understand top-level function literals properly.
Daniel Jasper [Tue, 20 May 2014 11:14:57 +0000 (11:14 +0000)]
clang-format: [JS] Understand top-level function literals properly.

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

10 years agoXCore target: sort typestring enum fields alphabetically
Robert Lytton [Tue, 20 May 2014 07:19:33 +0000 (07:19 +0000)]
XCore target: sort typestring enum fields alphabetically

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

10 years agoSpeculative fix for Windows buildbot after r209138
Ben Langmuir [Tue, 20 May 2014 05:55:04 +0000 (05:55 +0000)]
Speculative fix for Windows buildbot after r209138

It appears that Windows doesn't like renaming over open files, which we
do in clearOutputFiles. The file being compiled should be safe to
removed, but this isn't very satisfying - we don't want to manually
manage the lifetime of files we cannot prove have no references.

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

10 years ago[C++11] Use 'nullptr'. Tooling edition.
Craig Topper [Tue, 20 May 2014 04:51:16 +0000 (04:51 +0000)]
[C++11] Use 'nullptr'. Tooling edition.

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

10 years ago[C++11] Use 'nullptr'. Analysis edition.
Craig Topper [Tue, 20 May 2014 04:30:07 +0000 (04:30 +0000)]
[C++11] Use 'nullptr'. Analysis edition.

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

10 years agoFix diagnostic message for member function pointer mismatches where one of the
Richard Trieu [Tue, 20 May 2014 04:10:24 +0000 (04:10 +0000)]
Fix diagnostic message for member function pointer mismatches where one of the
classes is a template argument.

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

10 years agoIgnore void returning overloaded functions fom -Wunused-comparison. PR19791.
Richard Trieu [Tue, 20 May 2014 01:34:43 +0000 (01:34 +0000)]
Ignore void returning overloaded functions fom -Wunused-comparison.  PR19791.

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

10 years agoARCMT/GC-check-warn-nsalloc.m: don't provide a diag group
Alp Toker [Mon, 19 May 2014 23:48:49 +0000 (23:48 +0000)]
ARCMT/GC-check-warn-nsalloc.m: don't provide a diag group

This diagnostic is now controlled solely by -no-ns-alloc-error thus matching
the original intended behaviour.

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

10 years agoDemote the "Debug Info Version" module flag to llvm::Module::Warning
Adrian Prantl [Mon, 19 May 2014 23:40:06 +0000 (23:40 +0000)]
Demote the "Debug Info Version" module flag to llvm::Module::Warning
behavior on mismatch. The AutoUpgrader will drop incompatible debug info
any way and also emit a warning diagnostic for it.

rdar://problem/16926122

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

10 years agoUsing SmallString and correct addr var
Renato Golin [Mon, 19 May 2014 23:25:25 +0000 (23:25 +0000)]
Using SmallString and correct addr var

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

10 years agoImprove test verification from r209172
Alp Toker [Mon, 19 May 2014 22:56:13 +0000 (22:56 +0000)]
Improve test verification from r209172

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

10 years agoGet ARCMT/GC-check-warn-nsalloc.m working
Alp Toker [Mon, 19 May 2014 22:51:11 +0000 (22:51 +0000)]
Get ARCMT/GC-check-warn-nsalloc.m working

The -no-ns-alloc-error migration option now causes the diagnostic to be ignored
completely. If this isn't desired, the error can be downgraded to a warning
using the usual -Wno-error=arcmt-ns-alloc.

Note that we can't use -verify right now on this test because
VerifyDiagnosticConsumer gets confused by multiple SourceManager instances,
which is presumably the reason it was XFAILed in the first place and why the
regression wasn't detected. We'll grep instead for now.

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

10 years agoFix usage of string when StringRef was needed
Renato Golin [Mon, 19 May 2014 22:36:19 +0000 (22:36 +0000)]
Fix usage of string when StringRef was needed

Also adding a variable to the test, so release bots match %1.
This should also calm the gdb buildbot.

.

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

10 years ago[modules] Fix ODR violation: there's another clang::TypeLocVisitor elsewhere.
Richard Smith [Mon, 19 May 2014 22:34:38 +0000 (22:34 +0000)]
[modules] Fix ODR violation: there's another clang::TypeLocVisitor elsewhere.

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

10 years ago[module] Remove a header that isn't used and doesn't compile.
Richard Smith [Mon, 19 May 2014 22:20:41 +0000 (22:20 +0000)]
[module] Remove a header that isn't used and doesn't compile.

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

10 years agoImplement the no_split_stack attribute.
Peter Collingbourne [Mon, 19 May 2014 22:14:34 +0000 (22:14 +0000)]
Implement the no_split_stack attribute.

This is a GNU attribute that allows split stacks to be turned off on a
per-function basis.

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

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

10 years agoIf two sibling modules declare the same entity, and we indirectly pull a
Richard Smith [Mon, 19 May 2014 20:59:20 +0000 (20:59 +0000)]
If two sibling modules declare the same entity, and we indirectly pull a
declaration of that entity in from one of those modules, keep track of the fact
that we've not completed the redeclaration chain yet so that we can pull the
remaining declarations in from the other module if they're needed.

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

10 years agoAllow dllimport on function definitions when they're template instantiations
Hans Wennborg [Mon, 19 May 2014 20:14:13 +0000 (20:14 +0000)]
Allow dllimport on function definitions when they're template instantiations

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

10 years agoNon-allocatable Global Named Register
Renato Golin [Mon, 19 May 2014 18:15:42 +0000 (18:15 +0000)]
Non-allocatable Global Named Register

This patch implements global named registers in Clang, lowering to the just
created intrinsics in LLVM (@llvm.read/write_register). A new type of LValue
had to be created (Register), which just adds support to carry the metadata
node containing the name of the register. Two new methods to emit loads and
stores interoperate with another to emit the named metadata node.

No guarantees are being made and only non-allocatable global variable named
registers are being supported. Local named register support is unchanged.

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

10 years agoRemoving an XFAIL which shouldn't apply. We no longer care about MSVC 9, and this...
Aaron Ballman [Mon, 19 May 2014 17:58:28 +0000 (17:58 +0000)]
Removing an XFAIL which shouldn't apply. We no longer care about MSVC 9, and this test probably should not have been XFAILed everywhere regardless. The test passes on Windows with MSVC 12.

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

10 years agotest/CodeGenCXX/dllexport.cpp: -O2 and -disable-llvm-optzns aren't nedded
Hans Wennborg [Mon, 19 May 2014 17:23:01 +0000 (17:23 +0000)]
test/CodeGenCXX/dllexport.cpp: -O2 and -disable-llvm-optzns aren't nedded

We only need them on the dllimport.cpp test to make sure that we emit code
for available_externaly functions, and don't inline the IR.

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

10 years agoDon't refresh stat() info for pcm files
Ben Langmuir [Mon, 19 May 2014 17:04:28 +0000 (17:04 +0000)]
Don't refresh stat() info for pcm files

Follow-up fix for 209138.  Actually, since we already have this file
open, we don't want to refresh the stat() info, since that might be
newer than what we have open (bad!).

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

10 years agoThis test doesn't need to be XFAILed anywhere; it just needed to be updated to the...
Aaron Ballman [Mon, 19 May 2014 16:35:00 +0000 (16:35 +0000)]
This test doesn't need to be XFAILed anywhere; it just needed to be updated to the appropriate diagnostic wording.

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

10 years agoFix use-after-free and spurious error during module load
Ben Langmuir [Mon, 19 May 2014 16:13:45 +0000 (16:13 +0000)]
Fix use-after-free and spurious error during module load

FileManager::invalidateCache is not safe to call when there may be
existing references to the file. What module load failure needs is
to refresh so stale stat() info isn't stored.

This may be the last user of invalidateCache; I'll take a look and
remove it if possible in a future commit.

This caused a use-after-free error as well as a spurious error message
that a module was "found in both 'X.pcm' and 'X.pcm'" in some cases.

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

10 years ago[analyzer] Alpha and implicit checker lists, expand/collapse feature.
Anton Yartsev [Mon, 19 May 2014 15:04:55 +0000 (15:04 +0000)]
[analyzer] Alpha and implicit checker lists, expand/collapse feature.

The list of alpha and the list of implicit checkers added. An ability to expand/collapse long texts added. Markup fixed.

http://reviews.llvm.org/D3457

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

10 years agoThis test is XFAILed on Windows, but I cannot see a reason as to why it should be...
Aaron Ballman [Mon, 19 May 2014 15:02:10 +0000 (15:02 +0000)]
This test is XFAILed on Windows, but I cannot see a reason as to why it should be failing. The original commit which XFAILed this was r111581, which suggested something was wrong with file remapping, but that may have been subsequently fixed.

Removing the XFAIL, but will watch the build bots to see if any go red because of this. Local testing on Windows succeeds.

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

10 years agoFixing some comments in this test. No functional changes.
Aaron Ballman [Mon, 19 May 2014 14:52:09 +0000 (14:52 +0000)]
Fixing some comments in this test. No functional changes.

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

10 years ago[OpenCL] Reject reqd_work_group_size(X, Y, Z) where X, Y or Z == 0.
Joey Gouly [Mon, 19 May 2014 14:41:38 +0000 (14:41 +0000)]
[OpenCL] Reject reqd_work_group_size(X, Y, Z) where X, Y or Z == 0.

Patch by Pedro Ferreira!

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

10 years agoPass -gdwarf-N options to integrated assembler
Oliver Stannard [Mon, 19 May 2014 13:39:13 +0000 (13:39 +0000)]
Pass -gdwarf-N options to integrated assembler

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

10 years agoARM: PCS non-compliance when struct is padded to avoid register/stack split, and...
Oliver Stannard [Mon, 19 May 2014 13:10:05 +0000 (13:10 +0000)]
ARM: PCS non-compliance when struct is padded to avoid register/stack split, and requires internal padding

When we were padding a struct to avoid splitting it between registers and
the stack, we were throwing away the type which the argument should be coerced
to.

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

10 years agoMake the ARCMT tests self-contained.
Manuel Klimek [Mon, 19 May 2014 11:51:44 +0000 (11:51 +0000)]
Make the ARCMT tests self-contained.

This is necessary to reduce staging times on parallel build systems.

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

10 years agoclang-format: Don't force line breaks in ObjC calls with ColumnLimit 0.
Daniel Jasper [Mon, 19 May 2014 08:06:34 +0000 (08:06 +0000)]
clang-format: Don't force line breaks in ObjC calls with ColumnLimit 0.

Before:
  [self.x a:b c:d];

Got reformatted toi (with ColumnLimit set to 0):
  [self.x a:b
          c:d];

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

10 years agoclang-format: [JS] Support ES6 destructuring assignments.
Daniel Jasper [Mon, 19 May 2014 07:37:07 +0000 (07:37 +0000)]
clang-format: [JS] Support ES6 destructuring assignments.

Before:
  var[a, b, c] = [1, 2, 3];

After:
  var [a, b, c] = [1, 2, 3];

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

10 years agoclang-format: [JS] Support for EC6 arrow functions.
Daniel Jasper [Mon, 19 May 2014 07:27:02 +0000 (07:27 +0000)]
clang-format: [JS] Support for EC6 arrow functions.

Before:
  var b = a.map((x) = > x + 1);

After:
  var b = a.map((x) => x + 1);

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

10 years agoRAV reunification: MSPropertyRefExpr visitation
Alp Toker [Sun, 18 May 2014 21:01:45 +0000 (21:01 +0000)]
RAV reunification: MSPropertyRefExpr visitation

r179585 introduced different MSPropertyRefExpr visitation for RAV and DRAV that
appears to have been unintentional. Let's use the more complete one.

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

10 years agoRAV reunification: merge r162133 (visit the TypeLoc when RecursiveASTVisitor visits...
Alp Toker [Sun, 18 May 2014 21:00:44 +0000 (21:00 +0000)]
RAV reunification: merge r162133 (visit the TypeLoc when RecursiveASTVisitor visits a CompoundLiteralExpr)

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

10 years agoOngoing RAV reunification
Alp Toker [Sun, 18 May 2014 18:38:28 +0000 (18:38 +0000)]
Ongoing RAV reunification

 * Shuffle around code to reduce delta between the two RAVs.
 * Merge r189185 that was applied only to one of the RAVs and became apparent during the unification work.
 * Fix Enqueue data recursion typo.

Our delta is down to +-579!

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

10 years agoFormat the two RecursiveASTVisitors
Alp Toker [Sun, 18 May 2014 18:38:19 +0000 (18:38 +0000)]
Format the two RecursiveASTVisitors

Apply current ToT clang-format on the two RAVs to reduce delta and help
identify differences between the two.

We lose a little pretty formatting in the headers but that's the price to pay
so we can diff these two files effectively and look to a future where we don't
have to maintain two copies of this code.

Formatting and whitespace only.

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

10 years agoBegin RAV reunification: s/DataRecursiveASTVisitor/RecursiveASTVisitor/
Alp Toker [Sun, 18 May 2014 18:38:08 +0000 (18:38 +0000)]
Begin RAV reunification: s/DataRecursiveASTVisitor/RecursiveASTVisitor/

Define a macro to reduce the delta between RecursiveASTVisitor and
DataRecursiveASTVisitor.

Some years ago, someone thought it was a good idea to copy the entire RAV to
support cursor visitation in libclang.

Since then the two have diverged needlessly and the rest is history.

This series of commits aims to reduce delta between the two so that we can
reason about their differences, apply bugfixes that were only made to one but
not the other, and ultimately find a way to unify two two chunks of code.

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

10 years agoRemove historical Unicode TODOs
Alp Toker [Sun, 18 May 2014 18:37:59 +0000 (18:37 +0000)]
Remove historical Unicode TODOs

There's no immediate demand or plan to work on these.

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

10 years agoRemove unused diagnostic.
Benjamin Kramer [Sun, 18 May 2014 12:05:21 +0000 (12:05 +0000)]
Remove unused diagnostic.

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

10 years agoDriver: force restricted IT blocks for Windows on ARM
Saleem Abdulrasool [Sun, 18 May 2014 06:42:02 +0000 (06:42 +0000)]
Driver: force restricted IT blocks for Windows on ARM

Windows on ARM expects ARMv8 (restricted IT) conditional instructions only.
Force enable the restricted IT mode via the backend option when targeting WoA.

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

10 years ago[C++11] Use 'nullptr'. Lex edition.
Craig Topper [Sat, 17 May 2014 23:10:59 +0000 (23:10 +0000)]
[C++11] Use 'nullptr'. Lex edition.

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Sat, 17 May 2014 21:30:14 +0000 (21:30 +0000)]
Update for llvm api change.

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Sat, 17 May 2014 19:58:16 +0000 (19:58 +0000)]
Update for llvm api change.

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

10 years ago[C++11] Use 'nullptr'. ASTMatchers edition.
Craig Topper [Sat, 17 May 2014 18:49:24 +0000 (18:49 +0000)]
[C++11] Use 'nullptr'. ASTMatchers edition.

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

10 years ago[C++11] Use 'nullptr'. Driver edition.
Craig Topper [Sat, 17 May 2014 16:56:41 +0000 (16:56 +0000)]
[C++11] Use 'nullptr'. Driver edition.

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

10 years agoCodeGen: remove MinGW and Cygwin legacy entries
Saleem Abdulrasool [Sat, 17 May 2014 15:46:59 +0000 (15:46 +0000)]
CodeGen: remove MinGW and Cygwin legacy entries

These are now treated as environments.  Remove references to these enumeration
values in order to clean up the unused enumeration entries in LLVM.  The target
normalisation prior to tool invocation should ensure that the old values
continue to function properly.

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

10 years agoProvide and use a safe Token::getRawIdentifier() accessor
Alp Toker [Sat, 17 May 2014 04:53:25 +0000 (04:53 +0000)]
Provide and use a safe Token::getRawIdentifier() accessor

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

10 years agoMore fixes for isBetterOverloadCandidate not being a strict weak ordering. The
Richard Smith [Sat, 17 May 2014 04:36:39 +0000 (04:36 +0000)]
More fixes for isBetterOverloadCandidate not being a strict weak ordering. The
bug was obvious from inspection, figuring out a way to test it was... less so.

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

10 years ago[objcmt] Don't wrap a PCH generation action with a ObjCMigrateAction one, it messes...
Argyrios Kyrtzidis [Sat, 17 May 2014 04:35:12 +0000 (04:35 +0000)]
[objcmt] Don't wrap a PCH generation action with a ObjCMigrateAction one, it messes up the PCH file.

rdar://16941811

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

10 years agoSwitch to a more efficient expression of this check.
Richard Smith [Sat, 17 May 2014 02:21:47 +0000 (02:21 +0000)]
Switch to a more efficient expression of this check.

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

10 years agoCorrect incoherent function versus function template partial ordering for conversion...
Richard Smith [Sat, 17 May 2014 01:58:45 +0000 (01:58 +0000)]
Correct incoherent function versus function template partial ordering for conversion operators (the comparison could claim that two conversion operators are both better than each other). Actually implement DR495, rather than passing its test by chance because the declarations happened to be in the "lucky" order.

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

10 years agoTweak diagnostic wording for init list narrowing
Alp Toker [Sat, 17 May 2014 01:13:18 +0000 (01:13 +0000)]
Tweak diagnostic wording for init list narrowing

The conventional form is '<action> to silence this warning'.

Also call the diagnostic an 'issue' rather than a 'message' because the latter
term is more widely used with reference to message expressions.

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

10 years agoAdd missed file from r209046.
Richard Smith [Fri, 16 May 2014 23:16:06 +0000 (23:16 +0000)]
Add missed file from r209046.

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

10 years agoIf a declaration is loaded, and then a module import adds a redeclaration, then
Richard Smith [Fri, 16 May 2014 23:01:30 +0000 (23:01 +0000)]
If a declaration is loaded, and then a module import adds a redeclaration, then
ensure that querying the first declaration for its most recent declaration
checks for redeclarations from the imported module.

This works as follows:
 * The 'most recent' pointer on a canonical declaration grows a pointer to the
   external AST source and a generation number (space- and time-optimized for
   the case where there is no external source).
 * Each time the 'most recent' pointer is queried, if it has an external source,
   we check whether it's up to date, and update it if not.
 * The ancillary data stored on the canonical declaration is allocated lazily
   to avoid filling it in for declarations that end up being non-canonical.
   We'll still perform a redundant (ASTContext) allocation if someone asks for
   the most recent declaration from a decl before setPreviousDecl is called,
   but such cases are probably all bugs, and are now easy to find.

Some finessing is still in order here -- in particular, we use a very general
mechanism for handling the DefinitionData pointer on CXXRecordData, and a more
targeted approach would be more compact.

Also, the MayHaveOutOfDateDef mechanism should now be expunged, since it was
addressing only a corner of the full problem space here. That's not covered
by this patch.

Early performance benchmarks show that this makes no measurable difference to
Clang performance without modules enabled (and fixes a major correctness issue
with modules enabled). I'll revert if a full performance comparison shows any
problems.

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

10 years agoUse getAliasee instead of getAliasedGlobal.
Rafael Espindola [Fri, 16 May 2014 22:20:18 +0000 (22:20 +0000)]
Use getAliasee instead of getAliasedGlobal.

No functionality change.

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

10 years agoMissed a ! in the if statement when these were being set and the options
Eric Christopher [Fri, 16 May 2014 20:46:14 +0000 (20:46 +0000)]
Missed a ! in the if statement when these were being set and the options
are inverted in clang and llvm.

I'll attempt to get a testcase for this that doesn't involve compiling to .s,
but it's unlikely.

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Fri, 16 May 2014 19:35:48 +0000 (19:35 +0000)]
Update for llvm api change.

Now that llvm cannot represent alias cycles, we have to diagnose erros just
before trying to close the cycle. This degrades the errors a bit. The real
solution is what it was before: if we want to provide good errors for these
cases, we have to be able to find a clang level decl given a mangled name
and produce the error from Sema.

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

10 years ago[ASTMatchers] Move the 'isImplicit' matcher from CXXConstructorDecl to Decl.
Joey Gouly [Fri, 16 May 2014 19:31:08 +0000 (19:31 +0000)]
[ASTMatchers] Move the 'isImplicit' matcher from CXXConstructorDecl to Decl.

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

10 years agoMerge a couple of copy-and-pasted functions
Alp Toker [Fri, 16 May 2014 18:59:21 +0000 (18:59 +0000)]
Merge a couple of copy-and-pasted functions

No change in functionality.

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

10 years agoRename SourceManager::createFileIDForMemBuffer()
Alp Toker [Fri, 16 May 2014 17:23:01 +0000 (17:23 +0000)]
Rename SourceManager::createFileIDForMemBuffer()

It makes more sense to just overload createFileID().

Gardening only.

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

10 years agoTooling: use stderr, not stdout for missing command line messages
Alp Toker [Fri, 16 May 2014 13:45:29 +0000 (13:45 +0000)]
Tooling: use stderr, not stdout for missing command line messages

Matches other tooling output that use stderr.

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

10 years agoUpdate for llvm API change.
Rafael Espindola [Fri, 16 May 2014 13:34:28 +0000 (13:34 +0000)]
Update for llvm API change.

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

10 years agoImprove a scan-build message
Sylvestre Ledru [Fri, 16 May 2014 07:03:15 +0000 (07:03 +0000)]
Improve a scan-build message

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