summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [SemaObjC] Properly handle mix between type arguments and protocols.Bruno Cardoso Lopes2016-04-132-9/+56
| | | | | | | | | | | | | | | | | | | | | | | Under certain conditions clang currently fails to properly diagnostic ObjectC parameter list when type args and protocols are mixed in the same list. This happens when the first item in the parameter list is a (1) protocol, (2) unknown type or (3) a list of protocols/unknown types up to the first type argument. Fix the problem to report the proper error, example: NSArray<M, NSValue *, NSURL, NSArray <id <M>>> *foo = @[@"a"]; NSNumber *bar = foo[0]; NSLog(@"%@", bar); $ clang ... x.m:7:13: error: angle brackets contain both a type ('NSValue') and a protocol ('M') NSArray<M, NSValue *, NSURL, NSArray <id <M>>> *foo = @[@"a"]; ~ ^ Differential Revision: http://reviews.llvm.org/D18997 rdar://problem/22204367 llvm-svn: 266245
* Make sure CheckDestructor gets called on dllimported classes if the vtable ↵Hans Wennborg2016-04-131-7/+14
| | | | | | is used (PR27319) llvm-svn: 266242
* [CrashReproducer] Setup 'use-external-names' in YAML files.Bruno Cardoso Lopes2016-04-132-4/+13
| | | | | | | | | | | | | | Hide the real paths when rebuilding from VFS by setting up the crash reproducer to use 'use-external-names' = false. This way we avoid module redifinition errors and consistently use the same paths against all modules. With this change on Darwin we are able to simulate a crash for a simple application using "Foundation/Foundation.h" (which relies on a bunch of different frameworks and headers) and successfully rebuild all the modules by relying solely at the VFS overlay. llvm-svn: 266234
* [VFS] Move default values to in-class member initialization. NFCBruno Cardoso Lopes2016-04-131-3/+3
| | | | llvm-svn: 266233
* Remove redundant null-check; NFCHubert Tong2016-04-131-1/+1
| | | | llvm-svn: 266226
* [analyzer] Nullability: Suppress diagnostic on bind with cast.Devin Coughlin2016-04-131-6/+28
| | | | | | | | | | | | | | Update the nullability checker to allow an explicit cast to nonnull to suppress a warning on an assignment of nil to a nonnull: id _Nonnull x = (id _Nonnull)nil; // no-warning This suppression as already possible for diagnostics on returns and function/method arguments. rdar://problem/25381178 llvm-svn: 266219
* AArch64: allow 64-bit access to sysregs.Tim Northover2016-04-131-1/+1
| | | | | | | | Although all the registers are actually 32-bits, I think we have to assume the high 32-bits could be RES0 (the ARM ARM is unclear). If so, reading as a 32-bit register can require extra zero extension operations. llvm-svn: 266212
* ARM: make Darwin's "-arch armv7em" default to hard-float.Tim Northover2016-04-131-1/+6
| | | | | | | | | | We've already paid the price for separate "armv7m" and "armv7em" slices (support in other tools), it's silly to make them identical other than the default CPU. rdar://23055688 llvm-svn: 266211
* [Clang][AVX512][Builtin] Adding support to intrinsics of ↵Michael Zuckerman2016-04-132-0/+438
| | | | | | | | pmovs{d|q}{b|w|d}{128|256|512} instruction set Differential Revision: http://reviews.llvm.org/D19023 llvm-svn: 266202
* Reverting r266199; it causes build bot failures.Aaron Ballman2016-04-131-274/+272
| | | | | | | http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/3255 http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/3517 llvm-svn: 266201
* Add functions declared in ctype.h to builtin function database. All ↵Aaron Ballman2016-04-131-272/+274
| | | | | | | | functions are annotated with nothrow and pure attribute, which enables better optimization. Patch by Taewook Oh. llvm-svn: 266199
* [OPENMP 4.0] Fixed DSA analysis for taskloop directives.Alexey Bataev2016-04-132-30/+30
| | | | | | | Patch make clang to perform analysis for task-based directives also for taskloop-based directives. llvm-svn: 266198
* [Clang][AVX512][Builtin] Adding support for VBROADCAST and ↵Michael Zuckerman2016-04-135-3/+585
| | | | | | | | | VPBROADCASTB/W/D/Q instruction set Differential Revision: http://reviews.llvm.org/D19012 llvm-svn: 266195
* [Clang][AVX512][Builtin] Adding supporting to intrinsics of ↵Michael Zuckerman2016-04-134-0/+127
| | | | | | | | cvt{b|d|q}2mask{128|256|512} and cvtmask2{b|d|q}{128|256|512} instruction set. Differential Revision: http://reviews.llvm.org/D19009 llvm-svn: 266188
* Enable support for __float128 in ClangNemanja Ivanovic2016-04-1331-52/+218
| | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D15120 It adds support for the __float128 keyword, literals and a target feature to enable it. This support is disabled by default on all targets and any target that has support for this type is free to add it. Based on feedback that I've received from target maintainers, this appears to be the right thing for most targets. I have not heard from the maintainers of X86 which I believe supports this type. I will subsequently investigate the impact of enabling this on X86. llvm-svn: 266186
* [OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.Alexey Bader2016-04-1324-32/+32
| | | | | | | | | | Putting OpenCLImageTypes.def to clangAST library violates layering requirement: "It's not OK for a Basic/ header to include an AST/ header". This fixes the modules build. Differential revision: http://reviews.llvm.org/D18954 Reviewers: Richard Smith, Vassil Vassilev. llvm-svn: 266180
* ASTWriterDecl.cpp: Prune a couple of \param(s), corresponding to r266160. ↵NAKAMURA Takumi2016-04-131-10/+0
| | | | | | [-Wdocumentation] llvm-svn: 266177
* [modules] Add some missing blockinfo records. No functionality change except ↵Richard Smith2016-04-131-0/+12
| | | | | | to llvm-bcanalyzer output. llvm-svn: 266176
* [PPC64][VSX] Add a couple of new data types for vec_vsx_ld and vec_vsx_st ↵Chuang-Yu Cheng2016-04-131-14/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | intrinsics and fix incorrect testcases with minor refactoring New added data types: vector double vec_vsx_ld (int, const double *); vector float vec_vsx_ld (int, const float *); vector bool short vec_vsx_ld (int, const vector bool short *); vector bool int vec_vsx_ld (int, const vector bool int *); vector signed int vec_vsx_ld (int, const signed int *); vector unsigned int vec_vsx_ld (int, const unsigned int *); void vec_vsx_st (vector double, int, double *); void vec_vsx_st (vector float, int, float *); void vec_vsx_st (vector bool short, int, vector bool short *); void vec_vsx_st (vector bool short, int, signed short *); void vec_vsx_st (vector bool short, int, unsigned short *); void vec_vsx_st (vector bool int, int, vector bool int *); void vec_vsx_st (vector bool int, int, signed int *); void vec_vsx_st (vector bool int, int, unsigned int *); Also fix testcases which use non-vector argument version of vec_vsx_ld or vec_vsx_st, but pass incorrect parameter. llvm-svn: 266166
* [modules] Refactor handling of cases where we write an offset to a prior ↵Richard Smith2016-04-132-29/+13
| | | | | | record into the bitstream and simplify a little, in preparation for doing this in more cases. llvm-svn: 266160
* [analyzer] Nullability: Treat nil _Nonnull ivar as invariant violation.Devin Coughlin2016-04-131-14/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Treat a _Nonnull ivar that is nil as an invariant violation in a similar fashion to how a nil _Nonnull parameter is treated as a precondition violation. This avoids warning on defensive returns of nil on defensive internal checks, such as the following common idiom: @class InternalImplementation @interface PublicClass { InternalImplementation * _Nonnull _internal; } -(id _Nonnull)foo; @end @implementation PublicClass -(id _Nonnull)foo { if (!_internal) return nil; // no-warning return [_internal foo]; } @end rdar://problem/24485171 llvm-svn: 266157
* [ObjC] Pop all cleanups created in EmitObjCForCollectionStmt beforeAkira Hatanaka2016-04-121-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exiting the for-in loop. This commit fixes a bug where EmitObjCForCollectionStmt didn't pop cleanups for captures. For example, in the following for-in loop, a block which captures self is passed to foo1: for (id x in [self foo1:^{ use(self); }]) { use(x); break; } Previously, the code in EmitObjCForCollectionStmt wouldn't pop the cleanup for the captured self before exiting the loop, which caused code-gen to generate an IR in which objc_release was called twice on the captured self. This commit fixes the bug by entering a RunCleanupsScope before the loop condition is evaluated and forcing its cleanup before exiting the loop. rdar://problem/16865751 Differential Revision: http://reviews.llvm.org/D18618 llvm-svn: 266147
* ObjC class properties: add diagnostics for unimplemented class properties.Manman Ren2016-04-121-42/+62
| | | | | | rdar://24711047 llvm-svn: 266146
* [AMDGPU] Add debugger related target optionsKonstantin Zhuravlyov2016-04-121-0/+20
| | | | | | Differential Revision: http://reviews.llvm.org/D18748 llvm-svn: 266133
* Add a fixme for an old patch I had lying around that I'm not going to finish ↵David Blaikie2016-04-121-0/+5
| | | | | | any time so n llvm-svn: 266127
* Always use --eh-frame-hdr on FreeBSD, even for -staticEd Maste2016-04-121-1/+1
| | | | | | | | | | | | FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and is expected to use it more widely in the future), and it requires the EH frame segment in static binaries. This is the same as r203742 for NetBSD. Differential Revision: http://reviews.llvm.org/D19029 llvm-svn: 266123
* Add a couple of missing vsx load and store intrinsics.Eric Christopher2016-04-121-0/+10
| | | | | | Patch by Jing Yu! llvm-svn: 266122
* Pass -backend-option to LLVM when there is no target machine.Yaxun Liu2016-04-121-16/+23
| | | | | | | | Clang should pass -backend-option to LLVM even though there is no target machine, since LLVM passes are used when emitting LLVM IR. Differential Revision: http://reviews.llvm.org/D17552 llvm-svn: 266117
* [modules] Extend r266113 to cope with submodules.Richard Smith2016-04-121-1/+3
| | | | llvm-svn: 266116
* [modules] When an incompatible module file is explicitly provided for a module,Richard Smith2016-04-121-1/+4
| | | | | | | | and we fall back to textual inclusion, don't require the module as a whole to be marked available; it's OK if some other file in the same module is missing, just as it would be if the header were explicitly marked textual. llvm-svn: 266113
* PR19957: [OpenCL] Incorrectly accepts implicit address space conversion with ↵Yaxun Liu2016-04-122-9/+75
| | | | | | | | | | | | ternary operator. Generates addrspacecast instead of bitcast for ternary operator when necessary, and diagnose ternary operator with incompatible second and third operands. https://llvm.org/bugs/show_bug.cgi?id=19957 Differential Revision: http://reviews.llvm.org/D17412 llvm-svn: 266111
* [analyzer] Nullability: Suppress return diagnostics in inlined functions.Devin Coughlin2016-04-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The nullability checker can sometimes miss detecting nullability precondition violations in inlined functions because the binding for the parameter that violated the precondition becomes dead before the return: int * _Nonnull callee(int * _Nonnull p2) { if (!p2) // p2 becomes dead here, so binding removed. return 0; // warning here because value stored in p2 is symbolic. else return p2; } int *caller(int * _Nonnull p1) { return callee(p1); } The fix, which is quite blunt, is to not warn about null returns in inlined methods/functions. This won’t lose much coverage for ObjC because the analyzer always analyzes each ObjC method at the top level in addition to inlined. It *will* lose coverage for C — but there aren’t that many codebases with C nullability annotations. rdar://problem/25615050 llvm-svn: 266109
* clang-cl: Remove -isystem, add -imsvc.Nico Weber2016-04-121-0/+4
| | | | | | | | | | | | | | | | | r260990 exposed -isystem in clang-cl. -isystem adds a directory to the front of the system include search path. The idea was to use this to point to a hermetic msvc install, but as it turns out this doesn't work: -isystem then adds the hermetic headers in front of clang's builtin headers, and clang's headers that are supposed to wrap msvc headers (say, stdarg.h) aren't picked up at all anymore. So revert that, and instead expose -imsvc which works as if the passed directory was part of %INCLUDE%: The header is treated as a system header, but it is searched after clang's lib/Header headers. Fixes half of PRPR26751. llvm-svn: 266108
* [OpenCL] Handle AddressSpaceConversion when target address space does not ↵Yaxun Liu2016-04-121-1/+4
| | | | | | | | | | | | | change. In codegen different address spaces may be mapped to the same address space for a target, e.g. in x86/x86-64 all address spaces are mapped to 0. Therefore AddressSpaceConversion should be translated by CreatePointerBitCastOrAddrSpaceCast instead of CreateAddrSpaceCast. Differential Revision: http://reviews.llvm.org/D18713 llvm-svn: 266107
* [FileManager] Don't crash if reading from stdin and stat(".") failsDavid Majnemer2016-04-121-1/+1
| | | | | | | | | | | | | addAncestorsAsVirtualDirs("<stdin>") quickly returns without doing work because "<stdin>" has no parent_path. This violates the expectation that a subsequent call to getDirectoryFromFile("<stdin>") would succeed. Instead, it fails because it uses the "." if the file has no path component. Fix this by keeping the behavior between addAncestorsAsVirtualDirs and getDirectoryFromFile symmetric. llvm-svn: 266089
* [OPENMP 4.0] Support for 'linear' clause in 'declare simd' directive.Alexey Bataev2016-04-123-64/+240
| | | | | | | | | | The linear clause declares one or more list items to be private to a SIMD lane and to have a linear relationship with respect to the iteration space of a loop. 'linear' '(' <linear-list> [ ':' <linear-step> ] ')' When a linear-step expression is specified in a linear clause it must be either a constant integer expression or an integer-typed parameter that is specified in a uniform clause on the directive. The special this pointer can be used as if was one of the arguments to the function in any of the linear, aligned, or uniform clauses. llvm-svn: 266056
* [OPENMP 4.0] Support for 'aligned' clause in 'declare simd' directive.Alexey Bataev2016-04-123-67/+165
| | | | | | | | | The aligned clause declares that the object to which each list item points is aligned to the number of bytes expressed in the optional parameter of the aligned clause. 'aligned' '(' <argument-list> [ ':' <alignment> ] ')' The optional parameter of the aligned clause, alignment, must be a constant positive integer expression. If no optional parameter is specified, implementation-defined default alignments for SIMD instructions on the target platforms are assumed. The special this pointer can be used as if was one of the arguments to the function in any of the linear, aligned, or uniform clauses. llvm-svn: 266052
* [Clang][BuiltIn][avx512] Adding avx512 (shuf,sqrt{ss|sd},rsqrt ) builtin to ↵Michael Zuckerman2016-04-122-0/+581
| | | | | | clang llvm-svn: 266048
* [OPENMP 4.0] Support for 'uniform' clause in 'declare simd' directive.Alexey Bataev2016-04-126-146/+211
| | | | | | | | | OpenMP 4.0 defines clause 'uniform' in 'declare simd' directive: 'uniform' '(' <argument-list> ')' The uniform clause declares one or more arguments to have an invariant value for all concurrent invocations of the function in the execution of a single SIMD loop. The special this pointer can be used as if was one of the arguments to the function in any of the linear, aligned, or uniform clauses. llvm-svn: 266041
* Basic: fix profiling with GNU EABISaleem Abdulrasool2016-04-121-0/+4
| | | | | | | | | The GNU profiling support indicates that the interface is `_mcount` rather than `mcount`. Conditionalise the behaviour according to the `-meabi gnu` flag. Resolves PR27311 llvm-svn: 266039
* [analyzer] Fix assertion in ReturnVisitor for body-farm synthesized gettersDevin Coughlin2016-04-121-0/+3
| | | | | | | Don't emit a path note marking the return site if the return statement does not have a valid location. This fixes an assertion failure I introduced in r265839. llvm-svn: 266031
* Allow simultaneous safestack and stackprotector attributes.Evgeniy Stepanov2016-04-111-9/+4
| | | | | | | | | This is the clang part of http://reviews.llvm.org/D18846. SafeStack instrumentation pass adds stack protector canaries if both attributes are present on a function. StackProtector pass will step back if the function has a safestack attribute. llvm-svn: 266005
* Emit the module hash by default with -flto=thin.Mehdi Amini2016-04-111-1/+2
| | | | | | | | | | | Reviewers: tejohnson Subscribers: joker.eph, cfe-commits Differential Revision: http://reviews.llvm.org/D18947 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265977
* [Clang][AVX512][BuiltIn] Adding avx512 ( ↵Michael Zuckerman2016-04-112-0/+479
| | | | | | | | psll{d|q}512,psllv{16si|8di},psra{d|q}512,psrav{16si|8di},pternlog{d|q}{128|256|512} ) builtin to clang Differential Revision: http://reviews.llvm.org/D18926 llvm-svn: 265964
* [CLANG] [AVX512] [BUILTIN] Adding PSRA{Q|D|QI|DI}{128|256|512} builtinMichael Zuckerman2016-04-112-0/+209
| | | | | | Differential Revision: http://reviews.llvm.org/D17693 llvm-svn: 265952
* [Clang][AVX512][BuiltIn] Adding avx512 ( ↵Michael Zuckerman2016-04-112-0/+585
| | | | | | | | punpck{h|l}{dq|qdq}{128|256|512},rndscale{ss|sd}, {scalef{ss|sd|pd512|ps512} ) builtin to clang Differential Revision: http://reviews.llvm.org/D18929 llvm-svn: 265935
* [clang-format] Walk backwards from end() instead of forwards from rend().Benjamin Kramer2016-04-111-1/+1
| | | | | | | | This should've been forwards from rbegin(), reverse iterators are just too confusing to be used by mere mortals. Fixes out-of-bounds walks over the list. llvm-svn: 265934
* [Clang][AVX512][BuiltIn] Adding avx512 ( ptest{n}m{b|w}{128|256|512} ) ↵Michael Zuckerman2016-04-114-0/+336
| | | | | | | | builtin to clang Differential Revision: http://reviews.llvm.org/D18924 llvm-svn: 265928
* Remove redundant conditions of the form (A || (!A && B)) -> (A || B)Benjamin Kramer2016-04-115-12/+8
| | | | | | Found by cppcheck! PR27286 PR27287 PR27288 PR27289 llvm-svn: 265918
* [GCC] Attribute ifunc support in clangDmitry Polukhin2016-04-116-27/+144
| | | | | | | | | | | This patch add support for GCC attribute((ifunc("resolver"))) for targets that use ELF as object file format. In general ifunc is a special kind of function alias with type @gnu_indirect_function. LLVM patch http://reviews.llvm.org/D15525 Differential Revision: http://reviews.llvm.org/D15524 llvm-svn: 265917
OpenPOWER on IntegriCloud