summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-051-1/+1
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* Revert r193994 and part of r193995Justin Bogner2013-11-221-2/+4
| | | | | | | | | | | | | Not long ago I made the CodeGen of for loops simplify the condition at -O0 in the same way we do for if and conditionals. Unfortunately this ties how loops and simple conditions work together too tightly, which makes features such as instrumentation based PGO awkward. Ultimately, we should find a more general way to simplify the logic in a given condition, but for now we'll just avoid using EmitBranchOnBool for loops, like we already do for while and do loops. llvm-svn: 195438
* CodeGen: WhitespaceJustin Bogner2013-11-221-3/+3
| | | | llvm-svn: 195437
* CodeGen: Use EmitBranchOnBool when generating For and CXXForRangeJustin Bogner2013-11-041-5/+2
| | | | | | | | | | | | | A while ago EmitForStmt was changed to explicitly evaluate the condition expression and create a branch instead of using EmitBranchOnBool, so that the condition expression could be used for some cleanup logic. The cleanup stuff has since been reorganized, and this is no longer necessary. In EmitCXXForRange, the evaluated condition was never used for anything else. The logic was presumably modeled on EmitForStmt. llvm-svn: 193994
* CodeGen: Move an initialization away from an unrelated commentJustin Bogner2013-11-041-1/+1
| | | | | | | | An initialization somehow found its way in between a comment and the block of code the comment is about. Moving the initialization makes this less confusing. llvm-svn: 193993
* Thread a SourceLocation into the EmitCheck for "load_invalid_value". This occursNick Lewycky2013-10-021-8/+11
| | | | | | when scalars are loaded / undergo lvalue-to-rvalue conversion. llvm-svn: 191808
* Emit an error when attempting to generate IR for SEH __tryReid Kleckner2013-09-161-1/+2
| | | | | | | Currently we silently omit the code in the try and finally bodies, which is pretty bad. This way we fail loudly. llvm-svn: 190809
* OpenMP: Data-sharing attributes analysis and clause 'shared' (fixed test ↵Alexey Bataev2013-09-061-2/+4
| | | | | | threadprivate_messages.cpp) llvm-svn: 190183
* Revert "OpenMP: Data-sharing attributes analysis and clause 'shared'"Rafael Espindola2013-09-031-4/+2
| | | | | | | | This reverts commit r189795. threadprivate_messages.cpp is faling on windows. llvm-svn: 189811
* OpenMP: Data-sharing attributes analysis and clause 'shared'Alexey Bataev2013-09-031-2/+4
| | | | llvm-svn: 189795
* Simplify/clean up debug info suppression in CodeGenFunctionDavid Blaikie2013-08-261-3/+0
| | | | | | | | | | CodeGenFunction is run on only one function - a new object is made for each new function. I would add an assertion/flag to this effect, but there's an exception: ObjC properties involve emitting helper functions that are all emitted by the same CodeGenFunction object, so such a check is not possible/correct. llvm-svn: 189277
* OpenMP: basic support for #pragma omp parallelAlexey Bataev2013-07-191-0/+1
| | | | llvm-svn: 186647
* Use a LexicalScope here since it is one and it will encapsulateEric Christopher2013-07-101-12/+2
| | | | | | the two sets of debug scope and cleanup scope. llvm-svn: 186030
* Remove an ugly hack that was meant to eliminate the breakpoint ambiguityAdrian Prantl2013-06-181-4/+1
| | | | | | | | | | | | | | between a block assignment and the entry of the block function. In reality this wouldn't work anyway because blocks are predominantly created on-the-fly inside of an ObjC method invocation. The proper fix for the ambiguity is to use -gcolumn-info to differentiate the breakpoints. This is expected to break some block-related darwin-gdb tests. rdar://problem/14039866 llvm-svn: 184157
* Simplify: we don't need any special-case lifetime extension when initializingRichard Smith2013-06-121-1/+1
| | | | | | | declarations of reference type; they're handled by the general case handling of MaterializeTemporaryExpr. llvm-svn: 183875
* Make sure we don't emit invalid IR for StmtExprs with complex cleanups.Eli Friedman2013-06-101-10/+21
| | | | | | Fixes <rdar://problem/14074868>. llvm-svn: 183699
* Debug info: An if condition now creates a lexical scope of its own.Adrian Prantl2013-06-081-0/+10
| | | | | | | | | Two variables with the same name declared in two if conditions in the same scope are no longer coalesced into one. rdar://problem/14024005 llvm-svn: 183597
* Diagnose malformed x86 inline asm using 'y' constraint.Tim Northover2013-06-071-3/+12
| | | | | | | | X86's 'y' inline assembly constraint represents an MMX register, this change prevents Clang from hitting an assertion when passed an incompatible type to deal with. llvm-svn: 183467
* CodeGen for CapturedStmtsBen Langmuir2013-05-091-3/+92
| | | | | | | | | | | | | | | | | EmitCapturedStmt creates a captured struct containing all of the captured variables, and then emits a call to the outlined function. This is similar in principle to EmitBlockLiteral. GenerateCapturedFunction actually produces the outlined function. It is based on GenerateBlockFunction, but is much simpler. The function type is determined by the parameters that are in the CapturedDecl. Some changes have been added to this patch that were reviewed as part of the serialization patch and moving the parameters to the captured decl. Differential Revision: http://llvm-reviews.chandlerc.com/D640 llvm-svn: 181536
* The style guide prefers preincrement expressions :-)Adrian Prantl2013-05-071-2/+2
| | | | llvm-svn: 181373
* remove commented out code.Adrian Prantl2013-05-071-2/+1
| | | | llvm-svn: 181372
* Reapply r180982 with repaired logic and an additional testcase.Adrian Prantl2013-05-031-3/+4
| | | | | | | | | | | | | | 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
* Revert "Attempt to un-break the gdb buildbot."Adrian Prantl2013-05-031-4/+3
| | | | | | This reverts commit 180982. llvm-svn: 180990
* Attempt to un-break the gdb buildbot.Adrian Prantl2013-05-031-3/+4
| | | | | | | | | | | | | - 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: 180982
* Move parsing of identifiers in MS-style inline assembly intoJohn McCall2013-05-031-4/+8
| | | | | | | | | | | | | | | | | | | | | 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
* Ensure that the line table for functions with cleanups is sequential.Adrian Prantl2013-05-021-0/+6
| | | | | | | | | | | | | | | | If there is cleanup code, the cleanup code gets the debug location of the closing '}'. The subsequent ret IR-instruction does not get a debug location. The return _expression_ will get the debug location of the return statement. If the function contains only a single, simple return statement, the cleanup code may become the first breakpoint in the function. In this case we set the debug location for the cleanup code to the location of the return statement. rdar://problem/13442648 llvm-svn: 180932
* Standardize accesses to the TargetInfo in IR-gen.John McCall2013-04-161-10/+12
| | | | | | Patch by Stephen Lin! llvm-svn: 179638
* Implement CapturedStmt ASTTareq A. Siraj2013-04-161-1/+7
| | | | | | | | | | | | | | | 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
* Remove useGlobalsForAutomaticVariables.Rafael Espindola2013-03-261-2/+1
| | | | | | It is unused since pic support went away. llvm-svn: 178055
* Make clang to mark static stack allocations with lifetime markers to enable ↵Nadav Rotem2013-03-231-4/+30
| | | | | | | | | a more aggressive stack coloring. Patch by John McCall with help by Shuxin Yang. rdar://13115369 llvm-svn: 177819
* Change hasAggregateLLVMType, which conflates complex andJohn McCall2013-03-071-13/+25
| | | | | | | | | | | | | | | aggregate types in a profoundly wrong way that has to be worked around in every call site, to getEvaluationKind, which classifies and distinguishes between all of these cases. Also, normalize the API for loading and storing complexes. I'm working on a larger patch and wanted to pull these changes out, but it would have be annoying to detangle them from each other. llvm-svn: 176656
* LLVM API changes.Peter Collingbourne2013-03-021-2/+1
| | | | llvm-svn: 176398
* PR14566: Debug Info: avoid top level lexical blocks in functionsDavid Blaikie2013-01-261-0/+6
| | | | | | | | | | | | | | | One of the gotchas (see changes to CodeGenFunction) was due to the fix in r139416 (for PR10829). This only worked previously because the top level lexical block would set the location to the end of the function, the debug location would be updated (as per r139416), the location would be set to the end of the function again (but that would no-op, since it was the same as the previous location), then the return instruction would be emitted using the debug location. Once the top level lexical block was no longer emitted, the end-of-function location change was causing the debug loc to be updated, regressing that bug. llvm-svn: 173593
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-3/+3
| | | | | | | | reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. llvm-svn: 171369
* Rename llvm::Attributes to llvm::Attribute.Bill Wendling2012-12-201-2/+2
| | | | llvm-svn: 170722
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-201-2/+2
| | | | | | which is wrong here. llvm-svn: 170721
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-2/+2
| | | | | | single attribute in the future. llvm-svn: 170500
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-071-1/+1
| | | | | | in the near future. llvm-svn: 169652
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-2/+2
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Handle '*' and '#' asm constraint modifiers.Ulrich Weigand2012-10-291-0/+4
| | | | llvm-svn: 166924
* Add missing safety check to an optimization for do-while loops. PR14191.Eli Friedman2012-10-261-0/+4
| | | | llvm-svn: 166832
* Use the Attributes::get method which takes an AttrVal value directly to ↵Bill Wendling2012-10-161-3/+2
| | | | | | simplify the code a bit. No functionality change. llvm-svn: 166010
* Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling2012-10-151-1/+1
| | | | | | own class named AttrBuilder. No functionality change. llvm-svn: 165961
* Use enum values instead of magic numbers for indexing into the attribute list.Bill Wendling2012-10-151-1/+2
| | | | llvm-svn: 165925
* Attributes RewriteBill Wendling2012-10-151-1/+1
| | | | | | | | Convert the uses of the Attributes class over to the new format. The Attributes::get method call now takes an LLVM context so that the attributes object can be uniquified and stored. llvm-svn: 165918
* Remove the final bits of Attributes being declared in the AttributeBill Wendling2012-10-101-1/+3
| | | | | | | namespace. Use the attribute's enum value instead. No functionality change intended. llvm-svn: 165611
* Move TargetData to DataLayout.Micah Villmow2012-10-081-4/+4
| | | | llvm-svn: 165395
* During jump-scope checking, build an ExprWithCleanups immediatelyJohn McCall2012-09-251-0/+12
| | | | | | | | | | | | into the enclosing scope; this is a more accurate model but is (I believe) unnecessary in my test case due to other flaws. However, one of those flaws is now intentional: blocks which appear in return statements can be trivially observed to not extend in lifetime past the return, and so we can allow a jump past them. Do the necessary magic in IR-generation to make this work. llvm-svn: 164589
* Update for r163231.Chad Rosier2012-09-051-2/+3
| | | | llvm-svn: 163232
* [ms-inline asm] Set the inline assembly dialect in CodeGen.Chad Rosier2012-09-041-1/+3
| | | | llvm-svn: 163178
OpenPOWER on IntegriCloud