summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP] Sema analysis for 'atomic capture' construct.Alexey Bataev2015-04-014-29/+244
| | | | | | Added sema checks for forms of expressions/statements allowed under control of 'atomic capture' directive + generation of helper objects for future codegen. llvm-svn: 233785
* [Objective-C metadata patch]. Patch to allocate one more space for Fariborz Jahanian2015-03-311-1/+7
| | | | | | Protocol objects in OBJC2. rdar://20286356 llvm-svn: 233766
* Add sm_37 target to Clang for NVPTXEli Bendersky2015-03-311-0/+5
| | | | | | Support for this target was added in LLVM r233575 and r233583 llvm-svn: 233715
* Sema: Accept pointers to any address space for builtin functionsTom Stellard2015-03-311-3/+94
| | | | | | | | 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-311-0/+11
| | | | llvm-svn: 233698
* [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-311-1/+1
| | | | llvm-svn: 233649
* [Objective-C patch]. Amend TransformObjCMessageExpr to handle callFariborz Jahanian2015-03-301-0/+38
| | | | | | | to 'super' of instance/class methods and not assert. rdar://20350364 llvm-svn: 233642
* Add driver support for Native Client SDKDerek Schuff2015-03-307-3/+396
| | | | | | | | | | | | | | 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] Disable all retain count diagnostics on values that come from ivars.Jordan Rose2015-03-301-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-301-82/+1
| | | | | | | | | 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
* [PPC] Move argument range checks for HTM and crypto builtins to SemaKit Barton2015-03-302-113/+27
| | | | | | | | | | | 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 definition of IntMaxType / Int64TypeUlrich Weigand2015-03-301-0/+2
| | | | | | | | 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-301-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-301-0/+21
| | | | | | | | | | | | | | 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-301-2/+3
| | | | | | | | | | | | | | | | | | 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-308-95/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-303-17/+33
| | | | | | | 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-297-49/+42
| | | | | | | | | | 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-291-1/+3
| | | | | | | | 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-291-0/+3
| | | | | | | | | | | 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-291-1/+3
| | | | | | | 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-291-1/+2
| | | | | | | 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-291-2/+4
| | | | | | It will crash downstream somewhere. Found by afl-fuzz. llvm-svn: 233493
* [Parse] Don't crash on ~A::{Benjamin Kramer2015-03-291-1/+1
| | | | | | Found by clang-fuzz. llvm-svn: 233492
* [lex] Don't read past the end of the bufferBenjamin Kramer2015-03-291-3/+4
| | | | | | | | | 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
* [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-281-1/+1
| | | | | | 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-281-2/+4
| | | | | | | | 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
* 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-271-3/+6
| | | | | | 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
* [modules] When merging class definitions, make the retained definition visibleRichard Smith2015-03-272-25/+31
| | | | | | | | 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-272-2/+10
| | | | llvm-svn: 233407
* Revert "Don't use unique section names by default if using the integrated as."Rafael Espindola2015-03-271-6/+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-271-3/+6
| | | | | | | This saves some IO and ccache space by not creating long section names. It should work with every ELF linker. llvm-svn: 233393
* [Sema] Factor diags with %plural. No functionality change intended.Benjamin Kramer2015-03-272-32/+13
| | | | llvm-svn: 233387
* [Sema] Implement DR777Benjamin Kramer2015-03-271-7/+7
| | | | | | | | 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-271-2/+11
| | | | | | | | 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
* Diagnose delayed typos in an expr list that is in an invalid expression.Kaelyn Takata2015-03-271-0/+3
| | | | | | | | | | Previously, if the expr list parsed fine but the expr to the left of the open parenthesis was invalid (when parsing the suffix of a postfix-expression), the parsed expr list was just ignored. Fixes PR23005. llvm-svn: 233347
* [modules] Handle defining a tag with a typedef name for linkage purposes on ↵Richard Smith2015-03-273-8/+44
| | | | | | top of an existing imported-but-not-visible definition. llvm-svn: 233345
* [Modules] Make Sema's map of referenced selectors have a deterministicChandler Carruth2015-03-273-19/+11
| | | | | | | | | | | order based on order of insertion. This should cause both our warnings about these and the modules serialization to be deterministic as a consequence. Found by inspection. llvm-svn: 233343
* [Modules] Make our on-disk hash table of selector IDs be built inChandler Carruth2015-03-271-6/+5
| | | | | | | | | | a deterministic order. This uses a MapVector to track the insertion order of selectors. Found by inspection. llvm-svn: 233342
* [modules] Handle defining a class template on top of an existing ↵Richard Smith2015-03-273-7/+44
| | | | | | imported-but-not-visible definition. llvm-svn: 233341
* [Modules] Sort the file IDs prior to building the flattened array ofChandler Carruth2015-03-271-10/+13
| | | | | | | | | | | DeclIDs so that in addition to be grouped by file, the order of these groups is stable. Found by inspection, no test case. Not sure this can be observed without a randomized seed for the hash table, but we shouldn't be relying on the hash table layout under any circumstances. llvm-svn: 233339
* [Modules] Make the AST serialization always use lexicographic order whenChandler Carruth2015-03-261-4/+12
| | | | | | | | | | | | | | | | traversing the identifier table. No easy test case as this table is somewhere between hard and impossible to observe as non-deterministically ordered. The table is a hash table but we hash the string contents and never remove entries from the table so the growth pattern, etc, is all completely fixed. However, relying on the hash function being deterministic is specifically against the long-term direction of LLVM's hashing datastructures, which are intended to provide *no* ordering guarantees. As such, this defends against these things by sorting the identifiers. Sorting identifiers right before we emit them to a serialized form seems a low cost for predictability here. llvm-svn: 233332
OpenPOWER on IntegriCloud