summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Remove unneeded #include.Adrian Prantl2015-09-081-1/+0
| | | | llvm-svn: 247081
* Collect SEH captures in a set instead of a vector to avoidJohn McCall2015-09-082-4/+34
| | | | | | | | doing redundant work if a variable is used multiple times. Fixes PR24751. llvm-svn: 247075
* [Static Analyzer] Objective-C Generics Checker improvements.Gabor Horvath2015-09-083-469/+1097
| | | | | | Differential Revision: http://reviews.llvm.org/D12701 llvm-svn: 247071
* Module Debugging: Emit debug type information into clang ObjC modules.Adrian Prantl2015-09-088-10/+141
| | | | | | | | | | When -fmodule-format is set to "obj", emit debug info for all types declared in a module or referenced by a declaration into the module's object file container. This patch adds support for Objective-C types and methods. llvm-svn: 247068
* [modules] Write the options records to a separate subblock rather than writingRichard Smith2015-09-084-166/+209
| | | | | | | | them directly to the control block. These are fairly large, and in a build with lots of modules / chained PCH, we don't need to read most of them. No functionality change intended. llvm-svn: 247055
* [Shave]: add a -MT option to moviCompile if there wasn't oneDouglas Katzman2015-09-082-9/+25
| | | | | | Differential Revision: http://reviews.llvm.org/D12622 llvm-svn: 247052
* Module Debugging: Emit debug type information into clang modules.Adrian Prantl2015-09-084-0/+155
| | | | | | | | | | When -fmodule-format is set to "obj", emit debug info for all types declared in a module or referenced by a declaration into the module's object file container. This patch adds support for C and C++ types. llvm-svn: 247049
* Failing test highlighting no poisoning if dtor undeclared.Naomi Musgrave2015-09-081-0/+15
| | | | | | | | | | | | | | | | | | | | | Summary: If class or struct has not declared a destructor, no destructor is emitted, and members are not poisoned after destruction. This case highlights bug in current implementation of use-after-dtor poisoning (detailed in https://github.com/google/sanitizers/issues/596). Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12616 Only check simplest object for existence of sanitizing callback. Rename test. llvm-svn: 247025
* Fix performance regression when running clang tools.Manuel Klimek2015-09-083-28/+42
| | | | | | | Brings tool start time for a large synthetic test case down from (on my machine) 4 seconds to 0.5 seconds. llvm-svn: 247018
* clang/test/CodeGen/complex-convert.c: Appease for targeting powerpc64-*.NAKAMURA Takumi2015-09-081-0/+2
| | | | llvm-svn: 247015
* findDominatingStoreToReturn in CGCall.cpp didn't check if a candidate storeJakub Kuderski2015-09-082-11/+31
| | | | | | | | | | | | | | instruction used the ReturnValue as pointer operand or value operand. This led to wrong code gen - in later stages (load-store elision code) the found store and its operand would be erased, causing ReturnValue to become a <badref>. The patch adds a check that makes sure that ReturnValue is a pointer operand of store instruction. Regression test is also added. This fixes PR24386. Differential Revision: http://reviews.llvm.org/D12400 llvm-svn: 247003
* Update code owners for AST matchers / libtooling.Manuel Klimek2015-09-081-0/+4
| | | | llvm-svn: 247001
* Fix documentation of numSelectorArgs.Manuel Klimek2015-09-082-1/+4
| | | | | | | | | | | | Currently, the documentation for numSelectorArgs includes an incorrect example. It shows a case where an argument of 1 will match a property getter, but a getter will be matched only when N == 0. This diff corrects the documentation and adds a test for numSelectorArgs(0). Patch by Dave Lee. llvm-svn: 246998
* clangCodeGen: Fix comments. [-Wdocumentation]NAKAMURA Takumi2015-09-083-7/+8
| | | | llvm-svn: 246995
* Fix clang/test/CodeGen/mips-varargs.c for -Asserts, possibly typo.NAKAMURA Takumi2015-09-081-1/+1
| | | | llvm-svn: 246994
* Another fix to this test, this one apparently working byJohn McCall2015-09-081-0/+1
| | | | | | coincidence on all bots. llvm-svn: 246993
* Fix clang/test/CodeGenCXX/alignment.cpp for -Asserts.NAKAMURA Takumi2015-09-081-0/+1
| | | | llvm-svn: 246992
* When building the alloca for a local variable, set its nameJohn McCall2015-09-081-1/+5
| | | | | | | | | | separately from building the instruction so that it's preserved even in -Asserts builds. Employ C++'s mystical "comment" feature to discourage breaking this in the future. llvm-svn: 246991
* Remove unnecessary braces; this resolves against aJohn McCall2015-09-081-2/+2
| | | | | | single-pointer overload instead of the ArrayRef one. llvm-svn: 246988
* Move BlockByrefHelpers back to CodeGenModule.h to placate MSVC.John McCall2015-09-082-29/+30
| | | | llvm-svn: 246986
* Compute and preserve alignment more faithfully in IR-generation.John McCall2015-09-08110-5583/+7234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an Address type to bundle a pointer value with an alignment. Introduce APIs on CGBuilderTy to work with Address values. Change core APIs on CGF/CGM to traffic in Address where appropriate. Require alignments to be non-zero. Update a ton of code to compute and propagate alignment information. As part of this, I've promoted CGBuiltin's EmitPointerWithAlignment helper function to CGF and made use of it in a number of places in the expression emitter. The end result is that we should now be significantly more correct when performing operations on objects that are locally known to be under-aligned. Since alignment is not reliably tracked in the type system, there are inherent limits to this, but at least we are no longer confused by standard operations like derived-to-base conversions and array-to-pointer decay. I've also fixed a large number of bugs where we were applying the complete-object alignment to a pointer instead of the non-virtual alignment, although most of these were hidden by the very conservative approach we took with member alignment. Also, because IRGen now reliably asserts on zero alignments, we should no longer be subject to an absurd but frustrating recurring bug where an incomplete type would report a zero alignment and then we'd naively do a alignmentAtOffset on it and emit code using an alignment equal to the largest power-of-two factor of the offset. We should also now be emitting much more aggressive alignment attributes in the presence of over-alignment. In particular, field access now uses alignmentAtOffset instead of min. Several times in this patch, I had to change the existing code-generation pattern in order to more effectively use the Address APIs. For the most part, this seems to be a strict improvement, like doing pointer arithmetic with GEPs instead of ptrtoint. That said, I've tried very hard to not change semantics, but it is likely that I've failed in a few places, for which I apologize. ABIArgInfo now always carries the assumed alignment of indirect and indirect byval arguments. In order to cut down on what was already a dauntingly large patch, I changed the code to never set align attributes in the IR on non-byval indirect arguments. That is, we still generate code which assumes that indirect arguments have the given alignment, but we don't express this information to the backend except where it's semantically required (i.e. on byvals). This is likely a minor regression for those targets that did provide this information, but it'll be trivial to add it back in a later patch. I partially punted on applying this work to CGBuiltin. Please do not add more uses of the CreateDefaultAligned{Load,Store} APIs; they will be going away eventually. llvm-svn: 246985
* [analyzer] Apply whitespace cleanups by Honggyu Kim.Ted Kremenek2015-09-0885-985/+983
| | | | llvm-svn: 246978
* [X86][SSE4A] Added SSE4A IR + assembly codegen builtin testsSimon Pilgrim2015-09-071-14/+25
| | | | llvm-svn: 246974
* [X86][SSSE3] Added SSSE3 IR + assembly codegen builtin testsSimon Pilgrim2015-09-062-10/+127
| | | | | | Transferred SSSE3 instructions from sse-builtins.c llvm-svn: 246948
* [X86]][SSE3] Added SSE41 IR + assembly codegen builtin testsSimon Pilgrim2015-09-062-162/+433
| | | | | | Transferred SSE41 instructions from sse-builtins.c llvm-svn: 246947
* Refactoring of how ARMTargetInfo handles default target features.Alexandros Lamprineas2015-09-062-33/+39
| | | | | | Differential Revision: http://reviews.llvm.org/D11299 llvm-svn: 246946
* [X86]][SSE3] Added SSE3 IR + assembly codegen builtin testsSimon Pilgrim2015-09-061-0/+85
| | | | llvm-svn: 246945
* [X86]][SSE42] Added SSE42 IR + assembly codegen builtin testsSimon Pilgrim2015-09-061-0/+141
| | | | llvm-svn: 246944
* Index: expose visibility attributeSaleem Abdulrasool2015-09-055-2/+34
| | | | | | | Expose the previously unexposed visibility attribute via the python and C bindings. llvm-svn: 246931
* Fix a bug in __builtin_object_size cast removalGeorge Burgess IV2015-09-042-3/+40
| | | | | | | | | | | Apparently there are many cast kinds that may cause implicit pointer arithmetic to happen. In light of this, the cast ignoring logic introduced in r246877 has been changed to only ignore a small set of cast kinds, and a test for this behavior has been added. Thanks to Richard for catching this before it became a bug report. :) llvm-svn: 246890
* Relax partial-init test case for ARMReid Kleckner2015-09-041-1/+1
| | | | llvm-svn: 246889
* Don't crash on a self-alias declarationHal Finkel2015-09-042-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were crashing in CodeGen given input like this: int self_alias(void) __attribute__((weak, alias("self_alias"))); such a self-alias is invalid, but instead of diagnosing the situation, we'd proceed to produce IR for both the function declaration and the alias. Because we already had a function named 'self_alias', the alias could not be named the same thing, and so LLVM would pick a different name ('self_alias1' for example) for that value. When we later called CodeGenModule::checkAliases, we'd look up the IR value corresponding to the alias name, find the function declaration instead, and then assert in a cast to llvm::GlobalAlias. The easiest way to prevent this is simply to avoid creating the wrongly-named alias value in the first place and issue the diagnostic there (instead of in checkAliases). We detect a related cycle case in CodeGenModule::EmitAliasDefinition already, so this just adds a second such check. Even though the other test cases for this 'alias definition is part of a cycle' diagnostic are in test/Sema/attr-alias-elf.c, I've added a separate regression test for this case. This is because I can't add this check to test/Sema/attr-alias-elf.c without disturbing the other test cases in that file. In order to avoid construction of the bad IR values, this diagnostic is emitted from within CodeGenModule::EmitAliasDefinition (and the relevant declaration is not added to the Aliases vector). The other cycle checks are done within the CodeGenModule::checkAliases function based on the Aliases vector, called from CodeGenModule::Release. However, if there have been errors earlier, HandleTranslationUnit does not call Release, and so checkAliases is never called, and so none of the other diagnostics would be produced. Fixes PR23509. llvm-svn: 246882
* Fix crash on invalid if we can't find a suitable PCH file in a specifiedRichard Smith2015-09-042-3/+9
| | | | | | | directory, and our frontend action cares whether the frontend setup actually succeeded. llvm-svn: 246881
* Don't use unreachable as a placeholder, it confuses EmitBlockReid Kleckner2015-09-042-1/+30
| | | | | | | | | | This fixes an issue raised in D12412, where we generated invalid IR. Thanks to Vedant Kumar for coming up with the initial work around. Differential Revision: http://reviews.llvm.org/D12412 llvm-svn: 246880
* Increase accuracy of __builtin_object_size.George Burgess IV2015-09-042-39/+211
| | | | | | | | | | | | | | | | | | | Improvements: - For all types, we would give up in a case such as: __builtin_object_size((char*)&foo, N); even if we could provide an answer to __builtin_object_size(&foo, N); We now provide the same answer for both of the above examples in all cases. - For type=1|3, we now support subobjects with unknown bases, as long as the designator is valid. Thanks to Richard Smith for the review + design planning. Review: http://reviews.llvm.org/D12169 llvm-svn: 246877
* Don't allow dllexport/import on static local variablesHans Wennborg2015-09-045-16/+17
| | | | | | | | They might technically have external linkage, but it still doesn't make sense for the user to try and export such variables. This matches MSVC's and MinGW's behaviour. llvm-svn: 246864
* Fixing a bug where hasType(decl()) would fail to match on C code involving ↵Aaron Ballman2015-09-043-5/+12
| | | | | | structs or unions. llvm-svn: 246860
* Put ext_implicit_lib_function_decl in ImplicitFunctionDeclare.Ed Schouten2015-09-043-3/+4
| | | | | | | | | | | | | | If we build with -Werror=implicit-function-declaration, only implicit function declarations of non-library functions throw compiler errors. For library functions, we only produce a warning. There is no way to promote both of these cases to an error without promoting other warnings. It makes little sense to introduce an additional compiler flag just to control this specific warning. In my opinion it should just be part of the same group. llvm-svn: 246857
* [OPENMP] Fix false diagnostic on instantiation-dependent exprs for atomic ↵Alexey Bataev2015-09-043-43/+58
| | | | | | | | constructs. Some of instantiation-dependent expressions could cause false diagnostic to be emitted about unsupported atomic constructs. Relaxed rules for detection of incorrect expressions. llvm-svn: 246853
* clang/test/SemaCXX/sourceranges.cpp: Fix silly expressions. Sorry for the ↵NAKAMURA Takumi2015-09-041-3/+3
| | | | | | breakage. llvm-svn: 246850
* clang/test/SemaCXX/sourceranges.cpp: Appease win32. Class method is thiscall ↵NAKAMURA Takumi2015-09-041-2/+2
| | | | | | for targeting i686-(msvc|mingw32). llvm-svn: 246849
* [OPENMP] Fix for http://llvm.org/PR24674: assertion failed and and abort trapAlexey Bataev2015-09-0411-28/+106
| | | | | | Fix processing of shared variables with reference types in OpenMP constructs. Previously, if the variable was not marked in one of the private clauses, the reference to this variable was emitted incorrectly and caused an assertion later. llvm-svn: 246846
* Fix the perentheses location when the constructor is called on a class that ↵Olivier Goffart2015-09-042-3/+19
| | | | | | has a destructor llvm-svn: 246844
* Fix a couple of \param(s) in r246815. [-Wdocumentation]NAKAMURA Takumi2015-09-041-2/+2
| | | | llvm-svn: 246838
* Cleanups, no functionality change.Richard Smith2015-09-041-18/+13
| | | | llvm-svn: 246837
* [X86-64] Allow additional register names in inline assembler.Alexey Bataev2015-09-042-0/+61
| | | | | | | Patch allows to recognize additional registers x8d, x8b, x8w - x15d, x15b, x15w in inline assembler, already recognized by backend Differential Revision: http://reviews.llvm.org/D12594 llvm-svn: 246835
* Fix a potential APInt memory leak when using __attribute__((flag_enum)), andRichard Smith2015-09-044-60/+25
| | | | | | simplify the implementation a bit. llvm-svn: 246830
* Untabify.Eric Christopher2015-09-041-1/+1
| | | | llvm-svn: 246826
* [Static Analyzer] Remove sinks from nullability checks.Gabor Horvath2015-09-032-26/+208
| | | | | | Differential Revision: http://reviews.llvm.org/D12445 llvm-svn: 246818
* Refactored dtor sanitizing into EHScopeStackNaomi Musgrave2015-09-036-59/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Dtor sanitization handled amidst other dtor cleanups, between cleaning bases and fields. Sanitizer call pushed onto stack of cleanup operations. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D12022 Refactoring dtor sanitizing emission order. - Support multiple inheritance by poisoning after member destructors are invoked, and before base class destructors are invoked. - Poison for virtual destructor and virtual bases. - Repress dtor aliasing when sanitizing in dtor. - CFE test for dtor aliasing, and repression of aliasing in dtor code generation. - Poison members on field-by-field basis, with collective poisoning of trivial members when possible. - Check msan flags and existence of fields, before dtor sanitizing, and when determining if aliasing is allowed. - Testing sanitizing bit fields. llvm-svn: 246815
OpenPOWER on IntegriCloud