summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add a missing call to MDNode::deleteTemporary().Adrian Prantl2016-02-061-3/+4
| | | | | | | | Follow-up to r259975. Kudos to the ASAN bots! <rdar://problem/24493203> llvm-svn: 260002
* [analyzer] DeallocChecker: Don't warn on release of readonly assign property ↵Devin Coughlin2016-02-061-0/+6
| | | | | | | | | in dealloc. It is common for the ivars for read-only assign properties to always be stored retained, so don't warn for a release in dealloc for the ivar backing these properties. llvm-svn: 259998
* Re-apply r259977 - [OpenMP] Reorganize code to allow specialized code ↵Samuel Antao2016-02-065-2/+86
| | | | | | | | generation for different devices. This was reverted due to a failure in a buildbot, but it turned out the failure was unrelated. llvm-svn: 259985
* Revert r259977 - [OpenMP] Reorganize code to allow specialized code ↵Samuel Antao2016-02-065-86/+2
| | | | | | | | generation for different devices. It triggered some problem in the configuration related with zlib and exposed in the driver. llvm-svn: 259984
* [OpenMP] Reorganize code to allow specialized code generation for different ↵Samuel Antao2016-02-065-2/+86
| | | | | | | | | | | | | | | | | | | | | | | devices. Summary: Different devices may in some cases require different code generation schemes in order to implement OpenMP. This is required not only for performance reasons, but also because it may not be possible to have the current (default) implementation working for these devices. E.g. GPU's cannot implement the same scheme a target such as powerpc or x86b would use, in the sense that it does not have the ability to fork threads, instead all the threads are always executing and need to be managed by the implementation. This patch proposes a reorganization of the code in the OpenMP code generation to pave the way to have specialized implementation of OpenMP support. More than a "real" patch this is more a request for comments in order to understand if what is proposed is acceptable or if there are better/easier ways to do it. In this patch part of the common OpenMP codegen infrastructure is moved to a new file under a new namespace (CGOpenMPCommon) so it can be shared between the default implementation and the specialized one. When CGOpenMPRuntime is created, an attempt to select a specialized implementation is done. In the patch a specialization for nvptx targets is done which currently checks if the target is an OpenMP device and trap if it is not. Let me know comments suggestions you may have. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: Hahnfeld, cfe-commits, fraggamuffin, caomhin, jholewinski Differential Revision: http://reviews.llvm.org/D16784 llvm-svn: 259977
* [modules] Compress files embedded into a .pcm file, to reduce the disk usage ↵Richard Smith2016-02-062-37/+70
| | | | | | of -fembed-all-files mode. llvm-svn: 259976
* Fix a crash when emitting dbeug info for forward-declared scoped enums.Adrian Prantl2016-02-061-1/+13
| | | | | | | | | | It is possible for enums to be created as part of their own declcontext. We need to cache a placeholder to avoid the type being created twice before hitting the cache. <rdar://problem/24493203> llvm-svn: 259975
* Eliminate an unnecessary enum, use the LLVM version. NFCPaul Robinson2016-02-052-17/+5
| | | | llvm-svn: 259950
* Exempt char array initializers from -Wconstant-converion.Richard Trieu2016-02-051-24/+39
| | | | | | | | Sometimes, char arrays are used as bit storage, with no difference made between signed and unsigned char. Thus, it is reasonable to use 0 to 255 instead of -128 to 127 and not trigger this warning. llvm-svn: 259947
* [CUDA] Bug 26497 : Remove wrappers for variants provided by CUDA headers.Artem Belevich2016-02-051-99/+59
| | | | | | | | ... and pull global-scope ones into std namespace with using-declaration. Differential Revision: http://reviews.llvm.org/D16932 llvm-svn: 259944
* Move DebugInfoKind enum from Driver to Basic. NFCPaul Robinson2016-02-051-1/+1
| | | | llvm-svn: 259935
* Add an ARC autoreleased-return-value caller marker on i386.John McCall2016-02-051-0/+5
| | | | | | rdar://24531556 llvm-svn: 259932
* [SystemZ] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macrosUlrich Weigand2016-02-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_[1248] macros on SystemZ. This fixes a miscompile of GCC C++11 standard library headers due to use of those macros in an ABI-changing manner. See e.g. /usr/include/c++/4.8.5/ext/concurrence.h: // Compile time constant that indicates prefered locking policy in // the current configuration. static const _Lock_policy __default_lock_policy = #ifdef __GTHREADS #if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) \ && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) _S_atomic; #else _S_mutex; #endif #else _S_single; #endif A different choice of __default_lock_policy causes different sizes of several of the C++11 data structures, which are then incompatible when inlined in clang-compiled code with what the (GCC-compiled) external library expects. This in turn leads to various crashes when using std::thread in code compiled with clang, as see e.g. via the ThreadPool unit tests. See PR 26473 for an example. llvm-svn: 259931
* Do not honor explicit alignment attribute on fields for PS4.Sunil Srivastava2016-02-053-2/+9
| | | | | | | | This change reverts r257462 for PS4 triple. Differential Revision: http://reviews.llvm.org/D16788 llvm-svn: 259916
* [Parser] Perform CachedTokens update dependent on token consumptionBruno Cardoso Lopes2016-02-051-2/+6
| | | | | | | | | | | | | | In the context where we break one tok::greatergreater into two tok::greater in order to correctly update the cached tokens; update the CachedTokens with two tok::greater only if ParseGreaterThanInTemplateList clients asks to consume the last token. Otherwise we only need to add one because the second is already added later on, as a not yet cached token. Differential Revision: http://reviews.llvm.org/D16906 rdar://problem/24488367 llvm-svn: 259910
* [modules] Separately track whether an identifier's preprocessor information andRichard Smith2016-02-053-2/+7
| | | | | | | | | | name lookup information have changed since deserialization. For a C++ modules build, we do not need to re-emit the identifier into the serialized identifier table if only the name lookup information has changed (and in all cases, we don't need to re-emit the macro information if only the name lookup information has changed). llvm-svn: 259901
* [ASTMatchers] Allow hasName() to look through inline namespacesSamuel Benzaquen2016-02-051-21/+125
| | | | | | | | | | | | | | | | | Summary: Allow hasName() to look through inline namespaces. This will fix the interaction between some clang-tidy checks and libc++. libc++ defines names in an inline namespace named std::<version_#>. When we try to match a name using hasName("std::xxx") it fails to match and the clang-tidy check does not work. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D15506 llvm-svn: 259898
* clang-format: Fix corner case in template detection.Daniel Jasper2016-02-052-7/+16
| | | | | | | | | | Before: f(a.operator() < A > ()); After: f(a.operator()<A>()); llvm-svn: 259884
* [analyzer] Suppress localization diagnostics in debug classes and methods.Devin Coughlin2016-02-051-0/+35
| | | | | | | If the class or method name case-insensitively contains the term "debug", suppress warnings about string constants flowing to user-facing UI APIs. llvm-svn: 259875
* CodeGen: correct Windows ARM C++ assertionSaleem Abdulrasool2016-02-051-15/+0
| | | | | | | | | | | Because the Decl is explicitly passed as nullptr further up the call chain, it is possible to invoke isa on a nullptr, which will assert. Guard against the nullptr. Take the opportunity to reuse the helper method rather than re-implementing this logic. llvm-svn: 259874
* [modules] Factor out common code to mark identifier being "from AST", and add aRichard Smith2016-02-051-15/+15
| | | | | | | call in one more place to reduce the size of identifier tables in non-leaf modules. No behavior change. llvm-svn: 259866
* Don't synthesize an ImportDecl for a module named in -fmodule-implementation-ofBen Langmuir2016-02-051-1/+7
| | | | | | | | | | When building a PCH with modules enabled this import would assert in the ASTWriter and (if assertions were disabled) sometimes crash the compiler that loaded the resulting PCH when trying to lookup the submodule ID. rdar://problem/24137448 llvm-svn: 259859
* PR25271: When attaching default template arguments to redeclarations of aRichard Smith2016-02-041-0/+2
| | | | | | | | | template, keep looking for default arguments if we see a template parameter pack. There may be default arguments preceding a pack with no default argument. Patch by Jannis Harder! llvm-svn: 259836
* Fix a crash when there is a typo in the return statement.Manman Ren2016-02-041-0/+5
| | | | | | | | | | | | | | If the typo happens after a successful deduction for an earlier return statement, we should check if the deduced type is null before using it. The typo correction happens after we try to deduce the return type and we ignore the deduction from the typo and continue to typo correction. rdar://24342247 llvm-svn: 259820
* [PGO] code simplification: use existing VP annotation API /NFCXinliang David Li2016-02-041-27/+3
| | | | llvm-svn: 259819
* [PGO] cc1 option name change for profile instrumentationRong Xu2016-02-047-16/+37
| | | | | | | | | | | | This patch changes cc1 option -fprofile-instr-generate to an enum option -fprofile-instrument={clang|none}. It also changes cc1 options -fprofile-instr-generate= to -fprofile-instrument-path=. The driver level option -fprofile-instr-generate and -fprofile-instr-generate= remain intact. This change will pave the way to integrate new PGO instrumentation in IR level. Review: http://reviews.llvm.org/D16730 llvm-svn: 259811
* [x86] Correct setting of WIntType for MCU targetAndrey Bokhanko2016-02-041-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D16626 llvm-svn: 259780
* [OPENMP 4.0] Fixed support of array sections/array subscripts.Alexey Bataev2016-02-047-109/+205
| | | | | | Codegen for array sections/array subscripts worked only for expressions with arrays as base. Patch fixes codegen for bases with pointer/reference types. llvm-svn: 259776
* Basic: mark TLS as supported on Windows on ARMSaleem Abdulrasool2016-02-041-1/+0
| | | | | | | LLVM can now lower TLS access as per the MS ABI on ARM. This enables the generation of TLS access for Windows on ARM. llvm-svn: 259751
* PR23057: fix use-after-free due to local token buffer in ↵Alexey Bataev2016-02-041-1/+19
| | | | | | | | | | ParseCXXAmbiguousParenExpression, by Dmitry Polukhin Differential Revision: http://reviews.llvm.org/D16572 A test/Parser/cxx-ambig-paren-expr-asan.cpp M lib/Parse/ParseExprCXX.cpp llvm-svn: 259750
* Fix predefine for __NSConstantString struct typeBen Langmuir2016-02-044-22/+44
| | | | | | | | | | | | | | | | | Per review feedback the name was wrong and it can be used outside Objective-C. Unfortunately, making the internal struct visible broke some ASTMatchers tests that assumed that the first record decl would be from user code, rather than a builtin type. I'm worried that this will also affect users' code. So this patch adds a typedef to wrap the internal struct and only makes the typedef visible to namelookup. This is sufficient to allow the ASTReader to merge the decls we need without making the struct itself visible. rdar://problem/24425801 llvm-svn: 259734
* Reapply r259624, it is likely not the commit causing the bot failures.Quentin Colombet2016-02-034-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original message: Make CF constant string decl visible to name lookup to fix module errors The return type of the __builtin___*StringMakeConstantString functions is a pointer to a struct, so we need that struct to be visible to name lookup so that we will correctly merge multiple declarations of that type if they come from different modules. Incidentally, to make this visible to name lookup we need to rename the type to __NSConstantString, since the real NSConstantString is an Objective-C interface type. This shouldn't affect anyone outside the compiler since users of the constant string builtins cast the result immediately to CFStringRef. Since this struct type is otherwise implicitly created by the AST context and cannot access namelookup, we make this a predefined type and initialize it in Sema. Note: this issue of builtins that refer to types not visible to name lookup technically also affects other builtins (e.g. objc_msgSendSuper), but in all other cases the builtin is a library builtin and the issue goes away if you include the library that defines the types it uses, unlike for these constant string builtins. rdar://problem/24425801 llvm-svn: 259721
* [cfi] Safe handling of unaddressable vtable pointers (clang).Evgeniy Stepanov2016-02-034-5/+55
| | | | | | | | | | | Avoid crashing when printing diagnostics for vtable-related CFI errors. In diagnostic mode, the frontend does an additional check of the vtable pointer against the set of all known vtable addresses and lets the runtime handler know if it is safe to inspect the vtable. http://reviews.llvm.org/D16823 llvm-svn: 259716
* Revert r259624 - Make CF constant string decl visible to name lookup to fix ↵Quentin Colombet2016-02-034-19/+4
| | | | | | | | | module errors. This breaks some internal bots in stage2: clang seg fault. Looking with Ben to see what is going on. llvm-svn: 259715
* [CUDA] added declarations for device-side system callsArtem Belevich2016-02-031-8/+35
| | | | | | ...and std:: wrappers for free/malloc. llvm-svn: 259690
* Ensure that we substitute into the declaration of a template parameter packRichard Smith2016-02-031-4/+32
| | | | | | | (that is not a pack expansion) during template argument deduction, even if we deduced that the pack would be empty. llvm-svn: 259688
* Refactor conversion of deduced template arguments to reduce repetition.Richard Smith2016-02-031-103/+49
| | | | llvm-svn: 259687
* [Sema debugger support] Require non-void types to be complete in ↵Douglas Gregor2016-02-031-0/+6
| | | | | | | | | | unknown-anytype casts. When performing a cast from an __unknown_anytype function call to a non-void type, we need to make sure that type is complete. Fixes rdar://problem/23959960. llvm-svn: 259681
* Fix regression from r259622: the operand of an increment that is the operand ofRichard Smith2016-02-031-2/+2
| | | | | | | a cast expression is not the operand of a cast expression itself, so if it's parenthesized we need to form a ParenExpr not a ParenListExpr. llvm-svn: 259677
* Add builtins for bitreverse intrinsicMatt Arsenault2016-02-031-42/+45
| | | | | | | Follow the naming convention that bswap uses since it's a similar sort of operation. llvm-svn: 259671
* clang-format: Fix formatting of ternary expressions with comments.Daniel Jasper2016-02-031-4/+8
| | | | | | | | | | | | | | Before: int i = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? /*bbbbbbbbbbbbbbbbbbbb=*/bbbbbbbbbbbbbbbbbbbbbbbbb : ccccccccccccccccccccccccccc; After: int i = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? /*bbbbbbbbbbbbbbbbbbbb=*/bbbbbbbbbbbbbbbbbbbbbbbbb : ccccccccccccccccccccccccccc; llvm-svn: 259670
* [OpenMP] Parsing + sema for target parallel for directive.Arpith Chacko Jacob2016-02-0313-14/+287
| | | | | | | | | | | Summary: This patch adds parsing + sema for the target parallel for directive along with testcases. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16759 llvm-svn: 259654
* Minor cleanup to remove casts and improve some const correctness. NFC.Aaron Ballman2016-02-031-26/+26
| | | | | | Patch by Alexander Riccio. llvm-svn: 259652
* [OpenCL] Adding reserved operator logical xor for OpenCLAnastasia Stulova2016-02-033-0/+7
| | | | | | | | | | | | | | | | | | This patch adds the reserved operator ^^ when compiling for OpenCL (spec v1.1 s6.3.g), which results in a more meaningful error message. Patch by Neil Hickey! Review: http://reviews.llvm.org/D13280 M test/SemaOpenCL/unsupported.cl M include/clang/Basic/TokenKinds.def M include/clang/Basic/DiagnosticParseKinds.td M lib/Basic/OperatorPrecedence.cpp M lib/Lex/Lexer.cpp M lib/Parse/ParseExpr.cpp llvm-svn: 259651
* [analyzer] AnalysisConsumer: print fully-qualified function name while ↵Yury Gribov2016-02-031-1/+1
| | | | | | | | | | | displaying progress -analyzer-display progress option prints only function names which may be ambiguous. This patch forces AnalysisConsumer to print fully-qualified function names. Patch by Alex Sidorin! Differential Revision: http://reviews.llvm.org/D16804 llvm-svn: 259646
* -inline-asm][X86] Add ability to use AVX512 in MS inline asmMarina Yatsina2016-02-032-1/+14
| | | | | | | | | Defined the new AVX512 registers in clang inline asm. Fixed a bug in the MC subtarget info creation during the parsing of MS asm statement - now it receives the actual CPU and target features information. Differential Revision: http://reviews.llvm.org/D16757 llvm-svn: 259639
* Reduce initial Sema memory consumption by 400KB. By Elisavet Sakellari.Axel Naumann2016-02-031-1/+1
| | | | llvm-svn: 259637
* clang-format: [JS/TypeScript] Support "enum" as an optional property name, too.Daniel Jasper2016-02-031-1/+2
| | | | | | | | | | | Before: enum?: string []; After: enum?: string[]; llvm-svn: 259628
* Make CF constant string decl visible to name lookup to fix module errorsBen Langmuir2016-02-034-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | The return type of the __builtin___*StringMakeConstantString functions is a pointer to a struct, so we need that struct to be visible to name lookup so that we will correctly merge multiple declarations of that type if they come from different modules. Incidentally, to make this visible to name lookup we need to rename the type to __NSConstantString, since the real NSConstantString is an Objective-C interface type. This shouldn't affect anyone outside the compiler since users of the constant string builtins cast the result immediately to CFStringRef. Since this struct type is otherwise implicitly created by the AST context and cannot access namelookup, we make this a predefined type and initialize it in Sema. Note: this issue of builtins that refer to types not visible to name lookup technically also affects other builtins (e.g. objc_msgSendSuper), but in all other cases the builtin is a library builtin and the issue goes away if you include the library that defines the types it uses, unlike for these constant string builtins. rdar://problem/24425801 llvm-svn: 259624
* Fix miscompile and rejects-valids when disambiguating after an ambiguousRichard Smith2016-02-031-3/+12
| | | | | | | C-style-cast to function/array type or parenthesized function-style cast/array indexing. llvm-svn: 259622
OpenPOWER on IntegriCloud