[llvm-commits] [llvm] r120601 - in /llvm/trunk/lib/Support: Unix/PathV2.inc Windows/PathV2.inc

Michael J. Spencer bigcheesegs at gmail.com
Wed Dec 1 12:37:43 PST 2010


Author: mspencer
Date: Wed Dec  1 14:37:42 2010
New Revision: 120601

URL: http://llvm.org/viewvc/llvm-project?rev=120601&view=rev
Log:
Support/FileSystem: Fix copy_file implementation to use toNullTerminatedStringRef
instead of toStringRef. The file system APIs need c strings.

Modified:
    llvm/trunk/lib/Support/Unix/PathV2.inc
    llvm/trunk/lib/Support/Windows/PathV2.inc

Modified: llvm/trunk/lib/Support/Unix/PathV2.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/PathV2.inc?rev=120601&r1=120600&r2=120601&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/PathV2.inc (original)
+++ llvm/trunk/lib/Support/Unix/PathV2.inc Wed Dec  1 14:37:42 2010
@@ -71,8 +71,8 @@
  // Get arguments.
   SmallString<128> from_storage;
   SmallString<128> to_storage;
-  StringRef f = from.toStringRef(from_storage);
-  StringRef t = to.toStringRef(to_storage);
+  StringRef f = from.toNullTerminatedStringRef(from_storage);
+  StringRef t = to.toNullTerminatedStringRef(to_storage);
 
   const size_t buf_sz = 32768;
   char buffer[buf_sz];

Modified: llvm/trunk/lib/Support/Windows/PathV2.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/PathV2.inc?rev=120601&r1=120600&r2=120601&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/PathV2.inc (original)
+++ llvm/trunk/lib/Support/Windows/PathV2.inc Wed Dec  1 14:37:42 2010
@@ -104,8 +104,8 @@
   // Get arguments.
   SmallString<128> from_storage;
   SmallString<128> to_storage;
-  StringRef f = from.toStringRef(from_storage);
-  StringRef t = to.toStringRef(to_storage);
+  StringRef f = from.toNullTerminatedStringRef(from_storage);
+  StringRef t = to.toNullTerminatedStringRef(to_storage);
 
   // Convert to utf-16.
   SmallVector<wchar_t, 128> wide_from;





More information about the llvm-commits mailing list