aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
AgeCommit message (Collapse)Author
2013-03-05Use ASTContext::getDeclAlign(<Field Decl>) to get the alignment of the firstLang Hames
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> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176512 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-05Don't emit calls to virtual [[noreturn]] functions as noreturn; overrides of aRichard Smith
[[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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176476 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-05Silence a number of static analyzer warnings with assertions and such.Jordan Rose
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176469 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04Fix the emission of the copy-initialization of a block captureJohn McCall
from a lambda capture when the capture is not trivially-copyable. rdar://13295759 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176431 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-03Improve C11 atomics support:David Chisnall
- 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176420 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-02LLVM API changes.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01Restore order to placate test. I had no real reason to switch them.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176328 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01Re-use bit from superclass and extract stuff into a localJohn McCall
function. Serves a patch we're kicking around out-of-tree. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176327 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28Add more of the command line options as attribute flags.Bill Wendling
These can be easily queried by the back-end. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176304 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28Use the actual ABI-determined C calling convention for runtimeJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176286 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28Improve property metadata generation with the GNUstep runtime.David Chisnall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176254 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Better support for constructors with -cxx-abi microsoft, partly fixes PR12784Timur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176186 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Update clang for LLVM API change. No functionality change.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176174 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Use the correct alignment for POD-member memcpys where the first field is aLang Hames
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176163 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Rename methods to comply with the LLVM Coding Standards.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176159 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Move LinkageInfo out of NamedDecl so that it can be used in Type.h.Rafael Espindola
Everything that cares about visibility also cares about linkage, so I just moved it to Visibility.h instead of creating a new .h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176155 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Temporarily revert r176116 for compile-time performance regression.Adrian Prantl
This reverts commit ea95e4587fd13606fbf63b10a07a7d02026aa39c. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Reapply r176133 with testcase fixes.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176145 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26Temporarily revert r176133 until testcases are modified.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176137 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26Don't set the -target-cpu and -target-features attributes just now.Bill Wendling
This is causing some problems with some of the builders. It's non-trivial to reset the target's features. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176133 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26Ensure that DIType is regenerated after we visited an implementation that ↵Adrian Prantl
adds ivars to an interface. Fixes rdar://13175234 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176116 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26Unify clang/llvm attributes for asan/tsan/msan (Clang part)Kostya Serebryany
These are two related changes (one in llvm, one in clang). LLVM: - rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode) - rename thread_safety => sanitize_thread - rename no_uninitialized_checks -> sanitize_memory CLANG: - add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis)) - add __attribute__((no_sanitize_thread)) - add __attribute__((no_sanitize_memory)) for S in address thread memory If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not set llvm attribute sanitize_S git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176076 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-25[ubsan] Emit single check for left shift.Will Dietz
Avoids warning twice on same shift. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176056 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-25Revert "Add more attributes from the command line to functions."Anna Zaks
This reverts commit 176009. The commit is a likely cause of several buildbot failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176044 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-25Add more attributes from the command line to functions.Bill Wendling
This is an ongoing process. Any command line option which a back-end cares about should be added here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176009 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-25Update Clang for a minor DIBuilder breaking change.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176003 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-24PR15338: Don't assert if -fsanitize=bounds sees array indexing on an incompleteRichard Smith
array type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175982 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-24In Sema::InstantiateStaticDataMemberDefinition, pass the var decl to the ↵Argyrios Kyrtzidis
consumer just using ASTConsumer::HandleCXXStaticMemberVarInstantiation(), don't pass it with ASTConsumer::HandleTopLevelDecl. ASTConsumer::HandleTopLevelDecl is intended for user-written top-level decls; a consumer can treat an instantiated static data member however it wants of course. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175976 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-23Prefer 'and' over '&' in comments.David Blaikie
Post commit code review feedback from Matt Beaumont-Gay on r174248. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175969 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-23Add streamed versions of getQualifiedNameAsString.Benjamin Kramer
Move the cold virtual method getNameForDiagnostic out of line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175966 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-23ubsan: Emit bounds checks for array indexing, vector indexing, and (in ↵Richard Smith
really simple cases) pointer arithmetic. This augments the existing bounds checking with language-level array bounds information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175949 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-23Revert r175912, "Add support for coldcc to clang" at John's request.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175936 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22Propagate the split dwarf file information through into the backendEric Christopher
and through to the debug info in the module. In order to make the testcase a bit more efficient allow the filename to go through compilation for compile and not assemble jobs and turn off the extract for cases where we don't create an object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175935 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22Make sure we apply attributes to correct places.Bill Wendling
Some attributes make sense only on the function or on the call site, but not both. Make this distinction here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175918 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22Add support for coldcc to clangPeter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175912 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22[Sema] Semantic analysis for empty-declaration and attribute-declaration.Michael Han
Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these attributes can be sema checked just as attributes attached to "normal" declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175900 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22Streamify getNameForDiagnostic and remove the string versions of ↵Benjamin Kramer
PrintTemplateArgumentList. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175894 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22Apply the 'nobuiltin' attribute to call sites when the user specifies ↵Bill Wendling
`-fno-builtin' on the command line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175836 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21Fix formatting and tabs in file.Eric Christopher
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175815 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21Patch for debug info of qualified-id types is 'id'Fariborz Jahanian
By Adrian Pranti. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175793 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21Add support to Sema and CodeGen for floating point vector types in OpenCL.Joey Gouly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175734 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21objective-C arc IR-gen. Retaining of strongFariborz Jahanian
arguments in function prologue is done with objc_StoreStrong to pair it with similar objc_StoreStrong for release in function epilogue. This is done with -O0 only. // rdar://13145317 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175698 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20Add a new 'type_visibility' attribute to allow users toJohn McCall
control the visibility of a type for the purposes of RTTI and template argument restrictions independently of how visibility propagates to its non-type member declarations. Also fix r175326 to not ignore template argument visibility on a template explicit instantiation when a member has an explicit attribute but the instantiation does not. The type_visibility work is rdar://11880378 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175587 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-19Use the actual class visibility for the ObjC EHTYPE global,John McCall
not the global visibility mode. Noticed by inspection. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-19Temporarily revert r175471 for more review.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175477 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18Add a 'no-builtin' attribute if we do not want to simplify calls.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18CodeGenFunction::CurFuncDecl can be NULL; fix crash introduced in r175386.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175448 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17Re-apply r174919 - smarter copy/move assignment/construction, with fixes forLang Hames
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175389 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17[CodeGen] tighten objc ivar invariant.load attributionSaleem Abdulrasool
An ivar ofset cannot be marked as invariant load in all cases. The ivar offset is a lazily initialised constant, which is dependent on an objc_msgSend invocation to perform a fixup of the offset. If the load is being performed on a method implemented by the class then this load can safely be marked as an inviarant because a message must have been passed to the class at some point, forcing the ivar offset to be resolved. An additional heuristic that can be used to identify an invariant load would be if the ivar offset base is a parameter to an objc method. However, without the parameters available at hand, this is currently not possible. Reviewed-by: John McCall <rjmccall@apple.com> Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175386 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16Emit vtables for an extern template class as available_externally, not asRichard Smith
linkonce_odr. Emit construction vtables as internal in this case, since the ABI does not guarantee that they will be availble externally. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175330 91177308-0d34-0410-b5e6-96231b3b80d8