Commit Graph

277 Commits

Author SHA1 Message Date
Eugene Zelenko
9feaa97ada Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes.
Differential revision: https://reviews.llvm.org/D23789


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279535 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23 17:14:32 +00:00
Justin Bogner
7d7a23e700 Replace a few more "fall through" comments with LLVM_FALLTHROUGH
Follow up to r278902. I had missed "fall through", with a space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 20:30:52 +00:00
Justin Bogner
833a10e76a Fix a use of LLVM_FALLTHROUGH that wasn't even in a switch.
I was over-aggressive in my conversions from comments to the
fallthrough attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 05:25:38 +00:00
Justin Bogner
6673ea81f6 Replace "fallthrough" comments with LLVM_FALLTHROUGH
This is a mechanical change of comments in switches like fallthrough,
fall-through, or fall-thru to use the LLVM_FALLTHROUGH macro instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 05:10:15 +00:00
Ahmed Bougacha
27cc0cc039 [TableGen] Autobrief-ize Record. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:53:14 +00:00
Ahmed Bougacha
cf03606efc [TableGen] Cleanup Record comments. NFC.
LLVM doesn't use exceptions anymore.
Also remove the implementation comments. Some of them diverged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275424 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:53:11 +00:00
Tim Northover
edff0683c8 TableGen: promote "code" type from syntactic sugar.
It's being immediately converted to a "string", but being able to tell what
type the field was originally can be useful in backends.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-05 21:22:55 +00:00
Benjamin Kramer
04a303b821 Avoid copies of std::strings and APInt/APFloats where we only read from it
As suggested by clang-tidy's performance-unnecessary-copy-initialization.
This can easily hit lifetime issues, so I audited every change and ran the
tests under asan, which came back clean.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 10:01:20 +00:00
Mehdi Amini
f6071e14c5 [NFC] Header cleanup
Removed some unused headers, replaced some headers with forward class declarations.

Found using simple scripts like this one:
clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap'

Patch by Eugene Kosov <claprix@yandex.ru>

Differential Revision: http://reviews.llvm.org/D19219

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266595 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-18 09:17:29 +00:00
Richard Smith
43ef70d524 Update and fix LLVM_ENABLE_MODULES:
1) We need to add this flag prior to adding any other, in case the user has
specified a -fmodule-cache-path= flag in their custom CXXFLAGS. Such a flag
causes -Werror builds to fail, and thus all config checks fail, until we add
the corresponding -fmodules flag. The modules selfhost bot does this, for
instance.

2) Delete module maps that were putting .cpp files into modules.

3) Enable -fmodules-local-submodule-visibility, to get proper module
visibility rules applied across submodules of the same module. Disable
-fmodules for C builds, since that flag is not available there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-16 00:48:58 +00:00
Craig Topper
62bd2798ad [TableGen] Fix typos in comments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261984 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-26 06:50:27 +00:00
Yaron Keren
55307987a1 Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment.
clang part in r259232, this is the LLVM part of the patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 20:50:44 +00:00
Chris Bieneman
caeade4234 Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

"I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened."
- Obi Wan Kenobi

Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark

Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits

Differential Revision: http://reviews.llvm.org/D16471

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 21:29:08 +00:00
Craig Topper
dd6092dc5c [TableGen] Use FoldingSets instead of DenseMaps to unique UnOpInit, BinOpInit and TernOpInit. This remove the memory needed to store the key for the DenseMap. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258071 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-18 20:36:06 +00:00
Craig Topper
b51e7cd7a3 [TableGen] Fix an assert I missed in r258063.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-18 19:59:05 +00:00
Craig Topper
401ee722ee [TableGen] Merge the SuperClass Record and SMRange vector into a single vector. This removes the state needed to manage the extra vector thus reducing the size of the Record class. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-18 19:52:37 +00:00
Craig Topper
11c70fa131 [TableGen] Allocate the Init pointer array for BitsInit/ListInit after the BitsInit/ListInit object itself. Saves a bit of memory. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-18 19:52:24 +00:00
Craig Topper
d8f59233d2 [TableGen] Use some free space in Init to store the opcode for UnOpInit/BinOpInit/TernOpInit allowing those types to be a little smaller. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256733 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-04 06:28:49 +00:00
Craig Topper
2507b00594 [TableGen] Change TGParser::SetValue to take an ArrayRef instead of std::vector reference. Use None in many places where a default constructed vector was being passed. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-04 03:15:08 +00:00
Craig Topper
ae62636ef8 [TableGen] Fix a bug that caused the wrong name for a record built from a multiclass containing a defm called NAME that references another multiclass that contains a defm that uses NAME concatenated with other strings.
It would end up doing the concatenations from the second multiclass twice. This occured because SetValue detected a self assignment when trying to set the value of NAME to a VarInit called NAME. NAME is special here and it will get cleaned up later. So add a flag to suppress the self assignment check for this case.

Strangely the self-assignment error was returning false indicating it wasn't an error, but it wasn't doing the right thing. So this also changes it to report an error.

This fixes the names of some AVX512 FMA instructions that showed this double expansion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-04 03:05:14 +00:00
Benjamin Kramer
55cb91eee9 [TblGen] ArrayRefize TGParser. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 12:46:45 +00:00
Matt Arsenault
6a224c30a5 TableGen: Support folding casts from bits to int
This is to fix an incorrect error when trying to initialize
DwarfNumbers with a !cast<int> of a bits initializer.
getValuesAsListOfInts("DwarfNumbers") would not see an IntInit
and instead the cast, so would give up.

