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)
commite08aac49ea25f904699bb6411c4063a619e64c0d
treed4ec5a62307670317d9ecdad0f707363c5fcb104
parent5645e5fd141f8693d1d6372cdce0dee94732ba95
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201347 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Path.cpp