Commit Graph

45205 Commits

Author SHA1 Message Date
Richard Smith 430c23bb42 Handle parens properly when initializing a char array from a string literal.
llvm-svn: 181159
2013-05-05 16:40:13 +00:00
Richard Smith e54c307bb4 ArrayRef'ization of some methods in SemaOverload. Patch by Robert Wilhelm!
llvm-svn: 181158
2013-05-05 15:51:06 +00:00
Benjamin Kramer 1ce5d80066 Use remove_if to erase parts of a vector. Avoids O(n^2) worst cases.
llvm-svn: 181150
2013-05-05 12:39:28 +00:00
Dmitri Gribenko 010316ce34 ArrayRef<T>() -> None cleanup
llvm-svn: 181140
2013-05-05 01:03:47 +00:00
Dmitri Gribenko 44ebbd5436 Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None
Patch by Robert Wilhelm.

llvm-svn: 181139
2013-05-05 00:41:58 +00:00
Aaron Ballman 444eb6e23c Properly parsing __declspec(safebuffers), though there is no semantic hookup. For more information about safebuffers, see MSDN: http://msdn.microsoft.com/en-us/library/dd778695(v=vs.110).aspx
llvm-svn: 181123
2013-05-04 16:58:37 +00:00
Aaron Ballman d428ff46fe Reverting r181004 since it has broken test/Sema/wchar.c.
llvm-svn: 181122
2013-05-04 16:56:22 +00:00
Enea Zaffanella b2d998f356 Moved pretty printer test for thread local storage in its own file
and specified the triple.

llvm-svn: 181115
2013-05-04 11:26:59 +00:00
Benjamin Kramer c2f5f29b8d Lex: Fix quadratic behavior when unescaping _Pragma strings.
No functionality change.

llvm-svn: 181114
2013-05-04 10:37:20 +00:00
Enea Zaffanella acb8ecd664 In VarDecl nodes, store the thread storage class specifier as written.
llvm-svn: 181113
2013-05-04 08:27:07 +00:00
Tim Northover 8ec8c4bf89 AArch64: teach Clang about __clear_cache intrinsic
libgcc provides a __clear_cache intrinsic on AArch64, much like it
does on 32-bit ARM.

llvm-svn: 181111
2013-05-04 07:15:13 +00:00
Richard Smith fa7a7b4f36 Tweaks to C++ status: add a link to Faisal's generic lambdas implementation,
and mark "clarifying memory allocation" as done, since it turns out that our
optimizations here (such as they are) already conform to the new rules.

llvm-svn: 181110
2013-05-04 07:12:37 +00:00
Richard Smith 452d6b0331 More colours for C++ status page, and mark relaxed constexpr as partially complete.
llvm-svn: 181109
2013-05-04 07:02:10 +00:00
Richard Smith 2a7d481faf Implement most of N3638 (return type deduction for normal functions).
Missing (somewhat ironically) is support for the new deduction rules
in lambda functions, plus PCH support for return type patching.

llvm-svn: 181108
2013-05-04 07:00:32 +00:00
Richard Smith 22262abd78 Don't build a call expression referring to a function which we're not allowed
to use. This makes very little difference right now (other than suppressing
follow-on errors in some cases), but will matter more once we support deduced
return types (we don't want expressions with undeduced return types in the
AST).

llvm-svn: 181107
2013-05-04 06:44:46 +00:00
Richard Smith 489e4e0369 Say 'decltype(auto)' not 'auto' as appropriate in mismatched-deduction diagnostic.
llvm-svn: 181103
2013-05-04 04:19:27 +00:00
Wei Pan 17fbf6edc2 Implement template support for CapturedStmt
- Sema tests added and CodeGen tests are pending

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

llvm-svn: 181101
2013-05-04 03:59:06 +00:00
Sean Callanan 0325fb8576 Added a function to check whether a Decl is in
the list of Decls for a given DeclContext.  This
is useful for LLDB's implementation of
FindExternalLexicalDecls.

