summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Disable PIC/PIE for MSP430 target by default.Anton Korobeynikov2019-01-252-0/+33
| | | | | | | | | | Relocatable code generation is meaningless on MSP430, as the platform is too small to use shared libraries. Patch by Dmitry Mikushev! Differential Revision: https://reviews.llvm.org/D56927 llvm-svn: 352181
* [MSP430] Ajust f32/f64 alignment according to MSP430 EABIAnton Korobeynikov2019-01-253-1/+30
| | | | | | | | Patch by Kristina Bessonova! Differential Revision: https://reviews.llvm.org/D57015 llvm-svn: 352177
* [X86] Remove mask and passthru arguments from vpconflict builtins. Use ↵Craig Topper2019-01-255-80/+78
| | | | | | select in IR instead. llvm-svn: 352173
* [AArch64] Make the test for rsr and rsr64 stricterPetr Hosek2019-01-251-2/+7
| | | | | | | | | | | | | | | ACLE specifies that return type for rsr and rsr64 is uint32_t and uint64_t respectively. D56852 change the return type of rsr64 from unsigned long to unsigned long long which at least on Linux doesn't match uint64_t, but the test isn't strict enough to detect that because compiler implicitly converts unsigned long long to uint64_t, but it breaks other uses such as printf with PRIx64 type specifier. This change makes the test stricter enforcing that the return type of rsr and rsr64 builtins is what is actually specified in ACLE. Differential Revision: https://reviews.llvm.org/D57210 llvm-svn: 352156
* Revert "[AArch64] Use LL for 64-bit intrinsic arguments"Petr Hosek2019-01-253-20/+15
| | | | | | | | | | This reverts commit r351740: this broke on platforms where unsigned long long isn't the same as uint64_t which is what ACLE specifies for the return value of rsr64. Differential Revision: https://reviews.llvm.org/D57209 llvm-svn: 352153
* [analyzer] Port RetainSummaryManager to the new AnyCall interface, decouple ↵George Karpenkov2019-01-259-112/+127
| | | | | | | | | | ARCMT from the analyzer rdar://19694750 Differential Revision: https://reviews.llvm.org/D57127 llvm-svn: 352149
* [analysis] Introduce an AnyCall helper class, for abstraction over different ↵George Karpenkov2019-01-251-0/+174
| | | | | | | | | | | | | | | | | | | | | | callables A lot of code, particularly in the analyzer, has to perform a lot of duplication to handle functions/ObjCMessages/destructors/constructors in a generic setting. The analyzer already has a CallEvent helper class abstracting over such calls, but it's not always suitable, since it's tightly coupled to other analyzer classes (ExplodedNode, ProgramState, etc.) and it's not always possible to construct. This change introduces a very simple, very lightweight helper class to do simple generic operations over callables. In future, parts of CallEvent could be changed to use this class to avoid some duplication. Differential Revision: https://reviews.llvm.org/D57126 llvm-svn: 352148
* [AST] Add a method to get a call type from an ObjCMessageExprGeorge Karpenkov2019-01-252-0/+32
| | | | | | | | | | | | Due to references, expression type does not always correspond to an expected method return type (e.g. for a method returning int & the expression type of the call would still be int). We have a helper method for getting the expected type on CallExpr, but not on ObjCMessageExpr. Differential Revision: https://reviews.llvm.org/D57204 llvm-svn: 352147
* [clang-format] square parens with one token are not Objective-C message sendsAlex Lorenz2019-01-242-2/+21
| | | | | | | | | | | | | | The commit r322690 introduced support for ObjC detection in header files. Unfortunately some C headers that use designated initializers are now incorrectly detected as Objective-C. This commit fixes it by ensuring that `[ token ]` is not annotated as an Objective-C message send. rdar://45504376 Differential Revision: https://reviews.llvm.org/D56226 llvm-svn: 352125
* [clang-cl] Ignore space-separated /AI argumentsReid Kleckner2019-01-242-1/+2
| | | | | | | | | | The /AI flag is for #using directives, which I don't think we support. This is consistent with how the /I flag is handled by MSVC. Add a test for it. Differential Revision: https://reviews.llvm.org/D57189 llvm-svn: 352119
* [WebAssembly] Add WebAssemblyImportModule to ↵Dan Gohman2019-01-241-0/+1
| | | | | | pragma-attribute-supported-attributes-list.test llvm-svn: 352108
* [WebAssembly] Add an import_module function attributeDan Gohman2019-01-245-1/+72
| | | | | | | | | This adds a C/C++ attribute which corresponds to the LLVM IR wasm-import-module attribute. It allows code to specify an explicit import module. Differential Revision: https://reviews.llvm.org/D57160 llvm-svn: 352106
* [WebAssembly] Add a __wasi__ target macroDan Gohman2019-01-243-9/+40
| | | | | | | | | This adds a `__wasi__` macro for the wasi OS, similar to `__linux__` etc. for other OS's. Differential Revision: https://reviews.llvm.org/D57155 llvm-svn: 352105
* Add a triple to this test so it passes for targets where alignof(double)Richard Smith2019-01-241-1/+1
| | | | | | really should be equal to alignof(float). llvm-svn: 352102
* [WebAssembly] Support __float128Dan Gohman2019-01-242-0/+4
| | | | | | | | This enables support for the "__float128" keyword. Differential Revision: https://reviews.llvm.org/D57154 llvm-svn: 352100
* [WebAssembly] Factor commonality between wasm32 and wasm64 in ↵Dan Gohman2019-01-241-633/+342
| | | | | | | | | | | test/Preprocessor/init.c Use the -check-prefixes= feature to merge most of the WEBASSEMBLY32 and WEBASSEMBLY64 test checks into a shared WEBASSEMBLY test check. Differential Revision: https://reviews.llvm.org/D57153 llvm-svn: 352099
* [NFC][clang] Test updates for CreateAlignmentAssumption() changes in D54653Roman Lebedev2019-01-242-27/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D57175 llvm-svn: 352090
* Add a priority field to availability attributes to prioritize explicitAlex Lorenz2019-01-248-91/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attributes from declaration over attributes from '#pragma clang attribute' Before this commit users had an issue when using #pragma clang attribute with availability attributes: The explicit attribute that's specified next to the declaration is not guaranteed to be preferred over the attribute specified in the pragma. This commit fixes this by introducing a priority field to the availability attribute to control how they're merged. Attributes with higher priority are applied over attributes with lower priority for the same platform. The implicitly inferred attributes are given the lower priority. This ensures that: - explicit attributes are preferred over all other attributes. - implicitly inferred attributes that are inferred from an explicit attribute are discarded if there's an explicit attribute or an attribute specified using a #pragma for the same platform. - implicitly inferred attributes that are inferred from an attribute in the #pragma are not used if there's an explicit, explicit #pragma, or an implicit attribute inferred from an explicit attribute for the declaration. This is the resulting ranking: `platform availability > platform availability from pragma > inferred availability > inferred availability from pragma` rdar://46390243 Differential Revision: https://reviews.llvm.org/D56892 llvm-svn: 352084
* [FileManager] Revert r347205 to avoid PCH file-descriptor leak.Sam McCall2019-01-244-54/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: r347205 fixed a bug in FileManager: first calling getFile(shouldOpen=false) and then getFile(shouldOpen=true) results in the file not being open. Unfortunately, some code was (inadvertently?) relying on this bug: when building with a PCH, the file entries are obtained first by passing shouldOpen=false, and then later shouldOpen=true, without any intention of reading them. After r347205, they do get unneccesarily opened. Aside from extra operations, this means they need to be closed. Normally files are closed when their contents are read. As these files are never read, they stay open until clang exits. On platforms with a low open-files limit (e.g. Mac), this can lead to spurious file-not-found errors when building large projects with PCH enabled, e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=924225 Fixing the callsites to pass shouldOpen=false when the file won't be read is not quite trivial (that info isn't available at the direct callsite), and passing shouldOpen=false is a performance regression (it results in open+fstat pairs being replaced by stat+open). So an ideal fix is going to be a little risky and we need some fix soon (especially for the llvm 8 branch). The problem addressed by r347205 is rare and has only been observed in clangd. It was present in llvm-7, so we can live with it for now. Reviewers: bkramer, thakis Subscribers: ilya-biryukov, ioeric, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D57165 llvm-svn: 352079
* Revert "[Sanitizers] UBSan unreachable incompatible with ASan in the ↵Julian Lettner2019-01-242-23/+16
| | | | | | | | presence of `noreturn` calls" This reverts commit cea84ab93aeb079a358ab1c8aeba6d9140ef8b47. llvm-svn: 352069
* Fix failing buildbotsGabor Marton2019-01-241-2/+2
| | | | | | | | | Fix remaining unittest errors caused by __attribute__((no_caller_saved_registers)) Related commit which caused the buildbots to fail: rL352050 llvm-svn: 352060
* Fix failing buildbotsGabor Marton2019-01-241-1/+4
| | | | | | | Related commit which caused the buildbots to fail: rL352050 llvm-svn: 352055
* [CPU-Dispatch] Make pentium_iii_no_xmm_regs and pentium_iii alias.Erich Keane2019-01-242-1/+4
| | | | | | | | | | | | | | | | I discovered that in ICC (where this list comes from), that the two pentium_iii versions were actually identical despite the two different names (despite them implying a difference). Because of this, they ended up having identical manglings, which obviously caused problems when used together. This patch makes pentium_iii_no_xmm_regs an alias for pentium_iii so that it can still be used, but has the same meaning as ICC. However, we still prohibit using the two together which is different (albeit better) behavior. Change-Id: I4f3c9a47e48490c81525c8a3d23ed4201921b288 llvm-svn: 352054
* [ASTImporter] Fix inequality of functions with different attributesGabor Marton2019-01-242-1/+53
| | | | | | | | | | | | | | | | Summary: FunctionType::ExtInfo holds such properties of a function which are needed mostly for code gen. We should not compare these bits when checking for structural equivalency. Checking ExtInfo caused false ODR errors during CTU analysis (of tmux). Reviewers: a_sidorin, a.sidorin, shafik Subscribers: rnkovacs, dkrupp, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D53699 llvm-svn: 352050
* [Sema] Don't crash when recovering from a misspelled pseudo destructor call ↵Bruno Ricci2019-01-242-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | to an incomplete type. When attempting to correct a misspelled pseudo destructor call as in: struct Foo; void foo(Foo *p) { p.~Foo(); } a call is made in canRecoverDotPseudoDestructorCallsOnPointerObjects to LookupDestructor without checking that the record has a definition. This causes an assertion later in LookupSpecialMember which assumes that the record has a definition. Patch By Roman Zhikharevich! Differential Revision: https://reviews.llvm.org/D57111 Reviewed By: riccibruno llvm-svn: 352047
* Test commit: fix typo.Pierre Gousseau2019-01-241-1/+1
| | | | llvm-svn: 352042
* [CodeComplete] [clangd] Fix crash on ValueDecl with a null typeIlya Biryukov2019-01-242-1/+10
| | | | | | | | | | | | Reviewers: kadircet Reviewed By: kadircet Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D57093 llvm-svn: 352040
* Fix python3 compability issue in clang bindingSerge Guelton2019-01-241-23/+15
| | | | | | | | | | | | | | The file contents could be of str type. Should use byte length instead of str length, otherwise utf-8 encoded files may not get properly parsed for completion. Source issue: https://github.com/ncm2/ncm2-pyclang#2 Commited on behalf of `roxma' Differential Revision: https://reviews.llvm.org/D56429 llvm-svn: 352039
* Reland r345009 "[DebugInfo] Generate debug information for labels."Hsiangkai Wang2019-01-245-0/+83
| | | | | | | | | | | | | | | | Generate DILabel metadata and call llvm.dbg.label after label statement to associate the metadata with the label. After fixing PR37395. After fixing problems in LiveDebugVariables. After fixing NULL symbol problems in AddressPool when enabling split-dwarf-file. After fixing PR39094. After landing D54199 and D54465 to fix Chromium build failed. Differential Revision: https://reviews.llvm.org/D45045 llvm-svn: 352025
* [CMake][Fuchsia] Enable hermetic static libc++abi for FuchsiaPetr Hosek2019-01-241-1/+2
| | | | | | | | Similarly to libc++, we want to use hermetic static libc++abi. Differential Revision: https://reviews.llvm.org/D57136 llvm-svn: 352018
* Improve diagnostic for -fvisibility mismatch between module/PCH buildRichard Smith2019-01-241-2/+2
| | | | | | and use. llvm-svn: 352011
* [Sanitizers] UBSan unreachable incompatible with ASan in the presence of ↵Julian Lettner2019-01-242-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `noreturn` calls Summary: UBSan wants to detect when unreachable code is actually reached, so it adds instrumentation before every `unreachable` instruction. However, the optimizer will remove code after calls to functions marked with `noreturn`. To avoid this UBSan removes `noreturn` from both the call instruction as well as from the function itself. Unfortunately, ASan relies on this annotation to unpoison the stack by inserting calls to `_asan_handle_no_return` before `noreturn` functions. This is important for functions that do not return but access the the stack memory, e.g., unwinder functions *like* `longjmp` (`longjmp` itself is actually "double-proofed" via its interceptor). The result is that when ASan and UBSan are combined, the `noreturn` attributes are missing and ASan cannot unpoison the stack, so it has false positives when stack unwinding is used. Changes: # UBSan now adds the `expect_noreturn` attribute whenever it removes the `noreturn` attribute from a function # ASan additionally checks for the presence of this attribute Generated code: ``` call void @__asan_handle_no_return // Additionally inserted to avoid false positives call void @longjmp call void @__asan_handle_no_return call void @__ubsan_handle_builtin_unreachable unreachable ``` The second call to `__asan_handle_no_return` is redundant. This will be cleaned up in a follow-up patch. rdar://problem/40723397 Reviewers: delcypher, eugenis Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D56624 llvm-svn: 352003
* [Sema] Fix Modified Type in address_space AttributedTypeLeonard Chan2019-01-248-31/+119
| | | | | | | | | | | This is a fix for https://reviews.llvm.org/D51229 where we pass the address_space qualified type as the modified type of an AttributedType. This change now instead wraps the AttributedType with either the address_space qualifier or a DependentAddressSpaceType. Differential Revision: https://reviews.llvm.org/D55447 llvm-svn: 351997
* [Documentation] Fix problem in docs/SafeStack.rst introduced in r351976.Eugene Zelenko2019-01-231-3/+3
| | | | llvm-svn: 351977
* [Documentation] Use HTTPS whenever possibleEugene Zelenko2019-01-2319-60/+60
| | | | | | Differential revision: https://reviews.llvm.org/D56946 llvm-svn: 351976
* Merge similar target diagnostics for interrupt attribute into one; NFCAaron Ballman2019-01-232-21/+15
| | | | | | Patch by Kristina Bessonova! llvm-svn: 351969
* [ubsan] Check the correct size when sanitizing array new.Richard Smith2019-01-234-21/+79
| | | | | | We previously forgot to multiply the element size by the array bound. llvm-svn: 351924
* [Sema][ObjC] Check whether a DelayedDiagnosticPool has been pushedAkira Hatanaka2019-01-232-3/+17
| | | | | | | | | | | before adding a delayed diagnostic to DelayedDiagnostics. This fixes an assertion failure in Sema::DelayedDiagnostics::add that was caused by the changes made in r141037. rdar://problem/42782323 llvm-svn: 351911
* [mips] Replace help-text for '-m{no}-relax-pic-calls'. NFCVladimir Stefanovic2019-01-221-4/+4
| | | | | | Thanks to Simon Dardis for the new text. llvm-svn: 351889
* [analyzer] Insert notes in RetainCountChecker where our dynamic cast ↵George Karpenkov2019-01-225-8/+29
| | | | | | | | | | modeling assumes 'null' output rdar://47397214 Differential Revision: https://reviews.llvm.org/D56952 llvm-svn: 351865
* [analyzer] Model another special-case kind of cast for OSObject ↵George Karpenkov2019-01-225-8/+33
| | | | | | | | RetainCountChecker Differential Revision: https://reviews.llvm.org/D56951 llvm-svn: 351864
* [ASTImporter] Fix importing OperatorDelete from CXXConstructorDeclRaphael Isemann2019-01-223-1/+30
| | | | | | | | | | | | | | | | | Summary: Shafik found out that importing a CXXConstructorDecl will create a translation unit that causes Clang's CodeGen to crash. The reason for that is that we don't copy the OperatorDelete from the CXXConstructorDecl when importing. This patch fixes it and adds a test case for that. Reviewers: shafik, martong, a_sidorin, a.sidorin Reviewed By: martong, a_sidorin Subscribers: rnkovacs, cfe-commits Differential Revision: https://reviews.llvm.org/D56651 llvm-svn: 351849
* ReleaseNotes: remove openmp notes from r351580Hans Wennborg2019-01-221-30/+1
| | | | | | They were for the 8.0 branch, and have been committed there in r351839. llvm-svn: 351841
* [CodeGen] Always use string computed in Sema for PredefinedExprEli Friedman2019-01-223-14/+11
| | | | | | | | | | | | | | | | | | | | | | | | We can't use any other string, anyway, because its type wouldn't match the type of the PredefinedExpr. With this change, we don't compute a "nice" name for the __func__ global when it's used in the initializer for a constant. This doesn't seem like a great loss, and I'm not sure how to fix it without either storing more information in the AST, or somehow threading through the information from ExprConstant.cpp. This could break some situations involving BlockDecl; currently, CodeGenFunction::EmitPredefinedLValue has some logic to intentionally emit a string different from what Sema computed. This code skips that logic... but that logic can't work correctly in general anyway. (For example, sizeof(__func__) returns the wrong result.) Hopefully this doesn't affect practical code. Fixes https://bugs.llvm.org/show_bug.cgi?id=40313 . Differential Revision: https://reviews.llvm.org/D56821 llvm-svn: 351766
* [test] Pass -ccc-install-dir in mac compilation db testMichal Gorny2019-01-211-1/+6
| | | | | | | | | | | | Pass -ccc-install-dir explicitly as the compilation database code does not pass argv[0] to getMainExecutable(), while some systems require it to return the correct path. Since the relevant code is apparently only applicable to Darwin, just pass correct -ccc-install-dir to make the tests pass on *BSD systems. Differential Revision: https://reviews.llvm.org/D56976 llvm-svn: 351752
* Mark the lambda function pointer conversion operator as noexcept.Aaron Ballman2019-01-215-9/+30
| | | | | | This implements CWG DR 1722 and fixes PR40309. Patch by Ignat Loskutov. llvm-svn: 351750
* Regenerating the C++ DR status page from the latest Core issues list.Aaron Ballman2019-01-211-14010/+14172
| | | | llvm-svn: 351749
* [OpenCL] Allow address spaces as method qualifiers.Anastasia Stulova2019-01-219-60/+187
| | | | | | | | | | | | | | | Methods can now be qualified with address spaces to prevent undesirable conversions to generic or to provide custom implementation to be used if the object is located in certain memory segments. This commit extends parsing and standard C++ overloading to work for an address space of a method (i.e. implicit 'this' parameter). Differential Revision: https://reviews.llvm.org/D55850 llvm-svn: 351747
* [Analyzer] Remove extra blank line from Iterator Checker (test commit)Adam Balogh2019-01-211-1/+0
| | | | llvm-svn: 351746
* [NFC] Fix comparison warning issues by MSVCJohannes Doerfert2019-01-211-1/+3
| | | | llvm-svn: 351744
OpenPOWER on IntegriCloud