summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't produce a L symbol in __DATA,__data.Rafael Espindola2014-03-271-1/+1
| | | | | | The section __DATA,__data is atomized by the linker and cannot have L symbols. llvm-svn: 204879
* Just call getContextDescriptor to get the context for subprogramsEric Christopher2014-03-261-8/+3
| | | | | | | | instead of rolling an inefficient version of the function. This changes some order of emission of metadata nodes, fix up those testcases and make them more flexible to some changes. llvm-svn: 204874
* PR19254: If a thread_local data member of a class is accessed via member accessRichard Smith2014-03-264-19/+21
| | | | | | syntax, don't forget to run its initializer. llvm-svn: 204869
* InstrProf: Use unique_ptrDuncan P. N. Exon Smith2014-03-262-25/+16
| | | | llvm-svn: 204846
* InstrProf: Use referencesDuncan P. N. Exon Smith2014-03-261-54/+52
| | | | llvm-svn: 204845
* Fix atomic libcall.Logan Chien2014-03-261-2/+4
| | | | | | | | This commit fixes a cast instruction assertion failure due to the incompatible type cast. This will only happen when the target requires atomic libcalls. llvm-svn: 204834
* -fms-extensions: Add __va_start builtin, which is used for x64Reid Kleckner2014-03-261-1/+4
| | | | | | | | | | The main difference between __va_start and __builtin_va_start is that the address of the va_list has already been taken, and the va_list is always a char*. __va_end and __va_arg are not needed. llvm-svn: 204821
* Add support for __builtin___clear_cache in ClangRenato Golin2014-03-261-0/+6
| | | | | | Adding the mapping between __builtin___clear_cache into @llvm.clear_cache llvm-svn: 204820
* 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
* [PGO] Add simplified branch weights for Objective-C for-collection loops.Bob Wilson2014-03-251-8/+11
| | | | | | | | | | | | | Conceptually one of these loops is just a while-loop, but the actual code-gen is more complicated. We don't instrument all the different control flow edges to get accurate counts for each conditional branch, nor do I think it makes sense to do so. Instead, make the simplifying assumption that the loop behaves like a while-loop. Use the same branch weights for the first check for an empty collection as would be used for the back-edge of a while loop, and use that same weighting for the innermost loop, ignoring the possibility that there may be some extra code to go fetch more elements. llvm-svn: 204767
* Proper handling of static local variables with address space qualifiers.Eli Bendersky2014-03-242-11/+17
| | | | | | | | Similar to the implementation for globals in r157167. Patch by Jingyue Wu. llvm-svn: 204677
* MS ABI: Eliminate Duplicate StringsDavid Majnemer2014-03-242-19/+64
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix a compile-time warningTimur Iskhodzhanov2014-03-241-4/+0
| | | | | | lib/CodeGen/CGBuiltin.cpp:3136:12: warning: variable ‘TblPos’ set but not used [-Wunused-but-set-variable] llvm-svn: 204599
* Revert r204562,204566,204586,204587 as they broke ASan on WindowsTimur Iskhodzhanov2014-03-242-60/+19
| | | | 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
* Cleanup dead assignments reported by scan-buildArnaud A. de Grandmaison2014-03-231-4/+0
| | | | llvm-svn: 204569
* MS ABI: Eliminate Duplicate StringsDavid Majnemer2014-03-232-19/+64
| | | | | | | | | | | | | | | | | | | | | 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
* CGDebugInfo: At the end of EmitFunctionStart, Initialize PrevLoc to theAdrian Prantl2014-03-211-1/+4
| | | | | | | | location that the next call emitLocation() would default to. Otherwise setLocation() may wrongly believe that the current source file didn't change, when in fact it did. llvm-svn: 204517
* PGO: Don't define instrumentation data available_externallyDuncan P. N. Exon Smith2014-03-201-0/+15
| | | | | | | | | | | | | | | Variables with available_externally linkage can be dropped at will. This causes link errors, since there are still references to the instrumentation! linkonce_odr is almost equivalent, so use that instead. As a drive-by fix (I don't have an Elf system, so I'm not sure how to write a testcase), use linkonce linkage for the instrumentation of extern_weak functions. <rdar://problem/15943240> llvm-svn: 204408
* PGO: Rename FuncLinkage to VarLinkage; no functionality changeDuncan P. N. Exon Smith2014-03-202-5/+5
| | | | | | | | | The variable is used to set the linkage for variables, and will become different from function linkage in a follow-up commit. <rdar://problem/15943240> llvm-svn: 204407
* PGO: Change runtime prefix from pgo to profileDuncan P. N. Exon Smith2014-03-202-9/+9
| | | | | | | | | | | These functions are in the profile runtime. PGO comes later. Unfortunately, there's only room for 16 characters in a Darwin section, so use __llvm_prf_ instead of __llvm_profile_ for section names. <rdar://problem/15943240> llvm-svn: 204390
* PGO: Remove explicit static initializationDuncan P. N. Exon Smith2014-03-201-16/+3
| | | | | | | | | | | | | | Remove the remaining explicit static initialization from translation units, at least on Darwin. Instead, create a use of __llvm_pgo_runtime, which will pull in required code from compiler-rt. After this commit (and its pair in compiler-rt), a user can define their own __llvm_pgo_runtime to satisfy this undefined symbol and call the functions in compiler-rt directly. <rdar://problem/15943240> llvm-svn: 204379
* Use nullptr; no functionality changeDuncan P. N. Exon Smith2014-03-201-7/+7
| | | | llvm-svn: 204372
* Kill -faddress-sanitizer, -fthread-sanitizer and -fcatch-undefined-behavior ↵Alexey Samsonov2014-03-201-1/+1
| | | | | | | | | flags. These flags are deprecated since at least Clang 3.3. Users should instead use -fsanitize= with appropriate values. llvm-svn: 204330
* PGO: use linker magic to find instrumentation data on DarwinDuncan P. N. Exon Smith2014-03-201-3/+8
| | | | | | <rdar://problem/15943240> llvm-svn: 204301
* PGO: Separate out common isMachO logic; no functionality changeDuncan P. N. Exon Smith2014-03-201-12/+7
| | | | | | <rdar://problem/15943240> llvm-svn: 204297
* CodeGen: Include a function hash in instrumentation based profilingJustin Bogner2014-03-182-13/+29
| | | | | | | | | The hash itself is still the number of counters, which isn't all that useful, but this separates the API changes from the actual implementation of the hash and will make it easier to transition to the ProfileData library once it's implemented. llvm-svn: 204186
* PGO: Switch to isOSBinFormatMachO()Duncan P. N. Exon Smith2014-03-181-3/+3
| | | | llvm-svn: 204098
* PGO: Statically generate data structuresDuncan P. N. Exon Smith2014-03-175-95/+164
| | | | | | | | | | | | | | | | | | | In instrumentation-based profiling, we need a set of data structures to represent the counters. Previously, these were built up during static initialization. Now, they're shoved into a specially-named section so that they show up as an array. As a consequence of the reorganizing symbols, instrumentation data structures for linkonce functions are now correctly coalesced. This is the first step in a larger project to minimize runtime overhead and dependencies in instrumentation-based profilng. The larger picture includes removing all initialization overhead and making the dependency on libc optional. <rdar://problem/15943240> llvm-svn: 204080
* [C++11] Replacing CGFunctionInfo arg iterators with iterator_range ↵Aaron Ballman2014-03-172-49/+35
| | | | | | arguments(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204068
* [C++11] Replacing CallArgList writeback iterators with iterator_range ↵Aaron Ballman2014-03-172-6/+8
| | | | | | writebacks(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions. llvm-svn: 204062
* [C++11] Replacing CompoundStmt iterators body_begin() and body_end() with ↵Aaron Ballman2014-03-173-12/+7
| | | | | | iterator_range body(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204040
* [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with ↵Aaron Ballman2014-03-144-60/+45
| | | | | | iterator_range captures(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203958
* Fix PR19104: Incorrect handling of non-virtual calls of virtual methodsTimur Iskhodzhanov2014-03-144-96/+83
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D3054 llvm-svn: 203949
* [C++11] Replacing DeclStmt iterators decl_begin() and decl_end() with ↵Aaron Ballman2014-03-142-7/+5
| | | | | | iterator_range decls(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203947
* [C++11] Replacing FunctionTemplateDecl iterators spec_begin() and spec_end() ↵Aaron Ballman2014-03-141-4/+2
| | | | | | with iterator_range specializations(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203938
* Objective-C++ IRGen. Due to change to AST for initialization of c++11’s Fariborz Jahanian2014-03-141-1/+4
| | | | | | | | data members by addition of CXXDefaultInitExpr node to the initializer expression, it has broken treatment of arc code for such initializations. Reviewed by John McCall. // rdar://16299964 llvm-svn: 203935
* [C++11] Replacing ObjCCategoryDecl iterators propimpl_begin() and ↵Aaron Ballman2014-03-143-17/+5
| | | | | | 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 ObjCCategoryDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-141-4/+2
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203922
* AArch64_be varargs processing for ARM ABIChristian Pirker2014-03-141-4/+33
| | | | llvm-svn: 203917
* [C++11] Replacing ObjCProtocolDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-132-6/+4
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203863
* [C++11] Replacing ObjCInterfaceDecl iterators ↵Aaron Ballman2014-03-131-5/+2
| | | | | | all_referenced_protocol_begin() and all_referenced_protocol_end() with iterator_range all_referenced_protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203848
* [C++11] Replacing ObjCInterfaceDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-131-6/+2
| | | | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. Drive-by fixing some incorrect types where a for loop would be improperly using ObjCInterfaceDecl::protocol_iterator. No functional changes in these cases. llvm-svn: 203842
* [C++11] Replacing ObjCContainerDecl iterators classmeth_begin() and ↵Aaron Ballman2014-03-132-39/+21
| | | | | | classmeth_end() with iterator_range class_methods(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203840
* [C++11] Replacing ObjCContainerDecl iterators instmeth_begin() and ↵Aaron Ballman2014-03-132-38/+24
| | | | | | instmeth_end() with iterator_range instance_methods(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203839
* CodeGen: use symbolic enumerators for memory orderTim Northover2014-03-131-5/+10
| | | | | | | It makes the code clearer and less error-prone to use our (already known) special values for the various memory order cases. llvm-svn: 203838
* CodeGen: make use of weaker failure orders on cmpxchg.Tim Northover2014-03-131-67/+151
| | | | | | | | | | | | This makes Clang take advantage of the recent IR addition of a "failure" memory ordering requirement. As with the "success" ordering, we try to emit just a single version if the expression is constant, but fall back to runtime detection (to allow optimisation across function-call boundaries). rdar://problem/15996804 llvm-svn: 203837
* Renaming the recently-created (r203830) props() range API to properties() ↵Aaron Ballman2014-03-133-4/+4
| | | | | | for clarity. llvm-svn: 203835
* [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
OpenPOWER on IntegriCloud