llvm-svn: 181093
2013-05-04 02:04:27 +00:00
Richard Smith b875c43307 Simplify slightly.
llvm-svn: 181092
2013-05-04 01:51:08 +00:00
Richard Smith 01518fa77a Separate out and special-case the diagnostic for 'auto' in a
conversion-type-id, in preparation for this becoming valid in c++1y mode.
No functionality change; small diagnostic improvement.

llvm-svn: 181089
2013-05-04 01:26:46 +00:00
Ted Kremenek 7b9b5a2c48 [analyzer;alternate edges] start experimenting with control flow "barriers" to prevent an edge being optimized away.
llvm-svn: 181088
2013-05-04 01:13:22 +00:00
Ted Kremenek 992b3112ce [analyzer;alternate edges] ignore parentheses when determining edge levels.
llvm-svn: 181087
2013-05-04 01:13:12 +00:00
Ted Kremenek bcd6b0d891 [analyzer; alternate edges] - eliminate unnecessary edges where between parents and subexpressions.
llvm-svn: 181086
2013-05-04 01:13:08 +00:00
Ted Kremenek ccb6d1ea0c [analyzer; alternate edges] - merge control edges where we descend to a subexpression and pop back out.
llvm-svn: 181085
2013-05-04 01:13:05 +00:00
Ted Kremenek 6cf3c97c55 [analyzer; alternate edges] prune edges whose end/begin locations have the same statement parents.
This change required some minor changes to LocationContextMap to have it map
from PathPieces to LocationContexts instead of PathDiagnosticCallPieces to
LocationContexts.  These changes are in the other diagnostic
generation logic as well, but are functionally equivalent.

Interestingly, this optimize requires delaying "cleanUpLocation()" until
later; possibly after all edges have been optimized.  This is because
we need PathDiagnosticLocations to refer to the semantic entity (e.g. a statement)
as long as possible.  Raw source locations tell us nothing about
the semantic relationship between two locations in a path.

llvm-svn: 181084
2013-05-04 01:13:01 +00:00
Ted Kremenek 74c0d388e8 [analyzer;alternate edges] - add in events (loop iterations, etc)
These were being dropped due a transcription mistake from the original
algorithm.

llvm-svn: 181083
2013-05-04 01:12:55 +00:00
Fariborz Jahanian 6738e430a9 [doc parsing]: Make warning about unknown command
tags off by default for now. Move diagnostic code
to DiagnosticCommentKinds.td. // rdar://12381408

llvm-svn: 181081
2013-05-04 00:47:28 +00:00
Richard Smith 47752e489e ArrayRef'ize MultiLevelTemplateArgumentList::ArgList. Patch by Faisal Vali!
llvm-svn: 181077
2013-05-03 23:46:09 +00:00
Douglas Gregor b4eadc34e1 <rdar://problem/13806270> A template argument list is a constant-evaluated context.
llvm-svn: 181076
2013-05-03 23:44:54 +00:00
Argyrios Kyrtzidis 56c56d218d Revert r177218.
Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag.

llvm-svn: 181073
2013-05-03 23:20:27 +00:00
Fariborz Jahanian 5b637078e1 [Doc parsing] Provide diagnostics for unknown documentation
commands. // rdar://12381408

llvm-svn: 181071
2013-05-03 23:15:20 +00:00
Douglas Gregor 30071cead9 Remove DiagnosticConsumer::clone(), a bad idea that is now unused.
llvm-svn: 181070
2013-05-03 23:07:45 +00:00
Douglas Gregor 6b930967e8 When building a module, forward diagnostics to the outer diagnostic consumer.
Previously, we would clone the current diagnostic consumer to produce
a new diagnostic consumer to use when building a module. The problem
here is that we end up losing diagnostics for important diagnostic
consumers, such as serialized diagnostics (where we'd end up with two
diagnostic consumers writing the same output file). With forwarding,
the diagnostics from all of the different modules being built get
forwarded to the one serialized-diagnostic consumer and are emitted in
a sane way.

Fixes <rdar://problem/13663996>.

llvm-svn: 181067
2013-05-03 22:58:43 +00:00
Argyrios Kyrtzidis 37e48ff547 [Preprocessor] For the MacroExpands preprocessor callback, also pass the MacroArgs object that provides information about
the argument tokens for a function macro.

