]> granicus.if.org Git - clang/log
clang
10 years agoClean DiagRanges. Fix a possible problem introduced in r209468.
Alexander Kornienko [Fri, 23 May 2014 01:37:30 +0000 (01:37 +0000)]
Clean DiagRanges. Fix a possible problem introduced in r209468.

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

10 years agoFix a bug in xmmintrin.h.
Akira Hatanaka [Fri, 23 May 2014 00:38:07 +0000 (00:38 +0000)]
Fix a bug in xmmintrin.h.

The last step of _mm_cvtps_pi16 should use _mm_packs_pi32, which is a function
that reads two __m64 values and packs four 32-bit values into four 16-bit
values.

<rdar://problem/16873717>

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

10 years agoDon't set unnamed_addr in CreateRuntimeVariable.
Rafael Espindola [Thu, 22 May 2014 23:33:27 +0000 (23:33 +0000)]
Don't set unnamed_addr in CreateRuntimeVariable.

This was fairly broken. For example,

@__dso_handle would or would not get an unnamed_addr depending on how many
global destructors were used in a translation unit.

The consensus was that not every runtime variable is unnamed_addr and that
__dso_handle handle should not be, so just don't add unnamed_addr in
CreateRuntimeVariable.

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

10 years agoAvoid allocating extra memory to handle the lazy definition data pointer for
Richard Smith [Thu, 22 May 2014 23:19:02 +0000 (23:19 +0000)]
Avoid allocating extra memory to handle the lazy definition data pointer for
CXXRecordDecls when modules is enabled.

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

10 years agoDon't reduce the stack protector level given -fstack-protector.
Rafael Espindola [Thu, 22 May 2014 22:57:39 +0000 (22:57 +0000)]
Don't reduce the stack protector level given -fstack-protector.

Before -fstack-protector would always force a level of 1, even if the default
was 2.

Patch by Brad Smith.

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

10 years agoUse error_code::success() instead of make_error_code(llvm::errc::success).
Alexander Kornienko [Thu, 22 May 2014 22:06:08 +0000 (22:06 +0000)]
Use error_code::success() instead of make_error_code(llvm::errc::success).

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

10 years agoUnify the name of compiler-rt builtins library on Linux.
Alexey Samsonov [Thu, 22 May 2014 21:13:30 +0000 (21:13 +0000)]
Unify the name of compiler-rt builtins library on Linux.

Call it "libclang_rt.builtins-<arch>.a" to be consistent
with sanitizers/profile libraries naming. Modify Makefile
and CMake build systems and Clang driver accordingly.

Fixes PR19822.

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

10 years agoIf a class template specialization from one module has its definition
Richard Smith [Thu, 22 May 2014 20:59:29 +0000 (20:59 +0000)]
If a class template specialization from one module has its definition
instantiated in another module, and the instantiation uses a partial
specialization, include the partial specialization and its template arguments
in the update record. We'll need them if someone imports the second module and
tries to instantiate a member of the template.

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

10 years agoDon't warn about undefined inline functions if they're dllexport/import
Hans Wennborg [Thu, 22 May 2014 20:45:53 +0000 (20:45 +0000)]
Don't warn about undefined inline functions if they're dllexport/import

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

10 years agoRemove limits on the number of fix-it hints and ranges in the DiagnosticsEngine.
Alexander Kornienko [Thu, 22 May 2014 19:56:11 +0000 (19:56 +0000)]
Remove limits on the number of fix-it hints and ranges in the DiagnosticsEngine.

Summary:
The limits on the number of fix-it hints and ranges attached to a
diagnostic are arbitrary and don't apply universally to all users of the
DiagnosticsEngine. The way the limits are enforced may lead to diagnostics
generating invalid sets of fixes. I suggest removing the limits, which will also
simplify the implementation.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: klimek, cfe-commits

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

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