It seems likely that this could be generalized to attempt
the convertInitializerTo for any type. I'm not really sure
why the existing code seems to special case the string cast cases
when convertInitializerTo seems like it should generally handle this
sort of thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243722 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 01:12:06 +00:00
Davide Italiano
c11299b4a7 [TableGen] Emit the correct error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243284 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-27 17:22:19 +00:00
Craig Topper
fade2f72b8 [TableGen] Change a couple methods to return an ArrayRef instead of a const std::vector reference. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241430 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 06:23:01 +00:00
Craig Topper
1405564987 [TableGen] Restore the use of the TheInit field in Record to cache the Record's DefInit. I broke this when I fixed memory leaks recently. Remove the DenseMap that mapped Record's to DefInit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240524 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 06:19:19 +00:00
Alexander Kornienko
cd52a7a381 Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Apparently, the style needs to be agreed upon first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240390 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 09:49:53 +00:00
Alexander Kornienko
cf0db29df2 Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
  -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
  llvm/lib/


Thanks to Eugene Kosov for the original patch!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240137 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 15:57:42 +00:00
Craig Topper
d032911655 [TableGen] Change OpInit::getNumOperands and getOperand to use unsigned integers. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:34:04 +00:00
Craig Topper
32d99f93e4 [TableGen] Remove trailing whitespace, add space between 'if' and paren, other formatting fixes. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239209 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:34:01 +00:00
Craig Topper
8e29f136cf [TableGen] Remove unnecessary temporary. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:34:00 +00:00
Craig Topper
33d0763bd1 [TableGen] Fold variable declaration/initialization into if condition for a couple short lived variables. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239207 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:33:58 +00:00
Craig Topper
c052f54559 [TableGen] Remove unnecessary outer 'if' and merge it's conditions into the inner 'if's. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239206 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:33:55 +00:00
Craig Topper
77411bdfe3 [TableGen] Fold variable declarations with their assignments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239205 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 00:44:45 +00:00
Craig Topper
44bc71549e [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239022 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 07:40:14 +00:00
Craig Topper
40c791eda9 [TableGen] Merge single prefix bit in RecordVal into PointerIntPair with Name to reduce memory usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239021 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 07:40:12 +00:00
Craig Topper
caa40ec228 [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238808 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 06:19:28 +00:00
Craig Topper
61f49542d7 [TableGen] Rename ListInit::getSize to just 'size' to be more consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238806 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 04:15:57 +00:00
Craig Topper
a1bedd75a0 [TableGen] Use range-based for loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238805 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 04:15:51 +00:00
Craig Topper
dd2a26fccb [TableGen] Move a couple virtual methods out of line so vtable anchors can be removed. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238727 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 06:44:18 +00:00
Craig Topper
be43b88fae [TableGen] Merge RecTy::typeIsConvertibleTo and RecTy::baseClassOf. NFC
typeIsConvertibleTo was just calling baseClassOf(this) on the argument passed to it, but there weren't different signatures for baseClassOf so passing 'this' didn't really do anything interesting. typeIsConvertibleTo could have just been a non-virtual method in RecTy. But since that would be kind of a silly method, I instead re-distributed the logic from baseClassOf into typeIsConvertibleTo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238648 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-30 07:36:01 +00:00
Craig Topper
17246b12cf [TableGen] Remove all the variations of RecTy::convertValue and just handle the conversions in convertInitializerTo directly. This saves a bunch of vtable entries. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-30 07:34:51 +00:00
Benjamin Kramer
9589ff8949 Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.


Call sites were found with the ASTMatcher + some semi-automated cleanup.

memberCallExpr(
    argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
    on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
    hasArgument(0, bindTemporaryExpr(
                       hasType(recordDecl(hasNonTrivialDestructor())),
                       has(constructExpr()))),
    unless(isInTemplateInstantiation()))

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238602 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-29 19:43:39 +00:00
Craig Topper
60bc0ab340 [TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and TernOpInit as they weren't able to be called.
I don't think converting the inputs to the Ops was the right behavior anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238543 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-29 05:51:32 +00:00
Benjamin Kramer
24bccaf9f9 Don't call utostr in Twine/raw_ostream contexts.
Creating temporary std::strings there is unnecessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238412 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 11:24:24 +00:00
Craig Topper
aac3ba8fad [TableGen] Use DefInit::getAsString instead of getDef()->getName(). NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238399 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 06:38:32 +00:00
Craig Topper
38e3e6a195 [TableGen] Don't convert types to strings to query what they are. Just use 'isa'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238398 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 06:38:28 +00:00
Craig Topper
7b0f8fc600 [TableGen] Fix line wrapping logic for the autogenerated header to use math that makes more sense (at least to me).
The old code had a bug if the description was between 75 and 85 characters or so as it substracted PSLen from Desc.size() instead of MAX_LINE_LEN in the compare. It also calculated odd values for PosE on the last split and just let StringRef::slice take care of it being larger than the description string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 08:07:56 +00:00
Craig Topper
c9739ec212 [TableGen] Rewrite an assert to not do a bunch unsigned math and then try to ensure the result is a positive number.
I think the fact that it was explicitly excluding 0 kept this from being a tautology. The exclusion of 0 for the old math was also a bug that's easily hit if the description gets split into multiple lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 08:07:49 +00:00
Craig Topper
88008cb710 [TableGen] Put a space between '*' and description in the autogenerated tablegen header. Minor cleanup in surrounding code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 08:07:45 +00:00
Craig Topper
d0185f83c6 [TableGen] Fix indentation. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 06:48:47 +00:00