llvm-svn: 181065
2013-05-03 22:31:32 +00:00
Argyrios Kyrtzidis 5d2ce840c1 Rename ObjCImplementationDecl::getSuperLoc() -> getSuperClassLoc() for consistency with ObjCInterfaceDecl::getSuperClassLoc()
llvm-svn: 181064
2013-05-03 22:31:26 +00:00
Wei Pan c4c76d1b4f Test commit
llvm-svn: 181057
2013-05-03 21:07:45 +00:00
Adrian Prantl 52bf3c4c3f Reapply r180982 with repaired logic and an additional testcase.
Un-break the gdb buildbot.
- Use the debug location of the return expression for the cleanup code
  if the return expression is trivially evaluatable, regardless of the
  number of stop points in the function.
- Ensure that any EH code in the cleanup still gets the line number of
  the closing } of the lexical scope.
- Added a testcase with EH in the cleanup.

rdar://problem/13442648

llvm-svn: 181056
2013-05-03 20:11:48 +00:00
Ben Langmuir ce914fc84b Serialization for captured statements
Add serialization for captured statements and captured decls.  Also add
a const_capture_iterator to CapturedStmt.

Test contributed by Wei Pan

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

llvm-svn: 181048
2013-05-03 19:20:19 +00:00
Richard Smith fa11fd669f PR15906: The body of a lambda is not an evaluated subexpression; don't visit it when visiting such subexpressions.
llvm-svn: 181046
2013-05-03 19:16:22 +00:00
Ben Langmuir 37943a7af8 Move CapturedStmt parameters to CapturedDecl
Move the creation of CapturedStmt parameters out of CodeGen and into
Sema, making it easier to customize the outlined function. The
ImplicitParamDecls are stored in the CapturedDecl using an
ASTContext-allocated array.

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

llvm-svn: 181043
2013-05-03 19:00:33 +00:00
Douglas Gregor 231ca1c929 Restore Richard's belief in me.
llvm-svn: 181042
2013-05-03 18:51:59 +00:00
Ted Kremenek acf99a1a51 [analyzer] Start hacking up alternate control-flow edge generation. WIP. Not guaranteed to do anything useful yet.
llvm-svn: 181040
2013-05-03 18:25:33 +00:00
Argyrios Kyrtzidis fac3162022 Keep track of an @implementation's super class name location, if one was provided.
llvm-svn: 181039
2013-05-03 18:05:44 +00:00
John McCall 55c0ceecac Micro-optimization: check the overloaded operator kind before
checking for a lambda.

Thanks to Jordan for the pointer.

llvm-svn: 181031
2013-05-03 17:11:14 +00:00
Dmitri Gribenko 8f8930fc01 ArrayRef'ize InitializationSequence constructor and InitializationSequence::Diagnose()
Patch by Robert Wilhelm.

llvm-svn: 181022
2013-05-03 15:05:50 +00:00
Rafael Espindola aabf533656 Initialize WarnOnSpellCheck.
Clang always calls setWarnOnSpellCheck, but we shouldn't require every client to
do so.

Issue noticed by Enea Zaffanella.

llvm-svn: 181021
2013-05-03 15:01:36 +00:00
Daniel Jasper 72463d32e0 Add space between ; and (.
Before: for (int i = 0;(i < 10); ++i) {}
After:  for (int i = 0; (i < 10); ++i) {}
llvm-svn: 181020
2013-05-03 14:50:50 +00:00
Daniel Jasper c37de30219 Fix expression recognition in for-loops.
Before: for (; a&& b;) {}
After:  for (; a && b;) {}
llvm-svn: 181017
2013-05-03 14:41:24 +00:00
Dmitri Gribenko 5267fdfb7f Add const qualifier to Sema::getTypeName's parameter `II`
Patch by Ismail Pazarbasi.

llvm-svn: 181011
2013-05-03 13:12:11 +00:00
Benjamin Kramer 914d7e06b6 Add support for -march=btver2.
llvm-svn: 181006
2013-05-03 10:47:15 +00:00