Commit Graph

1144 Commits

Author SHA1 Message Date
Slava Pestov
175b40919f AST: Fewer headers include Expr.h, Module.h, Stmt.h 2018-04-26 22:55:26 -07:00
swift-ci
80defe51b7 Merge pull request #15950 from gottesmm/pr-ad010a566f73a3f80c1bce1ac1d652208c260c8b 2018-04-16 10:51:52 -07:00
Michael Gottesman
26a569b33c [stringref-upgrade] Change FrontendInputsAndOutputs::numberOfPrimaryInputsEndingWith to take a StringRef instead of a const char *.
This is in prepration for changing Strings.h to use StringLiteral.
2018-04-16 09:50:54 -07:00
Michael Gottesman
87d633b4cd [stringref-upgrade] Return a StringRef from suffixForPrincipalOutputFileForAction instead of a const char *.
This is in prepration for changing Strings.h to use StringLiteral.
2018-04-16 09:50:26 -07:00
Vedant Kumar
ca27e829ba Add a transform to help test lldb expression evaluation
The initial version of the debugger testing transform instruments
assignments in a way that allows the debugger to sanity-check its
expression evaluator.

Given an assignment expression of the form:

```
  a = b
```

The transform rewrites the relevant bits of the AST to look like this:

```
  { () -> () in
    a = b
    checkExpect("a", stringForPrintObject(a))
  }()
```

The purpose of the rewrite is to make it easier to exercise the
debugger's expression evaluator in new contexts. This can be automated
by having the debugger set a breakpoint on checkExpect, running `expr
$Varname`, and comparing the result to the expected value generated by
the runtime.

While the initial version of this testing transform only supports
instrumenting assignments, it should be simple to teach it to do more
interesting rewrites.

There's a driver script available in SWIFT_BIN_DIR/lldb-check-expect to
simplfiy the process of launching and testing instrumented programs.

rdar://36032055
2018-03-30 16:50:31 -07:00
Sho Ikeda
869b6bf7d8 Merge pull request #15473 from ikesyo/frontend-using-over-typedef
[gardening][Frontend] Replace `typedef` with `using`
2018-03-26 08:57:42 +09:00
Jordan Rose
02a2af60b3 [Frontend] Move the argument converter header files into lib/ (#15417)
...since they don't need to be accessed from other libraries. No
intended functionality change.
2018-03-25 16:01:23 -07:00
Sho Ikeda
f737add594 [gardening][Frontend] Replace typedef with using 2018-03-24 10:15:48 +09:00
David Ungar
3376ca741d Add frontend check to ensure that all primaries are present in the supplementary output filemap. 2018-03-22 14:57:27 -07:00
David Ungar
807dd5864e Renamed swift::types to swift::file_types. 2018-03-22 08:40:06 -07:00
David Ungar
e3535ff3d8 Merge pull request #15371 from davidungar/PR-18-11-fileMap-redo
[Batch mode] Write out filemaps for supplementary outputs.
2018-03-21 17:05:36 -07:00
David Ungar
90773d298c Write out filemaps for supplementary outputs.
Add -driver-force-one-batch-repartition and enhance  batch_mode-overlong_argv test.
2018-03-20 09:42:13 -07:00
Pavel Yaskevich
fd3610b8c0 Revert "[Batch mode] Write supplementary output file map. rdar://problem/38157859" 2018-03-17 21:01:46 -07:00
David Ungar
a0cd1c57bc Merge pull request #15013 from davidungar/PR-18-11-fileMap
[Batch mode] Write supplementary output file map. rdar://problem/38157859
2018-03-16 17:38:53 -07:00
David Ungar
3570af7476 Fixes 2018-03-12 15:40:08 -07:00
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
David Ungar
ba1a714dbe Formatting 2018-03-10 16:10:38 -08:00
David Ungar
f7b4ee00f9 OFM fixes 2018-03-09 19:57:06 -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
David Ungar
798dd7b490 Write out filemaps for supplementary outputs. 2018-03-09 13:54:44 -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
Jordan Rose
de74836673 Wire up FileSpecificDiagnosticConsumer for serialized diagnostics
It appears to work!
2018-03-02 13:23:16 -08:00
David Ungar
4866df6dfd Move SupplementaryOutputs into each InputFile. 2018-02-28 09:41:49 -08:00
Graydon Hoare
628c446fe3 [Stats] Add -profile-stats-{events,entities} 2018-02-21 16:22:48 -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
dec78900cd Only use supplementary outputs for first parallel-generated input. 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
David Ungar
1e32ff31b7 Move SupplementaryOutputPaths to Basic. 2018-02-15 15:32:26 -07: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
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
David Ungar
6b1d16b68b Move comment to declaration. 2018-02-01 15:20:20 -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
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
4ac390d24d Move InputFile into a dedicated header. 2018-01-18 14:57:27 -08:00
David Ungar
df02341f16 Remove useless const for getPrimarySourceFiles. 2018-01-17 14:23:32 -08:00
David Ungar
cbd1d481fb Fixed two more \p's. 2018-01-17 13:29:30 -08:00
David Ungar
9528866762 Use \p for parameters in Doxygen comments. 2018-01-17 12:21:00 -08:00
David Ungar
1f8f9947fd Changed PrimarySourceFiles from a SetVector to an ArrayRef. 2018-01-17 12:20:52 -08:00
Graydon Hoare
2494b148f1 [BatchMode] Sink a bunch of FrontendTool uses of getPrimarySourceFile() 2018-01-17 11:57:13 -08:00
Graydon Hoare
b0e5726af9 [BatchMode] Change CompilerInstance::Primary{BufferID,SourceFile} to SetVectors. 2018-01-16 16:17:25 -08:00