10 years agoImproved location for non-constant initializers diagnostics.
Abramo Bagnara [Thu, 22 May 2014 19:20:46 +0000 (19:20 +0000)]
Improved location for non-constant initializers diagnostics.

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

10 years agoForgot to add updated datalayout test
Matt Arsenault [Thu, 22 May 2014 18:57:49 +0000 (18:57 +0000)]
Forgot to add updated datalayout test

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

10 years agoUpdate R600 datalayout
Matt Arsenault [Thu, 22 May 2014 18:33:55 +0000 (18:33 +0000)]
Update R600 datalayout

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

10 years agoAn inline function redeclaration does not drop the dllimport attribute
Hans Wennborg [Thu, 22 May 2014 15:46:15 +0000 (15:46 +0000)]
An inline function redeclaration does not drop the dllimport attribute

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

10 years agoclang-format: Add basic test for -style=none.
Daniel Jasper [Thu, 22 May 2014 15:13:48 +0000 (15:13 +0000)]
clang-format: Add basic test for -style=none.

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

10 years agoclang-format: Introduce DisableFormat that prevents formatting.
Daniel Jasper [Thu, 22 May 2014 15:12:22 +0000 (15:12 +0000)]
clang-format: Introduce DisableFormat that prevents formatting.

And "none" pseudo-style indicating that formatting should be not
applied.

(1) Using .clang-format with "DisableFormat: true" effectively prevents
formatting for all files within the folder containing such .clang-format
file.

(2) Using -fallback-style=none together with -style=file prevents
formatting when .clang-format is not found, which can be used in on-save
callback.

Patch by Adam Strzelecki. Thank you!

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

10 years agoclang-format: Don't use Allman brace breaking for ObjC blocks.
Daniel Jasper [Thu, 22 May 2014 13:53:55 +0000 (13:53 +0000)]
clang-format: Don't use Allman brace breaking for ObjC blocks.

It just seems wrong. This fixes llvm.org/PR19736.

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

10 years agoclang-format: Fix corner case in AllowShortBlocksOnASingleLine.
Daniel Jasper [Thu, 22 May 2014 13:25:26 +0000 (13:25 +0000)]
clang-format: Fix corner case in AllowShortBlocksOnASingleLine.

Before:
  template <int> struct A4 { A4() { }
  };

After:
  template <int i> struct A4 {
    A4() {}
  };

This fixes llvm.org/PR19813 (at least the part that isn't working as
intended).

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

10 years agoMachO: look for nearby tools on all MachO platforms.
Tim Northover [Thu, 22 May 2014 13:12:14 +0000 (13:12 +0000)]
MachO: look for nearby tools on all MachO platforms.

This brings "-arch armv7m" (etc) behaviour more in line with what's expected
for developers on OS X, and allows Clang to find an "ld" (for example) in the
same directory instead of using the default /usr/bin/ld.

Unfortunately no test because it relies on the specific place Clang is running
from.

rdar://problem/16427320

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

10 years agoRevert "TMP"
Tim Northover [Thu, 22 May 2014 12:55:29 +0000 (12:55 +0000)]
Revert "TMP"

This reverts r209433. Sorry about that, it needs a test & better message.

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

10 years agoMachO: perform ARM ABI detection even for non-Darwin triples.
Tim Northover [Thu, 22 May 2014 12:54:30 +0000 (12:54 +0000)]
MachO: perform ARM ABI detection even for non-Darwin triples.

When "-arch armv7m" is specified, we want "aapcs", for example.

rdar://problem/16581138

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

10 years agoTMP
Tim Northover [Thu, 22 May 2014 12:54:24 +0000 (12:54 +0000)]
TMP

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

10 years agoUse stack protector strong by default on OpenBSD.
Rafael Espindola [Thu, 22 May 2014 12:52:35 +0000 (12:52 +0000)]
Use stack protector strong by default on OpenBSD.

Use stack protector strong by default to match the base OS and ports/packages
compiler policy.

Patch by Brad Smith.

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

