summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Sema: Accept pointers to any address space for builtin functionsTom Stellard2015-03-315-4/+118
| | | | | | | | As long as they don't have an address space explicitly defined. This allows builtins with pointer arguments to be used with OpenCL. llvm-svn: 233706
* clang-format: [JS] Support getters, setters and methods in object literals.Daniel Jasper2015-03-312-0/+32
| | | | llvm-svn: 233698
* Make new test slightly more generic to allow running it underDaniel Jasper2015-03-311-19/+19
| | | | | | non-standard test runners. llvm-svn: 233677
* [X86] Use getHostCPUFeatures when 'native' is specified for cpu.Craig Topper2015-03-311-0/+11
| | | | | | This is necessary because not aall Sandybridge, Ivybrige, Haswell, and Broadwell CPUs support AVX. Currently we modify the CPU name back to Nehalem for this case, but that turns off additional features for these CPUs. llvm-svn: 233672
* Update for llvm commit r233648.Eric Christopher2015-03-312-4/+3
| | | | llvm-svn: 233649
* [Objective-C patch]. Amend TransformObjCMessageExpr to handle callFariborz Jahanian2015-03-302-0/+61
| | | | | | | to 'super' of instance/class methods and not assert. rdar://20350364 llvm-svn: 233642
* Add driver support for Native Client SDKDerek Schuff2015-03-309-4/+505
| | | | | | | | | | | | | | Add Tool and ToolChain support for clang to target the NaCl OS using the NaCl SDK for x86-32, x86-64 and ARM. Includes nacltools::Assemble and Link which are derived from gnutools. They are similar to Linux but different enought that they warrant their own class. Also includes a NaCl_TC in ToolChains derived from Generic_ELF with library and include paths suitable for an SDK and independent of the system tools. Differential Revision: http://reviews.llvm.org/D8590 llvm-svn: 233594
* [analyzer] Add test for previous commit.Jordan Rose2015-03-301-0/+8
| | | | | | | | | Again, this is being applied in a separate commit so that the previous commit can be reverted while leaving the test in place. rdar://problem/20335433 llvm-svn: 233593
* [analyzer] Disable all retain count diagnostics on values that come from ivars.Jordan Rose2015-03-303-1634/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is imitating a pre-r228174 state where ivars are not considered tracked by default, but with the addition that even ivars /with/ retain count information (e.g. "[_ivar retain]; [ivar _release];") are not being tracked as well. This is to ensure that we don't regress on values accessed through both properties and ivars, which is what r228174 was trying to fix. The issue occurs in code like this: [_contentView retain]; [_contentView removeFromSuperview]; [self addSubview:_contentView]; // invalidates 'self' [_contentView release]; In this case, the call to -addSubview: may change the value of self->_contentView, and so the analyzer can't be sure that we didn't leak the original _contentView. This is a correct conservative view of the world, but not a useful one. Until we have a heuristic that allows us to not consider this a leak, not emitting a diagnostic is our best bet. This commit disables all of the ivar-related retain count tests, but does not remove them to ensure that we don't crash trying to evaluate either valid or erroneous code. The next commit will add a new test for the example above so that this commit (and the previous one) can be reverted wholesale when a better solution is implemented. Rest of rdar://problem/20335433 llvm-svn: 233592
* [analyzer] Don't special-case ivars backing +0 properties.Jordan Rose2015-03-303-387/+12
| | | | | | | | | Give up this checking in order to continue tracking that these values came from direct ivar access, which will be important in the next commit. Part of rdar://problem/20335433 llvm-svn: 233591
* DebugInfo: Use new LLVM API for DebugLocDuncan P. N. Exon Smith2015-03-303-3/+3
| | | | | | | Use the new API for `DebugLoc` added in r233573 before the old one disappears. llvm-svn: 233589
* Updating code owners file per discussion with Doug at the 2014-10 dev meeting.Richard Smith2015-03-301-2/+2
| | | | llvm-svn: 233588
* [PPC] Move argument range checks for HTM and crypto builtins to SemaKit Barton2015-03-305-161/+80
| | | | | | | | | | | The argument range checks for the HTM and Crypto builtins were implemented in CGBuiltin.cpp, not in Sema. This change moves them to the appropriate location in SemaChecking.cpp. It requires the creation of a new method in the Sema class to do checks for PPC-specific builtins. http://reviews.llvm.org/D8672 llvm-svn: 233586
* [SystemZ] Fix fallout from r233543 on no-assert buildsUlrich Weigand2015-03-302-75/+517
| | | | | | | | | | Test cases must not check for symbolic variable names that are not present in IR generated by no-assert builds. Fixed by testing a more complete subset of the va_arg dataflow, without relying on variable names. llvm-svn: 233574
* [SystemZ] Fix definition of IntMaxType / Int64TypeUlrich Weigand2015-03-303-26/+28
| | | | | | | | Like on other 64-bit platforms, Int64Type should be SignedLong on SystemZ, not SignedLongLong as per default. This could cause ABI incompatibilities in certain cases (e.g. name mangling). llvm-svn: 233544
* [SystemZ] Fix some ABI corner casesUlrich Weigand2015-03-304-8/+413
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running the GCC's inter-compiler ABI compatibility test suite uncovered a couple of errors in clang's SystemZ ABI implementation. These all affect only rare corner cases: - Short vector types GCC synthetic vector types defined with __attribute__ ((vector_size ...)) are always passed and returned by reference. (This is not documented in the official ABI document, but is the de-facto ABI implemented by GCC.) clang would do that only for vector sizes >= 16 bytes, but not for shorter vector types. - Float-like aggregates and empty bitfields clang would consider any aggregate containing an empty bitfield as first element to be a float-like aggregate. That's obviously wrong. According to the ABI doc, the presence of an empty bitfield makes an aggregate to be *not* float-like. However, due to a bug in GCC, empty bitfields are ignored in C++; this patch changes clang to be compatible with this "feature" of GCC. - Float-like aggregates and va_arg The va_arg implementation would mis-detect some aggregates as float-like that aren't actually passed as such. This applies to aggregates that have only a single element of type float or double, but using an aligned attribute that increases the total struct size to more than 8 bytes. This error occurred because the va_arg implement used to have an copy of the float-like aggregate detection logic (i.e. it would call the isFPArgumentType routine, but not perform the size check). To simplify the logic, this patch removes the duplicated logic and instead simply checks the (possibly coerced) LLVM argument type as already determined by classifyArgumentType. llvm-svn: 233543
* [mips] Add support for 'ZC' inline assembly memory constraint.Daniel Sanders2015-03-302-0/+40
| | | | | | | | | | | | | | Summary: Also add tests for 'R' and 'm'. Reviewers: atanasyan Reviewed By: atanasyan Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8449 llvm-svn: 233542
* clang-format: [JS] Fix comment formatting in goog.scopes.Daniel Jasper2015-03-302-2/+8
| | | | | | | | | | | | | | | | | | Before: goog.scope(function() { // test var x = 0; // test }); After: goog.scope(function() { // test var x = 0; // test }); llvm-svn: 233530
* [OPENMP] Codegen for 'atomic update' construct.Alexey Bataev2015-03-3011-123/+1450
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds atomic update codegen for the following forms of expressions: x binop= expr; x++; ++x; x--; --x; x = x binop expr; x = expr binop x; If x and expr are integer and binop is associative or x is a LHS in a RHS of the assignment expression, and atomics are allowed for type of x on the target platform atomicrmw instruction is emitted. Otherwise compare-and-swap sequence is emitted: bb: ... atomic load <x> cont: <expected> = phi [ <x>, label %bb ], [ <new_failed>, %cont ] <desired> = <expected> binop <expr> <res> = cmpxchg atomic &<x>, desired, expected <new_failed> = <res>.field1; br <res>field2, label %exit, label %cont exit: ... Differential Revision: http://reviews.llvm.org/D8536 llvm-svn: 233513
* [OPENMP] Improved codegen for implicit/explicit 'barrier' constructs.Alexey Bataev2015-03-306-29/+56
| | | | | | | Replace boolean IsExplicit parameter of OpenMPRuntime::emitBarrierCall() method by OpenMPDirectiveKind Kind for better compatibility with the runtime library. Also add processing of 'nowait' clause on worksharing directives. Differential Revision: http://reviews.llvm.org/D8659 llvm-svn: 233511
* Add check for kind of UnqualifiedId in Declarator::isStaticMember()Petar Jovanovic2015-03-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Method CXXMethodDecl::isStaticOverloadedOperator expects Operator field from the struct OperatorFunctionId, which is a member of the union in the class UnqualifiedId. If the kind of UnqualifiedId is not checked, there is no guarantee that the value that this method receives will be correct, because it can be the value of another union member and not OperatorFunctionId. This bug manifests itself when running make check-all on mips64 BE. This fix resolves the following regression tests: Clang :: CXX/special/class.dtor/p9.cpp Clang :: CodeGenCXX/2006-09-12-OpaqueStructCrash.cpp Clang :: CodeGenCXX/ctor-dtor-alias.cpp Clang :: CodeGenCXX/debug-info-windows-dtor.cpp Clang :: CodeGenCXX/dllexport-members.cpp Clang :: CodeGenCXX/dllexport.cpp Patch by Violeta Vukobrat. Differential Revision: http://reviews.llvm.org/D8437 llvm-svn: 233508
* [MS ABI] Rework .xdata HandlerType emissionDavid Majnemer2015-03-299-55/+47
| | | | | | | | | | Utilizing IMAGEREL relocations for synthetic IR constructs isn't valuable, just clutter. While we are here, simplify HandlerType names by making the numeric value for the 'adjective' part of the mangled name instead of appending '.const', etc. The old scheme made for very long global names and leads to wordy things like '.std_bad_alloc' llvm-svn: 233503
* [parse] Don't crash on alternative operator spellings from macros in c++11 ↵Benjamin Kramer2015-03-292-1/+10
| | | | | | | | attributes. Found by afl-fuzz. llvm-svn: 233499
* [lex] Provide a valid token when __has_include is found outside of a pp ↵Benjamin Kramer2015-03-292-0/+9
| | | | | | | | | | | directive ExpandBuiltinMacro would strip the identifier and downstream users crash when they encounter an identifier token with nullptr identifier info. Found by afl-fuzz. llvm-svn: 233497
* [edit] Don't hit an assert when trying to delete a trailing space at EOFBenjamin Kramer2015-03-292-1/+12
| | | | | | | The buffer is guaranteed to be zero-terminated so we can just circumvent the check. Found by afl-fuzz. llvm-svn: 233496
* [parser] Push _Atomic locs through DeclaratorChunk.Benjamin Kramer2015-03-293-2/+7
| | | | | | | Otherwise it stays uninitialized with potentially catastrophic results. Found by afl-fuzz. llvm-svn: 233494
* [lex] Don't create a garbage token if parsing of __has_include fails.Benjamin Kramer2015-03-292-2/+16
| | | | | | It will crash downstream somewhere. Found by afl-fuzz. llvm-svn: 233493
* [Parse] Don't crash on ~A::{Benjamin Kramer2015-03-292-1/+2
| | | | | | Found by clang-fuzz. llvm-svn: 233492
* [lex] Don't read past the end of the bufferBenjamin Kramer2015-03-292-3/+13
| | | | | | | | | While dereferencing ThisTokEnd is fine and we know that it's not in [a-zA-Z0-9_.], ThisTokEnd[1] is really past the end. Found by asan and with a little help from clang-fuzz. llvm-svn: 233491
* [lex] Turn range checks into asserts.Benjamin Kramer2015-03-291-44/+36
| | | | | | | We know that the last accessible char is not in [a-zA-Z0-9_.] so we can happily scan on as long as it is. No functionality change. llvm-svn: 233490
* [scan-build] Be friendly to "" in the argument list.Anna Zaks2015-03-281-0/+5
| | | | | | Do not fail when "" is one of the compilation arguments. llvm-svn: 233465
* [Modules] Don't compute a modules cache path if we're not using modules!Chandler Carruth2015-03-281-1/+2
| | | | | | | | | Notably, this prevents us from doing *tons* of work to compute the modules hash, including trying to read a darwin specific plist file off of the system. There is a lot that needs cleaning up below this layer too. llvm-svn: 233462
* Make the clang-fuzzer use the CompilerInstance directly.Manuel Klimek2015-03-283-6/+23
| | | | | | Going through the driver is too slow. llvm-svn: 233459
* A conversion from a scoped enumeration bitfield to an integral type is anRichard Smith2015-03-282-2/+12
| | | | | | | | integral promotion only if it converts to the underlying type or its promoted type, not if it converts to the promoted type that the bitfield would have it if were of the underlying type. llvm-svn: 233457
* Add initial version of a clang-fuzzer.Manuel Klimek2015-03-283-0/+51
| | | | llvm-svn: 233455
* DebugInfo: Don't call DIBuilder::retainType(nullptr)Duncan P. N. Exon Smith2015-03-271-3/+4
| | | | | | | | | | An upcoming LLVM commit will make calling `DIBuilder::retainType(nullptr)` illegal (actually, it already was, but it wasn't verified). Check for null before calling. This triggered in test/CodeGenObjC/debug-info-block-helper.m. llvm-svn: 233443
* [modules] Allow a function template definition if we have a pre-existing but ↵Richard Smith2015-03-273-9/+33
| | | | | | not visible definition of the same template. llvm-svn: 233430
* [Modules] Work around PR23030 again, in a different code path, whereChandler Carruth2015-03-271-6/+9
| | | | | | | | | | I again added the "reasonable" assertions and they again fired during a modules self-host. This hopefully will un-break the self-host build bot. No test case handy and adding one seems to have little or no value really. llvm-svn: 233426
* Add file forgotten from r233420.Richard Smith2015-03-271-0/+1
| | | | llvm-svn: 233425
* [modules] When merging class definitions, make the retained definition visibleRichard Smith2015-03-277-44/+50
| | | | | | | | if the merged definition is visible, and perform lookups into all merged copies of the definition (not just for special members) so that we can complete the redecl chains for members of the class. llvm-svn: 233420
* [modules] Allow a function to be redefined if the old definition is not visible.Richard Smith2015-03-275-5/+23
| | | | llvm-svn: 233407
* Revert "Don't use unique section names by default if using the integrated as."Rafael Espindola2015-03-272-16/+3
| | | | | | This reverts commit r233393 while a debug a bot failure. llvm-svn: 233398
* Don't use unique section names by default if using the integrated as.Rafael Espindola2015-03-272-3/+16
| | | | | | | This saves some IO and ccache space by not creating long section names. It should work with every ELF linker. llvm-svn: 233393
* Mark DR777 only as fixed in clang SVN.Benjamin Kramer2015-03-272-2/+2
| | | | llvm-svn: 233391
* [Sema] Factor diags with %plural. No functionality change intended.Benjamin Kramer2015-03-273-77/+27
| | | | llvm-svn: 233387
* Make -fsanitize-coverage flag a core option so it's available via the ↵Timur Iskhodzhanov2015-03-272-1/+9
| | | | | | | | clang-cl driver too Reviewed at http://reviews.llvm.org/D8663 llvm-svn: 233384
* Remove test for PR12917 for now. I'm relatively sure this is ill-formed per ↵Benjamin Kramer2015-03-271-22/+0
| | | | | | [dcl.fct.default]p3. llvm-svn: 233379
* [Sema] Implement DR777Benjamin Kramer2015-03-273-8/+28
| | | | | | | | A parameter pack after a default argument is now valid. PR23029. llvm-svn: 233377
* [Sema] Diagnose default argument on a parameter pack.Benjamin Kramer2015-03-273-2/+16
| | | | | | | | This is ill-formed (and cannot be used anyways). PR23028. llvm-svn: 233376
* [Modules] When walking the lookup results in a namespace, sort them byChandler Carruth2015-03-271-9/+23
| | | | | | | | | | | | declaration name so that we mark declarations for emission in a deterministic order (and in turn give them deterministic IDs). This is the last for loop or data structure I can find by inspection of the AST writer which doesn't use a deterministic order. Found by inspection, no test case. llvm-svn: 233348
OpenPOWER on IntegriCloud