summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix parameter name comments using clang-tidy. NFC.Rui Ueyama2019-07-163-6/+6
| | | | | | | | | | | | | | | | | | | | | This patch applies clang-tidy's bugprone-argument-comment tool to LLVM, clang and lld source trees. Here is how I created this patch: $ git clone https://github.com/llvm/llvm-project.git $ cd llvm-project $ mkdir build $ cd build $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug \ -DLLVM_ENABLE_PROJECTS='clang;lld;clang-tools-extra' \ -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLLVM_ENABLE_LLD=On \ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../llvm $ ninja $ parallel clang-tidy -checks='-*,bugprone-argument-comment' \ -config='{CheckOptions: [{key: StrictMode, value: 1}]}' -fix \ ::: ../llvm/lib/**/*.{cpp,h} ../clang/lib/**/*.{cpp,h} ../lld/**/*.{cpp,h} llvm-svn: 366177
* [FileCheck] Store line numbers as optional valuesThomas Preud'homme2019-07-151-10/+12
| | | | | | | | | | | | | | | | | | | | Summary: Processing of command-line definition of variable and logic around implicit not directives both reuse parsing code that expects a line number to be defined. So far, a special line number of 0 was used for those users of the parsing code where a line number does not make sense. This commit instead represents line numbers as Optional values so that they can be None for those cases. Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D64639 llvm-svn: 366109
* [TargetParser][ARM] Account dependencies when processing target featuresAlexandros Lamprineas2019-07-141-6/+20
| | | | | | | | | | Teaches ARM::appendArchExtFeatures to account dependencies when processing target features: i.e. when you say -march=armv8.1-m.main+mve.fp+nofp it means mve.fp should get discarded too. (Split from D63936) Differential Revision: https://reviews.llvm.org/D64048 llvm-svn: 366031
* [clang][Driver][ARM] Favor -mfpu over default CPU featuresAlexandros Lamprineas2019-07-141-24/+6
| | | | | | | | | | | | | | | | When processing the command line options march, mcpu and mfpu, we store the implied target features on a vector. The change D62998 introduced a temporary vector, where the processed features get accumulated. When calling DecodeARMFeaturesFromCPU, which sets the default features for the specified CPU, we certainly don't want to override the features that have been explicitly specified on the command line. Therefore, the default features should appear first in the final vector. This problem became evident once I added the missing (unhandled) target features in ARM::getExtensionFeatures. Differential Revision: https://reviews.llvm.org/D63936 llvm-svn: 366027
* FileCheck [7/12]: Arbitrary long numeric expressionsThomas Preud'homme2019-07-131-84/+124
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch is part of a patch series to add support for FileCheck numeric expressions. This specific patch extend numeric expression to support an arbitrary number of operands, either variable or literals. Copyright: - Linaro (changes up to diff 183612 of revision D55940) - GraphCore (changes in later versions of revision D55940 and in new revision created off D55940) Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield Tags: #llvm Differential Revision: https://reviews.llvm.org/D60387 llvm-svn: 366001
* [SystemZ] Add support for new cpu architecture - arch13Ulrich Weigand2019-07-121-0/+2
| | | | | | | | | | | | | | | | | | This patch series adds support for the next-generation arch13 CPU architecture to the SystemZ backend. This includes: - Basic support for the new processor and its features. - Assembler/disassembler support for new instructions. - CodeGen for new instructions, including new LLVM intrinsics. - Scheduler description for the new processor. - Detection of arch13 as host processor. Note: No currently available Z system supports the arch13 architecture. Once new systems become available, the official system name will be added as supported -march name. llvm-svn: 365932
* [Support] Move the static initializer install_out_memory_new_handler to InitLLVMFangrui Song2019-07-122-17/+6
| | | | | | | | | | | An application linking against LLVMSupport should not get the gratuitous set::std_new_handler call. Reviewed By: jfb Differential Revision: https://reviews.llvm.org/D64505 llvm-svn: 365915
* Add missing <atomic> include to appease MSVC builds.Simon Pilgrim2019-07-121-0/+1
| | | | llvm-svn: 365914
* Support for dumping current PrettyStackTrace on SIGINFO (Ctrl-T)Jordan Rose2019-07-123-17/+119
| | | | | | | | | | | | | | | | | | | | Support SIGINFO (and SIGUSR1 for POSIX purposes) to tell what long-running jobs are doing, as inspired by BSD tools (including on macOS), by dumping the current PrettyStackTrace. This adds a new kind of signal handler for non-fatal "info" signals, similar to the "interrupt" handler that already exists for SIGINT (Ctrl-C). It then uses that handler to update a "generation count" managed by the PrettyStackTrace infrastructure, which is then checked whenever a PrettyStackTraceEntry is pushed or popped on each thread. If the generation has changed---i.e. if the user has pressed Ctrl-T---the stack trace is dumped, though unfortunately it can't include the deepest entry because that one is currently being constructed/destructed. https://reviews.llvm.org/D63750 llvm-svn: 365911
* [YAMLIO] Remove trailing spaces when outputting mapsFangrui Song2019-07-121-11/+23
| | | | | | | | | | | | | | | | | | llvm::yaml::Output::paddedKey unconditionally outputs spaces, which are superfluous if the value to be dumped is a sequence or map. Change `bool NeedsNewLine` to `StringRef Padding` so that it can be overridden to `\n` if the value is a sequence or map. An empty map/sequence is special. It is printed as `{}` or `[]` without a newline, while a non-empty map/sequence follows a newline. To handle this distinction, add another variable `PaddingBeforeContainer` and does the special handling in endMapping/endSequence. Reviewed By: grimar, jhenderson Differential Revision: https://reviews.llvm.org/D64566 llvm-svn: 365869
* [llvm-objcopy] Don't change permissions of non-regular output filesFangrui Song2019-07-112-7/+13
| | | | | | | | | | | | | | | | | | | | | | There is currently an EPERM error when a regular user executes `llvm-objcopy a.o /dev/null`. Worse, root can even change the mode bits of /dev/null. Fix it by checking if the output file is special. A new overload of llvm::sys::fs::setPermissions with FD as the parameter is added. Users should provide `perm & ~umask` as the parameter if they intend to respect umask. The existing overload of llvm::sys::fs::setPermissions may be deleted if we can find an implementation of fchmod() on Windows. fchmod() is usually better than chmod() because it saves syscalls and can avoid race condition. Reviewed By: jakehehrlich, jhenderson Differential Revision: https://reviews.llvm.org/D64236 llvm-svn: 365753
* Revert Recommit "[CommandLine] Remove OptionCategory and SubCommand caches ↵Haojian Wu2019-07-111-53/+59
| | | | | | | | | | from the Option class." This reverts r365675 (git commit 43d75f977853c3ec891a440c362b2df183a211b5) The patch causes a crash in SupportTests (CommandLineTest.AliasesWithArguments). llvm-svn: 365742
* Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the ↵Don Hinton2019-07-101-59/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | Option class." Previously reverted in 364141 due to buildbot breakage, and fixed here by making GeneralCategory global a ManagedStatic. Summary: This change processes `OptionCategory`s and `SubCommand`s as they are seen instead of caching them in the Option class and processing them later. Doing so simplifies the work needed to be done by the Global parser and significantly reduces the size of the Option class to a mere 64 bytes. Removing the `OptionCategory` cache saved 24 bytes, and removing the `SubCommand` cache saved an additional 48 bytes, for a total of a 72 byte reduction. Reviewed By: serge-sans-paille Tags: #llvm, #clang Differential Revision: https://reviews.llvm.org/D62105 llvm-svn: 365675
* [FileCheck] Simplify numeric variable interfaceThomas Preud'homme2019-07-101-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch simplifies 2 aspects in the FileCheckNumericVariable code. First, setValue() method is turned into a void function since being called only on undefined variable is an invariant and is now asserted rather than returned. This remove the assert from the callers. Second, clearValue() method is also turned into a void function since the only caller does not check its return value since it may be trying to clear the value of variable that is already cleared without this being noteworthy. Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D64231 > llvm-svn: 365249 llvm-svn: 365625
* [FileCheck] Fix @LINE value after match failureThomas Preud'homme2019-07-101-1/+3
| | | | | | | | | | | | | | | | | | | | Summary: The value of the FileCheckNumericVariable class instance representing the @LINE numeric variable is set and cleared respectively before and after substitutions are made, if any. However, when a substitution fails, the value is not cleared. This causes the next substitution of @LINE later on to give the wrong value since setValue is a nop if the value is already set. This is what caused failures after commit r365249. Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield Tags: #llvm Differential Revision: https://reviews.llvm.org/D64449 llvm-svn: 365624
* [Support] Move llvm::MemoryBuffer to sys::fs::file_tReid Kleckner2019-07-105-78/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: On Windows, Posix integer file descriptors are a compatibility layer over native file handles provided by the C runtime. There is a hard limit on the maximum number of file descriptors that a process can open, and the limit is 8192. LLD typically doesn't run into this limit because it opens input files, maps them into memory, and then immediately closes the file descriptor. This prevents it from running out of FDs. For various reasons, I'd like to open handles to every input file and keep them open during linking. That requires migrating MemoryBuffer over to taking open native file handles instead of integer FDs. Reviewers: aganea, Bigcheese Reviewed By: aganea Subscribers: smeenai, silvas, mehdi_amini, hiraditya, steven_wu, dexonsmith, dang, llvm-commits, zturner Tags: #llvm Differential Revision: https://reviews.llvm.org/D63453 llvm-svn: 365588
* [AMDGPU] gfx908 targetStanislav Mekhanoshin2019-07-091-1/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D64429 llvm-svn: 365525
* Revert "[FileCheck] Simplify numeric variable interface"Michael Liao2019-07-051-5/+9
| | | | | | This reverts commit 096600a4b073dd94a366cc8e57bff93c34ff6966. llvm-svn: 365251
* [FileCheck] Simplify numeric variable interfaceThomas Preud'homme2019-07-051-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch simplifies 2 aspects in the FileCheckNumericVariable code. First, setValue() method is turned into a void function since being called only on undefined variable is an invariant and is now asserted rather than returned. This remove the assert from the callers. Second, clearValue() method is also turned into a void function since the only caller does not check its return value since it may be trying to clear the value of variable that is already cleared without this being noteworthy. Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D64231 llvm-svn: 365249
* [FileCheck] Share variable instance among usesThomas Preud'homme2019-07-051-28/+39
| | | | | | | | | | | | | | | | | | | | Summary: This patch changes expression support to use one instance of FileCheckNumericVariable per numeric variable rather than one per variable and per definition. The current system was only necessary for the last patch of the numeric expression support patch series in order to handle a line using a variable defined earlier on the same line from the input text. However this can be dealt more efficiently. Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D64229 llvm-svn: 365220
* [FileCheck] Don't diagnose undef vars at parse timeThomas Preud'homme2019-07-051-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Diagnosing use of undefined variables takes place in parseNumericVariableUse() and printSubstitutions() for numeric variables but only takes place in printSubstitutions() for string variables. The reason for the split location of diagnostics is that parsing is not aware of the clearing of variables due to --enable-var-scope and thus use of variables cleared in this way can only be catched by printSubstitutions(). Beyond the code level inconsistency, there is also a user facing inconsistency since diagnostics look different between the two functions. While the diagnostic in printSubstitutions is more verbose, doing the diagnostic there allows to diagnose all undefined variables rather than just the first one and error out. This patch create dummy variable definition when encountering a use of undefined variable so that parsing can proceed and be diagnosed by printSubstitutions() later. Tests that were testing whether parsing fails in such case are thus modified accordingly. Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D64228 llvm-svn: 365219
* [AMDGPU] Added a new metadata for multi grid sync implicit argumentYaxun Liu2019-07-051-0/+2
| | | | | | | | Patch by Christudasan Devadasan. Differential Revision: https://reviews.llvm.org/D63886 llvm-svn: 365217
* [FileCheck] Fix comment in parseNumericVariableUseThomas Preud'homme2019-07-051-6/+6
| | | | | | | | | | | | | | | | | | | | Summary: Comment explaining the interaction between parsing of numeric variable definition and uses in parseNumericVariableUse is stale since it suggests both use and definition parsing is done in the same function. This was the case in a previous version of the patch committed as 71d3f227a790d6cf39d8c6267940e0dc0c237e11 but is no longer the case. This patch updates the comment accordingly. Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D64227 llvm-svn: 365192
* [FileCheck] Factor some parsing checks outThomas Preud'homme2019-07-051-35/+14
| | | | | | | | | | | | | | | | | Summary: Both callers of parseNumericVariableDefinition() perform the same extra check that no character is found after the variable name. This patch factors out this check into parseNumericVariableDefinition(). Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D64226 llvm-svn: 365191
* [FileCheck] Add missing final dot in commentThomas Preud'homme2019-07-051-1/+1
| | | | llvm-svn: 365190
* Remove some autoconf references from docs and commentsSven van Haastregt2019-07-033-3/+3
| | | | | | | | | The autoconf build system support has been removed a while ago, remove some outdated references. Differential Revision: https://reviews.llvm.org/D63608 llvm-svn: 365013
* [triple] Use 'macabi' environment name for the Mac Catalyst triplesAlex Lorenz2019-07-031-2/+2
| | | | | | The 'macabi' environment name is preferred instead of 'maccatalyst'. llvm-svn: 364988
* [triple] add 'macCatalyst' environment typeAlex Lorenz2019-07-021-0/+2
| | | | | | | | Mac Catalyst is a new deployment platform in macOS Catalina. Differential Revision: https://reviews.llvm.org/D64097 llvm-svn: 364971
* [C++2a] Add __builtin_bit_cast, used to implement std::bit_castErik Pilkington2019-07-021-0/+53
| | | | | | | | | | | | | | | | | | This commit adds a new builtin, __builtin_bit_cast(T, v), which performs a bit_cast from a value v to a type T. This expression can be evaluated at compile time under specific circumstances. The compile time evaluation currently doesn't support bit-fields, but I'm planning on fixing this in a follow up (some of the logic for figuring this out is in CodeGen). I'm also planning follow-ups for supporting some more esoteric types that the constexpr evaluator supports, as well as extending __builtin_memcpy constexpr evaluation to use the same infrastructure. rdar://44987528 Differential revision: https://reviews.llvm.org/D62825 llvm-svn: 364954
* getMainExecutable: handle realpath() failure, falling back to getprogpath().Sam McCall2019-07-021-10/+10
| | | | | | | | | | | | | | | | | Summary: Previously, we'd pass a nullptr to std::string and crash(). This case happens when the binary is deleted while being used (e.g. rebuilding clangd). Reviewers: kadircet Subscribers: ilya-biryukov, kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64068 llvm-svn: 364936
* [llvm] [Support] Clean PrintStackTrace() ptr arithmetic upMichal Gorny2019-07-021-5/+2
| | | | | | | | | | | | | | | | | Use '%tu' modifier for pointer arithmetic since we are using C++11 already. Prefer static_cast<> over C-style cast. Remove unnecessary conversion of result, and add const qualifier to converted pointers, to silence the following warning: In file included from /home/mgorny/llvm-project/llvm/lib/Support/Signals.cpp:220:0: /home/mgorny/llvm-project/llvm/lib/Support/Unix/Signals.inc: In function ‘void llvm::sys::PrintStackTrace(llvm::raw_ostream&)’: /home/mgorny/llvm-project/llvm/lib/Support/Unix/Signals.inc:546:53: warning: cast from type ‘const void*’ to type ‘char*’ casts away qualifiers [-Wcast-qual] (char*)dlinfo.dli_saddr)); ^~~~~~~~~ Differential Revision: https://reviews.llvm.org/D63888 llvm-svn: 364912
* [APInt] Fix getBitsNeeded for INT_MIN valuesDmitry Venikov2019-06-291-1/+4
| | | | | | | | | | | | | | | | Summary: This patch fixes behaviour of APInt::getBitsNeeded for INT_MIN 10 bits values. Reviewers: regehr, RKSimon Reviewed By: RKSimon Subscribers: grandinj, dexonsmith, kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63691 llvm-svn: 364710
* [Support] Add fs::getUmask() function and change fs::setPermissionsAlex Brachet2019-06-282-2/+19
| | | | | | | | | | | | | | | | Summary: This patch changes fs::setPermissions to optionally set permissions while respecting the umask. It also adds the function fs::getUmask() which returns the current umask. Reviewers: jhenderson, rupprecht, aprantl, lhames Reviewed By: jhenderson, rupprecht Subscribers: sanaanajjar231288, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63583 llvm-svn: 364621
* [CodeGen] [SelectionDAG] More efficient code for X % C == 0 (UREM case) (try 3)Roman Lebedev2019-06-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I'm submitting a new revision since i don't understand how to reclaim/reopen/take over the existing one, D50222. There is no such action in "Add Action" menu... This implements an optimization described in Hacker's Delight 10-17: when `C` is constant, the result of `X % C == 0` can be computed more cheaply without actually calculating the remainder. The motivation is discussed here: https://bugs.llvm.org/show_bug.cgi?id=35479. This is a recommit, the original commit rL364563 was reverted in rL364568 because test-suite detected miscompile - the new comparison constant 'Q' was being computed incorrectly (we divided by `D0` instead of `D`). Original patch D50222 by @hermord (Dmytro Shynkevych) Notes: - In principle, it's possible to also handle the `X % C1 == C2` case, as discussed on bugzilla. This seems to require an extra branch on overflow, so I refrained from implementing this for now. - An explicit check for when the `REM` can be reduced to just its LHS is included: the `X % C` == 0 optimization breaks `test1` in `test/CodeGen/X86/jump_sign.ll` otherwise. I hadn't managed to find a better way to not generate worse output in this case. - The `test/CodeGen/X86/jump_sign.ll` regresses, and is being fixed by a followup patch D63390. Reviewers: RKSimon, craig.topper, spatel, hermord, xbolva00 Reviewed By: RKSimon, xbolva00 Subscribers: dexonsmith, kristina, xbolva00, javed.absar, llvm-commits, hermord Tags: #llvm Differential Revision: https://reviews.llvm.org/D63391 llvm-svn: 364600
* DataExtractor: use decodeSLEB128 to implement getSLEB128David Blaikie2019-06-241-21/+10
| | | | | | | | | Should've been NFC, but turns out DataExtractor had better test coverage for decoding SLEB128 than the decodeSLEB128 did - revealing a couple of bugs (one in the error handling, another in sign extension). So fixed those to get the DataExtractor tests passing again. llvm-svn: 364253
* NFC: DataExtractor: use decodeULEB128 to implement getULEB128David Blaikie2019-06-241-17/+11
| | | | llvm-svn: 364230
* [Support] Fix error handling in DataExtractor::get[US]LEB128Pavel Labath2019-06-241-14/+14
| | | | | | | | | | | | | | | | | | | | | | | Summary: These functions are documented as not modifying the offset argument if the extraction fails (just like other DataExtractor functions). However, while reviewing D63591 we discovered that this is not the case -- if the function reaches the end of the data buffer, it will just return the value parsed until that point and set offset to point to the end of the buffer. This fixes the functions to act as advertised, and adds a regression test. Reviewers: dblaikie, probinson, bkramer Subscribers: kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63645 llvm-svn: 364169
* [Support] Fix build under EmscriptenKeno Fischer2019-06-231-0/+3
| | | | | | | | | | | | | | | Summary: Emscripten's libc doesn't define MNT_LOCAL, thus causing a build failure in the fallback path. However, to the best of my knowledge, it also doesn't support remote file system mounts, so we may simply return `true` here (as we do for e.g. Fuchsia). With this fix, the core LLVM libraries build correctly under emscripten (though some of the tools and utils do not). Reviewers: kripken Differential Revision: https://reviews.llvm.org/D63688 llvm-svn: 364143
* Revert [CommandLine] Remove OptionCategory and SubCommand caches from the ↵Don Hinton2019-06-221-49/+58
| | | | | | | | | | | | | Option class. This reverts r364134 (git commit a5b83bc9e3b8e8945b55068c762bd6c73621a4b0) Caused errors in the asan bot, so the GeneralCategory global needs to be changed to ManagedStatic. Differential Revision: https://reviews.llvm.org/D62105 llvm-svn: 364141
* [CommandLine] Remove OptionCategory and SubCommand caches from the Option class.Don Hinton2019-06-221-58/+49
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change processes `OptionCategory`s and `SubCommand`s as they are seen instead of caching them in the Option class and processing them later. Doing so simplifies the work needed to be done by the Global parser and significantly reduces the size of the Option class to a mere 64 bytes. Removing the `OptionCategory` cache saved 24 bytes, and removing the `SubCommand` cache saved an additional 48 bytes, for a total of a 72 byte reduction. Reviewers: beanz, zturner, MaskRay, serge-sans-paille Reviewed By: serge-sans-paille Subscribers: serge-sans-paille, tstellar, zturner, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62105 llvm-svn: 364134
* Simplify std::lower_bound with llvm::{bsearch,lower_bound}. NFCFangrui Song2019-06-211-8/+3
| | | | llvm-svn: 364006
* [FileCheck] Stop qualifying expressions as numericThomas Preud'homme2019-06-191-40/+39
| | | | | | | | | | | | | | | | | Summary: Stop referring to "numeric expression", using simply the term "expression" instead. Likewise for numeric operation since operations are only used in numeric expressions. Reviewers: jhenderson, jdenny, probinson, arichardson Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63500 llvm-svn: 363901
* FileCheck: Return parse error w/ Error & ExpectedThomas Preud'homme2019-06-191-201/+214
| | | | | | | | | | | | | | | | Summary: Make use of Error and Expected to bubble up diagnostics and force checking of errors in the callers. Reviewers: jhenderson, jdenny, probinson, arichardson Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63125 llvm-svn: 363900
* [clang] Add storage for APValue in ConstantExprGauthier Harnisch2019-06-151-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When using ConstantExpr we often need the result of the expression to be kept in the AST. Currently this is done on a by the node that needs the result and has been done multiple times for enumerator, for constexpr variables... . This patch adds to ConstantExpr the ability to store the result of evaluating the expression. no functional changes expected. Changes: - Add trailling object to ConstantExpr that can hold an APValue or an uint64_t. the uint64_t is here because most ConstantExpr yield integral values so there is an optimized layout for integral values. - Add basic* serialization support for the trailing result. - Move conversion functions from an enum to a fltSemantics from clang::FloatingLiteral to llvm::APFloatBase. this change is to make it usable for serializing APValues. - Add basic* Import support for the trailing result. - ConstantExpr created in CheckConvertedConstantExpression now stores the result in the ConstantExpr Node. - Adapt AST dump to print the result when present. basic* : None, Indeterminate, Int, Float, FixedPoint, ComplexInt, ComplexFloat, the result is not yet used anywhere but for -ast-dump. Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: rnkovacs, hiraditya, dexonsmith, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D62399 llvm-svn: 363493
* [BranchProbability] Delete a redundant overflow checkFangrui Song2019-06-151-4/+0
| | | | llvm-svn: 363492
* Fix failing test on ARM buildbotEugene Leviant2019-06-141-1/+1
| | | | | | | | r363261 caused test failure on 32-bit ARM buildbot, because of unsigned integer overflow. This patch fixes it changing offset type from size_t to uint64_t. llvm-svn: 363393
* [AMDGPU] gfx1011/gfx1012 targetsStanislav Mekhanoshin2019-06-141-1/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D63307 llvm-svn: 363344
* Extra error checking to ARMAttributeParserEugene Leviant2019-06-131-0/+6
| | | | | | The patch checks for subsection length as discussed in D63191 llvm-svn: 363260
* [Path] Set FD to -1 in moved-from TempFileJonas Devlieghere2019-06-111-0/+1
| | | | | | | | | When moving a temp file, explicitly set the file descriptor to -1 so we can never accidentally close the moved-from TempFile. Differential revision: https://reviews.llvm.org/D63087 llvm-svn: 363083
* [AArch64] Add more CPUs to host detectionYi Kong2019-06-111-0/+6
| | | | | | | | | Returns "cortex-a73" for 3rd and 4th gen Kryo; not precisely correct, but close enough. Differential Revision: https://reviews.llvm.org/D63099 llvm-svn: 363013
OpenPOWER on IntegriCloud