summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow dllimport/dllexport on inline functions and adjust the linkage.Hans Wennborg2014-05-151-12/+3
| | | | | | | | This is a step towards handling these attributes on classes (PR11170). Differential Revision: http://reviews.llvm.org/D3772 llvm-svn: 208925
* Rename CodeGenModule::getLLVMLinkageforDeclarator -> getLLVMLinkageForDeclaratorHans Wennborg2014-05-141-3/+3
| | | | | | No functionality change. llvm-svn: 208808
* Update for llvm API change.Rafael Espindola2014-05-131-5/+4
| | | | llvm-svn: 208717
* Pacify bots again - turns out my checkout was slightly polluted when I was ↵James Molloy2014-05-091-1/+1
| | | | | | reverting a olista01s change, and this pollution made it upstream during the revert checkin :/ Sorryemacs -nw lib/CodeGen/CodeGenModule.cpp llvm-svn: 208426
* Revert r208417 (olista01 'ARM: HFAs must be passed in consecutive ↵James Molloy2014-05-091-1/+1
| | | | | | registers'). This is a followon commit from r208413 which broke the LLVM bots. llvm-svn: 208422
* Use auto to avoid duplicating the type.Rafael Espindola2014-05-091-83/+74
| | | | llvm-svn: 208374
* Cleanup setFunctionDefinitionAttributes.Rafael Espindola2014-05-081-10/+5
| | | | | | Use more specific type, update comments and name style. llvm-svn: 208328
* Small simplification: Reduce the use of cast<>.Rafael Espindola2014-05-081-24/+24
| | | | llvm-svn: 208320
* [OPENMP] Initial codegen for '#pragma omp parallel'Alexey Bataev2014-05-061-2/+10
| | | | llvm-svn: 208077
* Fix pr19653.Rafael Espindola2014-05-051-11/+23
| | | | | | Warn if an alias requests a section other than the aliasee section. llvm-svn: 207997
* Small refactoring, no functionality change.Rafael Espindola2014-05-051-3/+4
| | | | llvm-svn: 207991
* XCore target: fix bug in dereferencing null pointer.Robert Lytton2014-05-021-6/+7
| | | | | | Also add basic cpp ABI tests where they differ from C ABI output. llvm-svn: 207834
* XCore target: Add TypeString meta data to IR output.Robert Lytton2014-05-021-0/+4
| | | | | | | This includes the addition of the virtual function: TargetCodeGenInfo::EmitTargetMD() llvm-svn: 207832
* AST: Mangle reference temporaries reliablyDavid Majnemer2014-05-011-1/+2
| | | | | | | | | | | | | | | Summary: Previously, we would generate a single name for all reference temporaries and allow LLVM to rename them for us. Instead, number the reference temporaries as we build them in Sema. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3554 llvm-svn: 207776
* CodeGen: Reference temporaries inherit visibilityDavid Majnemer2014-04-291-0/+3
| | | | | | | Reference temporaries inherited many properties from the variable that they correspond to but visibility wasn't one of them. llvm-svn: 207496
* CodeGen: Fix linkage of reference temporariesDavid Majnemer2014-04-281-85/+94
| | | | | | | | | | | | | | | Summary: A reference temporary should inherit the linkage of the variable it initializes. Otherwise, we may hit cases where a reference temporary wouldn't have the same value in all translation units. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3515 llvm-svn: 207451
* CodeGen: Cleanup variable linkage calculationDavid Majnemer2014-04-251-9/+18
| | | | | | | | | | Almost all linkage calculation for VarDecls occured inside of GetLLVMLinkageVarDefinition except for static data members. Centralize the logic so that it can be more readily reused. No functionality change. llvm-svn: 207241
* CodeGen: Refactor linkage/visibility calculationDavid Majnemer2014-04-251-33/+27
| | | | | | | | | | It turns out that linkage and visibility have rather similar logic for both functions and non-variable globals. Split the calculation out so that both sides may share this code. No functionality change. llvm-svn: 207239
* Remove some empty statementsAlp Toker2014-04-191-1/+1
| | | | | | Cleanup only. llvm-svn: 206709
* CodeGen: Use LLVM's InstrProfReader in -fprofile-instr-use=Justin Bogner2014-04-181-4/+11
| | | | | | | | | Update clang to use the InstrProfReader from LLVM to read instrumentation based profile data. This also switches us from the naive text format to the binary format, since that's what's implemented in the reader. llvm-svn: 206658
* CodeGen: Emit warnings for out of date profile data during PGOJustin Bogner2014-04-151-0/+3
| | | | | | | | | This adds a warning that triggers when profile data doesn't match for the source that's being compiled with -fprofile-instr-use=. This fires only once per translation unit, as warning on every mismatched function would be quite noisy. llvm-svn: 206322
* CodeGen: Move PGO initialization into Release()Justin Bogner2014-04-101-4/+3
| | | | | | | | Emitting the PGO initialization in EmitGlobalFunctionDefinition is inefficient, since this only has an effect once per module. We move this to Release() with the rest of the once-per-module logic. llvm-svn: 205977
* CodeGen: Clean up CommonLinkage calculationDavid Majnemer2014-04-101-10/+35
| | | | | | No functionality change. llvm-svn: 205972
* CodeGen: Emit some functions as weak_odr under -fms-compatibilityDavid Majnemer2014-04-021-3/+2
| | | | | | | | | | | | | | | | | | | Summary: MSVC always emits inline functions marked with the extern storage class specifier. The result is something similar to the opposite of __attribute__((gnu_inline)). This extension is also available in C. This fixes PR19264. Reviewers: rnk, rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3207 llvm-svn: 205485
* Disable this-return optimizations when targeting iOS 5 and earlier.Bob Wilson2014-04-011-1/+6
| | | | | | | | | | | | | | | | Clang implements the part of the ARM ABI saying that certain functions (e.g., constructors and destructors) return "this", but Apple's version of gcc and llvm-gcc did not. The libstdc++ dylib on iOS 5 was built with llvm-gcc, which means that clang cannot safely assume that code from the C++ runtime will correctly follow the ABI. It is also possible to run into this problem when linking with other libraries built with gcc or llvm-gcc. Even though there is no way to reliably detect that situation, it is most likely to come up when targeting older versions of iOS. Disabling the optimization for any code targeting iOS 5 solves the libstdc++ problem and has a reasonably good chance of fixing the issue for other older libraries as well. <rdar://problem/16377159> llvm-svn: 205272
* Implement the 'optnone' attribute, which suppresses most optimizationsPaul Robinson2014-03-311-0/+10
| | | | | | on a function. llvm-svn: 205255
* ARM64: initial clang support commit.Tim Northover2014-03-291-0/+1
| | | | | | | | | | | This adds Clang support for the ARM64 backend. There are definitely still some rough edges, so please bring up any issues you see with this patch. As with the LLVM commit though, we think it'll be more useful for merging with AArch64 from within the tree. llvm-svn: 205100
* CodeGen: Don't crash when replacing functionsDavid Majnemer2014-03-291-5/+7
| | | | | | | | | | | | The peculiarities of C99 create scenario where an LLVM IR function declaration may need to be replaced with a definition baring a different type because the prototype and definition are not required to agree. However, we were not properly deferring this when it occurred. This fixes PR19280. llvm-svn: 205099
* Handle and warn on aliases to weak aliases.Rafael Espindola2014-03-271-1/+29
| | | | | | | This produces valid IR now that llvm rejects aliases to weak aliases and warns the user that the resolution is not changed if the weak alias is overridden. llvm-svn: 204935
* Revert "Update for llvm api change."Rafael Espindola2014-03-261-1/+1
| | | | | | This reverts commit r204783. llvm-svn: 204785
* Update for llvm api change.Rafael Espindola2014-03-261-1/+1
| | | | llvm-svn: 204783
* MS ABI: Eliminate Duplicate StringsDavid Majnemer2014-03-241-18/+60
| | | | | | | | | | | | | | | | | | | | | | | | COFF doesn't have mergeable sections so LLVM/clang's normal tactics for string deduplication will not have any effect. To remedy this we place each string inside it's own section and mark the section as IMAGE_COMDAT_SELECT_ANY. However, we can only do this if the string has an external name that we can generate from it's contents. To be compatible with MSVC, we must use their scheme. Otherwise identical strings in translation units from clang may not be deduplicated with translation units in MSVC. This fixes PR18248. N.B. We will not attempt to do anything with a string literal which is not of type 'char' or 'wchar_t' because their compiler does not support unicode string literals as of this date. Further, we avoid doing this if either -fwritable-strings or -fsanitize=address are present. This reverts commit r204596. llvm-svn: 204675
* Revert r204562,204566,204586,204587 as they broke ASan on WindowsTimur Iskhodzhanov2014-03-241-56/+18
| | | | llvm-svn: 204596
* MS ABI: Add tests, other cleanups for r204562David Majnemer2014-03-241-8/+4
| | | | | | | | | | | | | This commit cleans up a few accidents: - Do not rely on the order in which StringLiteral lays out bytes. - Use a more efficient mechanism for handling so-called "special-mappings" when mangling string literals. - There is no need to allocate a copy of the mangled name. - Add the test written for r204562. Thanks to Richard Smith for pointing these out! llvm-svn: 204586
* MS ABI: Eliminate Duplicate StringsDavid Majnemer2014-03-231-18/+60
| | | | | | | | | | | | | | | | | | | | | COFF doesn't have mergeable sections so LLVM/clang's normal tactics for string deduplication will not have any effect. To remedy this we place each string inside it's own section and mark the section as IMAGE_COMDAT_SELECT_ANY. However, we can only do this if the string has an external name that we can generate from it's contents. To be compatible with MSVC, we must use their scheme. Otherwise identical strings in translation units from clang may not be deduplicated with translation units in MSVC. This fixes PR18248. N.B. We will not attempt to do anything with a string literal which is not of type 'char' or 'wchar_t' because their compiler does not support unicode string literals as of this date. llvm-svn: 204562
* [C++11] Replacing ObjCCategoryDecl iterators propimpl_begin() and ↵Aaron Ballman2014-03-141-4/+1
| | | | | | propimpl_end() with iterator_range property_impls(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203930
* [C++11] Replacing ObjCContainerDecl iterators meth_begin() and meth_end() ↵Aaron Ballman2014-03-131-4/+2
| | | | | | with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203832
* Simplify code. No functionality change.Rafael Espindola2014-03-131-5/+5
| | | | llvm-svn: 203804
* Revert "CodeGen: Use a binary format for instrumentation based profiling"Justin Bogner2014-03-121-10/+3
| | | | | | | | | I've clearly done something wrong with how to get this to link correctly. Reverting for now. This reverts commit r203711. llvm-svn: 203712
* CodeGen: Use a binary format for instrumentation based profilingJustin Bogner2014-03-121-3/+10
| | | | | | | | This updates CodeGenPGO to use the ProfileDataReader introduced to llvm in r203703 and the new API for writing out the profile introduced to compiler-rt in r203710. llvm-svn: 203711
* [C++11] Replacing DeclBase iterators specific_attr_begin() and ↵Aaron Ballman2014-03-101-4/+2
| | | | | | specific_attr_end() with iterator_range specific_attrs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203474
* [C++11] Update Clang for the change to LLVM's Use-Def chain iterators inChandler Carruth2014-03-091-2/+2
| | | | | | | | | r203364: what was use_iterator is now user_iterator, and there is a use_iterator for directly iterating over the uses. This also switches to use the range-based APIs where appropriate. llvm-svn: 203365
* [C++11] Replacing DeclBase iterators decls_begin() and decls_end() with ↵Aaron Ballman2014-03-071-8/+6
| | | | | | iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203278
* Use llvm.compiler.used instead of llvm.used for objc symbols.Rafael Espindola2014-03-061-14/+26
| | | | | | | | | | | | | LLVM currently has a hack (shouldEmitUsedDirectiveFor) that causes it to not print no_dead_strip for symbols starting with 'l' or 'L'. These are exactly the ones that the clang's objc codegen is producing. The net result, is that it is equivalent to llvm.compiler.used. The need for putting the private symbol in llvm.compiler.used should be clear (the objc runtime uses them). The reason for also putting the weak symbols in it is for LTO: ld64 will not ask us to preserve the it. llvm-svn: 203172
* [Modules] Update to reflect the move of CallSite into the IR library inChandler Carruth2014-03-041-1/+1
| | | | | | LLVM r202816. llvm-svn: 202817
* DebugInfo: Emit only the declaration of a class template that has an ↵David Blaikie2014-03-031-1/+9
| | | | | | | | | | | | | | | | | | | | | | | explicit instantiation declaration (& always emit such a type when there's an explicit instantiation definition) We should only have this optimization fire when the explicit instantiation definition would cause at least one member function to be emitted, thus ensuring that even a compiler not performing this optimization would still emit the full type information elsewhere. But we should also pessimize output still by always emitting the definition when the explicit instantiation definition appears so that at some point in the future we can depend on that information even when no code had to be emitted in that TU. (this shouldn't happen very often, since people mostly use explicit spec decl/defs to reduce code size - but perhaps one day they could use it to explicitly reduce debug info size too) This was worth about 2% for Clang and LLVM - so not a huge win, but a win. It looks really great for simple STL programs (include <string> and just declare a string - 14k -> 1.4k of .dwo) llvm-svn: 202769
* Attr: Remove ForceInlineDavid Majnemer2014-02-251-4/+2
| | | | | | | | | | The __forceinline keyword's semantics are now recast as AlwaysInline and the kw___forceinline token has its language mode set for KEYMS. This preserves the semantics of the previous implementation but with less duplication of code. llvm-svn: 202131
* Exposing the noduplicate attribute within Clang, which marks functions so ↵Aaron Ballman2014-02-221-0/+2
| | | | | | | | that the optimizer does not duplicate code. Patch thanks to Marcello Maggioni! llvm-svn: 201941
* DebugInfo: imported_decl/using declarations at namespace scopeDavid Blaikie2014-02-151-1/+4
| | | | llvm-svn: 201470
* XCore target: add section information.Robert Lytton2014-02-111-0/+6
| | | | | | | | Xcore target ABI requires const data that is externally visible to be handled differently if it has C-language linkage rather than C++ language linkage. llvm-svn: 201142
OpenPOWER on IntegriCloud