summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Stmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* First pass of semantic analysis for init-captures: check the initializer, buildRichard Smith2013-05-161-1/+1
| | | | | | | | | | | | | a FieldDecl from it, and propagate both into the closure type and the LambdaExpr. You can't do much useful with them yet -- you can't use them within the body of the lambda, because we don't have a representation for "the this of the lambda, not the this of the enclosing context". We also don't have support or a representation for a nested capture of an init-capture yet, which was intended to work despite not being allowed by the current standard wording. llvm-svn: 181985
* Implement template support for CapturedStmtWei Pan2013-05-041-4/+6
| | | | | | | | - Sema tests added and CodeGen tests are pending Differential Revision: http://llvm-reviews.chandlerc.com/D728 llvm-svn: 181101
* Serialization for captured statementsBen Langmuir2013-05-031-2/+2
| | | | | | | | | | | 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
* Move parsing of identifiers in MS-style inline assembly intoJohn McCall2013-05-031-14/+27
| | | | | | | | | | | | | | | | | | | | | the actual parser and support arbitrary id-expressions. We're actually basically set up to do arbitrary expressions here if we wanted to. Assembly operands permit things like A::x to be written regardless of language mode, which forces us to embellish the evaluation context logic somewhat. The logic here under template instantiation is incorrect; we need to preserve the fact that an expression was unevaluated. Of course, template instantiation in general is fishy here because we have no way of delaying semantic analysis in the MC parser. It's all just fishy. I've also fixed the serialization of MS asm statements. This commit depends on an LLVM commit. llvm-svn: 180976
* Sema for Captured StatementsTareq A. Siraj2013-04-161-8/+8
| | | | | | | | | | | | | Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic analysis. Currently captures all variables by reference. TODO: templates Author: Ben Langmuir <ben.langmuir@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D433 llvm-svn: 179618
* Implement CapturedStmt ASTTareq A. Siraj2013-04-161-0/+102
| | | | | | | | | | | | | | | CapturedStmt can be used to implement generic function outlining as described in http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html. CapturedStmt is not exposed to the C api. Serialization and template support are pending. Author: Wei Pan <wei.pan@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D370 llvm-svn: 179615
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-081-3/+4
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* ArrayRefize CXXTryStmt.Nico Weber2012-12-291-7/+6
| | | | llvm-svn: 171239
* ArrayRefize a CompoundStmt constructor.Nico Weber2012-12-291-6/+6
| | | | llvm-svn: 171238
* Fix for PR12222.Erik Verbruggen2012-12-251-62/+45
| | | | | | | | Changed getLocStart() and getLocEnd() to be required for Stmts, and make getSourceRange() optional. The default implementation for getSourceRange() is build the range by calling getLocStart() and getLocEnd(). llvm-svn: 171067
* Include pruning and general cleanup.Benjamin Kramer2012-12-011-3/+4
| | | | llvm-svn: 169095
* Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't ↵Benjamin Kramer2012-12-011-0/+10
| | | | | | | | | pull in all the generated Attr code. Required to pull some functions out of line, but this shouldn't have a perf impact. No functionality change. llvm-svn: 169092
* [ms-inline asm] Move some logic around to simplify the interface between theChad Rosier2012-10-161-17/+11
| | | | | | front-end and the AsmParser. No functional change intended. llvm-svn: 166063
* Revert r163083 per chandlerc's request.Joao Matos2012-09-041-11/+0
| | | | llvm-svn: 163149
* [ms-inline asm] Fix an illegal index and an 80-column violation.Chad Rosier2012-09-041-7/+7
| | | | llvm-svn: 163143
* Implemented parsing and AST support for the MS __leave exception statement. ↵Joao Matos2012-09-021-0/+11
| | | | | | Also a minor fix to __except printing in StmtPrinter.cpp. Thanks to Aaron Ballman for review. llvm-svn: 163083
* [ms-inline asm] Have generateAsmString() return the AsmString computed by Sema.Chad Rosier2012-08-281-1/+1
| | | | | | | | We still need to translate the string, but this at least gets us one step closer to using the more general EmitAsmStmt() codegen function. No functional change intended. llvm-svn: 162785
* [ms-inline asm] Add constraints to MSAsmStmt. We don't currently computeChad Rosier2012-08-281-17/+10
| | | | | | | the constraints, so in the interim we speculatively assume a 'r' constraint. This is expected to work for most cases on x86. llvm-svn: 162784
* [ms-inline asm] Use dyn_cast<> here to simplify logic.Chad Rosier2012-08-281-30/+24
| | | | llvm-svn: 162773
* [ms-inline asm] Make the AsmStmt class non-virtual.Chad Rosier2012-08-281-0/+54
| | | | llvm-svn: 162768
* [ms-inline asm] Hoist more common code into the AsmStmt base class. Add stubsChad Rosier2012-08-281-12/+25
| | | | | | with FIXMEs for unimplemented features. No functional change intended. llvm-svn: 162716
* [ms-inline asm] Add virtual function, getClobber, that returns a StringRef.Chad Rosier2012-08-271-0/+4
| | | | | | More work towards unifying asm stmt codegen. llvm-svn: 162712
* [ms-inline asm] Rename GenerateAsmString to generateAsmString to conform withChad Rosier2012-08-271-2/+9
| | | | | | | coding standards. Also, add stub for MSAsmStmt class as part of unifying codegen logic for AsmStmts. llvm-svn: 162696
* [ms-inline asm] Hoist common logic into the AsmStmt base class.Chad Rosier2012-08-271-7/+5
| | | | llvm-svn: 162692
* [ms-inline asm] Add a new base class, AsmStmt, for the GCCAsmStmt and MSAsmStmtChad Rosier2012-08-271-4/+4
| | | | | | classes. llvm-svn: 162691
* [ms-inline asm] As part of a larger refactoring, rename AsmStmt to GCCAsmStmt.Chad Rosier2012-08-251-17/+18
| | | | | | No functional change intended. llvm-svn: 162632
* [ms-inline asm] Refactor code. No functional change intended.Chad Rosier2012-08-241-0/+21
| | | | llvm-svn: 162568
* [ms-inline asm] Add the basic APIs for Exprs to the MSAsmStmt AST. Next we needChad Rosier2012-08-241-2/+23
| | | | | | generate the Input/Output expressions using Sema::ActOnIdExpression(). llvm-svn: 162509
* [ms-inline asm] Remove old cruft now that MS-style asms their own code path.Chad Rosier2012-08-201-4/+3
| | | | llvm-svn: 162210
* [ms-inline asm] Add inputs and outputs to AST. No functional change.Chad Rosier2012-08-161-6/+15
| | | | llvm-svn: 162000
* [ms-inline asm] Add the left brace source location and improve the prettyChad Rosier2012-08-151-2/+3
| | | | | | printer. Patch by Enea Zaffanella <zaffanella@cs.unipr.it>. llvm-svn: 161958
* [ms-inline asm] Remove the last bits of LineEnds.Chad Rosier2012-08-141-8/+3
| | | | llvm-svn: 161904
* [ms-inline asm] Avoid extra allocations by making this an array of StringRefs.Chad Rosier2012-08-101-2/+2
| | | | llvm-svn: 161703
* [ms-inline asm] Fix a memory leak introduced in r161686.Chad Rosier2012-08-101-4/+9
| | | | llvm-svn: 161698
* [ms-inline asm] Add clobbers to AST representation.Chad Rosier2012-08-101-2/+7
| | | | llvm-svn: 161686
* [ms-inline asm] Use StringRef here, per Jordan's suggestion.Chad Rosier2012-08-091-2/+2
| | | | llvm-svn: 161619
* [ms-inline asm] Refactor the logic to generate the AsmString into Sema. NoChad Rosier2012-08-081-2/+7
| | | | | | functional change intended. llvm-svn: 161518
* Add the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.Chad Rosier2012-08-081-2/+3
| | | | llvm-svn: 161503
* Whitespace.Chad Rosier2012-08-071-36/+36
| | | | llvm-svn: 161455
* [ms-inline asm] Stmt destructors are never called, so allocate the AsmToks usingChad Rosier2012-08-071-5/+6
| | | | | | the ASTContext BumpPtr. Also use the preferred llvm::ArrayRef interface. llvm-svn: 161373
* [ms-inline asm] Pass Tokens to Sema and store them in the AST. No functionalChad Rosier2012-08-061-3/+7
| | | | | | change intended. No test case as there's no real way to test at this time. llvm-svn: 161342
* Inline storage of attributes in AttributedStmt.Alexander Kornienko2012-07-091-0/+17
| | | | llvm-svn: 159925
* Split out the "empty" case for compound statement into a separate ctor.Benjamin Kramer2012-07-041-0/+16
| | | | | | Move the ASTContext-dependent version out of line. llvm-svn: 159717
* Etch out the code path for MS-style inline assembly.Chad Rosier2012-06-111-0/+6
| | | | llvm-svn: 158325
* Add an AttributedStmt type to represent a statement with C++11 attributesRichard Smith2012-04-141-2/+4
| | | | | | | | | attached. Since we do not support any attributes which appertain to a statement (yet), testing of this is necessarily quite minimal. Patch by Alexander Kornienko! llvm-svn: 154723
* [AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().Daniel Dunbar2012-03-091-13/+13
| | | | | | | | | - getSourceRange().getBegin() is about as awesome a pattern as .copy().size(). I already killed the hot paths so this doesn't seem to impact performance on my tests-of-the-day, but it is a much more sensible (and shorter) pattern. llvm-svn: 152419
* [AST] Reimplement Stmt::getLoc{Start,End} to dispatch to subclass overloads.Daniel Dunbar2012-03-091-0/+66
| | | | | | | | - getSourceRange() can be very expensive, we should try to avoid it if at all possible. In conjunction with the previous commit I measured a ~2% speedup on 403.gcc/combine.c and a 3% speedup on OmniGroupFrameworks/NSBezierPath-OAExtensions.m. llvm-svn: 152411
* AST/stats: Don't effectively use an out-of-line function to return a staticDaniel Dunbar2012-03-051-5/+3
| | | | | | bool. Ugh. llvm-svn: 152062
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-2/+0
| | | | llvm-svn: 148577
* Extend the Stmt AST to make it easier to look through label, default,Chandler Carruth2011-09-101-0/+16
| | | | | | | | | | | and case statements. Use this to make the logic in the CFG builder more robust at finding the actual statements within a compound statement, even when there are many layers of labels obscuring it. Also extend the test cases for a large chunk of PR10063. Still more work to do here though. llvm-svn: 139437
OpenPOWER on IntegriCloud