Commit Graph

13 Commits

Author SHA1 Message Date
Xi Ge
ae9d873009 Frontend: add an option -bad-file-descriptor-retry-count
This option allows the compiler to retry opening an input file if the previous
opening returns an error of bad file descriptor. Swift-driver will set this
argument in certain circumstances to walk-around such error.

rdar://73157185
2021-01-15 10:28:27 -08:00
Brent Royal-Gordon
a5955fc682 [NFC] Extract helper from moveFileIfDifferent()
This separates the “do these two files have the same contents?” logic from the “move or delete” logic in `moveFileIfDifferent()`, creating a useful helper function. It also ties the special-case behavior for the `destination` parameter to a flag, since we have a use where we won’t want that.
2019-08-22 19:37:53 -07:00
Saleem Abdulrasool
adcdc39791 swift: update for LLVM SVN r344140
Update swift's usage of clang::vfs which has been hoisted into LLVM.
2019-02-07 17:53:42 -08:00
Michael Gottesman
7e70389b80 [upstream-update] Do not specify OpenFlags since it was removed upstream.
This was removed upstream in https://reviews.llvm.org/D47789 since the only
place this flag was used was in the windows implementation where the behavior
triggered by this could be hidden in the implementation instead of being an
argument. As such, this code doesn't compile on master-next.

Since this has an acceptable default argument given the current stable, we can
just fix this on master and everything will work.

rdar://42862352
2018-08-02 11:34:54 -07:00
Jordan Rose
1dd415ae68 Add a new helper, atomicallyWritingToFile, and use it
This replaces the use of a Clang utility function that was
inexplicably a non-static member function of CompilerInstance. It
would be nice to sink this all the way to LLVM and share the
implementation across both projects, but the Clang implementation does
a handful of things we don't need, and it's hard to justify including
them in an LLVM-level interface. (I stared at
llvm/Support/FileSystem.h for a long time before giving up.)

Anyway, Serialization and FrontendTool both get their atomic writes
now without depending on Clang, and without duplicating the
scaffolding around the Clang API. We should probably adopt this for
all our output files.

No functionality change.
2018-08-01 16:41:21 -07:00
Robert Widmann
0e58b7fd14 Plumbing for a Virtual File System
Adds the -vfsoverlay frontend option that enables the user to pass
VFS overlay YAML files to Swift. These files define a (potentially
many-layered) virtual mapping on which we predicate a VFS.

Switch all input-based memory buffer reads in the Frontend to the new
FileSystem-based approach.
2018-07-31 13:16:14 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01: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
Dan Raviv
29d76f3b68 Canonize swift header files headers and footers
- Added missing ifdef guard in PointerIntEnum header
- Consistent naming convention for ifdef guards
- Consistent 'end namespace swift'
- Consistent single EOL at end of header files
2016-03-23 09:04:12 +02:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
practicalswift
cd7d8dfaff Fix alignment as requested by @gribozavr in #692 2015-12-21 08:54:24 +01:00
practicalswift
176f487d76 Fix incorrect filenames in headers. 2015-12-20 23:59:05 +01:00
Jordan Rose
60c3154d95 Add swift::moveFileIfDifferent.
Equivalent to llvm::sys::fs::rename, except that if the destination file
exists and has the same contents as the source file, the source file is
simply deleted and the destination file is not touched.

Used in next commit.

Swift SVN r28041
2015-05-01 17:40:28 +00:00