aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2013-05-06Fix assert if __extension__ or _Generic is used when initializing a char ↵Richard Smith
array from a string literal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181174 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05C++1y: support for increment and decrement in constant expression evaluation.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181173 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05Factor out duplication between lvalue-to-rvalue conversions and variableRichard Smith
assignments in constant expressions. No significant functionality changes (slight improvement to potential constant expression checking). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181170 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05Replace 'MultiExprArg()' with 'None'Dmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181166 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05Make all 'is in extern "C"' tests use the lexical context.Rafael Espindola
I was not able to find a case (other than the fix in r181163) where this makes a difference, but it is a more obviously correct API to have. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181165 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05ArrayRef'ize Sema::CheckObjCMethodCallDmitri Gribenko
Patch by Robert Wilhelm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181164 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05Use lexical contexts when checking for conflicting language linkages.Rafael Espindola
This fixes pr14958. I will audit other calls to isExternCContext to see if there are any similar bugs left. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181163 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05Handle parens properly when initializing a char array from a string literal.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181159 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05ArrayRef'ization of some methods in SemaOverload. Patch by Robert Wilhelm!Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181158 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05Use remove_if to erase parts of a vector. Avoids O(n^2) worst cases.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181150 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef ↵Dmitri Gribenko
constructor from None Patch by Robert Wilhelm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181139 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04Properly parsing __declspec(safebuffers), though there is no semantic ↵Aaron Ballman
hookup. For more information about safebuffers, see MSDN: http://msdn.microsoft.com/en-us/library/dd778695(v=vs.110).aspx git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181123 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04Reverting r181004 since it has broken test/Sema/wchar.c.Aaron Ballman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181122 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04Lex: Fix quadratic behavior when unescaping _Pragma strings.Benjamin Kramer
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181114 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04In VarDecl nodes, store the thread storage class specifier as written.Enea Zaffanella
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181113 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04AArch64: teach Clang about __clear_cache intrinsicTim Northover
libgcc provides a __clear_cache intrinsic on AArch64, much like it does on 32-bit ARM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181111 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04Implement most of N3638 (return type deduction for normal functions).Richard Smith
Missing (somewhat ironically) is support for the new deduction rules in lambda functions, plus PCH support for return type patching. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181108 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04Don't build a call expression referring to a function which we're not allowedRichard Smith
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181107 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04Say 'decltype(auto)' not 'auto' as appropriate in mismatched-deduction ↵Richard Smith
diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181103 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04Implement template support for CapturedStmtWei Pan
- Sema tests added and CodeGen tests are pending Differential Revision: http://llvm-reviews.chandlerc.com/D728 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181101 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04Added a function to check whether a Decl is inSean Callanan
the list of Decls for a given DeclContext. This is useful for LLDB's implementation of FindExternalLexicalDecls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181093 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04Simplify slightly.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181092 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04Separate out and special-case the diagnostic for 'auto' in aRichard Smith
conversion-type-id, in preparation for this becoming valid in c++1y mode. No functionality change; small diagnostic improvement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181089 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04[analyzer;alternate edges] start experimenting with control flow "barriers" ↵Ted Kremenek
to prevent an edge being optimized away. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181088 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04[analyzer;alternate edges] ignore parentheses when determining edge levels.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181087 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04[analyzer; alternate edges] - eliminate unnecessary edges where between ↵Ted Kremenek
parents and subexpressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181086 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04[analyzer; alternate edges] - merge control edges where we descend to a ↵Ted Kremenek
subexpression and pop back out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181085 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04[analyzer; alternate edges] prune edges whose end/begin locations have the ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181084 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04[analyzer;alternate edges] - add in events (loop iterations, etc)Ted Kremenek
These were being dropped due a transcription mistake from the original algorithm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181083 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04[doc parsing]: Make warning about unknown commandFariborz Jahanian
tags off by default for now. Move diagnostic code to DiagnosticCommentKinds.td. // rdar://12381408 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181081 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03ArrayRef'ize MultiLevelTemplateArgumentList::ArgList. Patch by Faisal Vali!Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181077 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03<rdar://problem/13806270> A template argument list is a constant-evaluated ↵Douglas Gregor
context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181076 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Revert r177218.Argyrios Kyrtzidis
Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181073 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03[Doc parsing] Provide diagnostics for unknown documentation Fariborz Jahanian
commands. // rdar://12381408 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181071 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Remove DiagnosticConsumer::clone(), a bad idea that is now unused.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181070 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03When building a module, forward diagnostics to the outer diagnostic consumer.Douglas Gregor
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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181067 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03[Preprocessor] For the MacroExpands preprocessor callback, also pass the ↵Argyrios Kyrtzidis
MacroArgs object that provides information about the argument tokens for a function macro. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181065 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Rename ObjCImplementationDecl::getSuperLoc() -> getSuperClassLoc() for ↵Argyrios Kyrtzidis
consistency with ObjCInterfaceDecl::getSuperClassLoc() git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181064 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Test commitWei Pan
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181057 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Reapply r180982 with repaired logic and an additional testcase.Adrian Prantl
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181056 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Serialization for captured statementsBen Langmuir
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181048 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03PR15906: The body of a lambda is not an evaluated subexpression; don't visit ↵Richard Smith
it when visiting such subexpressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181046 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Move CapturedStmt parameters to CapturedDeclBen Langmuir
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181043 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03[analyzer] Start hacking up alternate control-flow edge generation. WIP. ↵Ted Kremenek
Not guaranteed to do anything useful yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181040 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Keep track of an @implementation's super class name location, if one was ↵Argyrios Kyrtzidis
provided. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181039 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Micro-optimization: check the overloaded operator kind beforeJohn McCall
checking for a lambda. Thanks to Jordan for the pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181031 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03ArrayRef'ize InitializationSequence constructor and ↵Dmitri Gribenko
InitializationSequence::Diagnose() Patch by Robert Wilhelm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181022 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Initialize WarnOnSpellCheck.Rafael Espindola
Clang always calls setWarnOnSpellCheck, but we shouldn't require every client to do so. Issue noticed by Enea Zaffanella. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181021 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Add space between ; and (.Daniel Jasper
Before: for (int i = 0;(i < 10); ++i) {} After: for (int i = 0; (i < 10); ++i) {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181020 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Fix expression recognition in for-loops.Daniel Jasper
Before: for (; a&& b;) {} After: for (; a && b;) {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181017 91177308-0d34-0410-b5e6-96231b3b80d8