summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [MS] Pass non-trivially-copyable objects indirectly on Windows ARMReid Kleckner2016-08-251-0/+6
| | | | | | | | | | This isn't exactly what MSVC does, unfortunately. MSVC does not pass objects with destructors but no copy constructors by address. More ARM expertise is required to really understand what should be done here. Fixes PR29136. llvm-svn: 279764
* [Sema][Comments] Add support for TypeAliasTemplateBruno Cardoso Lopes2016-08-251-0/+14
| | | | | | | | | | | | | | | | Emit proper diagnostics when -Wdocumentation is used with constructs such as: template<typename T> using fn = int(T aaa, int ccc); Previously clang wouldn't recognize the function and complain with 'comment that is not attached to a function declaration'. Differential Revision: https://reviews.llvm.org/D23860 rdar://problem/27300695 llvm-svn: 279754
* clang-format: [JS] nested and tagged template strings.Martin Probst2016-08-253-23/+71
| | | | | | | | | | | | | | | | | | | JavaScript template strings can be nested arbitrarily: foo = `text ${es.map(e => { return `<${e}>`; })} text`; This change lexes nested template strings using a stack of lexer states to correctly switch back to template string lexing on closing braces. Also, reuse the same stack for the token-stashed logic. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D22431 llvm-svn: 279727
* Remove a pointless LLVM_CONSTEXPR. NFC.George Burgess IV2016-08-251-1/+1
| | | | llvm-svn: 279702
* Lazily load the ContextDecl for a lambda's DefinitionData, to fix aRichard Smith2016-08-253-2/+8
| | | | | | | deserialization cycle caused by the ContextDecl recursively importing members of the lambda's closure type. llvm-svn: 279694
* [Sema][Comments] Factor out function type loc logic. NFCIBruno Cardoso Lopes2016-08-251-64/+64
| | | | | | This is in prepatation for @param TypeAliasTemplate support. llvm-svn: 279691
* DebugInfo: Let -gsplit-dwarf and -gmlt compose if -fno-split-dwarf-inlining ↵David Blaikie2016-08-241-7/+17
| | | | | | | | | | | is used If the inline info is not duplicated into the skeleton CU, then there's value in using -gsplit-dwarf and -gmlt together (to keep all those extra subprograms out of the skeleton CU, while also producing smaller .dwo files) llvm-svn: 279687
* PR29097: add an update record when we instantiate the default memberRichard Smith2016-08-245-0/+42
| | | | | | initializer of an imported field. llvm-svn: 279667
* [Sema][Comments] Support @param with c++ 'using' keywordBruno Cardoso Lopes2016-08-241-6/+6
| | | | | | | | | | | | | Give appropriate warnings with -Wdocumentation for @param comments that refer to function aliases defined with 'using'. Very similar to typedef's behavior. This does not add support for TypeAliasTemplateDecl yet. Differential Revision: https://reviews.llvm.org/D23783 rdar://problem/27300695 llvm-svn: 279662
* DebugInfo: Add flag to CU to disable emission of inline debug info into the ↵David Blaikie2016-08-243-1/+7
| | | | | | | | | | skeleton CU In cases where .dwo/.dwp files are guaranteed to be available, skipping the extra online (in the .o file) inline info can save a substantial amount of space - see the original r221306 for more details there. llvm-svn: 279651
* [Pragma] Clear loop distribution attribute between loopsAdam Nemet2016-08-241-0/+1
| | | | llvm-svn: 279608
* Remove excessive padding from PTHStatData (NFC)Mehdi Amini2016-08-241-2/+2
| | | | | | | | | | | | | This diff reorders the fields and removes excessive padding. This fixes the following warning: PTHLexer.cpp:629:7: warning: Excessive padding in 'class (anonymous namespace)::PTHStatData' (14 padding bytes, where 6 is optimal). Optimal fields order: Size, ModTime, UniqueID, HasData, IsDirectory, consider reordering the fields or adding explicit padding members. Patch by: Alexander Shaposhnikov <shal1t712@gmail.com> Differential Revision: https://reviews.llvm.org/D23826 llvm-svn: 279607
* Fix member call on null pointer, found by sanitizer buildbot.Richard Smith2016-08-231-2/+4
| | | | llvm-svn: 279571
* Remove two dos line endings.Nico Weber2016-08-231-2/+2
| | | | llvm-svn: 279558
* Fix regression introduced by r279164: only pass definitions as the PatternDefRichard Smith2016-08-234-62/+62
| | | | | | | | | | | | | | | | | | | | | | | | | to DiagnoseUninstantiableTemplate, teach hasVisibleDefinition to correctly determine whether a function definition is visible, and mark both the function and the template as visible when merging function template definitions to provide hasVisibleDefinition with the relevant information. The change to always pass the right declaration as the PatternDef to DiagnoseUninstantiableTemplate also caused those checks to happen before other diagnostics in InstantiateFunctionDefinition, giving worse diagnostics for the same situations, so I sunk the relevant diagnostics into DiagnoseUninstantiableTemplate. Those parts of this patch are based on changes in reviews.llvm.org/D23492 by Vassil Vassilev. This reinstates r279486, reverted in r279500, with a fix to DiagnoseUninstantiableTemplate to only mark uninstantiable explicit instantiation declarations as invalid if we actually diagnosed them. (When we trigger an explicit instantiation of a class member from an explicit instantiation declaration for the class, it's OK if there is no corresponding definition and we certainly don't want to mark the member invalid in that case.) This previously caused a build failure during bootstrap. llvm-svn: 279557
* ARM-Darwin: ignore and diagnose attempts to omit frame pointer.Tim Northover2016-08-232-6/+34
| | | | | | | | | | iOS (and other 32-bit ARM variants) always require a valid frame pointer to improve backtraces. Previously the -fomit-frame-pointer and -momit-leaf-frame-pointer options were being silently discarded via hacks in the backend. It's better if Clang configures itself to emit the correct IR and warns about (ignored) attempts to override this. llvm-svn: 279546
* clang-cl: Accept MSVC 2015's `/source-charset:utf-8` flag.Nico Weber2016-08-231-1/+1
| | | | | | | | | | | | | clang already treats all inputs as utf-8. Warn if anything but utf-8 is passed. Do this by mapping source-charset to finput-charset, which already behaves like this. Slightly tweak finput-charset to accept "utf-8" case-insensitively. This matches gcc's and cl.exe's behavior, and IANA says that character set names are case-insensitive. https://reviews.llvm.org/D23807 llvm-svn: 279531
* [analyzer] Fix CloneDetector crash on calling methods of class templates.Artem Dergachev2016-08-231-4/+3
| | | | | | | | | | | | | | If a call expression represents a method call of a class template, and the method itself isn't templated, then the method may be considered to be a template instantiation without template specialization arguments. No longer crash when we could not find template specialization arguments. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D23780 llvm-svn: 279529
* Revert r279486 "Fix regression introduced by r279164"Chandler Carruth2016-08-234-59/+59
| | | | | | | Build bots seem unhappy and as Richard was leaving he asked me to revert this for him. Doing so. llvm-svn: 279500
* Add comments. NFCAdrian Prantl2016-08-221-0/+2
| | | | llvm-svn: 279490
* Fix regression introduced by r279164: only pass definitions as the PatternDefRichard Smith2016-08-224-59/+59
| | | | | | | | | | | | | | | | to DiagnoseUninstantiableTemplate, teach hasVisibleDefinition to correctly determine whether a function definition is visible, and mark both the function and the template as visible when merging function template definitions to provide hasVisibleDefinition with the relevant information. The change to always pass the right declaration as the PatternDef to DiagnoseUninstantiableTemplate also caused those checks to happen before other diagnostics in InstantiateFunctionDefinition, giving worse diagnostics for the same situations, so I sunk the relevant diagnostics into DiagnoseUninstantiableTemplate. Those parts of this patch are based on changes in reviews.llvm.org/D23492 by Vassil Vassilev. llvm-svn: 279486
* Module debug info: Don't assert when encountering an incomplete definitionAdrian Prantl2016-08-221-1/+2
| | | | | | | | | | in isDefinedInClangModule() and assume that the incomplete definition is not defined in the module. This broke the -gmodules self host recently. rdar://problem/27894367 llvm-svn: 279485
* [SemaObjC] Do not RebuildObjCMessageExpr without valid method declBruno Cardoso Lopes2016-08-221-0/+3
| | | | | | | | | | | | | | Fix crash-on-invalid in ObjC Sema by avoiding to rebuild a message expression to a 'super' class in case the method to call does not exist (i.e. comes from another missing identifier). In this case, the typo transform is invoked upon the message expression in an attempt to solve a typo in a 'super' call parameters, but it crashes since it assumes the method to call has a valid declaration. rdar://problem/27305403 llvm-svn: 279481
* [AST] Remove unused function, to silence a GCC7 warning.Davide Italiano2016-08-221-4/+0
| | | | llvm-svn: 279479
* [GraphTraits] Replace all NodeType usage with NodeRefTim Shen2016-08-221-4/+3
| | | | | | | | This should finish the GraphTraits migration. Differential Revision: http://reviews.llvm.org/D23730 llvm-svn: 279475
* AMDGPU: Handle structs directly in AMDGPUABIInfoMatt Arsenault2016-08-221-1/+41
| | | | | | | | | | | | | | | | Structs are currently handled as pointer + byval, which makes AMDGPU LLVM backend generate incorrect code when structs are used. This patch changes struct argument to be handled directly and without flattening, which Clover (Mesa 3D Gallium OpenCL state tracker) will be able to handle. Flattening would expand the struct to individual elements and pass each as a separate argument, which Clover can not handle. Furthermore, such expansion does not fit the OpenCL programming model which requires to explicitely specify each argument index, size and memory location. Patch by Vedran Miletić llvm-svn: 279463
* [CUDA] Collapsed offload actions should not be top-level jobs.Artem Belevich2016-08-221-1/+1
| | | | | | | | | | | | If they are, we end up with the last intermediary output preserved in the current directory after compilation. Added a test case to verify that we're using appropriate filenames for outputs of different phases. Differential Revision: https://reviews.llvm.org/D23526 llvm-svn: 279455
* PR29086: DebugInfo: Improve support for fixed array dimensions in variable ↵David Blaikie2016-08-221-0/+5
| | | | | | length arrays llvm-svn: 279445
* clang-format: [JS] supports casts to types starting with punctuation ("{[(").Martin Probst2016-08-221-0/+3
| | | | | | | | | | | | | | | | | | Before: x as{x: number} After: x as {x: number} Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D23761 llvm-svn: 279436
* Reapply "[analyzer] Added valist related checkers."Gabor Horvath2016-08-222-0/+374
| | | | | | Differential Revision: https://reviews.llvm.org/D15227 llvm-svn: 279427
* [analyzer] Correctly add assumptions based on array bounds.Gabor Horvath2016-08-221-12/+67
| | | | | | | | Also simplify the constraints generated by the checker. Differential Revision: https://reviews.llvm.org/D23112 llvm-svn: 279425
* [X86][AVX512F] minor fix of the parameter namesAsaf Badouh2016-08-211-8/+8
| | | | | | | | | | | | | add "__" prefix Bug 28842 https://llvm.org/bugs/show_bug.cgi?id=29040 Differential Revision: https://reviews.llvm.org/D23753 llvm-svn: 279392
* Wdocumentation fixSimon Pilgrim2016-08-201-2/+2
| | | | llvm-svn: 279382
* [analyzer] Use faster hashing (MD5) in CloneDetector.Artem Dergachev2016-08-202-73/+189
| | | | | | | | | | | | | | | This replaces the old approach of fingerprinting every AST node into a string, which avoided collisions and was simple to implement, but turned out to be extremely ineffective with respect to both performance and memory. The collisions are now dealt with in a separate pass, which no longer causes performance problems because collisions are rare. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D22515 llvm-svn: 279378
* [Sema] Don't crash on scanf on forward-declared enums.Benjamin Kramer2016-08-202-4/+19
| | | | | | | | This is valid in GNU C, which allows pointers to incomplete enums. GCC just pretends that the underlying type is 'int' in those cases, follow that behavior. llvm-svn: 279374
* PR28423: Compare primary declaration contexts.Vassil Vassilev2016-08-201-1/+2
| | | | | | | | | | | In certain cases (mostly coming from modules), Sema's idea of the StdNamespace does not point to the first declaration of namespace std. Patch by Cristina Cristescu! Reviewed by Richard Smith. llvm-svn: 279371
* [analyzer] Make CloneDetector consider macro expansions.Artem Dergachev2016-08-201-4/+67
| | | | | | | | | | | | | | | | | So far macro-generated code was treated by the CloneDetector as normal code. This caused that some macros where reported as false-positive clones because large chunks of code coming from otherwise concise macro expansions were treated as copy-pasted code. This patch ensures that macros are treated in the same way as literals/function calls. This prevents macros that expand into multiple statements from being reported as clones. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D23316 llvm-svn: 279367
* [analyzer] Make CloneDetector consider template arguments.Artem Dergachev2016-08-201-2/+20
| | | | | | | | | | | For example, code samples `isa<Stmt>(S)' and `isa<Expr>(S)' are no longer considered to be clones. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D23555 llvm-svn: 279366
* Revert r279351 and r279357 due to bot failuresManman Ren2016-08-201-3/+6
| | | | llvm-svn: 279358
* [NFC] Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.Manman Ren2016-08-201-6/+3
| | | | | | | | | | | | | This is in preparation of adding a new type class ObjCTypeParamType that can take protocol qualifiers. ObjCProtocolQualifiers will be shared between ObjCObjectType and ObjCTypeParamType. rdar://24619481 rdar://25060179 Differential Revision: http://reviews.llvm.org/D23078 llvm-svn: 279351
* clang-format: [JS] handle object literals with casts.Martin Probst2016-08-191-1/+2
| | | | | | | | | | | | Summary: E.g. `{a: 1} as b`. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D23714 llvm-svn: 279250
* Re-commit [OpenCL] AMDGCN: Fix size_t typeYaxun Liu2016-08-195-9/+25
| | | | | | There was a premature cast to pointer type in emitPointerArithmetic which caused assertion in tests with assertion enabled. llvm-svn: 279206
* C++ Modules TS: support parsing the 'module' declaration (including extensionsRichard Smith2016-08-193-32/+153
| | | | | | | | from p0273r0 approved by EWG). We'll eventually need to handle this from the lexer as well, in order to disallow preprocessor directives preceding the module declaration and to support macro import. llvm-svn: 279196
* [analyzer] Weaken assertion in trackNullOrUndefValue()Devin Coughlin2016-08-191-1/+1
| | | | | | | | | | | | | | | | | We should ignore paren casts when making sure that the semantic expression in a PseudoObjectExpr for an ObjC getter is a message send. This has no other intended functionality change. Adding a test for this exposed an interesting issue in another test case that only manifests under ARC. trackNullOrUndefValue() is not properly suppressing for nil values that are the result of nil propagation from a nil receiver when the nil is returned from a function. I've added a FIXME for that missing suppression. rdar://problem/27290568 llvm-svn: 279181
* AMDGPU: Add clang builtin for ds_swizzle.Changpeng Fang2016-08-181-0/+3
| | | | | | | | | | | Summary: int __builtin_amdgcn_ds_swizzle (int a, int imm); while imm is a constant. Differential Revision: http://reviews.llvm.org/D23682 llvm-svn: 279165
* PR28794: Don't try to instantiate function templates which are not visible.Vassil Vassilev2016-08-183-69/+87
| | | | | | Reviewed by Richard Smith. llvm-svn: 279164
* C++ Modules TS: Add parsing support for module import declaration.Richard Smith2016-08-184-27/+55
| | | | llvm-svn: 279163
* CodeGen: Rename a variable to better fit LLVM style. NFCJustin Bogner2016-08-181-6/+6
| | | | llvm-svn: 279159
* CodeGen: use range based for loop, NFCSaleem Abdulrasool2016-08-181-3/+2
| | | | llvm-svn: 279154
* [CUDA] Improve handling of math functions.Justin Lebar2016-08-182-3/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A bunch of related changes here to our CUDA math headers. - The second arg to nexttoward is a double (well, technically, long double, but we don't have that), not a float. - Add a forward-declare of llround(float), which is defined in the CUDA headers. We need this for the same reason we need most of the other forward-declares: To prevent a constexpr function in our standard library from becoming host+device. - Add nexttowardf implementation. - Pull "foobarf" functions defined by the CUDA headers in the global namespace into namespace std. This lets you do e.g. std::sinf. - Add overloads for math functions accepting integer types. This lets you do e.g. std::sin(0) without having an ambiguity between the overload that takes a float and the one that takes a double. With these changes, we pass testcases derived from libc++ for cmath and math.h. We can check these testcases in to the test-suite once support for CUDA lands there. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23627 llvm-svn: 279140
OpenPOWER on IntegriCloud