summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Exploit this-return of a callsite in a this-return function.Manman Ren2013-03-207-12/+64
| | | | | | | | | | | | | | For constructors/desctructors that return 'this', if there exists a callsite that returns 'this' and is immediately before the return instruction, make sure we are using the return value from the callsite. We don't need to keep 'this' alive through the callsite. It also enables optimizations in the backend, such as tail call optimization. Updated from r177211. rdar://12818789 llvm-svn: 177541
* The flag "-coverage-function-names-in-data" is actually backwards -- we doNick Lewycky2013-03-201-2/+1
| | | | | | | | | | emit function names in .gcda files by default, and the flag turns that off! Rename the flag to make it match what it actually does. This keeps the default format compatible with gcc 4.2. Also add a test for this flag. llvm-svn: 177475
* Make clang emit linkage names in debug info for subprograms when coverage infoNick Lewycky2013-03-202-3/+9
| | | | | | | is enabled. Also add a new -test-coverage cc1 flag which makes testing coverage possible and add our first clang-side coverage test. llvm-svn: 177470
* Don't try to set attributes in alias, they have none.Rafael Espindola2013-03-191-1/+3
| | | | llvm-svn: 177402
* Revert r177329.Rafael Espindola2013-03-191-2/+1
| | | | | | | | | If this should not happen, we should have an assert. If it should happen, we should have a test and remove the comment. In no case should we have this self inconsistent code. llvm-svn: 177399
* PR15383: When -fsanitize=float-cast-overflow checks a float-to-int conversion,Richard Smith2013-03-191-8/+24
| | | | | | | | it wasn't taking into account that the float should be truncated *before* the range check happens. Thus (unsigned)-0.99 and (unsigned char)255.9 have defined behavior and should not be trapped. llvm-svn: 177362
* This code works around what appears to be a bug in another part of clang.Reed Kotler2013-03-181-1/+2
| | | | | | | | | | | | I have filed http://llvm.org/bugs/show_bug.cgi?id=15538 against clang. This code is safer anyway because "cast" assumes you really know that it's okay to make the cast. In this case isa should not be false and dyn_cast should not return null as far as I understand. But everything else is valid so I did not want to revert my previous patch for attributes mips16/nomips16 or use an llvm_unreachable here which would make a number of our tests fail for mips. llvm-svn: 177329
* revert r177211 due to its potential issuesManman Ren2013-03-167-49/+12
| | | | llvm-svn: 177222
* Exploit this-return of a callsite in a this-return function.Manman Ren2013-03-167-12/+49
| | | | | | | | | | | | | For constructors/desctructors that return 'this', if there exists a callsite that returns 'this' and is immediately before the return instruction, make sure we are using the return value from the callsite. We don't need to keep 'this' alive through the callsite. It also enables optimizations in the backend, such as tail call optimization. rdar://12818789 llvm-svn: 177211
* Force column info only for direct inlined functions. This should strikeAdrian Prantl2013-03-151-3/+5
| | | | | | | | | | the balance between expected behavior and compatibility with the gdb testsuite. (GDB gets confused if we break an expression into multiple debug stmts so we enable this behavior only for inlined functions. For the full experience people can still use -gcolumn-info.) llvm-svn: 177164
* Always declare the .block_descriptor parameter, not just the local copy.Adrian Prantl2013-03-141-9/+10
| | | | | | Un-breaks gdb's invoke-block behavior. llvm-svn: 177118
* Allocate stack storage for .block_descriptor and captured self at -O0.Adrian Prantl2013-03-144-16/+47
| | | | | | | | | This way the register allocator will not optimize away the debug info for captured variables. Fixes rdar://problem/12767564 llvm-svn: 177086
* Update GCOVProfiling pass creation for API change in r177002. No ↵Nick Lewycky2013-03-141-7/+12
| | | | | | functionality change. llvm-svn: 177004
* Have these attriubtes set to 'true' or 'false'.Bill Wendling2013-03-131-52/+16
| | | | | | | | | The back-end cannot differentiate between functions that are from a .ll file and those generated from the front-end. We cannot then take the non-precense of these attributes as a "false" value. Have the front-end explicitly set the value to 'true' or 'false' depending upon what is actually set. llvm-svn: 176985
* Cause the mips16/nomips16 attribute to be passed to LLVM from ClangReed Kotler2013-03-131-4/+10
| | | | | | in the LLVM assembly language output. llvm-svn: 176971
* Remove trailing comma in enum list.John McCall2013-03-131-1/+1
| | | | llvm-svn: 176926
* Tighten up the rules for precise lifetime and documentJohn McCall2013-03-138-27/+59
| | | | | | | | the requirements on the ARC optimizer. rdar://13407451 llvm-svn: 176924
* Force column info to be generated for call expressions so we canAdrian Prantl2013-03-123-15/+24
| | | | | | | | | differentiate multiple inlined call sites on the same line in the debug info. Fixes rdar://problem/13036237 llvm-svn: 176895
* Improve the caching of debuginfo Objective C interface types.Adrian Prantl2013-03-112-27/+63
| | | | | | | | Generate forward declarations that are RAUW'd by finalize(). We thus avoid outputting the same type several times in multiple stages of completion. llvm-svn: 176820
* Fix indirect byval passing of records in address spaced memory. Allocate ↵Guy Benyei2013-03-101-2/+8
| | | | | | memory on stack, and memcpy the actual value before the call. llvm-svn: 176786
* Make helper function static.Benjamin Kramer2013-03-091-2/+2
| | | | llvm-svn: 176767
* 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-082-0/+20
| | | | | | Patch by Murat Bolat! llvm-svn: 176686
* Promote atomic type sizes up to a power of two, capped byJohn McCall2013-03-079-38/+718
| | | | | | | | MaxAtomicPromoteWidth. Fix a ton of terrible bugs with _Atomic types and (non-intrinsic-mediated) loads and stores thereto. llvm-svn: 176658
* Move the atomics code into its own file.John McCall2013-03-073-463/+486
| | | | llvm-svn: 176657
* Change hasAggregateLLVMType, which conflates complex andJohn McCall2013-03-0719-322/+425
| | | | | | | | | | | | | | | 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
* Evaluate compound literals directly into the result aggregateJohn McCall2013-03-071-4/+2
| | | | | | when that aggregate isn't potentially aliased. llvm-svn: 176654
* Remove temporary std::vectors that ca be replaced with ArrayRef's magic.Benjamin Kramer2013-03-071-11/+7
| | | | llvm-svn: 176653
* Fix build with clang, this was supposed to be part of r176617.Nick Lewycky2013-03-071-3/+3
| | | | llvm-svn: 176619
* Ensure that DIType is regenerated after we visit an implementationAdrian Prantl2013-03-062-6/+68
| | | | | | | | | | that adds ivars to an interface. Fixes rdar://13175234 This is an update to r176116 that performs a smart caching of interfaces. llvm-svn: 176584
* [Sanitize] Don't emit function attribute sanitize_address/thread/memory if ↵Alexey Samsonov2013-03-061-10/+14
| | | | | | the function is blacklisted. llvm-svn: 176550
* Use ASTContext::getDeclAlign(<Field Decl>) to get the alignment of the firstLang Hames2013-03-051-3/+1
| | | | | | | | | | field to be memcpy'd, rather instead of ASTContext::getTypeAlign(<Field Type>). For packed structs the alignment of a field may be less than the alignment of the field's type. <rdar://problem/13338585> llvm-svn: 176512
* Don't emit calls to virtual [[noreturn]] functions as noreturn; overrides of aRichard Smith2013-03-051-1/+4
| | | | | | | | [[noreturn]] function are not required to also be [[noreturn]]. We still emit calls to virtual __attribute__((noreturn)) functions as noreturn; unlike GCC, we do require overriders to also be noreturn for that attribute. llvm-svn: 176476
* Silence a number of static analyzer warnings with assertions and such.Jordan Rose2013-03-051-0/+2
| | | | | | No functionality change. llvm-svn: 176469
* Fix the emission of the copy-initialization of a block captureJohn McCall2013-03-041-2/+10
| | | | | | | | from a lambda capture when the capture is not trivially-copyable. rdar://13295759 llvm-svn: 176431
* Improve C11 atomics support:David Chisnall2013-03-031-7/+89
| | | | | | | | | | | | | | | | | | | | - Generate atomicrmw operations in most of the cases when it's sensible to do so. - Don't crash in several common cases (and hopefully don't crash in more of them). - Add some better tests. We now generate significantly better code for things like: _Atomic(int) x; ... x++; On MIPS, this now generates a 4-instruction ll/sc loop, where previously it generated about 30 instructions in two nested loops. On x86-64, we generate a single lock incl, instead of a lock cmpxchgl loop (one instruction instead of ten). llvm-svn: 176420
* LLVM API changes.Peter Collingbourne2013-03-021-2/+1
| | | | llvm-svn: 176398
* Restore order to placate test. I had no real reason to switch them.John McCall2013-03-011-1/+1
| | | | llvm-svn: 176328
* Re-use bit from superclass and extract stuff into a localJohn McCall2013-03-011-9/+10
| | | | | | function. Serves a patch we're kicking around out-of-tree. llvm-svn: 176327
* Add more of the command line options as attribute flags.Bill Wendling2013-02-281-0/+60
| | | | | | These can be easily queried by the back-end. llvm-svn: 176304
* Use the actual ABI-determined C calling convention for runtimeJohn McCall2013-02-2821-336/+470
| | | | | | | | | | | | | | | | | | | | | | 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
* Improve property metadata generation with the GNUstep runtime.David Chisnall2013-02-281-18/+42
| | | | llvm-svn: 176254
* Better support for constructors with -cxx-abi microsoft, partly fixes PR12784Timur Iskhodzhanov2013-02-278-50/+200
| | | | llvm-svn: 176186
* Update clang for LLVM API change. No functionality change.Nick Lewycky2013-02-271-1/+2
| | | | llvm-svn: 176174
* Use the correct alignment for POD-member memcpys where the first field is aLang Hames2013-02-271-7/+10
| | | | | | | | | | | | bitfield. CGBitField::StorageAlignment holds the alignment in chars, but emitMemcpy had been treating it as if it were held in bits, leading to underaligned memcpys. Related to PR15348. Thanks very much to Chandler for the diagnosis. llvm-svn: 176163
* Rename methods to comply with the LLVM Coding Standards.Rafael Espindola2013-02-271-7/+7
| | | | llvm-svn: 176159
* Move LinkageInfo out of NamedDecl so that it can be used in Type.h.Rafael Espindola2013-02-271-3/+3
| | | | | | | Everything that cares about visibility also cares about linkage, so I just moved it to Visibility.h instead of creating a new .h. llvm-svn: 176155
* Temporarily revert r176116 for compile-time performance regression.Adrian Prantl2013-02-272-32/+2
| | | | | | This reverts commit ea95e4587fd13606fbf63b10a07a7d02026aa39c. llvm-svn: 176151
* Reapply r176133 with testcase fixes.Bill Wendling2013-02-271-13/+0
| | | | llvm-svn: 176145
* Temporarily revert r176133 until testcases are modified.Bill Wendling2013-02-261-0/+13
| | | | llvm-svn: 176137
OpenPOWER on IntegriCloud