summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Objective-C ARC. First patch toward generating new APIsFariborz Jahanian2014-08-066-10/+25
| | | | | | | for Objective-C's array and dictionary literals. rdar://17554063. This is wip. llvm-svn: 214983
* FormatTokenLexer: Avoid non-static member initializer.NAKAMURA Takumi2014-08-061-2/+2
| | | | llvm-svn: 214976
* Remove unnecessary semicolon.Manuel Klimek2014-08-061-1/+1
| | | | llvm-svn: 214970
* clang-format: Correct SBPO_Always-behavior after function-like keywordsDaniel Jasper2014-08-062-1/+21
| | | | | | | | | | | | | | | | | Before: auto f (int x) -> decltype(x) { return sizeof(x); } int g () noexcept(someCall ()); static_assert(sizeof(char) == 1, "Your compiler is broken"); After: auto f (int x) -> decltype (x) { return sizeof (x); } int g () noexcept (someCall ()); static_assert (sizeof (char) == 1, "Your compiler is broken"); This fixes llvm.org/PR20559. Patch by Roman Kashitsyn, thank you! llvm-svn: 214969
* clang-format: Add special comments to disable formatting.Daniel Jasper2014-08-061-0/+7
| | | | | | | | | | | | | | | | With this patch: int ThisWillBeFormatted; // clang-format off int ThisWontBeFormatted; // clang-format on int Formatted; This is for regions where a significantly nicer code layout can be found knowing the content of the code. This fixes llvm.org/PR20463. llvm-svn: 214966
* clang-format: Fix indentation in multi-line placement new.Daniel Jasper2014-08-061-0/+3
| | | | | | | | | | | | | | Before: auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa)) typename aaaaaaaaaaaaaaaaaaaaaaaa(); After: auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa)) typename aaaaaaaaaaaaaaaaaaaaaaaa(); llvm-svn: 214964
* Fix modelling of non-lifetime-extended temporary destructors in the analyzer.Manuel Klimek2014-08-063-149/+256
| | | | | | | | | | | | | | | | | | | 1. Changes to the CFG: When creating the CFG for temporary destructors, we create a structure that mirrors the branch structure of the conditionally executed temporary constructors in a full expression. The branches we create use a CXXBindTemporaryExpr as terminator which corresponds to the temporary constructor which must have been executed to enter the destruction branch. 2. Changes to the Analyzer: When we visit a CXXBindTemporaryExpr we mark the CXXBindTemporaryExpr as executed in the state; when we reach a branch that contains the corresponding CXXBindTemporaryExpr as terminator, we branch out depending on whether the corresponding CXXBindTemporaryExpr was marked as executed. llvm-svn: 214962
* [Driver] Move information about toolchain specific include directoriesSimon Atanasyan2014-08-061-17/+35
| | | | | | | | | | | | from the common driver code to the corresponding `MultilibSet` declarations. Now the `MultilibSet` can hold an optional callback function which is responsible to return a set of include directories specific for the toolchain. That allows to remove MIPS toolchain specific directories from `Linux::AddClangSystemIncludeArgs` method and simplify adding new directories in the future. llvm-svn: 214949
* MS ABI: Mangle lambdas which are given the same mangling numberDavid Majnemer2014-08-061-4/+1
| | | | | | | | It is possible for lambdas to get the same mangling number because they may exist in different mangling contexts. To handle this correctly, mangle the context into the name as well. llvm-svn: 214947
* MS ABI: Mangle empty type parameter packs compatiblyDavid Majnemer2014-08-051-5/+18
| | | | | | | | | | | The MS mangling scheme apparently has separate manglings for type and non-type parameter packs when they are empty. Match template arguments with parameters during mangling; check the parameter to see if it was destined to hold type-ish things or nontype-ish things. Differential Revision: http://reviews.llvm.org/D4792 llvm-svn: 214932
* Make crash diagnostics on Windows the tiniest bit more usefulReid Kleckner2014-08-052-1/+4
| | | | | | | | | | | | | | This escapes any backslashes in the executable path and fixes an issue with a trailing quote when the main file name had to be quoted during printing. It's impossible to test this without putting backslashes or quotes into the executable path, so I didn't add automated tests. The crash diagnostics are still only useful if you're using bash on Windows, though. This should probably be writing a batch file instead. llvm-svn: 214924
* Introduce f[no-]max-unknown-pointer-align=[number] optionFariborz Jahanian2014-08-053-1/+22
| | | | | | | | | to instruct the code generator to not enforce a higher alignment than the given number (of bytes) when accessing memory via an opaque pointer or reference. Patch reviewed by John McCall (with post-commit review pending). rdar://16254558 llvm-svn: 214911
* [Analyzer] fix for PR19102Anton Yartsev2014-08-051-0/+41
| | | | | | Newly-created unconsumed instance is now assumed escaped if an invoked constructor has an argument of a pointer-to-record type. llvm-svn: 214909
* [PR19983] SBPO_Always not covering all the cases.Chad Rosier2014-08-051-1/+1
| | | | | | | Patch by "Roman Kashitsyn" <romankashicin@gmail.com>. Phabricator revision: http://reviews.llvm.org/D4788 llvm-svn: 214904
* [AVX512] Add intrinsic for valignd/qAdam Nemet2014-08-051-0/+20
| | | | | | | | | | Note that similar to palingr, we could further optimize these to emit shufflevector when the shift count is <=64. This however does not change the overall design that unlike palignr we would still need the LLVM intrinsic corresponding to this intruction to handle the >64 cases. (palignr uses the psrldq intrinsic in this case.) llvm-svn: 214891
* [CMake] clangCodeGen: Update libdeps to add clangLex for PPChainedCallbacks.NAKAMURA Takumi2014-08-051-0/+1
| | | | llvm-svn: 214869
* clang-format: Add option to always break after a function's return type.Daniel Jasper2014-08-052-0/+9
| | | | | | | | | | This is required for GNU coding style, among others. Also update the configuration documentation. Modified from an original patch by Jarkko Hietaniemi, thank you! llvm-svn: 214858
* clang-format: Break before 'else' in Stroustrup style.Daniel Jasper2014-08-051-0/+2
| | | | | | | | | Seems to be the desired thing to do according to: http://www.stroustrup.com/Programming/PPP-style-rev3.pdf Patch by Jarkko Hietaniemi, thank you! llvm-svn: 214857
* MachO: set sizeof result type to what embedded headers expect.Tim Northover2014-08-051-2/+2
| | | | | | | | | Embedded systems seem to have inherited Darwin's choise of "unsigned long" for size_t (via a bunch of headers), so we should respect that. rdar://problem/17872787 llvm-svn: 214854
* MS ABI: Make the alias template mangling more correctDavid Majnemer2014-08-051-1/+1
| | | | llvm-svn: 214847
* MS ABI: Aligned tentative definitions don't have CommonLinkageDavid Majnemer2014-08-051-2/+10
| | | | | | | int __declspec(align(16)) foo; is a tentative definition but the storage for that variable should not have CommonLinkage. llvm-svn: 214828
* [PPC64LE] Fix wrong IR for vec_sld and vec_vsldoiBill Schmidt2014-08-041-108/+4
| | | | | | | | | | | | | | | | | | | | My original LE implementation of the vsldoi instruction, with its altivec.h interfaces vec_sld and vec_vsldoi, produces incorrect shufflevector operations in the LLVM IR. Correct code is generated because the back end handles the incorrect shufflevector in a consistent manner. This patch and a companion patch for LLVM correct this problem by removing the fixup from altivec.h and the corresponding fixup from the PowerPC back end. Several test cases are also modified to reflect the now-correct LLVM IR. The vec_sums and vec_vsumsws interfaces in altivec.h are also fixed, because they used vec_perm calls intended to be recognized as vsldoi instructions. These vec_perm calls are now replaced with code that more clearly shows the intent of the transformation. llvm-svn: 214801
* ThreadSafety.cpp: Prune bogus \param(s). [-Wdocumentation]NAKAMURA Takumi2014-08-041-3/+0
| | | | llvm-svn: 214796
* ThreadSafetyAnalysis: Fix annotations in class members. [-Wdocumentation]NAKAMURA Takumi2014-08-041-5/+5
| | | | llvm-svn: 214795
* Remove separator parameter from static local naming codeReid Kleckner2014-08-042-8/+5
| | | | | | It was always set to ".", which was duplicated in a few places. llvm-svn: 214792
* Thread Safety Analysis: add a -Wthread-safety-negative flag that warns wheneverDeLesley Hutchins2014-08-042-32/+79
| | | | | | | a mutex is acquired, but corresponding mutex is not provably not-held. This is based on the earlier negative requirements patch. llvm-svn: 214789
* Update for LLVM API change.Eric Christopher2014-08-041-2/+4
| | | | llvm-svn: 214786
* Don't drop dllimport from qualified friend redeclarations (PR20512)Hans Wennborg2014-08-041-4/+8
| | | | | | | | | | This matches MSVC's logic, which seems to be that when the friend declaration is qualified, it cannot be a declaration of a new symbol and so the dll linkage doesn't change. Differential Revision: http://reviews.llvm.org/D4764 llvm-svn: 214774
* A static_assert declaration cannot be a template; adding the diagnostic for ↵Aaron Ballman2014-08-042-3/+12
| | | | | | this instead of silently accepting and producing possibly-unexpected behavior. llvm-svn: 214770
* Revert r214757 (Same fix as r214758)Alex Lorenz2014-08-041-1/+0
| | | | llvm-svn: 214759
* Add CoverageMappingGen.cpp (introduced in r214752) to CMakeLists.txtDavid Blaikie2014-08-041-0/+1
| | | | llvm-svn: 214758
* add lib/CodeGen/CoverageMappingGen.cpp to CMakeAlex Lorenz2014-08-041-0/+1
| | | | llvm-svn: 214757
* Add coverage mapping generation.Alex Lorenz2014-08-0412-52/+1566
| | | | | | | | | | This patch adds the '-fcoverage-mapping' option which allows clang to generate the coverage mapping information that can be used to provide code coverage analysis using the execution counts obtained from the instrumentation based profiling (-fprofile-instr-generate). llvm-svn: 214752
* Fix crash when accessing a property of an invalid interfaceOlivier Goffart2014-08-041-12/+10
| | | | llvm-svn: 214735
* Fix crash when assiging to a property with an invalid typeOlivier Goffart2014-08-041-1/+6
| | | | | | | | | | This is a regression from clang 3.4 Set the result to ExprError and returns true, rather than simply returns false because errors have been reported already and returning false show a confusing error llvm-svn: 214734
* Diagnose GNU-style attributes preceding virt-specifiers, but only when the ↵Aaron Ballman2014-08-041-3/+12
| | | | | | | | attribute is known to GCC. Clang accepts attributes in this position, but GCC does not, so this is a GCC-compat warning. If the attribute is not known to GCC, then the diagnostic is suppressed. llvm-svn: 214730
* Thread safety analysis: Add support for negative requirements, which areDeLesley Hutchins2014-08-042-280/+267
| | | | | | | capability expressions of the form !expr, and denote a capability that must not be held. llvm-svn: 214725
* Highlight the offending function parameter when the format argument refers ↵Aaron Ballman2014-08-041-5/+6
| | | | | | to an invalid function parameter type. llvm-svn: 214723
* Highlight the offending function parameter when the format_arg argument ↵Aaron Ballman2014-08-041-6/+4
| | | | | | refers to an invalid function parameter type. llvm-svn: 214722
* clang-format: Understand parameter pack initialization.Daniel Jasper2014-08-041-1/+1
| | | | | | | | | | Before: Constructor(A... a) : a_(X<A> { std::forward<A>(a) }...) {} After: Constructor(A... a) : a_(X<A>{std::forward<A>(a)}...) {} llvm-svn: 214720
* [Driver][Mips] Construct dynamic linker path by string concatination.Simon Atanasyan2014-08-041-12/+17
| | | | | | | | | That reduces a number of `if` operators and prevent a combinatorics explosion if/when more dynamic linker path variants added. No functional changes. llvm-svn: 214712
* [x32] Add __int128 supportPavel Chupin2014-08-041-0/+2
| | | | | | | | | | | | | | | | Summary: Adding __int128 support explicitly for x86_64 because currently it's on only when pointer size >= 64 which is not the case for x32. Test Plan: One of the tests using __int128 is updated Reviewers: atanasyan, chandlerc Subscribers: cfe-commits, rob.khasanov, zinovy.nis, dschuff Differential Revision: http://reviews.llvm.org/D4755 llvm-svn: 214710
* AST: Fix the mangling for unqualified-blocksDavid Majnemer2014-08-041-2/+2
| | | | | | | | | | | | | | | | CXXNameMangler::mangleUnqualifiedBlock believed that MangleContext::getBlockId returned something that used Itanium-style discriminator numbers. Discriminator numbers start their numberign from 1 and the first mangling that actually gets any sort of number mangled in is the second discriminator. However, Block IDs start from zero. The logic for omitting the mangling number did a ' > 1' instead of a ' > 0' comparison; this could potentially cause mangling conflicts. llvm-svn: 214699
* AST: Propagate 'AlignIsRequired' though many levels of typedefsDavid Majnemer2014-08-041-1/+3
| | | | | | | A typedef of a typedef should have AlignIsRequired if *either* typedef has an AlignAttr attached to it. llvm-svn: 214698
* PR11778: Fix the rejects-valid half of this bug. We still produce the sameRichard Smith2014-08-041-63/+46
| | | | | | | poorly-worded warning for a case value that is not a possible value of the switched-on expression. llvm-svn: 214678
* Don't destroy MacroInfos if we find the macro definition is invalid; it'll getRichard Smith2014-08-031-12/+0
| | | | | | destroyed on shutdown regardless. Fixes a double-delete. llvm-svn: 214675
* Driver: Simplify a use of the path APIJustin Bogner2014-08-031-1/+1
| | | | | | | It's a bit more obvious what's going on if we use path::filename rather than decrementing an iterator here. llvm-svn: 214668
* Tools.cpp: Avoid std::to_string() on -fbuild-session-timestamp to appease ↵NAKAMURA Takumi2014-08-031-3/+4
| | | | | | mingw32 builder. llvm-svn: 214656
* In the case of mangling collisions, make an attempt to note both definitionsRichard Smith2014-08-021-6/+8
| | | | | | involved. llvm-svn: 214606
* [ASan] Use metadata to pass source-level information from Clang to ASan.Alexey Samsonov2014-08-022-25/+22
| | | | | | | | | | | | | | | | | Instead of creating global variables for source locations and global names, just create metadata nodes and strings. They will be transformed into actual globals in the instrumentation pass (if necessary). This approach is more flexible: 1) we don't have to ensure that our custom globals survive all the optimizations 2) if globals are discarded for some reason, we will simply ignore metadata for them and won't have to erase corresponding globals 3) metadata for source locations can be reused for other purposes: e.g. we may attach source location metadata to alloca instructions and provide better descriptions for stack variables in ASan error reports. No functionality change. llvm-svn: 214604
OpenPOWER on IntegriCloud