summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [OpenMP] Sema and parsing for 'target teams' pragmaKelvin Li2016-12-1713-19/+146
| | | | | | | | This patch is to implement sema and parsing for 'target teams' pragma. Differential Revision: https://reviews.llvm.org/D27818 llvm-svn: 290038
* [analyzer] UnixAPIChecker: Don't diagnose for functions in C++ namespacesDevin Coughlin2016-12-171-0/+6
| | | | | | | | | | Update the UnixAPIChecker to not diagnose for calls to functions that are declared in C++ namespaces. This avoids false positives when a namespaced function has the same name as a Unix API. This address PR28331. llvm-svn: 290023
* [analyzer] Extend UnixAPIChecker open() checks to handle openat().Devin Coughlin2016-12-161-11/+80
| | | | | | | | | The openat() API has similar constraints to the open() API -- it just takes an extra parameter. rdar://problem/29526458 llvm-svn: 290005
* IRGen: Fix assertion failure when creating debug info for an integer ↵Peter Collingbourne2016-12-161-6/+9
| | | | | | constant wider than 64 bits. llvm-svn: 289996
* Revert r289979 due to regressionsYaxun Liu2016-12-1614-338/+164
| | | | llvm-svn: 289991
* [Sema] Transform the default arguments of a lambda expression when theAkira Hatanaka2016-12-161-0/+12
| | | | | | | | | | | | | | | | lambda expression is instantiated. Rather than waiting until Sema::CheckCXXDefaultArgExpr tries to transform the default arguments (which fails because it can't get the template arguments that are used), transform the default arguments earlier when the lambda expression is transformed in TransformLambdaExpr. rdar://problem/27535319 Differential Revision: https://reviews.llvm.org/D23096 llvm-svn: 289990
* [OpenMP] support the 'is_device_ptr' clause with 'target parallel' pragmaKelvin Li2016-12-161-2/+3
| | | | | | | | This patch is to add support of the 'is_device_ptr' clause in the 'target parallel' pragma. Differential Revision: https://reviews.llvm.org/D27821 llvm-svn: 289989
* Revert "Update for LLVM global variable debug info API change."Adrian Prantl2016-12-162-28/+20
| | | | | | This reverts commit r289921. llvm-svn: 289984
* [OpenCL] Allow disabling types and declarations associated with extensionsYaxun Liu2016-12-1614-164/+338
| | | | | | | | | | | | | | | | | | Added a map to associate types and declarations with extensions. Refactored existing diagnostic for disabled types associated with extensions and extended it to declarations for generic situation. Fixed some bugs for types associated with extensions. Allow users to use pragma to declare types and functions for supported extensions, e.g. #pragma OPENCL EXTENSION the_new_extension_name : begin // declare types and functions associated with the extension here #pragma OPENCL EXTENSION the_new_extension_name : end Differential Revision: https://reviews.llvm.org/D21698 llvm-svn: 289979
* [analyzer] Fix crash in MallocChecker.Devin Coughlin2016-12-161-2/+1
| | | | | | | | | | | | | Fix a crash in the MallocChecker when the extent size for the argument to new[] is not known. A patch by Abramo Bagnara and Dániel Krupp! https://reviews.llvm.org/D27849 Differential Revision: https://reviews.llvm.org/D27849 llvm-svn: 289970
* [analyzer] Add another exception for Qt in MallocCheckerArtem Dergachev2016-12-161-0/+5
| | | | | | | | | | Treat pointers passed to QObject::connectImpl() as escaping. rdar://problem/29550440 Differential Revision: https://reviews.llvm.org/D27717 llvm-svn: 289939
* Update for LLVM global variable debug info API change.Adrian Prantl2016-12-162-20/+28
| | | | llvm-svn: 289921
* [Sema] Fix handling of enumerators used as default arguments of lambdaAkira Hatanaka2016-12-162-2/+7
| | | | | | | | | | | | | | | | | expressions in a function or class template. This patch makes the following changes: - Create a DependentScopeDeclRefExpr for the default argument instead of a CXXDependentScopeMemberExpr. - Pass CombineWithOuterScope=true so that the outer scope in which the enum is declared is searched for the instantiation of the enum. This is the first part of https://reviews.llvm.org/D23096. Fixes PR28795 rdar://problem/27535319 llvm-svn: 289914
* Revert "Update for LLVM global variable debug info API change."Adrian Prantl2016-12-162-28/+20
| | | | | | This reverts commit 289901 while investigating bot breakage. llvm-svn: 289908
* [c++1z] P0195R2: Allow multiple using-declarators in a single using-declaration.Richard Smith2016-12-164-159/+266
| | | | llvm-svn: 289905
* Update for LLVM global variable debug info API change.Adrian Prantl2016-12-162-20/+28
| | | | llvm-svn: 289901
* [analyzer] Teach the analyzer that pointers can escape into __cxa_demangleAnna Zaks2016-12-151-0/+5
| | | | | | | | This fixes a reported false positive in the malloc checker. Differential Revision: https://reviews.llvm.org/D27599 llvm-svn: 289886
* [analyzer] Refine the diagnostics in the nullability checker to ↵Anna Zaks2016-12-151-5/+10
| | | | | | | | | | | | differentiate between nil and null This is a big deal for ObjC, where nullability annotations are extensively used. I've also changed "Null" -> "null" and removed "is" as this is the pattern that Sema is using. Differential Revision: https://reviews.llvm.org/D27600 llvm-svn: 289885
* [analyzer] Refer to macro names in diagnostics for macros representing a literalAnna Zaks2016-12-151-5/+49
| | | | | | | | | | | | | When a macro expending to a literal is used in a comparison, use the macro name in the diagnostic rather than the literal. This improves readability of path notes. Added tests for various macro literals that could occur. Only BOOl, Int, and NULL tests have changed behavior with this patch. Differential Revision: https://reviews.llvm.org/D27726 llvm-svn: 289884
* [analyzer] Include type name in Retain Count Checker diagnosticsAnna Zaks2016-12-151-2/+14
| | | | | | | | | The more detailed diagnostic will make identifying which object the diagnostics refer to easier. Differential Revision: https://reviews.llvm.org/D27740 llvm-svn: 289883
* [analyzer] Add a new SVal to support pointer-to-member operations.Devin Coughlin2016-12-156-42/+267
| | | | | | | | | | | Add a new type of NonLoc SVal for C++ pointer-to-member operations. This SVal supports both pointers to member functions and pointers to member data. A patch by Kirill Romanenkov! Differential Revision: https://reviews.llvm.org/D25475 llvm-svn: 289873
* Add a class ASTRecordReader which wraps an ASTReader, a RecordData, and ↵David L. Jones2016-12-153-1447/+1378
| | | | | | | | | | | | | | | | | | | | | ModuleFile. Summary: When reading an ASTRecord, each RecordData is logically contained within a single ModuleFile, and global(er) state is contained by a single ASTReader. This means that any operations that read from a RecordData and reference an ASTReader or a ModuleFile, will always reference the same ASTReader or ModuleFile. ASTRecordReader groups these together so that parameters don't need to be duplicated ad infinitum. Most uses of the Idx variable seem to be redunant aliases as well, but I'll leave that for now. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27784 llvm-svn: 289870
* [CUDA] Add --ptxas-path= flag.Justin Lebar2016-12-151-1/+5
| | | | | | | | | | | | | | | | | Summary: This lets you build with one CUDA installation but use ptxas from another install. This is useful e.g. if you want to avoid bugs in an old ptxas without actually upgrading wholesale to a newer CUDA version. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27788 llvm-svn: 289847
* [Driver] Bump default x86 cpu to Penryn when targeting macosx10.12+.Ahmed Bougacha2016-12-151-0/+5
| | | | | | 10.12 dropped support for all pre-Penryn Macs. llvm-svn: 289839
* Fix typo in comment. NFC.Kelvin Li2016-12-151-1/+1
| | | | llvm-svn: 289836
* CodeGen: ubsan is built static on windows, give handlers local storageSaleem Abdulrasool2016-12-151-1/+2
| | | | | | | | | The UBSAN runtime is built static on Windows. This requires that we give local storage always. This impacts Windows where the linker would otherwise have to generate a thunk to access the symbol via the IAT. This should repair the windows clang build bots. llvm-svn: 289829
* Re-commit r289252 and r289285, and fix PR31374Yaxun Liu2016-12-1514-61/+212
| | | | llvm-svn: 289787
* [ARM] Implement execute-only support in CodeGenPrakhar Bahuguna2016-12-151-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This implements execute-only support for ARM code generation, which prevents the compiler from generating data accesses to code sections. The following changes are involved: * Add the CodeGen option "-arm-execute-only" to the ARM code generator. * Add the clang flag "-mexecute-only" as well as the GCC-compatible alias "-mpure-code" to enable this option. * When enabled, literal pools are replaced with MOVW/MOVT instructions, with VMOV used in addition for floating-point literals. As the MOVT instruction is required, execute-only support is only available in Thumb mode for targets supporting ARMv8-M baseline or Thumb2. * Jump tables are placed in data sections when in execute-only mode. * The execute-only text section is assigned section ID 0, and is marked as unreadable with the SHF_ARM_PURECODE flag with symbol 'y'. This also overrides selection of ELF sections for globals. Reviewers: t.p.northover, rengolin Subscribers: llvm-commits, aemerson Differential Revision: https://reviews.llvm.org/D27450 llvm-svn: 289786
* CodeGen: force builtins to be localSaleem Abdulrasool2016-12-151-3/+3
| | | | | | | | Unfortunately _setjmp3 can be both import or local. The ASAN tests try to emulate the flags which makes this harder to detect. Rely on the linker creating or using thunks here instead. Should repair the ASAN windows bots. llvm-svn: 289783
* CodeGen: fix runtime function dll storageSaleem Abdulrasool2016-12-157-21/+80
| | | | | | | | | | | | | | | | | Properly attribute DLL storage to runtime functions. When generating the runtime function, scan for an existing declaration which may provide an explicit declaration (local storage) or a DLL import or export storage from the user. Honour that if available. Otherwise, if building with a local visibility of the public or standard namespaces (-flto-visibility-public-std), give the symbols local storage (it indicates a /MT[d] link, so static runtime). Otherwise, assume that the link is dynamic, and give the runtime function dllimport storage. This allows for implementations to get the correct storage as long as they are properly declared, the user to override the import storage, and in case no explicit storage is given, use of the import storage. llvm-svn: 289776
* Fix os_log formating with arbitrary precision and field widthMehdi Amini2016-12-151-2/+27
| | | | llvm-svn: 289761
* [c++1z] Permit constant evaluation of a call through a function pointer whoseRichard Smith2016-12-153-22/+22
| | | | | | | type differs from the type of the actual function due to having a different exception specification. llvm-svn: 289754
* Move checks for creation of objects of abstract class type from the variousRichard Smith2016-12-153-10/+33
| | | | | | | | | constructs that can do so into the initialization code. This fixes a number of different cases in which we used to fail to check for abstract types. Thanks to Tim Shen for inspiring the weird code that uncovered this! llvm-svn: 289753
* Include SmallSet.h in BackendUtil.cppHal Finkel2016-12-151-0/+1
| | | | | | | | BackendUtil.cpp uses llvm::SmallSet but did not include the header. It was included indirectly, but this will change once the AssumptionCache is removed. NFC. llvm-svn: 289752
* Use PIC relocation mode by default for PowerPC64 ELFJoerg Sonnenberger2016-12-151-1/+9
| | | | | | | | | | | | | | Most of the PowerPC64 code generation already creates PIC access. This changes to a full PIC default, similar to what GCC is doing. Overall, a monolithic clang binary shrinks by 600KB (about 1%). This can be a slight regression for TLS access and will use the TOC more aggressively instead of synthesizing immediates. It is expected to be performance neutral. Differential Revision: https://reviews.llvm.org/D26564 llvm-svn: 289744
* Create SampleProfileLoader pass in llvm instead of clangDehao Chen2016-12-141-4/+2
| | | | | | | | | | | | | | Summary: We used to create SampleProfileLoader pass in clang. This makes LTO/ThinLTO unable to add this pass in the linker plugin. This patch moves the SampleProfileLoader pass creation from clang to llvm pass manager builder. Reviewers: tejohnson, davidxl, dnovillo Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D27744 llvm-svn: 289715
* Revert 289252 (and follow-up 289285), it caused PR31374Nico Weber2016-12-1414-212/+61
| | | | llvm-svn: 289713
* [DebugInfo] Changed DIBuilder::createCompileUnit() to take DIFile instead of ↵Amjad Aboud2016-12-141-5/+7
| | | | | | | | | | | | FileName and Directory. This way it will be easier to expand DIFile (e.g., to contain checksum) without the need to modify the createCompileUnit() API. Reviewers: cfe-commits, rnk Differential Revision: https://reviews.llvm.org/D27763 llvm-svn: 289701
* Remove unused variable found by GCC warning.Richard Smith2016-12-141-1/+1
| | | | llvm-svn: 289698
* AArch64: add architecture version feature to Clang invocation.Tim Northover2016-12-141-2/+4
| | | | | | | Otherwise we don't get the correct predefines and so on in the front-end (or the right features in the backend). llvm-svn: 289692
* Improve our handling of tag decls in function prototypesReid Kleckner2016-12-141-30/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | r289225 broke AST invariants by reparenting enumerators into function decl contexts. This improves things by only reparenting TagDecls while also attempting to preserve the lexical declcontext chain. The interesting example here is: int f(struct S { enum E { a = 1 } b; } c); The semantic contexts of E and S should be f, and the lexical context of S should be f and the lexical context of E should be S. We didn't do that with r289225, but now we should. This change should also improve our behavior on this example: void f() { extern void ext(struct S { } o); // S injected here } Before r289225 we would only remove 'S' from the surrounding tag injection context if it was the TU, but now we properly reparent S from f to ext. Fixes PR31366 llvm-svn: 289678
* revert r289670 which breaks bot.Dehao Chen2016-12-141-2/+4
| | | | llvm-svn: 289675
* Create SampleProfileLoader pass in llvm instead of clangDehao Chen2016-12-141-4/+2
| | | | | | | | | | | | | | Summary: We used to create SampleProfileLoader pass in clang. This makes LTO/ThinLTO unable to add this pass in the linker plugin. This patch moves the SampleProfileLoader pass creation from clang to llvm pass manager builder. Reviewers: tejohnson, davidxl, dnovillo Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D27744 llvm-svn: 289670
* [Driver] Allow setting the default linker during buildPetr Hosek2016-12-143-33/+34
| | | | | | | | | This change allows setting the default linker used by the Clang driver when configuring the build. Differential Revision: https://reviews.llvm.org/D25263 llvm-svn: 289668
* Update the default of the Mozilla coding styleSylvestre Ledru2016-12-141-1/+3
| | | | | | | | | | | | | | Summary: I also proposed the change in Firefox .clang-format file: https://bugzilla.mozilla.org/show_bug.cgi?id=1322321 Reviewers: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27557 llvm-svn: 289660
* Fix assert message. NFC.Kelvin Li2016-12-141-1/+1
| | | | llvm-svn: 289657
* Fixing cast condition for removing casts from builtin FPClassification.Neil Hickey2016-12-141-7/+10
| | | | | | | | | | | The function SemaBuiltinFPClassification removed superfluous float to double casts, this was changed to also remove float to float casts but this isn't valid in all cases, for example when doing an rvaluetolvalue cast. Added a check to only remove if this was a conventional floating cast. Added additional tests into SemaOpenCL/extensions to cover these cases llvm-svn: 289650
* Replace APFloatBase static fltSemantics data members with getter functionsStephan Bergmann2016-12-1411-72/+72
| | | | | | | | | | | | | At least the plugin used by the LibreOffice build (<https://wiki.documentfoundation.org/Development/Clang_plugins>) indirectly uses those members (through inline functions in LLVM/Clang include files in turn using them), but they are not exported by utils/extract_symbols.py on Windows, and accessing data across DLL/EXE boundaries on Windows is generally problematic. Differential Revision: https://reviews.llvm.org/D26671 llvm-svn: 289647
* [c++1z] P0217R3: Allow by-value structured binding of arrays.Richard Smith2016-12-142-10/+22
| | | | llvm-svn: 289630
* [PS4] Undo dialect tweak for Objective-C.Paul Robinson2016-12-141-2/+4
| | | | | | | | In r267772, we had set the PS4's default dialect for both C and Objective-C to gnu99. Make that change only for C; we don't really support Objective-C/C++ so there's no point fiddling the dialect. llvm-svn: 289625
OpenPOWER on IntegriCloud