]> granicus.if.org Git - clang/log
clang
10 years agoFix filename in file header comment more.
Nico Weber [Fri, 9 May 2014 00:42:08 +0000 (00:42 +0000)]
Fix filename in file header comment more.

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

10 years agoFix filename in file header comment.
Nico Weber [Fri, 9 May 2014 00:39:59 +0000 (00:39 +0000)]
Fix filename in file header comment.

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

10 years agoDon't indent inside namespaces.
Rafael Espindola [Fri, 9 May 2014 00:26:20 +0000 (00:26 +0000)]
Don't indent inside namespaces.

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

10 years agoFix link target.
Richard Smith [Fri, 9 May 2014 00:20:01 +0000 (00:20 +0000)]
Fix link target.

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

10 years agoUse auto to avoid duplicating the type.
Rafael Espindola [Fri, 9 May 2014 00:08:36 +0000 (00:08 +0000)]
Use auto to avoid duplicating the type.

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

10 years agoSwitch Wmodule-build to a remark
Ben Langmuir [Thu, 8 May 2014 22:36:02 +0000 (22:36 +0000)]
Switch Wmodule-build to a remark

On reflection, this is better despite the missing command-line handling
bits for remarks.  Making this a remark makes it much clearer that
this is purely informational and avoids the negative connotations of a
'warning'.

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

10 years agoFix an outdated comment.
Richard Smith [Thu, 8 May 2014 22:32:00 +0000 (22:32 +0000)]
Fix an outdated comment.

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

10 years ago[Driver] Range-based loop simplification.
Simon Atanasyan [Thu, 8 May 2014 19:32:46 +0000 (19:32 +0000)]
[Driver] Range-based loop simplification.

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

10 years agoRemove -Wnon-modular-include
Ben Langmuir [Thu, 8 May 2014 18:09:29 +0000 (18:09 +0000)]
Remove -Wnon-modular-include

But keep -Wnon-modular-include-in-[framework-]module

This warning is too noisy and doesn't really indicate a problem for most
people.  Even though it would only really affect people using
-Weverything, that seems bad so remove it.

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

10 years agoCodeGen: fix code model mapping
Saleem Abdulrasool [Thu, 8 May 2014 16:28:48 +0000 (16:28 +0000)]
CodeGen: fix code model mapping

Large is CodeModel::Model::Large, not CodeModel::Model::Medium.  Thanks to
majnemer for pointing out the typo!  Its unclear how to test the mapped value in
the compiler, the tests already cover the driver side.

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

10 years agoSimplify a few cast<>s.
Rafael Espindola [Thu, 8 May 2014 15:44:45 +0000 (15:44 +0000)]
Simplify a few cast<>s.

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

10 years agoCleanup setFunctionDefinitionAttributes.
Rafael Espindola [Thu, 8 May 2014 15:26:12 +0000 (15:26 +0000)]
Cleanup setFunctionDefinitionAttributes.

Use more specific type, update comments and name style.

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

10 years agoReplace virtual with override.
Rafael Espindola [Thu, 8 May 2014 15:01:48 +0000 (15:01 +0000)]
Replace virtual with override.

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

10 years agoUse more specific type.
Rafael Espindola [Thu, 8 May 2014 14:46:46 +0000 (14:46 +0000)]
Use more specific type.

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

10 years agoSmall simplification: Reduce the use of cast<>.
Rafael Espindola [Thu, 8 May 2014 14:33:38 +0000 (14:33 +0000)]
Small simplification: Reduce the use of cast<>.

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

10 years agoFix segmentation fault when mixing -Rpass with #line.
Diego Novillo [Thu, 8 May 2014 13:49:54 +0000 (13:49 +0000)]
Fix segmentation fault when mixing -Rpass with #line.

Summary:
When using #line directives, FileManager::getFile() will return a nil
entry. This triggers an assert in translateFileLineCol().

This patch handles nil FileEntry instances by emitting a note that the
location could not be translated back to a SourceLocation. I don't
really like this solution, but we are translating presumed locations,
so some information has already been lost.

Reviewers: rsmith

Subscribers: cfe-commits

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

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

