summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.Jordan Rose2013-03-081-6/+3
| | | | | | No (intended) functionality change. llvm-svn: 176726
* Add support for the OpenCL attribute 'vec_type_hint'.Joey Gouly2013-03-081-0/+17
| | | | | | Patch by Murat Bolat! llvm-svn: 176686
* Change hasAggregateLLVMType, which conflates complex andJohn McCall2013-03-071-31/+39
| | | | | | | | | | | | | | | 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
* Use the actual ABI-determined C calling convention for runtimeJohn McCall2013-02-281-4/+7
| | | | | | | | | | | | | | | | | | | | | | calls and declarations. LLVM has a default CC determined by the target triple. This is not always the actual default CC for the ABI we've been asked to target, and so we sometimes find ourselves annotating all user functions with an explicit calling convention. Since these calling conventions usually agree for the simple set of argument types passed to most runtime functions, using the LLVM-default CC in principle has no effect. However, the LLVM optimizer goes into histrionics if it sees this kind of formal CC mismatch, since it has no concept of CC compatibility. Therefore, if this module happens to define the "runtime" function, or got LTO'ed with such a definition, we can miscompile; so it's quite important to get this right. Defining runtime functions locally is quite common in embedded applications. llvm-svn: 176286
* Prefer 'and' over '&' in comments.David Blaikie2013-02-231-3/+4
| | | | | | Post commit code review feedback from Matt Beaumont-Gay on r174248. llvm-svn: 175969
* Re-apply r174919 - smarter copy/move assignment/construction, with fixes forLang Hames2013-02-171-0/+5
| | | | | | | | | | | bitfield related issues. The original commit broke Takumi's builder. The bug was caused by bitfield sizes being determined by their underlying type, rather than the field info. A similar issue with bitfield alignments showed up on closer testing. Both have been fixed in this patch. llvm-svn: 175389
* Emit virtual/deleting destructors properly with -cxx-abi microsoft, PR15058Timur Iskhodzhanov2013-02-131-2/+3
| | | | llvm-svn: 175045
* Backing out r174919 while I investigate a self-host bug on Takumi's builder.Lang Hames2013-02-121-5/+0
| | | | llvm-svn: 174925
* When generating IR for default copy-constructors, copy-assignment operators,Lang Hames2013-02-111-0/+5
| | | | | | | | | | | | | | | | | | | | move-constructors and move-assignment operators, use memcpy to copy adjacent POD members. Previously, classes with one or more Non-POD members would fall back on element-wise copies for all members, including POD members. This often generated a lot of IR. Without padding metadata, it wasn't often possible for the LLVM optimizers to turn the element-wise copies into a memcpy. This code hasn't yet received any serious tuning. I didn't see any serious regressions on a self-hosted clang build, or any of the nightly tests, but I think it's important to get this out in the wild to get more testing. Insights, feedback and comments welcome. Many thanks to David Blaikie, Richard Smith, and especially John McCall for their help and feedback on this work. llvm-svn: 174919
* Revert r174246, accidentally committed.David Blaikie2013-02-021-1/+0
| | | | | | This reverts commit 1513eb9284c23acfd19cf742b95996fbb11ca741. llvm-svn: 174249
* Sentenc-ify comment added in r174206.David Blaikie2013-02-021-2/+2
| | | | | | Based on post-commit review by Paul Robinson. llvm-svn: 174248
* BasicsDavid Blaikie2013-02-021-0/+1
| | | | llvm-svn: 174246
* Fix exception handling line table problems introduced by r173593David Blaikie2013-02-011-6/+9
| | | | | | | | | | | | | r173593 made us a little too eager to associate all code at the end of a function with the user-written 'return' line. This caused problems with breakpoints as they'd be set in exception handling code preceeding the actual non-exception return handling code, leading to the breakpoint never being hit in non-exceptional execution. This change restores the pre-r173593 exception handling line information where the cleanup code is associated with the '}' not the return line. llvm-svn: 174206
* PR14566: Debug Info: avoid top level lexical blocks in functionsDavid Blaikie2013-01-261-6/+10
| | | | | | | | | | | | | | | 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
* [ubsan] Add support for -fsanitize-blacklistWill Dietz2013-01-181-6/+12
| | | | llvm-svn: 172808
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-4/+4
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-4/+4
| | | | | | | | 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-1/+1
| | | | llvm-svn: 170722
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-201-1/+1
| | | | | | which is wrong here. llvm-svn: 170721
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-1/+1
| | | | | | single attribute in the future. llvm-svn: 170500
* Unbreak the clang build after r169712.Benjamin Kramer2012-12-091-3/+3
| | | | llvm-svn: 169713
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-4/+4
| | | | | | | | | | | | | 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
* Have clang use LLVM IR's fast-math flags when in FastMath or FiniteMathOnly ↵Michael Ilseman2012-12-041-0/+10
| | | | | | modes. Test cases included. llvm-svn: 169191
* remove trailing whitespaceMichael Ilseman2012-12-041-32/+32
| | | | llvm-svn: 169187
* [ubsan] Add flag to enable recovery from checks when possible.Will Dietz2012-12-021-2/+3
| | | | llvm-svn: 169114
* Simplify code. No functionality change.Benjamin Kramer2012-11-151-18/+12
| | | | llvm-svn: 168047
* When evaluating variably modified types for function parameters, dig out theEli Friedman2012-11-141-1/+10
| | | | | | | | | | type as written from the ParmVarDecl; it's unclear whether the standard (C99 6.9.1p10) requires this, but we're following the precedent set by gcc, and hopefully nobody will ever ask about this again. PR9559 / <rdar://problem/12621983>. llvm-svn: 167985
* Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith2012-11-051-4/+7
| | | | | | | checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413
* Simplify: replace getContext().getLangOpts() with just getLangOpts().Richard Smith2012-11-011-5/+5
| | | | llvm-svn: 167261
* Cleanup some clang code to use new type functions instead of using cast<>.Micah Villmow2012-10-251-2/+1
| | | | llvm-svn: 166684
* Switch CodeGenOptions over to a .def file, like we do with LangOptions.Douglas Gregor2012-10-231-1/+1
| | | | llvm-svn: 166497
* Transform pattern:Alexey Samsonov2012-10-161-2/+2
| | | | | | | | | | | if (CGM.getModuleDebugInfo()) DebugInfo = CGM.getModuleDebugInfo() into a call: maybeInitializeDebugInfo(); This is a simplification for a possible future fix of PR13942. llvm-svn: 166019
* At -O0, emit an @llvm.trap() call at the end of a value-returning function whichRichard Smith2012-10-151-0/+2
| | | | | | fails to return a value, to make debugging this issue easier. llvm-svn: 165914
* Have 'addFnAttr' take the attribute enum value. Then have it build the ↵Bill Wendling2012-10-101-2/+2
| | | | | | attribute object and add it appropriately. No functionality change. llvm-svn: 165596
* Tidy up formatting.Richard Smith2012-10-101-2/+1
| | | | llvm-svn: 165584
* -fcatch-undefined-behavior: catch a VLA bound which evalutes to a ↵Richard Smith2012-10-101-1/+18
| | | | | | non-positive value. llvm-svn: 165583
* -fcatch-undefined-behavior: emit calls to the runtime library whenever one ↵Richard Smith2012-10-091-1/+3
| | | | | | of the checks fails. llvm-svn: 165536
* Move TargetData to DataLayout.Micah Villmow2012-10-081-1/+1
| | | | llvm-svn: 165395
* If we flow off the end of a value-returning function:Richard Smith2012-10-041-0/+14
| | | | | | | | - outside C++, return undef (behavior is not undefined unless the value is used) - in C++, with -fcatch-undefined-behavior, perform an appropriate trap - in C++, produce an 'unreachable' (behavior is undefined immediately) llvm-svn: 165273
* Change APInt to APSInt in one instance. Also change a call to operator==() toRichard Trieu2012-07-231-2/+2
| | | | | | APSInt::isSameValue() when comparing different sized APSInt's. llvm-svn: 160641
* Update Clang to reflect the move of MDBuilder in r160237.Chandler Carruth2012-07-151-1/+1
| | | | llvm-svn: 160238
* Add OpenCL metadata for kernel arg names. This output is controlled via a ↵Tanya Lattner2012-07-111-0/+30
| | | | | | | | flag as noted in the OpenCL Spec. Includes a test case. llvm-svn: 160092
* Patch by Anton Lokhmotov to add OpenCL work group size attributes.Tanya Lattner2012-07-091-8/+46
| | | | llvm-svn: 159965
* block literal irgen: several improvements on naming blockFariborz Jahanian2012-06-261-2/+3
| | | | | | | | | | | | literal helper functions. All helper functions (global and locals) use block_invoke as their prefix. Local literal helper names are prefixed by their enclosing mangled function names. Blocks in non-local initializers (e.g. a global variable or a C++11 field) are prefixed by their mangled variable name. The descriminator number added to end of the name starts off with blank (for first block) and _<N> (for the N+2-th block). llvm-svn: 159206
* Documentation cleanup:James Dennett2012-06-151-1/+1
| | | | | | | | * Escaped Objective-C @keywords in Doxygen comments; * Documented more accurate \params; * Exposed some more summaries using \brief. llvm-svn: 158559
* wire -fbounds-checking to the new LLVM bounds checking passNuno Lopes2012-05-221-1/+0
| | | | llvm-svn: 157262
* add -fbounds-checking option.Nuno Lopes2012-05-081-0/+1
| | | | | | | | When enabled, clang generates bounds checks for array and pointers dereferences. Work to follow in LLVM's backend. OK'ed by Chad; thanks for the review. llvm-svn: 156431
* This patch adds a new Clang compiler flag "-gline-tables-only".Alexey Samsonov2012-05-041-1/+2
| | | | | | | | | | | | | | It reduces the amount of emitted debug information: 1) DIEs in .debug_info have types DW_TAG_compile_unit, DW_TAG_subprogram, DW_TAG_inlined_subroutine (for opt builds) and DW_TAG_lexical_block only. 2) .debug_str contains only function names. 3) No debug data for types/namespaces/variables is emitted. 4) The data in .debug_line is enough to produce valid stack traces with function names and line numbers. Reviewed by Eric Christopher. llvm-svn: 156160
* PR12571: Objects of type clang::ConstantArrayType aren't always emitted withRichard Smith2012-04-221-10/+26
| | | | | | | type llvm::ArrayType -- sometimes we emit them as packed structs. Don't assert if such a global array has an element type with a non-trivial destructor. llvm-svn: 155305
* Remove support for -fast-math metadata for the moment.Duncan Sands2012-04-161-4/+0
| | | | llvm-svn: 154851
OpenPOWER on IntegriCloud