Commit Graph

1094 Commits

Author SHA1 Message Date
Jordan Rose c5dcf01aca Merge pull request #14814 from jrose-apple/dump-truck
Dump (some) filelists in the PrettyStackTrace
2018-03-12 09:13:20 -07:00
Jordan Rose 501c1fd31b Replace std::ofstream with llvm::raw_fd_ostream in -verify-apply-fixes (#15133)
This isn't a user-facing feature, but why bother using std::ofstream?
2018-03-10 16:57:41 -08:00
Jordan Rose 6243096b0b Dump input filelists in the PrettyStackTrace
This may help us reproduce a failing build when all we have is a build
log, and will become much more important in batch mode when we
/really/ need to know what ended up in what batch.

For now, this doesn't include /output/ filelists, because David's
about to mess with that code anyway to make things better around
supplementary outputs in batch mode. There is one weirdness there,
though, which is that ArgsToFrontendInputsConverter peeks at the
outputs to see whether we're doing single-threaded or multi-threaded
WMO.
2018-03-09 18:32:02 -08:00
Jordan Rose c860a6067f Reorganize ArgsToFrontendInputsConverter to be more functional-style
Per a conversation with DavidU.
2018-03-09 18:24:12 -08:00
Jordan Rose 41286bc676 Make JSON fix-it outputs be per-primary in batch mode. (#14995)
This means moving the output path into SupplementaryOutputPaths, and
using the same sort of diagnostic dispatching that serialized
diagnostics use. This is part of what's needed to run the migrator
in batch mode.
2018-03-09 11:58:54 -08:00
Slava Pestov a4900aea1c Frontend: Clean up duplicated logic 2018-03-06 19:42:52 -08:00
Sho Ikeda 25cdc981c7 Merge pull request #14977 from ikesyo/gardening-use-empty
[gardening] Use `empty()` over `size() == 0`
2018-03-07 09:34:26 +09:00
David Ungar 30f95f4a90 Merge pull request #14920 from davidungar/PR-18-9-batch-fix
[Batch mode]: Use first primary name for batch input file name.
2018-03-05 09:25:47 -08:00
Sho Ikeda 26d650292f [gardening] Use empty() over size() == 0 2018-03-05 14:43:13 +09:00
David Ungar 026882d090 Use first primary name for batch input file name. 2018-03-03 19:30:13 -08:00
Graydon Hoare 0cd182defc Merge pull request #14900 from jrose-apple/mux
Wire up FileSpecificDiagnosticConsumer for serialized diagnostics
2018-03-02 18:32:17 -08:00
George Karpenkov a65da887f2 Determine whether a given sanitizer is available based on the presenc… (#14919)
Determine whether a given sanitizer is available based on the presence of the library.

rdar://37192887
2018-03-02 16:57:45 -08:00
Jordan Rose de74836673 Wire up FileSpecificDiagnosticConsumer for serialized diagnostics
It appears to work!
2018-03-02 13:23:16 -08:00
Jordan Rose 51fa9332d8 Add a RangeSpecificDiagnosticConsumer
If a top-level diagnostic is in a particular source range, the
RangeSpecificDiagnosticConsumer will funnel it and any attached notes
to a particular "sub-consumer" designated for that range (intended to
be used with whole files). If it's not in a range designated for any
sub-consumer, the diagnostic is passed to all registered
sub-consumers.

This is intended to be used for batch mode, so that diagnostics that
are definitely associated with a particular file can be emitted in
that file's .dia output, while diagnostics that may be associated with
other files (such as those that come from Clang) will still get
presented to the user.
2018-03-02 13:23:15 -08:00
David Ungar 91e8538d9d When emitting dependencies, only emit supplementary outputs for the current input. 2018-03-01 08:33:32 -08:00
David Ungar 9cc534a05a Merge pull request #14702 from davidungar/PR-18-7-OutputsInInputs
[Batch mode]: Move SupplementaryOutputs into each InputFile and use the proper supplementary output. (7)
2018-02-28 11:31:47 -08:00
David Ungar 4866df6dfd Move SupplementaryOutputs into each InputFile. 2018-02-28 09:41:49 -08:00
Ben Langmuir ce1cfcc73d [frontend] Input buffers have names too
There's no need to skip filename checks for in-memory buffers, and
indeed we want sourcekitd to behave the same for main.swift files as the
compiler.

SR-6624
rdar://36113282
2018-02-27 12:04:57 -08:00
Joe Groff b00ea61945 SILGen: Lower keypath references to other modules' properties and subscripts as external keypath components.
This way we'll link against the key path component the other module provides instead of making fragile assumptions about its current implementation. Since external keypath lowering isn't fully implemented elsewhere in the compiler, this is enabled behind a staging flag.

external keypath staging
2018-02-23 12:58:19 -08:00
swift-ci e052955260 Merge pull request #14792 from atrick/opt-markers 2018-02-22 17:01:21 -08:00
Andrew Trick 5d7d02d252 Allow options: -O with -enforce-exclusivity. 2018-02-22 16:04:18 -08:00
Graydon Hoare 628c446fe3 [Stats] Add -profile-stats-{events,entities} 2018-02-21 16:22:48 -08:00
Graydon Hoare dd85e946e7 [Stats] Replace nonstandard SharedTimers with FrontendStatsTracers. 2018-02-21 14:49:24 -08:00
Jordan Rose 098a1c98f8 Stop importing SILModule.h in Frontend.h
...for no other reason than to slightly improve compile times
when something changes in SILModule.h or SILFunction.h.
2018-02-20 17:50:50 -08:00
David Ungar 488db9fb9b Fix ReferencedNameTracker in preparation for batch mode. 2018-02-16 22:28:10 -07:00
David Ungar fec411e9bc reformatted 2018-02-15 15:34:55 -07:00
David Ungar 1f9a4f3591 Pass around arguments for primary-specific filenames.
Get rid of IRGenOpts attributes that won’t work for batch mode and also remove fakeNamesStub.
2018-02-15 15:34:55 -07:00
Andrew Trick def6d24237 Add -verify-exclusivity option (off by default) 2018-02-15 11:26:54 -08:00
Xi Ge 37f352fe41 sourcekitd: build Swift syntax tree more lazily than collecting parsed tokens. (#14578)
Before this patch, we have one flag (KeepSyntaxInfo) to turn on two syntax
functionalities of parser: (1) collecting parsed tokens for coloring and
(2) building syntax trees. Since sourcekitd is the only consumer of either of these
functionalities, sourcekitd by default always enables such flag.
However, empirical results show (2) is both heavier and less-frequently
needed than (1). Therefore, separating the flag to two flags makes more
sense, where CollectParsedToken controls (1) and BuildSyntaxTree
controls (2).

CollectingParsedToken is always enabled by sourcekitd because
formatting and syntax-coloring need it; however BuildSyntaxTree should
be explicitly switched on by sourcekitd clients.

resolves: rdar://problem/37483076
2018-02-13 16:27:12 -08:00
Mark Lacey 37009b0d8b [ConstraintSystem] Remove constraint propagation.
The current implementation isn't really useful in the face of generic
overloads. It has never been enabled by default, and isn't useful to
keep around if it is disabled. If we ever want to bring it back,
we know where to look!
2018-02-12 21:30:39 -08:00
David Ungar ef02d0bfc0 Cleaner handling of cases where action produces no output or where there are no inputs. 2018-02-08 13:22:49 -08:00
David Ungar ba4f2a84b4 Move supplementary outputs to SupplementaryOutputs in FrontendInputsAndOutputs. 2018-02-07 13:55:32 -08:00
David Ungar 56b50cb28d Merge pull request #14349 from davidungar/PR-18-4b-refactor-performCompile
[Batch Mode] NFC: Carve up performCompile & performCompileStepsPostSILGen. (2)
2018-02-05 19:17:53 -08:00
David Ungar 4821e15795 Extract shouldActionOnlyParse. 2018-02-02 20:25:05 -08:00
David Ungar c396a3a972 Don’t free the ASTContext if > 1 primary input. 2018-02-02 13:49:08 -08:00
eeckstein 1218515153 Merge pull request #14338 from eeckstein/fix-nd
Fix two issues which prevents incremental llvm compilation
2018-02-01 19:26:47 -08:00
David Ungar 6b1d16b68b Move comment to declaration. 2018-02-01 15:20:20 -08:00
Erik Eckstein 17d4459227 debug-info: Don't write temporary file names in the debug info.
This would prevent incremental llvm compilation because we would generate different IR on every compiler invocation.
2018-02-01 12:15:36 -08:00
David Ungar 614006bc4f Move main outputs to FrontendInputsAndOutputs and InputFile 2018-02-01 11:55:08 -08:00
David Ungar e006825d88 Move convertBufferNameFromLLVM_getFileOrSTDIN_toSwiftConventions deeper in the call stack. 2018-01-30 18:55:02 -08:00
David Ungar 4bd12ac509 Change conjunction to assertion in isInputPrimary to check consistency. 2018-01-30 18:55:01 -08:00
David Ungar 00da3e81ca Reorder attributes in FrontendInputsAndOutputs 2018-01-30 18:55:01 -08:00
David Ungar a9819b6e60 Renaming FrontendInputs -> FrontendInputsAndOutputs
Fix comment in ArtsToFrontendOptionsConverter re getOutputFilenamesFromCommandLineOrFilelist
2018-01-30 18:54:38 -08:00
David Ungar ec2a9573cc Rename FrontendInputs::AllFiles to AllInputs, getAllFiles to getAllInputs, etc. 2018-01-23 14:01:15 -08:00
David Ungar a70ba0a6cd Split out ArgsToFrontenfOptionsConverter. 2018-01-19 09:51:30 -08:00
David Ungar 68bda74a00 Split out ArgsToFrontendInputsConverter. 2018-01-18 18:36:12 -08:00
David Ungar 361ff7244c Move FrontendInputs into separate .h and .cpp files. 2018-01-18 18:34:57 -08:00
David Ungar 1f8f9947fd Changed PrimarySourceFiles from a SetVector to an ArrayRef. 2018-01-17 12:20:52 -08:00
Graydon Hoare b0e5726af9 [BatchMode] Change CompilerInstance::Primary{BufferID,SourceFile} to SetVectors. 2018-01-16 16:17:25 -08:00
Slava Pestov 6af8d18a00 IRGen: Remove -enable-class-resilience staging flag 2018-01-03 00:26:10 -08:00