Skip to content

Instantly share code, notes, and snippets.

@amatus
Created July 14, 2013 02:19
Show Gist options
  • Save amatus/5992946 to your computer and use it in GitHub Desktop.
Save amatus/5992946 to your computer and use it in GitHub Desktop.
Patch for llvm-ar to create sub-directories correctly.
--- llvm-3.2.src.orig/tools/llvm-ar/llvm-ar.cpp 2012-10-26 05:49:15.000000000 -0500
+++ llvm-3.2.src/tools/llvm-ar/llvm-ar.cpp 2013-07-13 21:17:35.047302973 -0500
@@ -461,11 +461,12 @@
(std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) {
// Make sure the intervening directories are created
- if (I->hasPath()) {
- sys::Path dirs(I->getPath());
- dirs.eraseComponent();
- if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg))
+ sys::Path dirs(I->getPath());
+ dirs.eraseComponent();
+ if (dirs.isValid()) {
+ if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg)) {
return true;
+ }
}
// Open up a file stream for writing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment