Commit Graph

52640 Commits

Author SHA1 Message Date
Richard Smith 6d54014144 PR19698, PR19674: enable __has_feature checks for cxx_generic_lambdas and
cxx_decltype_auto, and fix documentation of cxx_generic_lambdas and
cxx_init_captures to specify the right feature-check name.

llvm-svn: 208445
2014-05-09 21:08:59 +00:00
Fariborz Jahanian 65a78b5d9b Objective-C. Reduce false positive warnings with -Wselector by issuing warning
only when named selector is declared in TU and it is not declared in a system
header. rdar://16600230

llvm-svn: 208443
2014-05-09 19:51:39 +00:00
Aaron Ballman 0c6a14ca82 Amending r208439 to remove buildLExpr; this code isn't strictly required yet, and fixes a dead code warning.
llvm-svn: 208440
2014-05-09 18:44:48 +00:00
Aaron Ballman 7c192b452f Add the ability to use logical expressions for capability attributes. This is to allow requirements to be expressed not just in terms of lists, but in terms of logical expressions. Eg)
void foo(void) __attribute__((requires_capability((FlightControl || Worker) && !Logger)));

This is WIP code.

llvm-svn: 208439
2014-05-09 18:26:23 +00:00
Nico Weber 5f5b94141c Don't leak MacroArgs when using code completion, PR19688.
MacroArgs are owned by TokenLexer, and when a TokenLexer is destroyed, it'll
call its MacroArgs's destroy() method.  destroy() only appends the MacroArg to
Preprocessor's MacroArgCache list, and Preprocessor's destructor then calls
deallocate() on all MacroArgs in that list.  This method then ends up freeing
the MacroArgs's memory.

In a code completion context, Parser::cutOffParsing() gets called when a code
completion token is hit, which changes the type of the current token to
tok::eof.  eof tokens aren't always ConsumeToken()ed, so
Preprocessor::HandleEndOfFile() isn't always called, and that function is
responsible for popping the macro stack.

Due to this, Preprocessor::CurTokenLexer can be non-NULL when
~Preprocessor runs.  It's a unique_ptr, so it ended up being destructed after
~Preprocessor completed, and its MacroArgs thus got added to the freelist after
the code freeing things on the freelist had already completed.  The fix is to
explicitly call reset() before the freelist processing happens.  (See the bug
for more notes.)

llvm-svn: 208438
2014-05-09 18:09:42 +00:00
Benjamin Kramer a7bcab75d2 ThreadSafetyAnalysis: Don't crash when trying to analyze objc methods.
The thread safety analysis isn't very useful in ObjC (you can't annotate
ObjC classes or methods) but we can still analyze the actual code and
show violations in usage of C/C++ functions.

Fixes PR19541, which does not use thread safety attributes but crashes
with -Weverything.

llvm-svn: 208436
2014-05-09 17:08:01 +00:00
James Molloy e735b2bae3 Pacify bots again - turns out my checkout was slightly polluted when I was reverting a olista01s change, and this pollution made it upstream during the revert checkin :/ Sorryemacs -nw lib/CodeGen/CodeGenModule.cpp
llvm-svn: 208426
2014-05-09 16:28:56 +00:00
James Molloy 6f244b6f78 Reapply r208417 (olista01 'ARM: HFAs must be passed in consecutive registers'). Bots are now pacified.
llvm-svn: 208425
2014-05-09 16:21:39 +00:00
James Molloy 1aa0d5f3b2 Revert r208417 (olista01 'ARM: HFAs must be passed in consecutive registers'). This is a followon commit from r208413 which broke the LLVM bots.
llvm-svn: 208422
2014-05-09 16:17:09 +00:00
Oliver Stannard 19f3b4f2ce ARM: HFAs must be passed in consecutive registers
This is the clang counterpart to 208413, which ensures that Homogeneous
Floating-point Aggregates are passed in consecutive registers on ARM.

llvm-svn: 208417
2014-05-09 15:14:56 +00:00
Daniel Jasper b05a81debb clang-format: Fix bug introduced by r208392.
Also run clang-format over clang-format's files.

llvm-svn: 208409
2014-05-09 13:11:16 +00:00
Daniel Jasper 8f83a9072d clang-format: [JS] Allow up to 3 empty lines in Google's JS style.
llvm-svn: 208404
2014-05-09 10:28:58 +00:00
Daniel Jasper 8951908218 clang-format: [JS] Fix spacing in dict literals.
Before:
  someVariable = {'a':[{}]};

After:
  someVariable = {'a': [{}]};

llvm-svn: 208403
2014-05-09 10:26:08 +00:00
Will Wilson eadcdbbe57 Permit duplicate explicit class instantiations if MSVCCompat is enabled
llvm-svn: 208402
2014-05-09 09:52:13 +00:00
Ismail Pazarbasi 77c456be3e Revised wording for diagnostics in r208299
llvm-svn: 208401
2014-05-09 09:49:29 +00:00
Alp Toker e265cf1a33 Add support for partial jump scope checking
This lets us diagnose and perform more complete semantic analysis when faced
with errors in the function body or declaration.

By recovering here we provide more consistent diagnostics, particularly during
interactive editing.

llvm-svn: 208394
2014-05-09 08:40:10 +00:00
Craig Topper 2145bc0229 [C++11] Use 'nullptr'.
llvm-svn: 208392
2014-05-09 08:15:10 +00:00
Rafael Espindola e98ed2f49a Don't repeat function name in comment.
llvm-svn: 208387
2014-05-09 01:34:38 +00:00
Nico Weber 0e9da35c3d Wrap to 80 columns, no code change.
llvm-svn: 208386
2014-05-09 01:00:48 +00:00
Rafael Espindola 42ae74531c Don't indent in namespaces.
llvm-svn: 208384
2014-05-09 00:57:59 +00:00
Rafael Espindola b32629589d Simplify the code a bit by using linkage predicates.
llvm-svn: 208382
2014-05-09 00:43:37 +00:00
Nico Weber 33b2d71cb8 Fix filename in file header comment more.
llvm-svn: 208381
2014-05-09 00:42:08 +00:00
Nico Weber a7d1619e84 Fix filename in file header comment.
llvm-svn: 208380
2014-05-09 00:39:59 +00:00
Rafael Espindola 1404809002 Don't indent inside namespaces.
llvm-svn: 208377
2014-05-09 00:26:20 +00:00
Richard Smith 10f22aa1ea Fix link target.
llvm-svn: 208376
2014-05-09 00:20:01 +00:00
Rafael Espindola 2ae250c36a Use auto to avoid duplicating the type.
llvm-svn: 208374
2014-05-09 00:08:36 +00:00
Ben Langmuir c95e56488d 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'.

llvm-svn: 208367
2014-05-08 22:36:02 +00:00
Richard Smith a0a5d508ef Fix an outdated comment.
llvm-svn: 208366
2014-05-08 22:32:00 +00:00
Simon Atanasyan 6f657c46e9 [Driver] Range-based loop simplification.
llvm-svn: 208354
2014-05-08 19:32:46 +00:00
Ben Langmuir 46b02e3edd 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.

llvm-svn: 208345
2014-05-08 18:09:29 +00:00
Saleem Abdulrasool 61449c6b9a 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.

llvm-svn: 208335
2014-05-08 16:28:48 +00:00
Rafael Espindola bf6e67f2e9 Simplify a few cast<>s.
llvm-svn: 208331
2014-05-08 15:44:45 +00:00
Rafael Espindola e033c8c58c Cleanup setFunctionDefinitionAttributes.
Use more specific type, update comments and name style.

llvm-svn: 208328
2014-05-08 15:26:12 +00:00
Rafael Espindola 8dcd6e767b Replace virtual with override.
llvm-svn: 208324
2014-05-08 15:01:48 +00:00
Rafael Espindola 649263626a Use more specific type.
llvm-svn: 208321
2014-05-08 14:46:46 +00:00
Rafael Espindola 489c66b268 Small simplification: Reduce the use of cast<>.
llvm-svn: 208320
2014-05-08 14:33:38 +00:00
Diego Novillo 6dc9c4814f 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

llvm-svn: 208315
2014-05-08 13:49:54 +00:00
Karthik Bhat 967c13d3fb 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.

llvm-svn: 208313
2014-05-08 13:16:20 +00:00
Rafael Espindola c47b0a1b99 Use predicate function to simplify a bit.
llvm-svn: 208312
2014-05-08 13:07:37 +00:00
Ed Maste 279b97c130 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

llvm-svn: 208310
2014-05-08 13:01:26 +00:00
Daniel Jasper 05cd586863 clang-format: Cleanup redundant calculation of ParenLevel.
No functional changes intended.

llvm-svn: 208304
2014-05-08 12:21:30 +00:00
Daniel Jasper 04a71a45ff 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.

llvm-svn: 208302
2014-05-08 11:58:24 +00:00
Manuel Klimek b33bded176 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.

llvm-svn: 208300
2014-05-08 11:50:00 +00:00
Ismail Pazarbasi 49ff754d4b 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)
              ^
              :

llvm-svn: 208299
2014-05-08 11:28:25 +00:00
Daniel Jasper c03e16a7bc 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: ''}
    }
  };

llvm-svn: 208292
2014-05-08 09:25:39 +00:00
Daniel Jasper ea2d042f89 clang-format: Fix binary operator detection before lambdas.
Before:
  bool foo = true&& [] { return false; }();

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

llvm-svn: 208288
2014-05-08 08:50:10 +00:00
Daniel Jasper f7405c129e clang-format: [JS] Support regex literals after 'return'.
llvm-svn: 208285
2014-05-08 07:45:18 +00:00
Daniel Jasper f9ae312fc0 clang-format: [JS] Initial support for regex literals.
llvm-svn: 208281
2014-05-08 07:01:45 +00:00
Craig Topper f1186c5a8f [C++11] Use 'nullptr'.
llvm-svn: 208280
2014-05-08 06:41:40 +00:00
Alexey Bataev 0120ce8c9f [OPENMP] Another one fix in test for msvc
llvm-svn: 208279
2014-05-08 04:44:21 +00:00
Alexey Bataev 3e4fa2fff7 [OPENMP] Fix codegen test for msvc build
llvm-svn: 208278
2014-05-08 04:33:26 +00:00
Nico Weber 824285ec53 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.

llvm-svn: 208277
2014-05-08 04:26:47 +00:00
Saleem Abdulrasool 62849c677c 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.

llvm-svn: 208275
2014-05-08 02:28:32 +00:00
Richard Smith 93914a9518 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.

llvm-svn: 208270
2014-05-08 00:25:01 +00:00
Nikola Smiljanic e08a91ecd2 Enable alternative tokens by default for clang-format.
Patch by Bobby Moretti.

llvm-svn: 208269
2014-05-08 00:05:13 +00:00
John Thompson 2309b15cb0 fmodules-search-all: Removed dead code and added some comments.
llvm-svn: 208259
2014-05-07 22:47:08 +00:00
Duncan P. N. Exon Smith 4434d361d0 CodeGen: Don't set hidden visibility on symbols with local linkage
llvm-svn: 208258
2014-05-07 22:36:11 +00:00
Richard Smith 80877c228d 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.

llvm-svn: 208254
2014-05-07 21:53:27 +00:00
Nico Weber 1fa575dcc6 NSOrCFErrorDerefChecker: Don't leak bug type. Similar to r208110/r208155. Found by LSan.
llvm-svn: 208251
2014-05-07 21:28:03 +00:00
Nico Weber df6860279e c-index-test: Don't leak the strings returned by makeClientContainer().
llvm-svn: 208249
2014-05-07 21:09:42 +00:00
Nico Weber 8d19dffbed Make 2 functions static, remove unneeded cast, rewrap. No behavior change.
llvm-svn: 208247
2014-05-07 21:05:22 +00:00
James Molloy 491cefbe7a 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.

llvm-svn: 208231
2014-05-07 17:41:15 +00:00
David Blaikie 87dab87a66 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.

llvm-svn: 208226
2014-05-07 16:56:58 +00:00
Nico Weber 3bf77c5d30 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.

llvm-svn: 208222
2014-05-07 16:25:32 +00:00
Matheus Almeida 602bff3184 [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

llvm-svn: 208220
2014-05-07 16:16:07 +00:00
James Molloy 847501f92e 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'.
llvm-svn: 208217
2014-05-07 14:51:57 +00:00
James Molloy 467be60748 [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.

llvm-svn: 208216
2014-05-07 14:45:55 +00:00
Rafael Espindola 9b74ec415b Update for llvm api change.
llvm-svn: 208206
2014-05-07 13:00:49 +00:00
Ed Maste da70602222 DebugInfo: Use enum instead of unsigned
This makes debuging DebugInfo generation with LLDB a little more pleasant.

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

llvm-svn: 208203
2014-05-07 12:49:30 +00:00
Oliver Stannard 39d26c98c5 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.

llvm-svn: 208185
2014-05-07 10:39:12 +00:00
Yaron Keren 51db87766f Use nullptr instead of 0 for const char * value.
llvm-svn: 208178
2014-05-07 09:53:02 +00:00
Daniel Jasper 79dffb4128 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; };

llvm-svn: 208176
2014-05-07 09:48:30 +00:00
Daniel Jasper 8acf822b6f clang-format: Fix corner cases for comments in if conditions.
Before:
  if ( // a
          x + 3) { ..

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

llvm-svn: 208175
2014-05-07 09:23:05 +00:00
Joerg Sonnenberger 1ea6647838 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.

llvm-svn: 208170
2014-05-07 08:45:26 +00:00
Joerg Sonnenberger 3a6c28ad1c Also recognize Big Endian ARM variants.
llvm-svn: 208169
2014-05-07 08:24:23 +00:00
Daniel Jasper 7a2d60e328 clang-format: Fix bad space before braced initializer.
Before:
  new int {1};

After:
  new int{1};

llvm-svn: 208168
2014-05-07 07:59:03 +00:00
Alexey Bataev c6be05db0f [OPENMP] Fixed checking for mangled names in parallel_codegen.cpp test
llvm-svn: 208165
2014-05-07 07:02:29 +00:00
Craig Topper dcfc60ff41 Fix up indentation and fix an 80 column violation.
llvm-svn: 208164
2014-05-07 06:57:44 +00:00
Craig Topper 8ae1203992 [C++11] Use 'nullptr'.
llvm-svn: 208163
2014-05-07 06:21:57 +00:00
Alexey Bataev 15007ba94a [OPENMP] Fixed problem with temp removal on some platforms in codegen for '#pragma omp parallel'
llvm-svn: 208162
2014-05-07 06:18:01 +00:00
David Blaikie 5944d9ce3e PR19562: Fix memory leak when ObjC interface types cause the creation of further interfaces.
llvm-svn: 208161
2014-05-07 06:18:00 +00:00
David Blaikie aa6dd5bbb0 Fixing tests to account for LLVM r208159.
llvm-svn: 208160
2014-05-07 06:09:35 +00:00
Alexey Bataev 79eed41840 [OPENMP] Temporarily disable test parallel_codegen.cpp
llvm-svn: 208156
2014-05-07 04:47:36 +00:00
Jordan Rose 49afeb072f [analyzer] Use a lazily-initialized BugType in ObjCSelfInitChecker.
Follow-up to Nico's leak-stopping patch in r208110.

llvm-svn: 208155
2014-05-07 03:30:04 +00:00
Jordan Rose 2741654b89 [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

llvm-svn: 208154
2014-05-07 03:29:56 +00:00
Richard Smith 3d23c42029 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.

llvm-svn: 208150
2014-05-07 02:25:43 +00:00
Yunzhong Gao e185d28862 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

llvm-svn: 208147
2014-05-07 01:58:02 +00:00
Kaelyn Takata 50c4ffcca7 Try harder to ensure a strict weak ordering of overload candidates that
have arity mismatches.

llvm-svn: 208146
2014-05-07 00:43:38 +00:00
Argyrios Kyrtzidis 37b7b2aefc Rename "secondary initializer" -> "convenience initializer" in the warnings, which is a more correct and consistent term.
llvm-svn: 208142
2014-05-06 23:24:16 +00:00
David Majnemer 3b3bdb5169 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

llvm-svn: 208140
2014-05-06 22:49:16 +00:00
Nick Lewycky 0c4833f07e Add testcase for r208062.
llvm-svn: 208138
2014-05-06 22:28:58 +00:00
Tobias Grosser cfc57bb6e3 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.

llvm-svn: 208136
2014-05-06 22:06:56 +00:00
Nico Weber bdc969839a 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
llvm-svn: 208128
2014-05-06 20:32:45 +00:00
David Blaikie 483a9da598 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.

llvm-svn: 208114
2014-05-06 18:35:21 +00:00
Nico Weber 7ce830bb67 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.)

llvm-svn: 208110
2014-05-06 17:33:42 +00:00
Nico Weber 5f8116ba46 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.)

llvm-svn: 208108
2014-05-06 17:18:03 +00:00
David Blaikie 29020cc571 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.

llvm-svn: 208106
2014-05-06 17:02:15 +00:00
Tilmann Scheller e914bc8d46 Add driver support for AArch64 Fedora.
Reviewed by Eric Christopher.

llvm-svn: 208105
2014-05-06 16:58:14 +00:00
Jordan Rose b5d2dc2e89 Update comment for ObjCImplementationDecl's handling of instance variables.
No functionality change.

llvm-svn: 208099
2014-05-06 16:07:54 +00:00
Daniel Jasper 484033b188 clang-format: [JS] Keep space after closure style comments.
Before:
  var x = /** @type {foo} */ (bar);

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

llvm-svn: 208093
2014-05-06 14:41:29 +00:00
Daniel Jasper 166c19bd37 clang-format: [JS] Keep space between 'return' and '['.
llvm-svn: 208090
2014-05-06 14:12:21 +00:00
Daniel Jasper 4a39c84c91 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

llvm-svn: 208088
2014-05-06 13:54:10 +00:00
Alexey Bataev 0b397eaf93 [OPENMP] Another one fix for codegen test '#pragma omp parallel'
llvm-svn: 208087
2014-05-06 13:15:00 +00:00
Alexey Bataev 795b88b040 [OPENMP] Fixed test for '#pragma omp parallel' codegen
llvm-svn: 208086
2014-05-06 13:02:17 +00:00
Dinesh Dwivedi 2e92e66f66 Fixed one issue with casting
Before:
(void) SimplifyICmpOperands(Cond, LHS, RHS);

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

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

llvm-svn: 208080
2014-05-06 11:46:49 +00:00
Alexey Bataev e357df8eae [OPENMP] Temporary disable test for parallel codegen
llvm-svn: 208078
2014-05-06 10:51:53 +00:00
Alexey Bataev 9959db5fa9 [OPENMP] Initial codegen for '#pragma omp parallel'
llvm-svn: 208077
2014-05-06 10:08:46 +00:00
Kevin Qin e5cee260ce [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.

llvm-svn: 208075
2014-05-06 09:51:32 +00:00
Robert Lytton d263f14a0f XCore target: fix initialization bug found by MSan Bot.
llvm-svn: 208072
2014-05-06 09:38:54 +00:00
Dinesh Dwivedi 13b9b7e0e8 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

llvm-svn: 208071
2014-05-06 09:08:34 +00:00
David Blaikie 57407525fd 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.

llvm-svn: 208065
2014-05-06 07:33:30 +00:00
Craig Topper 34b4c43863 [C++11] Use 'nullptr'
llvm-svn: 208063
2014-05-06 06:48:52 +00:00
Nick Lewycky aa7168a215 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.

llvm-svn: 208062
2014-05-06 06:35:27 +00:00
Alexey Bataev bcbadb65ab [OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP clause 'proc_bind'
llvm-svn: 208060
2014-05-06 06:04:14 +00:00
David Blaikie f427b00b9a 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.

llvm-svn: 208055
2014-05-06 03:42:01 +00:00
Nico Weber 9ef9ca470f Support field references to struct names and c++11 aliases from inline asm.
This is in addition to the existing support for typedefs.

llvm-svn: 208053
2014-05-06 03:13:27 +00:00
Nick Lewycky e749400012 I fixed this fixme in r208017.
llvm-svn: 208027
2014-05-06 01:09:50 +00:00
Alp Toker 1fd1d5215c www: add a missing HTML open tag
This went AWOL in r207995.

llvm-svn: 208018
2014-05-06 00:17:24 +00:00
David Blaikie ef8a951882 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.

llvm-svn: 208015
2014-05-05 23:23:53 +00:00
David Blaikie fc55cb6e14 ObjC IVars aren't added when the type isn't emitted after the interface extension
llvm-svn: 208014
2014-05-05 23:23:50 +00:00
Richard Trieu 2664dc184e During parsing, update the range of the Declarator to include the identifier.
llvm-svn: 208011
2014-05-05 22:06:50 +00:00
Argyrios Kyrtzidis 26d56393c6 [Basic/FileManager] Propagate whether a file 'IsVolatile' to the file opening functions.
Needs llvm r208007.

llvm-svn: 208008
2014-05-05 21:57:46 +00:00
Ben Langmuir 71e1a64f91 Add -Wnon-modular-include* options
Warn on non-modular includes in various contexts.

-Wnon-modular-include
 -Wnon-modular-include-in-module
  -Wnon-modular-include-in-framework-module

Where each group is a subgroup of those above it.

llvm-svn: 208004
2014-05-05 21:44:13 +00:00
David Blaikie b8149044e0 Simplify replacement map by avoiding duplicate values and ensuring the values it does contain are necessary.
Items were being redundantly added to the replacement map (both when the
declaration was created, and then again when its definition was
constructed) which caused extra handling to be required when walking the
map (as elements may've already been replaced due to prior entries). By
avoiding adding the duplicates, the checks in the replacement handling
can be replaced with assertions.

llvm-svn: 208000
2014-05-05 21:21:39 +00:00
Reid Kleckner a82b5d840f MS ABI: Emit an error during IRgen on C++ exception handling
Currently, users get error messages about RTTI descriptor mangling with
no useful source location.  This addresses that.

Another approach would be to disable C++ exceptions by default in the
driver when using the Microsoft C++ ABI.  However, this makes it
impossible to parse system headers that use exception handling
constructs.  By delaying the error to IRgen, we can figure out if we
actually need to emit code for this construct.  Additionally, users who
are only interested in building refactoring tools on Windows still get a
correct AST without having to add flags.  Finally, this is consistent
with what we do for SEH.

llvm-svn: 207999
2014-05-05 21:12:12 +00:00
Rafael Espindola 502f65ae54 Fix pr19653.
Warn if an alias requests a section other than the aliasee section.

llvm-svn: 207997
2014-05-05 20:21:03 +00:00
Alp Toker 871de4ff4d www: remove proprietary dbtree.js script from r96013
This minified source code and artwork is copied from a commercial product and
carries no license information:

  dbtree.js (7 kb), 25.03.2014 14:51:32
  Purchase and download DBTree now for only $29.75 $9.75

It was used by a small TOC which looks fine now as a plain unordered list.

llvm-svn: 207995
2014-05-05 19:53:49 +00:00
Alp Toker 08f6e9ec15 Fix some typos
llvm-svn: 207994
2014-05-05 19:53:42 +00:00
Rafael Espindola c67b815217 Small refactoring, no functionality change.
llvm-svn: 207991
2014-05-05 19:33:09 +00:00
David Majnemer ceaaa8d09e CodeGen: Assign linkage to thread-wrappers correctly
We would sometimes incorrectly give a thread-wrapper external linkage
instead of internal linkage if we had only CodeGen'd it's declaration,
not it's definition.

This fixes PR19655.

llvm-svn: 207988
2014-05-05 18:54:23 +00:00
Manuel Klimek 75f34c1386 Fix handling of condition variables in the face of temp dtors.
The assignment needs to be before the destruction of the temporary.
This patch calls out to addStmt, which invokes VisitDeclStmt, which has
all the correct logic for handling temporaries.

llvm-svn: 207985
2014-05-05 18:21:06 +00:00
Duncan P. N. Exon Smith 48bc268290 CodeGen: Cleanup visibility in RTTIBuilder
No functionality change.

llvm-svn: 207978
2014-05-05 17:38:39 +00:00
Ben Langmuir 1ecf750ec8 Add -Wmodule-build to make it easy to see when modules are (re)built
Warning is default ignore, and not in -Wall.

llvm-svn: 207975
2014-05-05 16:58:47 +00:00
Daniel Jasper f10a28d705 clang-format: Understand functions with decltype return type.
Before:
  decltype(long_name_forcing_break)
      f() {}

After:
  decltype(long_name_forcing_break)
  f() {}

llvm-svn: 207965
2014-05-05 13:48:09 +00:00
Dinesh Dwivedi 76f98f8047 Added some heuristics to identify c style casting
Before:
void f() { my_int a = (my_int) * b; }
void f() { return P ? (my_int) * P : (my_int)0; }

After:
void f() { my_int a = (my_int)*b; }
void f() { return P ? (my_int)*P : (my_int)0; }

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

llvm-svn: 207964
2014-05-05 13:14:35 +00:00
Benjamin Kramer 6af073b636 Driver: Recognize CentOS 6 as RHEL 6.
Patch by Dimitry Andric!

llvm-svn: 207963
2014-05-05 12:39:32 +00:00
Alp Toker a030cd0558 StringRefize and take out an old FIXME
llvm-svn: 207962
2014-05-05 12:38:48 +00:00
Daniel Jasper 0e6c51c889 clang-format: Improve understanding of decltype.
Before:
  SomeFunction([](decltype(x), A * a) {});

After:
  SomeFunction([](decltype(x), A *a) {});

llvm-svn: 207961
2014-05-05 12:36:29 +00:00
Dinesh Dwivedi afe6fb6f05 Fix bug in clang-format while merging short function
Before:
    #ifdef _DEBUG
    int foo( int i = 0 )
    #else
    int foo( int i = 5 )
    #endif { return i; }

After:
    #ifdef _DEBUG
    int foo( int i = 0 )
    #else
    int foo( int i = 5 )
    #endif
    {
    	return i;
    }

llvm-svn: 207958
2014-05-05 11:36:35 +00:00
Manuel Klimek 264f963114 Fix crash when resolving branch conditions for temporary destructor condition blocks.
Document and simplify ResolveCondition.

1. Introduce a temporary special case for temporary desctructors when resolving
the branch condition - in an upcoming patch, alexmc will change temporary
destructor conditions to not run through this logic, in which case we can remove
this (marked as FIXME); this currently fixes a crash.

2. Simplify ResolveCondition; while documenting the function, I noticed that it
always returns the last statement - either that statement is the condition
itself (in which case the condition was returned anyway), or the rightmost
leaf is returned; for correctness, the rightmost leaf must be evaluated anyway
(which the CFG does in the last statement), thus we can just return the last
statement in that case, too. Added an assert to verify the invariant.

llvm-svn: 207957
2014-05-05 09:58:03 +00:00
Christian Pirker 918d1097a1 Simplify getARMCPUForMArch() and make it more consistent
llvm-svn: 207956
2014-05-05 08:48:18 +00:00
Daniel Jasper 9509f18836 clang-format: Fix import statements with ColumnLimit: 0
These used to interact badly with AlwaysBreakBeforeMultilineStrings.

llvm-svn: 207955
2014-05-05 08:08:07 +00:00
Alp Toker ee77934c17 Update lit.cfg to support the clang-interpreter test from r207950
Performs behind-the-scenes RUN line substitution similarly to what's done with
clang-check and clang-format to ensure the executable is found.

llvm-svn: 207951
2014-05-05 06:42:07 +00:00
Alp Toker 1d487617f2 Add speculative clang-interpreter test
Let's see how far this gets on the build servers. The application requires
native JIT and uses the C standard library, but hopefully we can get this
tested on at least some configurations.

Taking a lead from the clang-format tests, we'll just expect the executable to
get picked up from the build output path for now.

llvm-svn: 207950
2014-05-05 06:22:21 +00:00
Ben Langmuir 527040e0c8 Make module self-import an error
Ideally, importing Foo.a from Foo.b would "do the right thing", but
until it does, this patch makes it an error rather than allow it to
silently be ignored.

llvm-svn: 207948
2014-05-05 05:31:33 +00:00
Alp Toker d29607871f cindex-dump.py: fix the --show-ids description string
It looks like this was botched back in r94936.

llvm-svn: 207947
2014-05-05 04:42:26 +00:00
Alp Toker 777fce64cc Fix cindex-dump.py --show-ids
This option flag was incorrectly expecting an argument:

$ cindex-dump.py --show-ids test.cpp
cindex-dump.py: error: invalid number arguments

With this change the feature correctly gets enabled by --show-ids.

No tests.

llvm-svn: 207946
2014-05-05 04:39:18 +00:00
Alp Toker a01285c4b3 Split out header integration tests
These are somewhat arbitrary tests that check if "thing goes fine" when
processing various platform-specific headers.

Also move warn-sysheader.cpp to Misc where the other diagnostics infrastructure
tests live.

File moves only.

llvm-svn: 207936
2014-05-04 13:00:32 +00:00
Argyrios Kyrtzidis d113788ecb Speculative fix to unbreak the buildbots that fail with compiler errors.
llvm-svn: 207933
2014-05-04 05:27:24 +00:00
Ben Langmuir 027731d7b5 Fix a use-after-free bug I recently introduced in lookupModuleFile
llvm-svn: 207932
2014-05-04 05:20:54 +00:00
Argyrios Kyrtzidis 1b1256a1b1 [Modules] Add the resource-dir to the module hash.
llvm-svn: 207931
2014-05-04 04:35:31 +00:00
Saleem Abdulrasool 956c2ec532 CodeGen: complete ARM ACLE hint 8.4 support
Add support for the remaining hints from the ACLE.  Although __dbg is listed as
a hint, it is handled different, so it is not covered by this change.

llvm-svn: 207930
2014-05-04 02:52:25 +00:00
Saleem Abdulrasool 6323a2d63c Target: fix wchar_t definition for Windows on ARM
Windows on ARM uses AAPCS, but has some deviations.  wchar_t remains an unsigned
short on WoA, which does not conform to AAPCS.  Ensure that wchar_t is defined
accordingly.

llvm-svn: 207929
2014-05-04 01:56:04 +00:00
Nico Weber dfc592092c Minor cleanups, no behavior change.
* Fixes a "return" that was indented at the same level as the continuation
  from the previous line
* Wrap several lines to 80 columns
* Remove an if check that was always true
* Move a variable declaration slightly closer to its use

llvm-svn: 207922
2014-05-03 22:07:35 +00:00
Nico Weber 83ea012591 Wrap a few lines at 80 columns, change a confusing indent. No behavior change.
llvm-svn: 207921
2014-05-03 21:57:40 +00:00
Benjamin Kramer 834652ade0 Replace one-element SmallVectors inside DenseMaps with TinyPtrVector.
That's exactly what TinyPtrVector was designed for. No functionality change.

llvm-svn: 207919
2014-05-03 18:44:26 +00:00
Benjamin Kramer f6ba52b947 Remove unused diagnostics.
llvm-svn: 207908
2014-05-03 12:32:50 +00:00
Chandler Carruth 7ff07727b5 [leaks] The PDFileEntry nodes in the FilesMade FoldingSet contain
a std::vector that allocates on the heap. As a consequence, we have to
run all of their destructors when tearing down the set, not just
deallocate the memory blobs.

llvm-svn: 207902
2014-05-03 10:39:05 +00:00
Chandler Carruth e6c980c41d [leaks] Re-shuffle code such that we don't create a basic block for
initializing an array unless we need it. Specifically, position the
creation of a new basic block after we've checked all of the cases that
bypass the need for it.

Fixes another leak in test/CodeGen* found by LSan.

llvm-svn: 207900
2014-05-03 09:16:57 +00:00
Chandler Carruth 81f9e02ef3 [leaks] Don't leak the fake arguments we synthesize for LLVM option
parsing.

llvm-svn: 207899
2014-05-03 08:39:35 +00:00
Alp Toker 0804343733 Eliminate ASTContext's DelayInitialization flag
Having various possible states of initialization following construction doesn't
add value here.

Also remove the unused size_reserve parameter.

llvm-svn: 207897
2014-05-03 03:46:04 +00:00
Alp Toker b6cc592ea3 Fix a bunch of mislayered clang/Lex includes from Sema
llvm-svn: 207896
2014-05-03 03:45:55 +00:00
Alp Toker b7b579aa93 Update Preprocessor::Initialize() documentation following r207825
llvm-svn: 207895
2014-05-03 03:45:43 +00:00
David Majnemer 085b111d32 CodeGen: Cleanup ABIArgInfo
ABIArgInfo was pretty hard to grok, it had data members with names like
"BoolData0" and "UIntData".  Constructors with lots of bool arguments.
Reusing the same data member for multiple purposes.

It was also wasteful with memory, this new layout is 8 bytes smaller.

llvm-svn: 207894
2014-05-03 02:23:35 +00:00
David Majnemer a2245271af Revert "Sema: Implement DR244"
This was accidentally committed.

This reverts commit r207892.

llvm-svn: 207893
2014-05-03 02:22:11 +00:00
David Majnemer 22fcb08357 Sema: Implement DR244
Naming the destructor using a typedef-name for the class-name is
well-formed.

This fixes PR19620.

llvm-svn: 207892
2014-05-03 02:18:46 +00:00
Nick Lewycky 843571130f Err, wait. Those new test functions in r207890 need CHECK lines.
llvm-svn: 207891
2014-05-03 01:19:39 +00:00
Nick Lewycky d78f92fbb2 Rewrite NRVO determination. Track NRVO candidates on the parser Scope and apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal.
Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith.

llvm-svn: 207890
2014-05-03 00:41:18 +00:00
Reid Kleckner e39ee21551 MS ABI x64: Pass small objects with dtors but no copy ctors directly
Passing objects directly (in registers or memory) creates a second copy
of the object in the callee.  The callee always destroys its copy, but
we also have to destroy any temporary created in the caller.  In other
words, copy elision of these kinds of objects is impossible.

Objects larger than 8 bytes with non-trivial dtors and trivial copy
ctors are still passed indirectly, and we can still elide copies of
them.

Fixes PR19640.

llvm-svn: 207889
2014-05-03 00:33:28 +00:00
Chandler Carruth 7d8668288a [leaks] Fix a leak of a basic block when we successfully fold a switch
condition to a constant and emit only the relevant statement. In that
case, we were previously creating the epilog jump destination, a cleanup
scope, and emitting any condition variable into it. Instead, we can emit
the condition variable (if we have one) into the cleanup scope used for
the entire folded case sequence. We avoid creating a jump dest, a basic
block, and an extra cleanup scope. Win!

llvm-svn: 207888
2014-05-03 00:14:49 +00:00
Richard Trieu a1342406f2 Fix PR 19630, don't crash when file ends with whitespace.
llvm-svn: 207883
2014-05-02 23:40:32 +00:00
Chandler Carruth b2faa59976 [leaks] Parse the schema file every time we try to verify the XML. Yes,
this is wasteful, blah blah, but this is a test utility only. It turns
out that without doing this, libxml2 will always leak a bunch of the XML
data, and that is causing failures with LSan. This is also quite a bit
simpler and I don't think it is slow enough to really be a show stopper.
If someone yells about the runtime of c-index-test, we can do other
things to try to mitigate it, but the current strategy wasn't working
well.

llvm-svn: 207882
2014-05-02 23:30:59 +00:00
Hans Wennborg 55362851a9 Fix clang-cl Driver leak
We were synthesizing new arguments from e.g. '/Tcfile.c' arguments,
but didn't handle ownership correctly.

llvm-svn: 207880
2014-05-02 22:55:30 +00:00
Justin Bogner fb4e3f2f4e clang-c: Fix a typo
llvm-svn: 207879
2014-05-02 22:37:02 +00:00
Chandler Carruth 0702f8eefa [sanitizers] Propagate the sanitizer options through to the lit context.
This makes it *really* easy to debug leaks FYI:

ASAN_OPTIONS=detect_leaks=1 ./bin/llvm-lit -v <path to test>

llvm-svn: 207873
2014-05-02 21:46:39 +00:00
Chandler Carruth 4d9c3df429 [leaks] Fix a leak recently introduced to the pragma handling. This
whole code would be better with std::unique_ptr managing the lifetimes
of the handlers, but I wanted to make a targeted fix to the leaks first.
With this change, all of the Clang preprocessor tests are leak free with
LSan.

llvm-svn: 207872
2014-05-02 21:44:48 +00:00
Nico Weber b0f9e4ace7 Remove unused typedef found by gcc's -Wunused-local-typedefs.
llvm-svn: 207870
2014-05-02 21:22:21 +00:00
Alex McCarthy e14ddef034 Fix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl.
llvm-svn: 207867
2014-05-02 20:24:11 +00:00
Chad Rosier 3ba81bdb45 [driver] Enable the slp vectorizer at -Oz.
PR19568

llvm-svn: 207858
2014-05-02 18:41:57 +00:00
Hans Wennborg 802df13e4d Fix bad comment from r207573.
llvm-svn: 207854
2014-05-02 18:12:30 +00:00
Eric Christopher 25c4e67d69 Small formatting change.
llvm-svn: 207852
2014-05-02 17:52:19 +00:00
Dinesh Dwivedi ea3aca8b67 Fixes issue with Allman BreakBeforeBraces for Objective C @interface
Before:
        @interface BSApplicationController () {
    @private
      id _extraIvar;
    }
    @end

After:
    @interface BSApplicationController ()
    {
    @private
      id _extraIvar;
    }
    @end

llvm-svn: 207849
2014-05-02 17:01:46 +00:00
Benjamin Kramer 56c582279b Add support for -march=bdver4.
llvm-svn: 207848
2014-05-02 15:47:51 +00:00
Bradley Smith 9a6b29540e [ARM64/AArch64] Define the correct value for __ARM_NEON_FP
llvm-svn: 207842
2014-05-02 15:18:38 +00:00
Bradley Smith 418c5935f8 [ARM64/AArch64] Hook up CRC32 subtarget feature to the driver
llvm-svn: 207841
2014-05-02 15:17:51 +00:00
Aaron Ballman a82eaa70f1 Updated the attribute tablegen emitter for variadic arguments to emit a range accessor in addition to the iterators. Updated code using iterators to use range-based for loops.
llvm-svn: 207837
2014-05-02 13:35:42 +00:00
Aaron Ballman 73b3651e9d Renaming the CallableState variadic attribute argument to be CallableStates. No functional changes intended.
llvm-svn: 207836
2014-05-02 13:17:57 +00:00
Robert Lytton f80d68847d XCore target: fix bug in dereferencing null pointer.
Also add basic cpp ABI tests where they differ from C ABI output.

llvm-svn: 207834
2014-05-02 09:33:30 +00:00
Robert Lytton 894d25c1e0 XCore target: fix handling of -g0 flag
llvm-svn: 207833
2014-05-02 09:33:25 +00:00
Robert Lytton 844aeeb15a XCore target: Add TypeString meta data to IR output.
This includes the addition of the virtual function:
	TargetCodeGenInfo::EmitTargetMD()

llvm-svn: 207832
2014-05-02 09:33:20 +00:00
Saleem Abdulrasool 24164efb88 CodeGen: reorder ARM hint
__yield is part of the ACLE specified extensions and not specific to MSVC.
Move the declaration for the hint to the proper group.

llvm-svn: 207830
2014-05-02 07:01:34 +00:00
Saleem Abdulrasool 38ed6de3a0 CodeGen: rename __builtin_arm_sevl to __sevl
ACLE adds the __sevl() extension.  Rename the hint from a custom name to the
ACLE specified name.

llvm-svn: 207829
2014-05-02 06:53:57 +00:00
Alp Toker 9663780e35 Reformat code following Preprocessor constructor updates
Landing this separately to make the previous commits easy to follow at home.

llvm-svn: 207826
2014-05-02 03:43:38 +00:00
Alp Toker 1ae02f68be Factor TargetInfo pointer/DelayInitialization bool pair out of Preprocessor ctor
The Preprocessor::Initialize() function already offers a clear interface to
achieve this, further reducing the confusing number of states a newly
constructed preprocessor can have.

llvm-svn: 207825
2014-05-02 03:43:30 +00:00
Alp Toker 23aa353291 Remove unused IncrProcessing parameter from Preprocessor ctor
Preprocessor::enableIncrementalProcessing() provides a consistent interface to
enable the feature.

llvm-svn: 207824
2014-05-02 03:43:21 +00:00
Alp Toker 1c583cc668 Cut off parsing early during code completion
These calls to ConsumeCodeCompletionToken() caused parsing to continue
needlessly when an immediate cutOffParsing() would do.

Document the function to clarify its correct usage.

llvm-svn: 207823
2014-05-02 03:43:14 +00:00
Hans Wennborg b6d4e8cd4e Handle -fdelayed-template-parsing of out-of-line definitions of
class template member classes (PR19613)

Also improve this code in general by implementing suggestions
from Richard.

Differential Revision: http://reviews.llvm.org/D3555?id=9020

llvm-svn: 207822
2014-05-02 02:01:07 +00:00
Reid Kleckner ec87fece21 Remove unused variable that I missed in my rush to fix the bots
llvm-svn: 207820
2014-05-02 01:17:12 +00:00
Reid Kleckner 7f5f0f3f6e Win64: Use ConvertType instead of checking the MS inheritance
dependent-type-member-pointer.cpp is failing on a win64 bot because
-fms-extensions is not enabled.  Use ConvertType rather than relying on
the inheritance attributes.  It's less code, but probably slower.

llvm-svn: 207819
2014-05-02 01:14:59 +00:00
Reid Kleckner 9005f41837 Win64: Pass member pointers larger than 8 bytes by reference
The Win64 ABI docs on MSDN say that arguments bigger than 8 bytes are
passed by reference.  Prior to this change, we were only applying this
logic to RecordType arguments.  This affects both the Itanium and
Microsoft C++ ABIs.

Reviewers: majnemer

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

llvm-svn: 207817
2014-05-02 00:51:20 +00:00
Reid Kleckner 34a38d8efb MS ABI: Fix logic bug in member pointer null test code
This code is trying to test if the pointer is *not* null.  Therefore we
should use 'or' instead of 'and' to combine the results of 'icmp ne'.
This logic is consistent with the general member pointer comparison code
in EmitMemberPointerComparison.

llvm-svn: 207815
2014-05-02 00:05:16 +00:00
Lubos Lunak d9070c5ee7 -fsyntax-only for a test
llvm-svn: 207814
2014-05-01 23:58:20 +00:00
Richard Smith 51af519db3 Bitrig's standard C++ standard library changed from libstdc++ to libc++.
Also, it uses libc++abi and needs pthread.  While there, fix the libc++
include path. Patch by Patrick Wildt!

llvm-svn: 207813
2014-05-01 23:24:24 +00:00
Richard Smith 7d3192fca5 Bitrig now supports TLS, so enable TLS support when targeting it. Patch by Patrick Wildt!
llvm-svn: 207812
2014-05-01 23:19:06 +00:00
David Blaikie 8ad22e6a5c Use std::abs(int) portably.
Code review feedback from Reid Kleckner on r207806.

llvm-svn: 207811
2014-05-01 23:01:41 +00:00
Reid Kleckner c9bb8b5af4 Use %clang_cc1 in rewrite-includes-messages.c test and drop REQUIRES: shell
This test passes on Windows with lit's shell interpreter.

llvm-svn: 207810
2014-05-01 22:45:16 +00:00
Lubos Lunak 1f03d08a8c do not hide clang stderr output during a test
I don't know why this fails on the buildbot.

llvm-svn: 207808
2014-05-01 22:40:00 +00:00
David Blaikie 09acbf35e2 Fix some -Wabsolute-value warnings introduced in r207796.
llvm-svn: 207806
2014-05-01 22:23:56 +00:00
David Blaikie eef6b5c154 Revert "Use make_unique<T>(...) rather than unique_ptr<T>(new T(...))"
Seems to be crashing clang (3.3 and 3.4) on some buildbots...

This reverts commit r207792.

llvm-svn: 207799
2014-05-01 21:40:37 +00:00
Lubos Lunak adc2fde016 use 'diff' rather than 'cmp -s' in a test
That's what all tests use, no idea where I got the latter from.

llvm-svn: 207797
2014-05-01 21:36:08 +00:00
Kaelyn Takata b96b3be899 When sorting overload candidates, sort arity mismatches in ascending
order by the number of missing or extra parameters. This is useful if
there are more than a few overload candidates with arity mismatches,
particularly in the presence of -fshow-overloads=best.

llvm-svn: 207796
2014-05-01 21:15:24 +00:00
Lubos Lunak 4526b46ee6 write a line marker right before adding included file
Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.

llvm-svn: 207795
2014-05-01 21:11:57 +00:00
Lubos Lunak 72cad68b30 do not use "1" for line marker for the predefines "file" either
Similar to r207764.

llvm-svn: 207794
2014-05-01 21:10:08 +00:00
David Blaikie de9527c232 Use make_unique<T>(...) rather than unique_ptr<T>(new T(...))
llvm-svn: 207792
2014-05-01 20:46:30 +00:00
Richard Smith 06900a0ffb Update documentation to match recent API change. newFrontendActionFactory now returns a unique_ptr.
llvm-svn: 207789
2014-05-01 20:04:39 +00:00
Arnaud A. de Grandmaison 59615698d5 PR19601: testcase improvement
The test can now catch all cases:
 - no removal of the 'no-integrated-as' flag
 - bogus removal of the flag, like when the remove_if was not followed by an erase

llvm-svn: 207787
2014-05-01 19:36:13 +00:00
David Blaikie 1c286f6d8f PR19623: Support typedefs (and alias templates) of void.
llvm-svn: 207781
2014-05-01 18:25:19 +00:00
David Blaikie 80bec83d8d Fix debug-info-alias test to add CHECK to some lines that were missing it.
To simplify source location offsets, this test uses line directives to
force particular lines of interest to have known line numbers so that
adjustments before/after those points don't require updates to the CHECK
lines.

llvm-svn: 207779
2014-05-01 18:13:24 +00:00
David Majnemer daff37013c AST: Mangle reference temporaries reliably
Summary:
Previously, we would generate a single name for all reference
temporaries and allow LLVM to rename them for us.  Instead, number the
reference temporaries as we build them in Sema.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 207776
2014-05-01 17:50:17 +00:00
Dinesh Dwivedi 0db806b7f9 Fix typo (first commit to test commit access).
llvm-svn: 207775
2014-05-01 17:19:34 +00:00
Reid Kleckner 756199ccea Fix declspec-thread.cpp test with a triple
Not all triples support it.

llvm-svn: 207772
2014-05-01 17:12:20 +00:00
Reid Kleckner e502507d34 MSVCCompat: Don't produce an invalid AST when accepting void pseudo-dtors
We accept 'void *p; p->~void();' for MSVC compatibility since r148682.
However, we were returning ExprError, rather than producing an AST,
despite only diagnosing it with a warning.  CodeGen noticed that the
template function specialization had an invalid AST, and therefore
didn't generate code for it.  This change makes us produce an AST with a
void pseudo-dtor call.

Part of PR18256.

llvm-svn: 207771
2014-05-01 16:50:23 +00:00
Joey Gouly 81228382cf [libclang] Add attribute support for 'pure', 'const' and 'noduplicate'.
This bumps CINDEX_VERSION_MINOR up (to 26).

llvm-svn: 207767
2014-05-01 15:41:58 +00:00
Aaron Ballman d6459e5c43 Fixing a FIXME -- no longer using std::memcpy, since that would fail for non-trivial types. Replaced with std::copy. No functional changes intended since all uses of this functionality either use pointers or integers.
llvm-svn: 207766
2014-05-01 15:21:03 +00:00
Tobias Grosser 86a85678f2 Support 'remark' in VerifyDiagnosticConsumer
After Diego added support for -Rpass=inliner we have now in-tree remarks which
we can use to properly test this feature.

llvm-svn: 207765
2014-05-01 14:06:01 +00:00
Lubos Lunak 10961c0eab do not use "1" for line marker for the main file
"1" means entering a new file (from a different one), but the main
file is not included from anything (and this would e.g. confuse -Wunused-macros
to not report unused macros in the main file, see pr15610, or also see pr18948).
The line marker is still useful e.g. if the resulting file is renamed or used
via a pipe.

llvm-svn: 207764
2014-05-01 13:50:44 +00:00
Lubos Lunak 64568ca18a revert r207756
There's nothing wrong with the change itself, but
test/Frontend/rewrite-includes-messages.c fails without another
not-yet-committed fix.

llvm-svn: 207762
2014-05-01 13:37:55 +00:00
Lubos Lunak 576a0415cb do not warn about unknown pragmas in modes that do not handle them (pr9537)
And refactor to have just one place in code that sets up the empty
pragma handlers.

llvm-svn: 207758
2014-05-01 12:54:03 +00:00
Lubos Lunak c5f2bca866 write a line marker right before adding included file
Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.

llvm-svn: 207756
2014-05-01 12:45:08 +00:00
Ben Langmuir 05f82ba252 Avoid a potential race between stat() and open() of ASTFile
We need to open an ASTFile while checking its expected size and
modification time, or another clang instance can modify the file between
the stat() and the open().

llvm-svn: 207735
2014-05-01 03:33:36 +00:00
Reid Kleckner 7d6d2705f6 Add support for __declspec(thread) under -fms-extensions
Reviewers: rsmith

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

llvm-svn: 207734
2014-05-01 03:16:47 +00:00
Reid Kleckner ac64060c80 MS ABI x64: Don't destroy arguments twice on x64
We were destroying them in the callee, and then again in the caller.  We
should use an EH-only cleanup and disable it at the point of the call
for win64, even though we don't use inalloca.

llvm-svn: 207733
2014-05-01 03:07:18 +00:00
Richard Smith 09d5b3a928 Make typo-correction of inheriting constructors work a bit better. Limit
correction to direct base class members, and recover properly after we apply
such a correction.

llvm-svn: 207731
2014-05-01 00:35:04 +00:00
Dmitri Gribenko 0b2026de6b Comment parsing: remove HTML attribute validation
Since the community says that a blacklist is not good enough, and I don't have
enough time now to implement a proper whitelist, let's just remove the
attribute validation.

But, nevertheless, we can still communicate in the generated XML if our parser
found an issue with the HTML.  But this bit is best-effort and is specifically
called out in the schema as such.

llvm-svn: 207712
2014-04-30 21:54:30 +00:00
Arnaud A. de Grandmaison e1265143e2 PR19601: std::remove_if does not really remove the elements.
It moves them at the end of the range instead, so an extra erase is needed.

It is strange that this code works without the erase. On the other hand, removing the remove_if will make fail some tests.

llvm-svn: 207696
2014-04-30 19:59:22 +00:00
Reid Kleckner f1dccebe6a Fix typos in carries_dependency docs
llvm-svn: 207686
2014-04-30 18:50:03 +00:00
David Majnemer deca705593 Sema: Implement DR477
Summary: Friend declarations shouldn't mention explicit or virtual.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 207682
2014-04-30 18:24:01 +00:00
Richard Smith d94f2f16bd When typo-correcting a member using declaration, don't exclude member templates.
llvm-svn: 207681
2014-04-30 18:15:00 +00:00
Richard Smith 21866c3267 When typo-correcting a member using-declaration, only consider members of base classes.
llvm-svn: 207680
2014-04-30 18:03:21 +00:00
Richard Smith 30a615dca8 Fix crash if typo correction corrects a member using-declaration to a
non-member declaration. Patch by Dinesh Dwivedi!

llvm-svn: 207677
2014-04-30 17:40:35 +00:00
Reid Kleckner 92fc0178c6 __thread: Move constant init check to CheckCompleteVariableDeclaration
We were emitting dynamic initializers for __thread variables if there
was no explicit initializer, as in this test case:

struct S { S(); };
__thread S s;

llvm-svn: 207675
2014-04-30 17:10:18 +00:00
Reid Kleckner 121b1a1fa5 -Wunused-parameter: Don't fire on defaulted or deleted functions
Patch by Dinesh Dwivedi!

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

llvm-svn: 207672
2014-04-30 16:31:28 +00:00
Logan Chien 28f87f80e2 Android uses -fpic for arm64 as well.
llvm-svn: 207642
2014-04-30 12:18:12 +00:00
James Molloy 7c39a5ad02 Add a test for big-endian NEON on ARM64.
The enabled test #includes <arm_neon.h>, which is sufficient to test all
the code in r207624.

llvm-svn: 207641
2014-04-30 12:12:45 +00:00
Bradley Smith 4da7dd837d [ARM64] Port remaining relevant AArch64 clang tests over to ARM64
llvm-svn: 207632
2014-04-30 10:52:05 +00:00
James Molloy fa40368d9d [ARM64] Add arm64_be where it was accidentally missed from a bunch of if-conditions.
I think this is the last commit for ARM64 big endian in clang. This commit makes
arm_neon.h compile correctly.

llvm-svn: 207624
2014-04-30 10:11:40 +00:00
Andrea Di Biagio c7ce72c9f2 Simplify test. No functional change intended.
llvm-svn: 207623
2014-04-30 10:04:58 +00:00
Nico Weber ae360dc36c Add a triple to new test.
NULL is just 0 on Windows, so the Wsentinel part of the test doesn't pass there.

llvm-svn: 207607
2014-04-30 04:54:42 +00:00
Nico Weber 272bcf6768 Let stddef.h respect __need_{wchar_t, size_t, NULL, ptrdiff_t, wint_t}.
glibc expects that stddef.h only defines a single thing if either of these
defines is set.  For example, before this change, a C file containing

  #include <stdlib.h>
  int ptrdiff_t = 0;

would compile with gcc but not with clang. Now it compiles with clang too.

This also fixes PR12997, where older versions of the Linux headers would define
NULL incorrectly, and glibc would define __need_NULL and expect stddef.h to
redefine NULL with the correct definition.

llvm-svn: 207606
2014-04-30 04:35:09 +00:00
Richard Smith d1c4674603 Defer loading any pending update records until we've finished deserializing.
This fixes a bug where an update record causes us to load an entity that refers
to an entity we've not finished loading yet, resulting in badness.

llvm-svn: 207603
2014-04-30 02:24:17 +00:00