summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [CMake] Fix the path to CrossWinToARMLinux.cmake CMake cache.Vladimir Vereschaka2019-11-201-1/+1
| | | | | | | | The comment was slightly misleading. Behalf: broadwaylamb (Sergej Jaskiewicz) Differential Revision: https://reviews.llvm.org/D70499
* Fix parser bug that permitted 'private' as a (no-op) decl-specifier even ↵Richard Smith2019-11-202-1/+8
| | | | outside OpenCL.
* ARM-NEON: make type modifiers orthogonal and allow multiple modifiers.Tim Northover2019-11-207-1139/+1170
| | | | | | | | | | | | | | The modifier system used to mutate types on NEON intrinsic definitions had a separate letter for all kinds of transformations that might be needed, and we were quite quickly running out of letters to use. This patch converts to a much smaller set of orthogonal modifiers that can be applied together to achieve the desired effect. When merging with downstream it is likely to cause a conflict with any local modifications to the .td files. There is a new script in utils/convert_arm_neon.py that was used to convert all .td definitions and I would suggest running it on the last downstream version of those files before this commit rather than resolving conflicts manually.
* NeonEmitter: remove special case on casting polymorphic builtins.Tim Northover2019-11-202-5/+7
| | | | | | | For some reason we were not casting a fairly obscure class of builtin calls we expected to be polymorphic to vectors of char. It worked because the only affected intrinsics weren't actually polymorphic after all, but is unnecessarily complicated.
* ARM-NEON: separate soon-to-be conflicting f16 patterns. NFC.Tim Northover2019-11-201-2/+6
| | | | | | | | This separates some intrinsic definitions into multiple instantiations because they use a modifier that forces the float size to a given value. That modifier won't work in the new NeonEmitter modifier scheme and committing this separately allows the Python script to be run on the .td files to perform the conversion automatically.
* Update tests after change to llvm-cxxfilt's underscore stripping behaviour.Tim Northover2019-11-206-14/+14
|
* Reland "[clang] Remove the DIFlagArgumentNotModified debug info flag"Djordje Todorovic2019-11-203-71/+0
| | | | | | | | | | It turns out that the ExprMutationAnalyzer can be very slow when AST gets huge in some cases. The idea is to move this analysis to the LLVM back-end level (more precisely, in the LiveDebugValues pass). The new approach will remove the performance regression, simplify the implementation and give us front-end independent implementation. Differential Revision: https://reviews.llvm.org/D68206
* Revert "[clang][IFS] Driver Pipeline: generate stubs after standard pipeline ↵Puyan Lotfi2019-11-197-136/+39
| | | | | | (2)" This reverts commit ea8e02822341e2421b94167d828d3f224e767424.
* Revert "[clang][IFS] Fixing failing bots that do not have PPC target or ↵Puyan Lotfi2019-11-192-4/+0
| | | | | | "orbis-ld"" This reverts commit 377d70cdea733e36107e99d9148864d24797d51c.
* Revert "[clang][IFS] Attempting to fix missing 'orbis-ld' on scei-ps4-ubuntu ↵Puyan Lotfi2019-11-191-3/+1
| | | | | | bot." This reverts commit 29fd1e1f4a372f3870e054da24b57a4f45861808.
* Revert "[clang][IFS] Fixing unsupported emulation mode on ↵Puyan Lotfi2019-11-191-1/+0
| | | | | | clang-ppc64be-linux bot." This reverts commit 1b387484b9b38a4a1e98a9d22a9a26065b0d184e.
* Revert "[clang][IFS][test] Removing driver-test.c. Test is still too brittle."Puyan Lotfi2019-11-191-0/+15
| | | | This reverts commit f37356d6f60ae5db978611621d3a375ed87ec0f0.
* [clang][IFS][test] Removing driver-test.c. Test is still too brittle.Puyan Lotfi2019-11-191-15/+0
| | | | | | | Removing this test because if I add a triple then there are link falures on targets like ppc and s390x. If I don't add a triple then on PS4 targets the clang driver tries to invoke orbis-ld which ends up being not found.
* clang/Modules: Early return in CompilerInstance::createModuleManager, NFCDuncan P. N. Exon Smith2019-11-191-43/+44
| | | | Reduce nesting with an early `return`.
* [clang][IFS] Fixing unsupported emulation mode on clang-ppc64be-linux bot.Puyan Lotfi2019-11-191-0/+1
| | | | | | I am in another pickle here where if I specify a triple, I get the wrong elf target arch on the PPC bot (error from the PPC elf Linker). To avoid this I am going to turn this test off on the PPC bots for now.
* clang/Modules: Sink ASTReadResult in ReadControlBlock, NFCDuncan P. N. Exon Smith2019-11-191-5/+5
| | | | | | | | Simplify the code by avoiding some state that wasn't being used. The function-level `Result` was only assigned a value other than `Success` in the handler for `OPTIONS_BLOCK_ID`, but in that case it also hits an early return. Remove it at the function-level to make it obvious that the normal case always returns `Success`.
* [clang][IFS] Attempting to fix missing 'orbis-ld' on scei-ps4-ubuntu bot.Puyan Lotfi2019-11-191-1/+3
| | | | | | I want this test to run end to end, but I am still having trouble with missing linkers on the scei-ps4 bot. Will remove this test if it continues to be a source of brittle failures. Sorry for the noise.
* [clang][IFS] Fixing failing bots that do not have PPC target or "orbis-ld"Puyan Lotfi2019-11-192-0/+4
|
* [clang][IFS] Driver Pipeline: generate stubs after standard pipeline (2)Puyan Lotfi2019-11-197-39/+136
| | | | | | | | | | | | | | | | | | | Second Landing Attempt: Up until now, clang interface stubs has replaced the standard PP -> C -> BE -> ASM -> LNK pipeline. With this change, it will happen in conjunction with it. So what when you build your code you will get an a.out or lib.so as well as an interface stub file. Example: clang -shared -o libfoo.so -emit-interface-stubs ... will generate both a libfoo.so and a libfoo.ifso. The .so file will contain the code from the standard compilation pipeline and the .ifso file will contain the ELF stub library. Differential Revision: https://reviews.llvm.org/D70274
* Wrap C APIs with pragmas enforcing -Werror=strict-prototypesDuncan P. N. Exon Smith2019-11-199-53/+75
| | | | | | | | | Force `-Werror=strict-prototypes` so that C API tests fail to compile if we add a non-prototype declaration. This should help avoid regressions like bddecba4b333f7772029b4937d2c34f9f2fda6ca was fixing. https://reviews.llvm.org/D70285 rdar://problem/57203137
* [OPENMP50]Add if clause in simd directive.Alexey Bataev2019-11-1912-33/+246
| | | | | | According to OpenMP 5.0, if clause can be used in simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [CGDebugInfo] Emit subprograms for decls when AT_tail_call is understood ↵Vedant Kumar2019-11-195-31/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (reland with fixes) Currently, clang emits subprograms for declared functions when the target debugger or DWARF standard is known to support entry values (DW_OP_entry_value & the GNU equivalent). Treat DW_AT_tail_call the same way to allow debuggers to follow cross-TU tail calls. Pre-patch debug session with a cross-TU tail call: ``` * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt] frame #1: 0x0000000100000f99 main`main at a.c:8:10 [opt] ``` Post-patch (note that the tail-calling frame, "helper", is visible): ``` * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt] frame #1: 0x0000000100000f80 main`helper [opt] [artificial] frame #2: 0x0000000100000f99 main`main at a.c:8:10 [opt] ``` This was reverted in 5b9a072c because it attached declaration subprograms to inlinable builtin calls, which interacted badly with the MergeICmps pass. The fix is to not attach declarations to builtins. rdar://46577651 Differential Revision: https://reviews.llvm.org/D69743
* Add a key method to Sema to optimize debug info sizeReid Kleckner2019-11-192-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that the debug info describing the Sema class is an appreciable percentage of the total object file size of objects in Sema. By adding a key function, clang is able to optimize the debug info size by emitting a forward declaration in TUs that do not define the key function. On Windows, with clang-cl, these are the total sizes of object files in Sema before and after this change, compiling with optimizations and debug info: before: 335,012 KB after: 278,116 KB delta: -56,896 KB percent: -17.0% The effect on link time was negligible, despite having ~56MB less input. On Linux, with clang, these are the same sizes using DWARF -g and optimizations: before: 603,756 KB after: 515,340 KB delta: -88,416 KB percent: -14.6% I didn't use type units, DWARF-5, fission, or any other special flags. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D70340
* fixe leak found by asan build botTyker2019-11-191-1/+3
|
* [C-index] Fix test when using Debug target & MSVC STLAlexandre Ganea2019-11-191-1/+1
| | | | | | Avoids a deadlock in "clang/test/Index/crash-recovery-modules.m" when building with the MSVC STL & _ITERATOR_DEBUG_LEVEL == 2 (meaning a DEBUG build) Differential Revision: https://reviews.llvm.org/D69959
* clang: Add -fconvergent-functions flagMatt Arsenault2019-11-196-3/+19
| | | | | | | | The CUDA builtin library is apparently compiled in C++ mode, so the assumption of convergent needs to be made in a typically non-SPMD language. The functions in the library should still be assumed convergent. Currently they are not, which is potentially incorrect and this happens to work after the library is linked.
* [OPENMP]Rename function, NFC.Alexey Bataev2019-11-193-16/+16
| | | | Change the name of the CGOpenMPRuntime::emitOMPIfClause to CGOpenMPRuntime::emitIfClause.
* [NFC] Refactor representation of materialized temporariesTyker2019-11-1941-170/+328
| | | | | | | | | | | | | | | Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718 Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: thakis, sammccall, ilya-biryukov, rnkovacs, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69360
* [libTooling] Extend `buildASTFromCodeWithArgs` to take files argument.Yitzhak Mandelbaum2019-11-192-2/+9
| | | | | | | | | | | | | | | | | Summary: Adds an optional parameter to `buildASTFromCodeWithArgs` that allows the user to pass additional files that the main code needs to compile. This change makes `buildASTFromCodeWithArgs` consistent with `runToolOnCodeWithArgs`. Patch by Alexey Eremin. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70175
* Work on cleaning up denormal mode handlingMatt Arsenault2019-11-193-10/+7
| | | | | | | | | | | | | | | | | | | | | | Cleanup handling of the denormal-fp-math attribute. Consolidate places checking the allowed names in one place. This is in preparation for introducing FP type specific variants of the denormal-fp-mode attribute. AMDGPU will switch to using this in place of the current hacky use of subtarget features for the denormal mode. Introduce a new header for dealing with FP modes. The constrained intrinsic classes define related enums that should also be moved into this header for uses in other contexts. The verifier could use a check to make sure the denorm-fp-mode attribute is sane, but there currently isn't one. Currently, DAGCombiner incorrectly asssumes non-IEEE behavior by default in the one current user. Clang must be taught to start emitting this attribute by default to avoid regressions when this is switched to assume ieee behavior if the attribute isn't present.
* [clang][NFC] Make various uses of Regex constThomas Preud'homme2019-11-196-43/+43
| | | | | | | | | | | | | | | | The const-correctness of match() was fixed in rL372764, which allows uses of Regex objects to be const in cases they couldn't be before. This patch tightens up the const-ness of Regex in various such cases. Reviewers: thopre Reviewed By: thopre Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68155
* [ARM,MVE] Add intrinsics for scalar shifts.Simon Tatham2019-11-193-8/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fills in the small family of MVE intrinsics that have nothing to do with vectors: they implement bit-shift operations on 32- or 64-bit values held in one or two general-purpose registers. Most of these shift operations saturate if shifting left, and round to nearest if shifting right, although LSLL and ASRL behave like ordinary shifts. When these instructions take a variable shift count in a register, they pay attention to its sign, so that (for example) LSLL or UQRSHLL will shift left if given a positive number but right if given a negative one. That makes even LSLL and ASRL different enough from standard LLVM IR shift semantics that I couldn't see any better alternative than to simply model the whole family as a set of MVE-specific IR intrinsics. (The //immediate// forms of LSLL and ASRL, on the other hand, do behave exactly like a standard IR shift of a 64-bit value. In fact, those forms don't have ACLE intrinsics defined at all, because you can just write an ordinary C shift operation if you want one of those.) The 64-bit shifts have to be instruction-selected in C++, because they deliver two output values. But the 32-bit ones are simple enough that I could write a DAG isel pattern directly into each Instruction record. Reviewers: ostannard, MarkMurrayARM, dmgreen Reviewed By: dmgreen Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D70319
* Revert "[RISCV] Support mutilib in baremetal environment"Nico Weber2019-11-1929-201/+11
| | | | | This reverts commit b6d7bbfa004310777cd41448ffc377aea082fc8c. Driver/riscv64-toolchain.c fails on Windows.
* [RISCV] Support mutilib in baremetal environmentZakk Chen2019-11-1929-11/+201
| | | | | | | | | | Currently only support the set of multilibs same to riscv-gnu-toolchain. Reviewers: espindola, asb, kito-cheng, lenary Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D67508
* [clang-format] [NFC] add recent changes to release notesmydeveloperday2019-11-191-12/+30
| | | | | | | | | | | | | | Summary: clang-tidy keeps nice release notes of what is added, have clang-format do the same. Reviewers: klimek, mitchell-stellar, sylvestre.ledru, sammccall Reviewed By: mitchell-stellar Subscribers: merge_guards_bot, Eugene.Zelenko, cfe-commits Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D70355
* Revert "[clang][IFS] Driver pipeline: generate interface stubs after ↵Puyan Lotfi2019-11-196-123/+37
| | | | | | | | | standard pipeline." This reverts commit 58ea00b51fe9b011301484957556872fced7dd08. Test for .o + .ifs sidecar files is brittle and failing on bots. Reverting to unblock.
* [clang][IFS] Driver pipeline: generate interface stubs after standard pipeline.Puyan Lotfi2019-11-196-37/+123
| | | | | | | | | | | | | | | | | Up until now, clang interface stubs has replaced the standard PP -> C -> BE -> ASM -> LNK pipeline. With this change, it will happen in conjunction with it. So what when you build your code you will get an a.out or lib.so as well as an interface stub file. Example: clang -shared -o libfoo.so -emit-interface-stubs ... will generate both a libfoo.so and a libfoo.ifso. The .so file will contain the code from the standard compilation pipeline and the .ifso file will contain the ELF stub library. Differential Revision: https://reviews.llvm.org/D70274
* [CodeGen] Assign locations to calls to special struct helpersVedant Kumar2019-11-182-5/+9
| | | | | | | | | | | | | | Assign artificial locations to calls to special struct-related helper functions. Such calls may not inherit a location if emitted within FinishFunction, at which point the lexical scope stack may be empty, causing CGDebugInfo to report the current DebugLoc as empty. Fixes an IR verifier complaint about a call to '__destructor_8_s0' not having a !dbg location attached. rdar://57293361
* [NFC] Fix 'target' condition in checkTargetFeaturesErich Keane2019-11-181-2/+2
| | | | | | | | | | | | | | | | checkTargetFeatures was incorrectly checking for cpu_specific instead of just 'target'. While this function was never called in that situation, it seemed correct to fix the condition. Additionally, multiversion functions can never be always_inline, but if any function accidentially ended up here we shouldn't diagnose. Note that the adding of target-features to the list is unnecessary since the getFunctionFeatureMap actually considers attribute target, however adding it results in significantly better error messages by putting the 'target' features first (and thus first to fail). Otherwise, the error message would be the first feature 'implied' by the target attribute, and not necessarily the feature listed in the attribute itself.
* [profile] Support online merging with continuous sync modeVedant Kumar2019-11-181-6/+5
| | | | | | | | | | | | | | | Make it possible to use online profile merging ("%m" mode) with continuous sync ("%c" mode). To implement this, the merged profile is locked in the runtime initialization step and either a) filled out for the first time or b) checked for compatibility. Then, the profile can simply be mmap()'d with MAP_SHARED set. With the mmap() in place, counter updates from every process which uses an image are mapped onto the same set of physical pages assigned by the filesystem cache. After the mmap() is set up, the profile is unlocked. Differential Revision: https://reviews.llvm.org/D69586
* Populate CUDA flags on FreeBSD too, as many other toolchains do.Dimitry Andric2019-11-183-0/+296
| | | | | | | | | | | | | | | | Summary: This allows `clang` to be used to compile CUDA programs. Compiled simple helloworld.cu with this. Reviewers: dim, emaste, tra, yaxunl, ABataev Reviewed By: tra Subscribers: dim, emaste, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69990
* [Sema] Fix a -Wobjc-signed-char-bool false-positiveErik Pilkington2019-11-182-0/+62
| | | | | | | Unsigned bit-field flags can only have boolean values, so handle that case in Expr::isKnownToHaveBooleanValue. rdar://56256999
* Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))Pierre Habouzit2019-11-1824-50/+1024
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __attribute__((objc_direct)) is an attribute on methods declaration, and __attribute__((objc_direct_members)) on implementation, categories or extensions. A `direct` property specifier is added (@property(direct) type name) These attributes / specifiers cause the method to have no associated Objective-C metadata (for the property or the method itself), and the calling convention to be a direct C function call. The symbol for the method has enforced hidden visibility and such direct calls are hence unreachable cross image. An explicit C function must be made if so desired to wrap them. The implicit `self` and `_cmd` arguments are preserved, however to maintain compatibility with the usual `objc_msgSend` semantics, 3 fundamental precautions are taken: 1) for instance methods, `self` is nil-checked. On arm64 backends this typically adds a single instruction (cbz x0, <closest-ret>) to the codegen, for the vast majority of the cases when the return type is a scalar. 2) for class methods, because the class may not be realized/initialized yet, a call to `[self self]` is emitted. When the proper deployment target is used, this is optimized to `objc_opt_self(self)`. However, long term we might want to emit something better that the optimizer can reason about. When inlining kicks in, these calls aren't optimized away as the optimizer has no idea that a single call is really necessary. 3) the calling convention for the `_cmd` argument is changed: the caller leaves the second argument to the call undefined, and the selector is loaded inside the body when it's referenced only. As far as error reporting goes, the compiler refuses: - making any overloads direct, - making an overload of a direct method, - implementations marked as direct when the declaration in the interface isn't (the other way around is allowed, as the direct attribute is inherited from the declaration), - marking methods required for protocol conformance as direct, - messaging an unqualified `id` with a direct method, - forming any @selector() expression with only direct selectors. As warnings: - any inconsistency of direct-related calling convention when @selector() or messaging is used, - forming any @selector() expression with a possibly direct selector. Lastly an `objc_direct_members` attribute is added that can decorate `@implementation` blocks and causes methods only declared there (and in no `@interface`) to be automatically direct. When decorating an `@interface` then all methods and properties declared in this block are marked direct. Radar-ID: rdar://problem/2684889 Differential Revision: https://reviews.llvm.org/D69991 Reviewed-By: John McCall
* Reland: [Remarks][Driver] Use different remark files when targeting multiple ↵Francis Visoiu Mistrih2019-11-182-0/+27
| | | | | | | | | | | | | | | | | | architectures When the driver is targeting multiple architectures at once, for things like Universal Mach-Os, we need to emit different remark files for each cc1 invocation to avoid overwriting the files from a different invocation. For example: $ clang -c -o foo.o -fsave-optimization-record -arch x86_64 -arch x86_64h will create two remark files: * foo-x86_64.opt.yaml * foo-x86_64h.opt.yaml
* Revert "[Remarks][Driver] Use different remark files when targeting multiple ↵Reid Kleckner2019-11-182-24/+0
| | | | | | | | architectures" This reverts commit b4e2b112b58154a89171df39dae80044865ff4ff. Test doesn't appear to pass on Windows, maybe all non-Mac.
* Temporarily Revert "Add support for options -frounding-math, ftrapping-math, ↵Eric Christopher2019-11-1812-532/+18
| | | | | | | | -ffp-model=, and -ffp-exception-behavior=" and a follow-up NFC rearrangement as it's causing a crash on valid. Testcase is on the original review thread. This reverts commits af57dbf12e54f3a8ff48534bf1078f4de104c1cd and e6584b2b7b2de06f1e59aac41971760cac1e1b79
* Allocate builtins table earlier to fix bug found by ubsanReid Kleckner2019-11-181-1/+2
| | | | Follow up to 979da9a4c3ba
* [Remarks][Driver] Use different remark files when targeting multiple ↵Francis Visoiu Mistrih2019-11-182-0/+24
| | | | | | | | | | | | | | | | | | architectures When the driver is targeting multiple architectures at once, for things like Universal Mach-Os, we need to emit different remark files for each cc1 invocation to avoid overwriting the files from a different invocation. For example: $ clang -c -o foo.o -fsave-optimization-record -arch x86_64 -arch x86_64h will create two remark files: * foo-x86_64.opt.yaml * foo-x86_64h.opt.yaml
* [Attr] Fix `-ast-print` for `asm` attributeJoel E. Denny2019-11-182-5/+11
| | | | | | | | | | | | | | | | Without this fix, the tests introduced here produce the following assert fail: ``` clang: /home/jdenny/llvm/clang/include/clang/Basic/AttributeCommonInfo.h:163: unsigned int clang::AttributeCommonInfo::getAttributeSpellingListIndex() const: Assertion `(isAttributeSpellingListCalculated() || AttrName) && "Spelling cannot be found"' failed. ``` The bug was introduced by D67368, which caused `AsmLabelAttr`'s spelling index to be set to `SpellingNotCalculated`. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D70349
* [OPENMP50]Fix PR44024: runtime assert in distribute construct.Alexey Bataev2019-11-182-1/+18
| | | | | If the code is emitted for distribute construct, the nonmonotonic modifier should not be added.
OpenPOWER on IntegriCloud