HomePhabricator

[Support] Add docs for 'openFileFor{Write,Read}'

Authored by modocache on May 10 2018, 6:47 PM.

Description

[Support] Add docs for 'openFileFor{Write,Read}'

Summary:
Add documentation for the LLVM Support functions openFileForWrite and
openFileForRead. The openFileForRead parameter RealPath, in
particular, I think warranted some explanation.

In addition, make the behavior of the functions more consistent across
platforms. Prior to this patch, Windows would set or not set the result
file descriptor based on the nature of the error, whereas Unix would
consistently set it to -1 if the open failed. Make Windows
consistently set it to -1 as well.

Test Plan:

  1. ninja check-llvm
  2. ninja docs-llvm-html

Reviewers: zturner, rnk, danielmartin, scanon

Reviewed By: danielmartin, scanon

Subscribers: scanon, danielmartin, llvm-commits

Differential Revision: https://reviews.llvm.org/D46499

llvm-svn: 332075

Details