10 years agoFix PR19169 [Crash on invalid attempting to specialize a template method as a templat...
Karthik Bhat [Thu, 8 May 2014 13:16:20 +0000 (13:16 +0000)]
Fix PR19169 [Crash on invalid attempting to specialize a template method as a template variable].
A template declaration of a template name can be null in case we have a dependent name or a set of function templates.
Hence use dyn_cast_or_null instead of dyn_cast. Also improve the diagnostic emitted in this case.

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

10 years agoUse predicate function to simplify a bit.
Rafael Espindola [Thu, 8 May 2014 13:07:37 +0000 (13:07 +0000)]
Use predicate function to simplify a bit.

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

10 years agoEnable standalone-debug by default on FreeBSD
Ed Maste [Thu, 8 May 2014 13:01:26 +0000 (13:01 +0000)]
Enable standalone-debug by default on FreeBSD

It was set by default on Darwin in r198655.  The same usability issues
with DTrace and LLDB apply to FreeBSD, so set it by default there too.

rdar://problem/15758808
http://llvm.org/pr19676

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

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

10 years agoclang-format: Cleanup redundant calculation of ParenLevel.
Daniel Jasper [Thu, 8 May 2014 12:21:30 +0000 (12:21 +0000)]
clang-format: Cleanup redundant calculation of ParenLevel.

No functional changes intended.

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

10 years agoclang-format: Initial support for try-catch.
Daniel Jasper [Thu, 8 May 2014 11:58:24 +0000 (11:58 +0000)]
clang-format: Initial support for try-catch.

Most of this patch was created by Alexander Rojas in
http://reviews.llvm.org/D2555
Thank you!

Synced and addressed review comments.

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

10 years agoExplicitly keep track of temporaries during the consumed analysis.
Manuel Klimek [Thu, 8 May 2014 11:50:00 +0000 (11:50 +0000)]
Explicitly keep track of temporaries during the consumed analysis.

This makes the consumed analysis less dependent on the CFG layout and fixes
a bug where we wouldn't warn on an unconsumed value.

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

10 years agoSuggest fix-it ':' when '=' used in for-range-declaration
Ismail Pazarbasi [Thu, 8 May 2014 11:28:25 +0000 (11:28 +0000)]
Suggest fix-it ':' when '=' used in for-range-declaration

Fix for PR19176. Clang will suggest a fix-it hint for cases like:
  int arr[] = {1, 2, 3, 4};
  for (auto i = arr)
              ^
              :

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

10 years agoclang-format: [JS] support closures in container literals.
Daniel Jasper [Thu, 8 May 2014 09:25:39 +0000 (09:25 +0000)]
clang-format: [JS] support closures in container literals.

Before:
  return {body: {setAttribute: function(key, val) {this[key] = val;
  }
  , getAttribute : function(key) { return this[key]; }
  , style : {
  direction:
    ''
  }
  }
  }
  ;

After:
  return {
    body: {
      setAttribute: function(key, val) { this[key] = val; },
      getAttribute: function(key) { return this[key]; },
      style: {direction: ''}
    }
  };

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

10 years agoclang-format: Fix binary operator detection before lambdas.
Daniel Jasper [Thu, 8 May 2014 08:50:10 +0000 (08:50 +0000)]
clang-format: Fix binary operator detection before lambdas.

Before:
  bool foo = true&& [] { return false; }();

After:
  bool foo = true && [] { return false; }();

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

10 years agoclang-format: [JS] Support regex literals after 'return'.
Daniel Jasper [Thu, 8 May 2014 07:45:18 +0000 (07:45 +0000)]
clang-format: [JS] Support regex literals after 'return'.

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

10 years agoclang-format: [JS] Initial support for regex literals.
Daniel Jasper [Thu, 8 May 2014 07:01:45 +0000 (07:01 +0000)]
clang-format: [JS] Initial support for regex literals.

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

10 years ago[C++11] Use 'nullptr'.
Craig Topper [Thu, 8 May 2014 06:41:40 +0000 (06:41 +0000)]
[C++11] Use 'nullptr'.

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

10 years ago[OPENMP] Another one fix in test for msvc
Alexey Bataev [Thu, 8 May 2014 04:44:21 +0000 (04:44 +0000)]
[OPENMP] Another one fix in test for msvc

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

10 years ago[OPENMP] Fix codegen test for msvc build
Alexey Bataev [Thu, 8 May 2014 04:33:26 +0000 (04:33 +0000)]
[OPENMP] Fix codegen test for msvc build

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

10 years agoLet ASTReader optionally delete its ASTDeserializationListener.
Nico Weber [Thu, 8 May 2014 04:26:47 +0000 (04:26 +0000)]
Let ASTReader optionally delete its ASTDeserializationListener.

Use this to fix the leak of DeserializedDeclsDumper and DeserializedDeclsChecker
in FrontendAction (found by LSan), PR19560.

The "delete this" bool is necessary because both PCHGenerator and ASTUnit
return the same object from both getDeserializationListener() and
getASTMutationListener(), so ASTReader can't just have a unique_ptr.

It's also not possible to just let FrontendAction (or CompilerInstance) own
these listeners due to lifetime issues (see comments on PR19560).

Finally, ASTDeserializationListener can't easily be refcounted, since several of
the current listeners are allocated on the stack.

Having this bool isn't ideal, but it's a pattern that's used in other places in
the codebase too, and it seems better than leaking.

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

10 years agoDriver: parse -mcmodel earlier
Saleem Abdulrasool [Thu, 8 May 2014 02:28:32 +0000 (02:28 +0000)]
Driver: parse -mcmodel earlier

This addresses an existing FIXME item in the driver.  The code model flag was
parsed in the actual tool rather than in the driver.  This was problematic since
the value may be invalid.  In that case, we would silently treat it as a default
value in non-assert builds, and abort in assert builds.  Add a check in the
driver to validate that the value being passed is valid, and if not provide a
proper error message.

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

10 years agoFix latent bug. This can't actually manifest at the moment, but is a time-bomb
Richard Smith [Thu, 8 May 2014 00:25:01 +0000 (00:25 +0000)]
Fix latent bug. This can't actually manifest at the moment, but is a time-bomb
for the next time someone adds something to this function.

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

10 years agoEnable alternative tokens by default for clang-format.
Nikola Smiljanic [Thu, 8 May 2014 00:05:13 +0000 (00:05 +0000)]
Enable alternative tokens by default for clang-format.

Patch by Bobby Moretti.

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

10 years agofmodules-search-all: Removed dead code and added some comments.
John Thompson [Wed, 7 May 2014 22:47:08 +0000 (22:47 +0000)]
fmodules-search-all: Removed dead code and added some comments.

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

10 years agoCodeGen: Don't set hidden visibility on symbols with local linkage
Duncan P. N. Exon Smith [Wed, 7 May 2014 22:36:11 +0000 (22:36 +0000)]
CodeGen: Don't set hidden visibility on symbols with local linkage

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

10 years agoAdd an Extension warning for applying unary * to an operand of type 'void*' in
Richard Smith [Wed, 7 May 2014 21:53:27 +0000 (21:53 +0000)]
Add an Extension warning for applying unary * to an operand of type 'void*' in
C++. This seems like a pointless (and indeed harmful) restriction to me, so
I've suggested removing it to -core and disabled this diagnostic by default.

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

10 years agoNSOrCFErrorDerefChecker: Don't leak bug type. Similar to r208110/r208155. Found by...
Nico Weber [Wed, 7 May 2014 21:28:03 +0000 (21:28 +0000)]
NSOrCFErrorDerefChecker: Don't leak bug type. Similar to r208110/r208155. Found by LSan.

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

10 years agoc-index-test: Don't leak the strings returned by makeClientContainer().
Nico Weber [Wed, 7 May 2014 21:09:42 +0000 (21:09 +0000)]
c-index-test: Don't leak the strings returned by makeClientContainer().

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

10 years agoMake 2 functions static, remove unneeded cast, rewrap. No behavior change.
Nico Weber [Wed, 7 May 2014 21:05:22 +0000 (21:05 +0000)]
Make 2 functions static, remove unneeded cast, rewrap. No behavior change.

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

10 years agoWhen doing int<->ptr coercion for big-endian, calculate the shift amount correctly.
James Molloy [Wed, 7 May 2014 17:41:15 +0000 (17:41 +0000)]
When doing int<->ptr coercion for big-endian, calculate the shift amount correctly.

Previously we calculated the shift amount based upon DataLayout::getTypeAllocSizeInBits.
This will only work for legal types - types such as i24 that are created as part of
structs for bitfields will return "32" from that function. Change to using
getTypeSizeInBits.

It turns out that AArch64 didn't run across this problem because it always returned
[1 x i64] as the type for a bitfield, whereas ARM64 returns i64 so goes down this
(better, but wrong) codepath.

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

10 years agoPR19562: Fix another temporary node leak in Clang debug info emission
David Blaikie [Wed, 7 May 2014 16:56:58 +0000 (16:56 +0000)]
PR19562: Fix another temporary node leak in Clang debug info emission

While constructing ObjC Interface types we might create the declaration
of some normal C++ types, thus adding things to the ReplaceMap. Make
sure we process the ReplaceMap after the ObjC interfaces.

In theory we know at this point, since we're at the end of the TU, that
we won't be upgrading any declarations to definitions, so we could just
construct non-temporary nodes, but that would require extra state in
CGDebugInfo to conditionalize the creation of declaration nodes which
seems annoying/more work than is appropriate.

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

10 years agoRemove "CH_ECK" line (which is ignored) from test after r154191.
Nico Weber [Wed, 7 May 2014 16:25:32 +0000 (16:25 +0000)]
Remove "CH_ECK" line (which is ignored) from test after r154191.

r154191 switched to atexit() instead of global destructors, so the intent
was probably to check for _GLOBAL__D_a _not_ being in the output. There already
is a line for _ZN3barD1Ev further up, so just remove the CH_ECK line referring
to that.

The only circumstance in which clang emits _GLOBAL__D_a destructor symbols is
for -fapple-kext, and that is tested by test/CodeGenCXX/cxx-apple-kext.cpp.

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

10 years ago[mips] Pass nan2008 info to the back-end.
Matheus Almeida [Wed, 7 May 2014 16:16:07 +0000 (16:16 +0000)]
[mips] Pass nan2008 info to the back-end.

Summary: The initial support for NaN2008 was added to the back-end in r206396.

Reviewers: atanasyan

Reviewed By: atanasyan

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

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

10 years agoRe-satisfy the bots. Due to a de-sync between my clang and LLVM trees, I didn't notic...
James Molloy [Wed, 7 May 2014 14:51:57 +0000 (14:51 +0000)]
Re-satisfy the bots. Due to a de-sync between my clang and LLVM trees, I didn't notice that the generated BE alignment register is now unnamed and is not called '%align_be'.

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

10 years ago[ARM64-BE] Correctly deal with single element HFAs in varargs.
James Molloy [Wed, 7 May 2014 14:45:55 +0000 (14:45 +0000)]
[ARM64-BE] Correctly deal with single element HFAs in varargs.

Just because the first "if" didn't fire, doesn't mean we can not have
an HFA in the "else" clause.

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 7 May 2014 13:00:49 +0000 (13:00 +0000)]
Update for llvm api change.

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

