Commit Graph

48 Commits

Author SHA1 Message Date
Francis Visoiu Mistrih
47c6ce2af7 [Bitcode] Update includes: llvm/Bitcode -> llvm/Bitstream
The Bitstream part of Bitcode moved to llvm/Bitstream in LLVM. This
updates the uses in swift.

See r365091 [Bitcode] Move Bitstream to a separate library.

(cherry picked from commit 1cd8e19357)
2019-11-12 10:46:07 -08:00
Owen Voorhees
8a6711769e [Diagnostics] Refactor DiagnosticConsumer interface
DiagnosticInfo now holds all the information needed to consume
a diagnostic, so remove unneeded parameters from handleDiagnostic.
2019-10-29 13:52:12 -07:00
David Ungar
44daa88ebd Format 2019-04-03 12:53:31 -07:00
David Ungar
9cc3a4a9d8 Rename defaultDiagnosticLoc to bufferIndirectlyCausingDiagnostic. 2019-04-03 12:52:49 -07:00
David Ungar
c139c5909a Pass defaultDiagnosticLoc to handleDiagnostic, not currentPrimaryInput. 2019-04-02 22:27:55 -07:00
David Ungar
c90d9e69b6 Format 2019-04-02 00:43:59 -07:00
David Ungar
7a0e0ffc8a Store current primary in diagnostic engine, pass it down via handleDiagnostic. Unformmated. 2019-04-02 00:43:28 -07:00
Adrian Prantl
ff63eaea6f Remove \brief commands from doxygen comments.
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

      for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
2018-12-04 15:45:04 -08:00
Jordan Rose
0d054fbd3c Honor #sourceLocation filenames in serialized diagnostics
I'm not sure why we never handled this. Oops.

rdar://problem/43647151
2018-08-28 11:24:11 -07:00
David Ungar
20d099d4ce Remove now-unneeded argument from finishProcessing. 2018-06-12 16:37:04 -07:00
David Ungar
372f8ce8b0 Truncate serialized dia files instead of non-specific error. 2018-06-12 16:26:50 -07:00
David Ungar
524d88e921 Pass SM in finishProcessing 2018-05-12 19:40:09 -07:00
Sho Ikeda
f737add594 [gardening][Frontend] Replace typedef with using 2018-03-24 10:15:48 +09:00
Jordan Rose
de74836673 Wire up FileSpecificDiagnosticConsumer for serialized diagnostics
It appears to work!
2018-03-02 13:23:16 -08:00
Adam Nemet
9b9805420d Add optimization remarks
This allows reporting successful and unsuccessful optimizations similar to
clang/llvm.

This first patch adds support for the
options -Rpass=<pass-name-regex> -Rpass-missed=<pass-name-regex>.  These allow
reporting successful/unsuccessful optimization on the compiler output for passes
specified by the regex.  I've also added one missed and one passed remark type
to the inliner to test the infrastructure.

Clang also has the option of collecting these records in an external YAML data
file.  This will be added in a later patch.

A few notes:
* The goal is to use this facility for both user-lever "performance" warnings
and expert-level performance analysis.  There will probably be a flag in the
future differentiating the verbosity.

* The intent is match clang/llvm as much as it makes sense.  On the other hand I
did make some changes.  Unlike in llvm, the emitter is not a pass which
simplifies things.  Also the remark class hierarchy is greatly simplified since
we don't derive from DiagnosticInfo.  We also don't derive from Diagnostic to
support the streaming API for arbitrary named-value pairs.

* Currently function names are printed mangled which should be fixed.
2017-10-20 12:41:37 -07:00
Kosuke Ogawa
536702a7cf [Gardening] Fix typo: DiagosticKind -> DiagnosticKind 2017-07-25 18:10:39 +09:00
Pavel Yaskevich
ceebece399 [Diagnostics] Add buffer offset information to the serialized diagnostics
Some of the tools rely on the presence of buffer offset to correctly
navigate to the diagnostic area from the serialized diagnostics output,
let's get it based on the source location provided.

Resolves: rdar://problem/22935476
2017-05-22 19:45:42 -07:00
Argyrios Kyrtzidis
0bb299abc8 [frontend] Add 'finishProcessing()' method for DiagnosticConsumers to do their finalization (e.g. writing to a file)
Use this to avoid creating an empty serialized diagnostics file when the compiler crashes.
2017-05-05 18:25:02 -07:00
Maxwell Swadling
93d485e4f7 Changed handleDiagnostic to take a format string and format args instead of the formatted string
This allows diagnostic consumers to modify the way formatting of diagnostics is performed.
rdar://problem/31305854
2017-04-14 11:28:04 -07:00
Bob Wilson
7b0108ae22 Fix 80-column violations in my previous change 9114163f. 2017-01-08 17:21:44 -08:00
Bob Wilson
37e7d1c627 Merge remote-tracking branch 'origin/master' into master-next 2017-01-08 17:07:46 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Bob Wilson
9114163fcc Adjust for llvm r291016.
BitCodeAbbrev is now used as a shared_ptr, instead of making it an
IntrusiveRefCntPtr.
2017-01-05 21:53:11 -08:00
Bob Wilson
78b28243ff Merge remote-tracking branch 'origin/master' into master-next 2017-01-03 14:22:59 -08:00
practicalswift
38be6125e5 [gardening] C++ gardening: Terminate namespaces, fix argument names, ...
Changes:
* Terminate all namespaces with the correct closing comment.
* Make sure argument names in comments match the corresponding parameter name.
* Remove redundant get() calls on smart pointers.
* Prefer using "override" or "final" instead of "virtual". Remove "virtual" where appropriate.
2016-12-17 00:32:42 +01:00
Bob Wilson
deddf19aae Merge remote-tracking branch 'origin/master' into master-next 2016-12-13 10:23:03 -08:00
Michael Gottesman
59c6a64f5a [gardening] 0 => nullptr. Fixed with clang-tidy. 2016-12-06 23:14:13 -08:00
Bob Wilson
13da3fa8b1 Merge remote-tracking branch 'origin/master' into master-next 2016-12-04 18:16:09 -08:00
Hugh Bellamy
4779659f39 Fix warnings building swift/Frontend on Windows using MSVC 2016-12-02 12:50:39 +00:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Saleem Abdulrasool
4cced9b75a Frontend: replicate clang SVN r285660
The block info block does not require an explicit abbreviation width as the
local abbreviations are internal to the block.  Remove the parameter similar to
the clang change.
2016-11-15 17:38:58 -08:00
Ge Sen
5ad36b2962 [gardening] Put white spaces in between if/while clauses and braces where it is missing.
For instance:

'if (foo){' => 'if (foo) {'
2016-04-02 14:43:45 +08:00
saisi
08abcd92c3 fixed niggling typos 2016-01-29 22:22:12 -05:00
practicalswift
0d40662332 [gardening] Consistent use of header pattern 2016-01-23 12:19:51 +01:00
practicalswift
8efa5f587e [gardening] Remove "-*- C++ -*-" tag from .cpp files
Emacs assumes .h files are C files by default which is why the
tag "-*- C++ -*-" is needed.

.cpp files do not have this problem.
2016-01-23 12:09:32 +01:00
practicalswift
50baf2e53b Use consistent formatting in top of file headers. 2016-01-04 02:17:48 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
practicalswift
22e10737e2 Fix typos 2015-12-26 01:19:40 +01:00
Dmitri Gribenko
23366f2001 Merge pull request #506 from practicalswift/fix-typos-10
Fix typos (10 of 30)
2015-12-13 20:17:38 -08:00
practicalswift
bb6be23027 Fix typo: diagostics → diagnostics 2015-12-14 00:11:37 +01:00
practicalswift
2d9c3c3503 Fix typo: abbrevation → abbreviation 2015-12-13 23:56:38 +01:00
Ted Kremenek
1d1343ef7f Handle invalid locations in the serialized diagnostic consumer. Fixes <rdar://problem/17422366>.
Swift SVN r19178
2014-06-25 21:12:25 +00:00
Jordan Rose
574054b8fd Distance SourceManager from llvm::SourceMgr.
...in preparation for non-source locations, i.e. locations that don't come
frome source buffers.

No functionality change, but a fair bit of SourceManager API and idioms have
changed.

Swift SVN r18942
2014-06-17 01:15:47 +00:00
Jordan Rose
a843d9e61b Don't serialize invalid ranges in diagnostics.
No tests because I'm not sure when this ever happens, but it's a good
defensive commit anyway.

<rdar://problem/16414465>

Swift SVN r16841
2014-04-25 20:56:44 +00:00
Dmitri Hrybenko
f232267f23 Replace llvm::OwningPtr with std::unique_ptr
It looks like llvm::OwningPtr is going to be removed soon.


Swift SVN r14729
2014-03-06 09:47:17 +00:00
Jordan Rose
6685f72f3b Use Clang's stable enum values for serialized diagnostics.
A refinement of r14545, which was a response to "remarks" being added to Clang.
This commit requires Clang commit r202733.

Swift SVN r14613
2014-03-03 22:16:06 +00:00
Jordan Rose
3826099df4 Keep serialized diagnostic levels in sync with Clang.
Who would have thought this would ever change? But over in open-source-land,
they're adding "remarks" to the diagnostics (kind of like standalone notes)
and that shifted over the IDs of serialized diagnostics.

Swift SVN r14545
2014-03-01 00:44:13 +00:00
Connor Wakamo
2b3a922aa5 Move SerializedDiagnosticConsumer into swiftFrontend.
This matches where Clang implements its equivalent, and this makes it available to both swift and the new driver.

Swift SVN r10047
2013-11-08 19:26:13 +00:00