summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement section pragma feedback on r205810Reid Kleckner2015-03-043-8/+26
| | | | | | | Mostly short-circuits some conditionals. Adds target validation of sections passed to these pragmas. llvm-svn: 231317
* [analyzer] Bug fix: do not report leaks for alloca()Anton Yartsev2015-03-041-0/+5
| | | | llvm-svn: 231314
* Pass -dll to link.exe when building with -shared (PR22697)Hans Wennborg2015-03-041-1/+3
| | | | | | And start building a test for non-clang-cl link.exe invocations. llvm-svn: 231312
* Add Clang support for PPC cryptography builtinsNemanja Ivanovic2015-03-043-1/+175
| | | | | | Review: http://reviews.llvm.org/D7951 llvm-svn: 231291
* Fix test/CodeGen/builtins.c for platforms that don't lower sjljReid Kleckner2015-03-041-0/+4
| | | | | | | | Opt in Win64 to supporting sjlj lowering. We have the backend lowering, so I think this was just an oversight because WinX86_64TargetCodeGenInfo doesn't inherit from X86_64TargetCodeGenInfo. llvm-svn: 231280
* Try to fix the build after removing DataLayoutPassReid Kleckner2015-03-041-3/+0
| | | | llvm-svn: 231278
* [analyzer] Individual configuration options can be specified for checkers.Gabor Horvath2015-03-043-38/+71
| | | | | | | | | | Reviewed by: Anna Zaks Original patch by: Aleksei Sidorin Differential Revision: http://reviews.llvm.org/D7905 llvm-svn: 231266
* New ObjC warning: circular containers.Alex Denisov2015-03-043-2/+329
| | | | | | | | | | | | | | | | | | | | | This commit adds new warning to prevent user from creating 'circular containers'. Mutable collections from NSFoundation allows user to add collection to itself, e.g.: NSMutableArray *a = [NSMutableArray new]; [a addObject:a]; The code above leads to really weird behaviour (crashes, 'endless' recursion) and retain cycles (collection retains itself) if ARC enabled. Patch checks the following collections: - NSMutableArray, - NSMutableDictionary, - NSMutableSet, - NSMutableOrderedSet, - NSCountedSet. llvm-svn: 231265
* [Modules] Fix crash in Preprocessor::getLastMacroWithSpelling().Argyrios Kyrtzidis2015-03-041-3/+3
| | | | | | Macro names that got undefined inside a module may not have their MacroInfo set. llvm-svn: 231251
* Adjust the changes from r230255 to bail out if the backend can't lowerJoerg Sonnenberger2015-03-042-7/+11
| | | | | | | __builtin_setjmp/__builtin_longjmp and don't fall back to the libc functions. llvm-svn: 231245
* Move one more diagnostic into the new -Wformat-pedantic group.Daniel Jasper2015-03-041-8/+10
| | | | | | This was apparently overlooked in r231211. llvm-svn: 231242
* AT.isValid() should come before AT.matchesType()Seth Cantrell2015-03-041-30/+36
| | | | llvm-svn: 231213
* Add a format warning for "%p" with non-void* argsSeth Cantrell2015-03-042-68/+86
| | | | | | | | | | | | | | | | | | GCC -pedantic produces a format warning when the "%p" specifier is used with arguments that are not void*. It's useful for portability to be able to catch such warnings with clang as well. The warning is off by default in both gcc and with this patch. This patch enables it either when extensions are disabled with -pedantic, or with the specific flag -Wformat-pedantic. The C99 and C11 specs do appear to require arguments corresponding to 'p' specifiers to be void*: "If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined." [7.19.6.1 p9], and of the 'p' format specifier "The argument shall be a pointer to void." [7.19.6.1 p8] Both printf and scanf format checking are covered. llvm-svn: 231211
* TypePrinter print __restrict if not in C99 modeJacques Pienaar2015-03-031-6/+10
| | | | | | | | | | | | | | restrict is a keyword in C99 but not in C++ while clang accepts __restrict for C++ code. Modify the TypePrinter to print __restrict when not processing C99 code. Printing restrict in C++ was problematic as printing the argument of int f(int * __restrict a) { ... } resulted in int *restrict a which is incorrect. http://reviews.llvm.org/D8048 llvm-svn: 231179
* [analyzer] unix.Malloc: preserve AllocaRegion bound to __builtin_alloca().Anton Yartsev2015-03-031-13/+17
| | | | | | Binding __builtin_alloca() return value to the symbolic value kills previous binding to a AllocaRegion established by the core.BuiltinFunctions checker. Other checkers may rely upon this information. Rollback handling of __builtin_alloca() to the way prior to r229850. llvm-svn: 231160
* [UBSan] Split -fsanitize=shift into -fsanitize=shift-base and ↵Alexey Samsonov2015-03-031-28/+32
| | | | | | | | | | | | | | | | | | | | | -fsanitize=shift-exponent. -fsanitize=shift is now a group that includes both these checks, so exisiting users should not be affected. This change introduces two new UBSan kinds that sanitize only left-hand side and right-hand side of shift operation. In practice, invalid exponent value (negative or too large) tends to cause more portability problems, including inconsistencies between different compilers, crashes and inadequeate results on non-x86 architectures etc. That is, -fsanitize=shift-exponent failures should generally be addressed first. As a bonus, this change simplifies CodeGen implementation for emitting left shift (separate checks for base and exponent are now merged by the existing generic logic in EmitCheck()), and LLVM IR for these checks (the number of basic blocks is reduced). llvm-svn: 231150
* [Sanitizers] Use uint64_t for bitmask of enabled sanitizers.Alexey Samsonov2015-03-031-40/+40
| | | | | | | The total number of sanitizers and sanitizer groups will soon reach 32. llvm-svn: 231149
* Fix program name in "clang -help"Sumanth Gundapaneni2015-03-031-1/+1
| | | | | | | | | | | | | | | | | With out this patch, "clang -help" prints "USAGE: clang-3 [options] <inputs>". It should either print USAGE: clang [options] <inputs> or USAGE: clang-3.7 [options] <inputs> With this patch, on Linux, it prints USAGE: clang-3.7 [options] <inputs> On Windows, it prints USAGE: clang.exe [options] <inputs> llvm-svn: 231124
* [PowerPC]Activate "vector bool long long" (and alternate spellings) as a ↵Bill Seurer2015-03-031-2/+7
| | | | | | | | | | | | valid type for Altivec support for Power. There are two test case updates for very basic testing. While I was editing cxx-altivec.cpp I also updated it to better match some other changes in altivec.c. Note: "vector bool long" was not also added because its use is considered deprecated. http://reviews.llvm.org/D7235 llvm-svn: 231118
* Split catch IRgen into ItaniumCXXABI and MicrosoftCXXABIReid Kleckner2015-03-036-381/+434
| | | | | | | | | Use llvm.eh.begincatch for Microsoft-style catches. This moves lots of CGException code into ItaniumCXXABI. Sorry for the blame pain. llvm-svn: 231105
* Support __attribute__((availability)) on Android.Dan Albert2015-03-031-1/+6
| | | | | | | | | | | | Reviewers: srhines Reviewed By: srhines Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7929 llvm-svn: 231092
* Don't force -pie for Android.Dan Albert2015-03-031-5/+1
| | | | | | | | | | | | | | | | | | | Summary: There is no -no-pie flag that can override this, so making it default to being on for Android means it is no longer possible to create non-PIE executables on Android. While current versions of Android support (and the most recent requires) PIE, ICS and earlier versions of Android cannot run PIE executables, so this needs to be optional. Reviewers: srhines Reviewed By: srhines Subscribers: thakis, volkalexey, cfe-commits Differential Revision: http://reviews.llvm.org/D8015 llvm-svn: 231091
* Lower _mm256_broadcastsi128_si256 directly to a vector shuffle.Juergen Ributzka2015-03-032-8/+1
| | | | | | | | | | | | | | Originally we were using the same GCC builtins to lower this AVX2 vector intrinsic. Instead we will now lower it directly to a vector shuffle. This will not only allow LLVM to generate better code, but it will also allow us to remove the GCC intrinsics. Reviewed by Andrea This is related to rdar://problem/18742778. llvm-svn: 231081
* [SDK modernizer]. Patch fixes driver's lack ofFariborz Jahanian2015-03-031-0/+1
| | | | | | | recognition of mernizer's -objcmt-migrate-property-dot-syntax option with a new test in test/Driver. rdar://19994452 llvm-svn: 231080
* Make -Wuninitialized warn on pointer-to-member and comma operators.Manuel Klimek2015-03-032-12/+50
| | | | | | | | | | | `isTrackedVar` has been updated to also track records. `DeclRefExpr`s appearing on the left side of a comma operator are ignored, while those appearing on the right side are classified as `Use`. Patch by Enrico Pertoso. llvm-svn: 231068
* Make sure we initialize all values in WhitespaceManager::Change.Manuel Klimek2015-03-031-2/+3
| | | | llvm-svn: 231067
* clang-format: Fix access to uninitialized memory.Daniel Jasper2015-03-031-0/+1
| | | | | | | | | With incomplete code, we aren't guaranteed to generated changes for every token. In that case, we need to assume that even the very first change can continue a preprocessor directive and initialize values accordingly. llvm-svn: 231066
* Revert r231008 (and dependent r231019).Daniel Jasper2015-03-031-1/+0
| | | | | | | | | As Chandler responded on the initial commit, just directly setting the triple through -Xclang option to the driver creates havoc on other platforms. The driver test should specifically go into test/Driver and test the cc1 commandline itself. llvm-svn: 231063
* [ASTUnit] Fix crash when trying to load a module file via ↵Argyrios Kyrtzidis2015-03-031-5/+7
| | | | | | | | ASTUnit::LoadFromASTFile. rdar://19997358 llvm-svn: 231060
* Sema: Caught exception objects should be unqualifiedDavid Majnemer2015-03-031-1/+1
| | | | | | | | The exception object should be unqualified. Using a qualified exception object results in the wrong copy constructor getting called when the catch handler executes. llvm-svn: 231054
* Sema: Properly initialize the thrown exception objectDavid Majnemer2015-03-032-21/+19
| | | | | | | We would create the exception object with the wrong qualifiers, ensuring that the wrong copy constructor would get called. llvm-svn: 231049
* [SDK modernizer] Patch to fix type of the typed enums whenFariborz Jahanian2015-03-021-3/+3
| | | | | | migrating to NS_ENUM typedef. rdar://19994496 llvm-svn: 231036
* [SDK modernizer]. Patch fixes driver's lack ofFariborz Jahanian2015-03-021-0/+1
| | | | | | | recognition of mernizer's -objcmt-migrate-property-dot-syntax option. rdar://19994452 llvm-svn: 231008
* Add clang support for Objective-C application extensions.Bob Wilson2015-03-024-8/+34
| | | | | | | | This adds the -fapplication-extension option, along with the ios_app_extension and macosx_app_extension availability attributes. Patch by Ted Kremenek llvm-svn: 230989
* CodeGen: Fix passing of classes with only one AVX vector member in AVX registersBenjamin Kramer2015-03-021-15/+4
| | | | | | | | | | | | | | isSingleElementStruct was a bit too tight in its definition of struct so we got a mismatch between classify() and the actual code generation. To make matters worse the code in GetByteVectorType still defaulted to <2 x double> if it encountered a type it didn't know, making this a silent miscompilation (PR22753). Completely remove the "preferred type" stuff from GetByteVectorType and make it fail an assertion if someone tries to use it with a type not suitable for a vector register. llvm-svn: 230971
* Replace loop with equivalent ArrayRef function. NFC.Benjamin Kramer2015-03-021-6/+1
| | | | llvm-svn: 230949
* clang-format: Prefer wrapping a lambda's body over the lambda's return type.Daniel Jasper2015-03-021-0/+2
| | | | | | | | | | | | | | | Before: aaaaaaaaaaaaaaaaaaaaaa( [](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa) -> aaaaaaaaaaaaaaaaaaaaa { return aaaaaaaaaaaaaaaaa; }); After: aaaaaaaaaaaaaaaaaaaaaa( [](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa) -> aaaaaaaaaaaaaaaaaaaaa { return aaaaaaaaaaaaaaaaa; }); llvm-svn: 230942
* Fix ObjCInterfaceDecl::getCategoryMethod() and give it a caller. No behavior ↵Nico Weber2015-03-021-2/+1
| | | | | | change. llvm-svn: 230928
* DebugInfo: Give externally defined types a size and alignment wherePeter Collingbourne2015-03-011-1/+9
| | | | | | possible. Fixes PR22736. llvm-svn: 230914
* Add missing include.Benjamin Kramer2015-03-013-0/+3
| | | | llvm-svn: 230910
* clang-format: Always align */& in multi-var DeclStmts.Daniel Jasper2015-03-012-6/+15
| | | | | | | | Seems like the most consistent thing to do and in multi-var DeclStmts, it is especially important to point out that the */& bind to the identifier. llvm-svn: 230903
* Sema: Remove stray staticBenjamin Kramer2015-03-011-1/+1
| | | | | | | This is a real bug if the code path is ever used with different pointer sizes in the same process. llvm-svn: 230893
* [modules] Avoid adding a redecl chain to the 'pending out of date' list as theRichard Smith2015-02-281-4/+34
| | | | | | very first step in updating it. llvm-svn: 230840
* Give better diagnostics when -fmodule-file= finds a bad file: if the file isRichard Smith2015-02-281-3/+13
| | | | | | | found indirectly, explain how we got there, and distinguish between 'file not found' and 'file found but invalid'. llvm-svn: 230839
* [modules] Deduplicate when merging lists of template specializations from ↵Richard Smith2015-02-281-8/+8
| | | | | | imported modules. llvm-svn: 230834
* Rework our handling of key functions. We used to track a complete list of allRichard Smith2015-02-286-71/+29
| | | | | | | | | | | | | | dynamic classes in the translation unit and check whether each one's key function is defined when we got to the end of the TU (and when we got to the end of each module). This is really terrible for modules performance, since it causes unnecessary deserialization of every dynamic class in every compilation. We now use a much simpler (and, in a modules build, vastly more efficient) system: when we see an out-of-line definition of a virtual function, we check whether that function was in fact its class's key function. (If so, we need to emit the vtable.) llvm-svn: 230830
* DebugInfo: hoist definition into global context when neededSaleem Abdulrasool2015-02-281-3/+12
| | | | | | | | | | | | When generating debug info for a static inline member which is initialized for the DLLExport storage class, hoist the definition into a non-composite type context. Otherwise, we would trigger an assertion when generating the DIE for the associated global value as the debug context has a type association. This addresses PR22669. Thanks to David Blakie for help in coming up with a solution to this! llvm-svn: 230816
* [modules] When writing out a list of specializations for a template, if we haveRichard Smith2015-02-272-57/+58
| | | | | | | | undeserialized specializations (because we merged an imported declaration of the same template since we last added one), don't bother reading in the specializations themselves just so we can write out their IDs again. llvm-svn: 230805
* [modules] Avoid the possibility of a redeclaration chain not being marked 'upRichard Smith2015-02-271-3/+2
| | | | | | to date' after it gets updated. llvm-svn: 230789
* Add __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind instructions.Renato Golin2015-02-271-2/+14
| | | | | | | | Equally to NetBSD, Bitrig will be using .eh_frame unwinding on ARM. Patch by Patrick Wildt. llvm-svn: 230763
OpenPOWER on IntegriCloud