10 years agoDebugInfo: Use enum instead of unsigned
Ed Maste [Wed, 7 May 2014 12:49:30 +0000 (12:49 +0000)]
DebugInfo: Use enum instead of unsigned

This makes debuging DebugInfo generation with LLDB a little more pleasant.

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

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

10 years agoARM: Fix assertion caused by passing bitfield struct using ABIArgInfo::getExpandWithP...
Oliver Stannard [Wed, 7 May 2014 10:39:12 +0000 (10:39 +0000)]
ARM: Fix assertion caused by passing bitfield struct using ABIArgInfo::getExpandWithPadding

In cases where a struct must, according to the AAPCS, not be split between
general purpose and floating point registers, we use
ABIArgInfo::getExpandWithPadding to add the padding arguments. However,
ExpandWithPadding does not work if the struct contains bitfields, so we
instead must use ABIArgInfo::getDirect.

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

10 years agoUse nullptr instead of 0 for const char * value.
Yaron Keren [Wed, 7 May 2014 09:53:02 +0000 (09:53 +0000)]
Use nullptr instead of 0 for const char * value.

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

10 years agoclang-format: Be slightly more aggressive on single-line functions.
Daniel Jasper [Wed, 7 May 2014 09:48:30 +0000 (09:48 +0000)]
clang-format: Be slightly more aggressive on single-line functions.

