Use mkdir instead of stat+mkdir.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 13 Feb 2014 16:58:19 +0000 (16:58 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 13 Feb 2014 16:58:19 +0000 (16:58 +0000)
commitb6f72b240f3263675b7066b7278abe8fe0abc413
tree85ed41a2ef514a8afc42c66898f046709ee1f0ee
parentfbe5672746bed3920afc6265f5b8a0bce0f5e70b
Use mkdir instead of stat+mkdir.

This is an optimistic version of create_diretories: it tries to create the
directory first and looks at the parent only if that fails.

Running strace on "mkdir -p" shows that it is pessimistic, calling mkdir on
every element of the path. We could implement that if needed.

In any case, with both strategies there is no reason to call stat, just check
the return of mkdir.

llvm-svn: 201347
llvm/lib/Support/Path.cpp