10 years agoclang-format: Fix braced list detection.
Daniel Jasper [Thu, 22 May 2014 12:46:38 +0000 (12:46 +0000)]
clang-format: Fix braced list detection.

Before:
  static_assert(std::is_integral<int> {} + 0, "");
  int a = std::is_integral<int> {}
  + 0;

After:
  static_assert(std::is_integral<int>{} + 0, "");
  int a = std::is_integral<int>{} + 0;

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

10 years agoclang-format: Fix incorrect braced init identification.
Daniel Jasper [Thu, 22 May 2014 12:11:13 +0000 (12:11 +0000)]
clang-format: Fix incorrect braced init identification.

Before:
  int foo(int i) {
    return fo1 {}
    (i);
  }
  int foo(int i) {
    return fo1 {}
    (i);
  }

After:
  int foo(int i) { return fo1{}(i); }
  int foo(int i) { return fo1{}(i); }

This fixes llvm.org/PR19812.

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

10 years agoclang-format: Store pointers to seen formatting states.
Daniel Jasper [Thu, 22 May 2014 11:47:01 +0000 (11:47 +0000)]
clang-format: Store pointers to seen formatting states.

As the memory ownership is handled by the SpecificBumpPtrAllocator
anyway, there is no need to duplicate states when inserting them into
the Seen-set. This leads to an improvement of ~10% on the benchmark
formatting file.

No functional changes intended.

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

10 years agoclang-format: Fix vim-integration for empty files.
Daniel Jasper [Thu, 22 May 2014 11:37:05 +0000 (11:37 +0000)]
clang-format: Fix vim-integration for empty files.

Discovered by Ahmed Charles in http://reviews.llvm.org/D3018.

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

10 years agoclang-format: [JS] Understand line breaks in concatenated strings.
Daniel Jasper [Thu, 22 May 2014 09:10:04 +0000 (09:10 +0000)]
clang-format: [JS] Understand line breaks in concatenated strings.

Before:
  var literal = 'hello ' + 'world';

After:
  var literal = 'hello ' +
                'world';

There is no reason to concatenated two string literals with a '+' unless
the line break is intended.

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

10 years agoclang-format: Correctly identify multiplications in braces init lists.
Daniel Jasper [Thu, 22 May 2014 09:00:33 +0000 (09:00 +0000)]
clang-format: Correctly identify multiplications in braces init lists.

Before:
  int i{a *b};

After:
  int i{a * b};

Also fix unrelated issue where braced init lists were counted as blocks
and prevented single-line functions.

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

10 years agoThis patch adds a helper class (CGLoopInfo) for marking memory instructions with...
Alexander Musman [Thu, 22 May 2014 08:54:05 +0000 (08:54 +0000)]
This patch adds a helper class (CGLoopInfo) for marking memory instructions with llvm.mem.parallel_loop_access metadata.
It also adds a simple initial version of codegen for pragma omp simd (it will change in the future to support all the clauses).

Differential revision: http://reviews.llvm.org/D3644

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

10 years agoclang-format: Correctly calculate line lenghts for nest blocks.
Daniel Jasper [Thu, 22 May 2014 08:36:53 +0000 (08:36 +0000)]
clang-format: Correctly calculate line lenghts for nest blocks.

If simple (one-statement) blocks can be inlined, the length needs to be
calculated correctly.

Before (in JavaScript but this also affects lambdas, etc.):
  var x = {
    valueOf: function() { return 1; }
  };

After:
  var x = {valueOf: function() { return 1; }};

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

10 years agoFrontend: Propagate ASTReaderListener API in ChainedASTReaderListener
Justin Bogner [Thu, 22 May 2014 06:04:59 +0000 (06:04 +0000)]
Frontend: Propagate ASTReaderListener API in ChainedASTReaderListener

ASTReaderListener's documentation states that visitInputFile will be
called based on the return values of needsInputFileVisitation and
needsSystemInputFileVisitation, but ChainedASTReaderListener may call
these methods on a child listener based on the values returned by the
other child.