So that JS functions can also be merged into a single line.

Before:
  var func = function() {
    return 1;
  };

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

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

10 years agoclang-format: Fix corner cases for comments in if conditions.
Daniel Jasper [Wed, 7 May 2014 09:23:05 +0000 (09:23 +0000)]
clang-format: Fix corner cases for comments in if conditions.

Before:
  if ( // a
          x + 3) { ..

After:
  if ( // a
      x + 3) { ..

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

10 years agoDrop libgcc and default to libc++ for NetBSD/ARM on 6.99.40+.
Joerg Sonnenberger [Wed, 7 May 2014 08:45:26 +0000 (08:45 +0000)]
Drop libgcc and default to libc++ for NetBSD/ARM on 6.99.40+.
Don't bother with keeping the old support for x86_64 in 6.99.23+, just
use a single range. Update test cases for the always-on --eh-frame-hdr.

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

10 years agoAlso recognize Big Endian ARM variants.
Joerg Sonnenberger [Wed, 7 May 2014 08:24:23 +0000 (08:24 +0000)]
Also recognize Big Endian ARM variants.

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

10 years agoclang-format: Fix bad space before braced initializer.
Daniel Jasper [Wed, 7 May 2014 07:59:03 +0000 (07:59 +0000)]
clang-format: Fix bad space before braced initializer.

Before:
  new int {1};

After:
  new int{1};

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

10 years ago[OPENMP] Fixed checking for mangled names in parallel_codegen.cpp test
Alexey Bataev [Wed, 7 May 2014 07:02:29 +0000 (07:02 +0000)]
[OPENMP] Fixed checking for mangled names in parallel_codegen.cpp test

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

10 years agoFix up indentation and fix an 80 column violation.
Craig Topper [Wed, 7 May 2014 06:57:44 +0000 (06:57 +0000)]
Fix up indentation and fix an 80 column violation.

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

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

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

10 years ago[OPENMP] Fixed problem with temp removal on some platforms in codegen for '#pragma...
Alexey Bataev [Wed, 7 May 2014 06:18:01 +0000 (06:18 +0000)]
[OPENMP] Fixed problem with temp removal on some platforms in codegen for '#pragma omp parallel'

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

10 years agoPR19562: Fix memory leak when ObjC interface types cause the creation of further...
David Blaikie [Wed, 7 May 2014 06:18:00 +0000 (06:18 +0000)]
PR19562: Fix memory leak when ObjC interface types cause the creation of further interfaces.

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

10 years agoFixing tests to account for LLVM r208159.
David Blaikie [Wed, 7 May 2014 06:09:35 +0000 (06:09 +0000)]
Fixing tests to account for LLVM r208159.

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

10 years ago[OPENMP] Temporarily disable test parallel_codegen.cpp
Alexey Bataev [Wed, 7 May 2014 04:47:36 +0000 (04:47 +0000)]
[OPENMP] Temporarily disable test parallel_codegen.cpp

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

10 years ago[analyzer] Use a lazily-initialized BugType in ObjCSelfInitChecker.
Jordan Rose [Wed, 7 May 2014 03:30:04 +0000 (03:30 +0000)]
[analyzer] Use a lazily-initialized BugType in ObjCSelfInitChecker.

Follow-up to Nico's leak-stopping patch in r208110.

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

10 years ago[analyzer] Functions marked __attribute__((const)) don't modify any memory.
Jordan Rose [Wed, 7 May 2014 03:29:56 +0000 (03:29 +0000)]
[analyzer] Functions marked __attribute__((const)) don't modify any memory.

This applies to __attribute__((pure)) as well, but 'const' is more interesting
because many of our builtins are marked 'const'.

PR19661

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

10 years agoIf an instantiation of a template is required to be a complete type, check
Richard Smith [Wed, 7 May 2014 02:25:43 +0000 (02:25 +0000)]
If an instantiation of a template is required to be a complete type, check
whether the definition of the template is visible rather than checking whether
the instantiated definition happens to be in an imported module.

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

10 years agoClean up some existing keyword tests in the test/Lexer directory by using the
Yunzhong Gao [Wed, 7 May 2014 01:58:02 +0000 (01:58 +0000)]
Clean up some existing keyword tests in the test/Lexer directory by using the
pre-defined __is_identifier() macro.

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

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

10 years agoTry harder to ensure a strict weak ordering of overload candidates that
Kaelyn Takata [Wed, 7 May 2014 00:43:38 +0000 (00:43 +0000)]
Try harder to ensure a strict weak ordering of overload candidates that
have arity mismatches.

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

10 years agoRename "secondary initializer" -> "convenience initializer" in the warnings, which...
Argyrios Kyrtzidis [Tue, 6 May 2014 23:24:16 +0000 (23:24 +0000)]
Rename "secondary initializer" -> "convenience initializer" in the warnings, which is a more correct and consistent term.

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

10 years agoAST: Update reference temporary mangling
David Majnemer [Tue, 6 May 2014 22:49:16 +0000 (22:49 +0000)]
AST: Update reference temporary mangling

Summary:
Update our mangling to match the discussion on cxx-abi-dev.

This involves using a seq-id instead of an optional number.

Reviewers: rsmith

Subscribers: cfe-commits

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

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

10 years agoAdd testcase for r208062.
Nick Lewycky [Tue, 6 May 2014 22:28:58 +0000 (22:28 +0000)]
Add testcase for r208062.

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

10 years agotblgen: Modularize the diagnostic emitter
Tobias Grosser [Tue, 6 May 2014 22:06:56 +0000 (22:06 +0000)]
tblgen: Modularize the diagnostic emitter

Replace a large monolitic function, with per-table functions which all nicely
fit on my screen. I also added documentation to each function that describes
what kind of tables are generated and which information is contained and
switched to range based for loops. Finally, I run clang-format over the moved
code.

I spent a significant amount of time to understand this code when reasoning
about possible extensions to the diagnostic interface to support 'remark'
diagnostics. This change will definitely help such an implementation, but
already by itself it will save other people a lot of time when trying to
understand this functionality.

Even though the patch touches the full function, it is mostly mechanical. No
functional change intended. The generated tblgen files are identical.

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

10 years agoInclude translation unit filename in global ctor symbol names.
Nico Weber [Tue, 6 May 2014 20:32:45 +0000 (20:32 +0000)]
Include translation unit filename in global ctor symbol names.

This makes it easier to see where a global ctor comes from, and it also makes
ASan's init order analyzer output easier to understand.  gcc does this too,
but only in -fPIC mode for some reason.  Don't do this for constructors with
explicit init priority.

Also prepend "sub_" before the 'I', that way regular constructors stay
lexicographically after symbols with init priority (because
ord('s') > ord('I')).  gold seems to ignore the name of constructor symbols,
and ld only looks at the symbol if it includes an init priority, which this
patch doesn't change.

Before: __GLOBAL_I_a
Now: __GLOBAL_sub_I_myfile.cc

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

10 years agoReapply: DebugInfo: Emit the definition of enums when the definition preceeds the...
David Blaikie [Tue, 6 May 2014 18:35:21 +0000 (18:35 +0000)]
Reapply: DebugInfo: Emit the definition of enums when the definition preceeds the declaration and initial use.

Reverting r208106 to reapply r208065 with a fix for the regression. The
issue was that the enum tried to be built even if the declaration hadn't
been constructed for debug info - presenting problems for enum templates
and typedefs of enums with names for linkage purposes.

Original commit message:

This regressed a little further 208055 though it was already a little
broken.

While the requiresCompleteType optimization should be implemented here.
Future (possibly near future) work.

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

10 years agoFix leak in ObjCSelfInitChecker, found by LSan.
Nico Weber [Tue, 6 May 2014 17:33:42 +0000 (17:33 +0000)]
Fix leak in ObjCSelfInitChecker, found by LSan.

BugReport doesn't take ownership of the bug type, so let the checker own the
the bug type.  (Requires making the bug type mutable, which is icky, but which
is also what other checkers do.)

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

10 years agoFix a leak found by LSan: ConsumedBlockInfo owns its StateMapsArray entries.
Nico Weber [Tue, 6 May 2014 17:18:03 +0000 (17:18 +0000)]
Fix a leak found by LSan: ConsumedBlockInfo owns its StateMapsArray entries.

(I tried converting StateMapsArray to a vector<unique_ptr> and changing the
types of getInfo() and addInfo() to take unique_ptrs.  This mostly worked,
except for the three-argument form of addInfo() which I found confusing enough
that I went with this simpler fix for now.)

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

10 years agoRevert "DebugInfo: Emit the definition of enums when the definition preceeds the...
David Blaikie [Tue, 6 May 2014 17:02:15 +0000 (17:02 +0000)]
Revert "DebugInfo: Emit the definition of enums when the definition preceeds the declaration and initial use."

This is breaking the compiler-rt build. Reverting while I
investigate/fix.

This reverts commit r208065.

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

10 years agoAdd driver support for AArch64 Fedora.
Tilmann Scheller [Tue, 6 May 2014 16:58:14 +0000 (16:58 +0000)]
Add driver support for AArch64 Fedora.

Reviewed by Eric Christopher.

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

10 years agoUpdate comment for ObjCImplementationDecl's handling of instance variables.
Jordan Rose [Tue, 6 May 2014 16:07:54 +0000 (16:07 +0000)]
Update comment for ObjCImplementationDecl's handling of instance variables.

No functionality change.

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

10 years agoclang-format: [JS] Keep space after closure style comments.
Daniel Jasper [Tue, 6 May 2014 14:41:29 +0000 (14:41 +0000)]
clang-format: [JS] Keep space after closure style comments.

Before:
  var x = /** @type {foo} */ (bar);

After:
  var x = /** @type {foo} */(bar);

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

10 years agoclang-format: [JS] Keep space between 'return' and '['.
Daniel Jasper [Tue, 6 May 2014 14:12:21 +0000 (14:12 +0000)]
clang-format: [JS] Keep space between 'return' and '['.

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

10 years agoclang-format: [JS] Don't indent in goog.scope blocks.
Daniel Jasper [Tue, 6 May 2014 13:54:10 +0000 (13:54 +0000)]
clang-format: [JS] Don't indent in goog.scope blocks.

Before:
  goog.scope(function() {
    var x = a.b;
    var y = c.d;
  });  // goog.scope

After:
  goog.scope(function() {
  var x = a.b;
  var y = c.d;
  });  // goog.scope

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

10 years ago[OPENMP] Another one fix for codegen test '#pragma omp parallel'
Alexey Bataev [Tue, 6 May 2014 13:15:00 +0000 (13:15 +0000)]
[OPENMP] Another one fix for codegen test '#pragma omp parallel'

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

10 years ago[OPENMP] Fixed test for '#pragma omp parallel' codegen
Alexey Bataev [Tue, 6 May 2014 13:02:17 +0000 (13:02 +0000)]
[OPENMP] Fixed test for '#pragma omp parallel' codegen

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

10 years agoFixed one issue with casting
Dinesh Dwivedi [Tue, 6 May 2014 11:46:49 +0000 (11:46 +0000)]
Fixed one issue with casting

Before:
(void) SimplifyICmpOperands(Cond, LHS, RHS);

After:
(void)SimplifyICmpOperands(Cond, LHS, RHS);

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

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

10 years ago[OPENMP] Temporary disable test for parallel codegen
Alexey Bataev [Tue, 6 May 2014 10:51:53 +0000 (10:51 +0000)]
[OPENMP] Temporary disable test for parallel codegen

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

10 years ago[OPENMP] Initial codegen for '#pragma omp parallel'
Alexey Bataev [Tue, 6 May 2014 10:08:46 +0000 (10:08 +0000)]
[OPENMP] Initial codegen for '#pragma omp parallel'

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

10 years ago[PATCH] [ARM64] Enable alignment control option in front-end for ARM64.
Kevin Qin [Tue, 6 May 2014 09:51:32 +0000 (09:51 +0000)]
[PATCH] [ARM64] Enable alignment control option in front-end for ARM64.

This patch is to get "-mno-unaligned-access" and "-munaligned-access"
work in front-end for ARM64 target.

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

10 years agoXCore target: fix initialization bug found by MSan Bot.
Robert Lytton [Tue, 6 May 2014 09:38:54 +0000 (09:38 +0000)]
XCore target: fix initialization bug found by MSan Bot.

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

10 years agoPulled out cast detection in TokenAnnotator into its own function
Dinesh Dwivedi [Tue, 6 May 2014 09:08:34 +0000 (09:08 +0000)]
Pulled out cast detection in TokenAnnotator into its own function
This is to remove FIXME added in r207964.

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

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

10 years agoDebugInfo: Emit the definition of enums when the definition preceeds the declaration...
David Blaikie [Tue, 6 May 2014 07:33:30 +0000 (07:33 +0000)]
DebugInfo: Emit the definition of enums when the definition preceeds the declaration and initial use.

This regressed a little further 208055 though it was already a little
broken.

While the requiresCompleteType optimization should be implemented here.
Future (possibly near future) work.

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

10 years ago[C++11] Use 'nullptr'
Craig Topper [Tue, 6 May 2014 06:48:52 +0000 (06:48 +0000)]
[C++11] Use 'nullptr'

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

10 years agoFix crash when one overload candidate is a template instead of a function. Patch...
Nick Lewycky [Tue, 6 May 2014 06:35:27 +0000 (06:35 +0000)]
Fix crash when one overload candidate is a template instead of a function. Patch by Kaelyn Takata.

Testcase coming out of creduce will land in a separate commit shortly.

Also, it appears that this callback is used even in a SFINAE context where the results are never displayed.

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

10 years ago[OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP clause...
Alexey Bataev [Tue, 6 May 2014 06:04:14 +0000 (06:04 +0000)]
[OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP clause 'proc_bind'

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

10 years agoPR19598: Ensure temporary metadata nodes used in debug info are destroyed.
David Blaikie [Tue, 6 May 2014 03:42:01 +0000 (03:42 +0000)]
PR19598: Ensure temporary metadata nodes used in debug info are destroyed.

CGDebugInfo and DIBuilder were lax in their handling of temporary
MDNodes. All temporary nodes need to be deleted, which means they need
to be RAUW'd with a permanent node. This was not happening.

To ensure this, leverage DIBuilder's new ability to create both
permanent and temporary declarations. Ensure all temporary declarations
are RAUW'd, even with itself. (DIDescriptor::RAUW handles the case where
it is replaced with itself and creates a new, duplicate permanent node
to replace itself with)

This means that all temporary declarations must be added to the
ReplacementMap even if they're never upgraded to definitions - so move
the point of insertion into the map to the point of creation of the
declarations.

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

10 years agoSupport field references to struct names and c++11 aliases from inline asm.
Nico Weber [Tue, 6 May 2014 03:13:27 +0000 (03:13 +0000)]
Support field references to struct names and c++11 aliases from inline asm.
This is in addition to the existing support for typedefs.

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

10 years agoI fixed this fixme in r208017.
Nick Lewycky [Tue, 6 May 2014 01:09:50 +0000 (01:09 +0000)]
I fixed this fixme in r208017.

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

10 years agowww: add a missing HTML open tag
Alp Toker [Tue, 6 May 2014 00:17:24 +0000 (00:17 +0000)]
www: add a missing HTML open tag

This went AWOL in r207995.

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

10 years agoBuild debug info for ObjC interface types at the end of the translation unit to ensur...
David Blaikie [Mon, 5 May 2014 23:23:53 +0000 (23:23 +0000)]
Build debug info for ObjC interface types at the end of the translation unit to ensure all ivars are included.

This takes a different approach than the
completedType/requiresCompleteType work which relies on AST callbacks to
upgrade the type declaration to a definition. Instead, just defer
constructing the definition to the end of the translation unit.

This works because the definition is never needed by other debug info
(so far as I know), whereas the definition of a struct may be needed by
other debug info before the end of the translation unit (such as
emitting the definition of a member function which must refer to that
member function's declaration).

If we had a callback for whenever an IVar was added to an ObjC interface
we could use that, and remove the need for the ObjCInterfaceCache, which
might be nice. (also would need a callback for when it was more than
just a declaration so we could get properties, etc).

A side benefit is that we also don't need the CompletedTypeCache
anymore. Just rely on the declaration-ness of a type to decide whether
its definition is yet to be emitted.

There's still the PR19562 memory leak, but this should hopefully make
that a bit easier to approach.

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

10 years agoObjC IVars aren't added when the type isn't emitted after the interface extension
David Blaikie [Mon, 5 May 2014 23:23:50 +0000 (23:23 +0000)]
ObjC IVars aren't added when the type isn't emitted after the interface extension

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

10 years agoDuring parsing, update the range of the Declarator to include the identifier.
Richard Trieu [Mon, 5 May 2014 22:06:50 +0000 (22:06 +0000)]
During parsing, update the range of the Declarator to include the identifier.

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