Even worse, the calls to visitInputFile may be short-circuited due to
the use of the boolean or, so the calls to visit may not occur at all
for the second listener.

This updates ChainedASTReaderListener::visitInputFile to propagate the
ASTReaderListener behaviour to both children.

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

10 years ago[C++11] Use 'nullptr'. Serialization edition.
Craig Topper [Thu, 22 May 2014 05:54:18 +0000 (05:54 +0000)]
[C++11] Use 'nullptr'. Serialization edition.

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

10 years ago[C++11] Use 'nullptr'. Frontend edition.
Craig Topper [Thu, 22 May 2014 04:46:25 +0000 (04:46 +0000)]
[C++11] Use 'nullptr'. Frontend edition.

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

10 years agoAdd hasSameType overload to ASTContext for Type pointers. Switch a type
Richard Trieu [Thu, 22 May 2014 01:39:16 +0000 (01:39 +0000)]
Add hasSameType overload to ASTContext for Type pointers.  Switch a type
comparison check to use this instead of calling Type::getCanonicalTypeInternal

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

10 years agoVirtualFileSystem: Fix a few directory traversal bugs in VFSWriter
Justin Bogner [Wed, 21 May 2014 22:46:51 +0000 (22:46 +0000)]
VirtualFileSystem: Fix a few directory traversal bugs in VFSWriter

There are a couple of issues with writing VFS maps that are awkward to
fix within the current mutually recursive approach. Instead, replace
the algorithm with an iterative version that uses an explicit stack of
directories.

Includes tests for cases the old approach was tripping on.

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

10 years agoProvide an aka for the C++ operator name macro diagnostic
Alp Toker [Wed, 21 May 2014 21:23:39 +0000 (21:23 +0000)]
Provide an aka for the C++ operator name macro diagnostic

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

10 years agoSema: Implement DR244
David Majnemer [Wed, 21 May 2014 20:19:59 +0000 (20:19 +0000)]
Sema: Implement DR244

Summary:
Naming the destructor using a typedef-name for the class-name is
well-formed.

This fixes PR19620.

Reviewers: rsmith, doug.gregor

Subscribers: cfe-commits

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

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

10 years agocindex/test_cursor.py: no need to skip implicit decls in tests
Alp Toker [Wed, 21 May 2014 19:17:38 +0000 (19:17 +0000)]
cindex/test_cursor.py: no need to skip implicit decls in tests

clang was fixed some time ago to always skip "builtins and other cruft" so
tools no longer need hacks like this.

Passes nosetests.

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

10 years agoRemove outdated diagnostic.
Benjamin Kramer [Wed, 21 May 2014 15:57:22 +0000 (15:57 +0000)]
Remove outdated diagnostic.

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

10 years agoImproved recovery of switch statement
Serge Pavlov [Wed, 21 May 2014 14:48:43 +0000 (14:48 +0000)]
Improved recovery of switch statement

Make better diagnostic produced by erroneous switch statement.
It fixes PR19022.

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

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

10 years agoMove virtual methods out of line.
Rafael Espindola [Wed, 21 May 2014 14:19:22 +0000 (14:19 +0000)]
Move virtual methods out of line.

This is generally a good thing and in this case should also fix the
BUILD_SHARED_LIBS=ON build (see pr19774).

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

10 years agoMake the parent-map use significantly less memory.
Manuel Klimek [Wed, 21 May 2014 13:28:59 +0000 (13:28 +0000)]
Make the parent-map use significantly less memory.

On test files I ran this on, memory consumption overall went down from
2.5G to 2G, without performance regressions.
I also investigated making DynTypedNode by itself smaller (by pulling
out pointers for everything that doesn't fit in 8 bytes). This led to
another 200-300MB saved, but also introduced a significant regression in
performance due to the memory management overhead.

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

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