summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:37:18 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:37:18 +0000
commit58fe86dc0ecb7efff01abe2b0024a6a53ebb2c81 (patch)
tree9a16bdfe41de8b658563c67b2d511003ee346b3a /lib
parent61187dd0ad3d8574f655074e3e7948193d90bb1e (diff)
downloadllvm-58fe86dc0ecb7efff01abe2b0024a6a53ebb2c81.tar.gz
llvm-58fe86dc0ecb7efff01abe2b0024a6a53ebb2c81.tar.bz2
llvm-58fe86dc0ecb7efff01abe2b0024a6a53ebb2c81.tar.xz
Support: Move c_str from SmallVector back to SmallString and add a free standing
templated c_str in Windows.h to replace it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/Windows/PathV2.inc2
-rw-r--r--lib/Support/Windows/Windows.h13
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/Support/Windows/PathV2.inc b/lib/Support/Windows/PathV2.inc
index 6a1ea93914..6b425c41d5 100644
--- a/lib/Support/Windows/PathV2.inc
+++ b/lib/Support/Windows/PathV2.inc
@@ -623,7 +623,7 @@ error_code directory_iterator_construct(directory_iterator& it,
// Get the first directory entry.
WIN32_FIND_DATAW FirstFind;
- ScopedFindHandle FindHandle(::FindFirstFileW(path_utf16.c_str(), &FirstFind));
+ ScopedFindHandle FindHandle(::FindFirstFileW(c_str(path_utf16), &FirstFind));
if (!FindHandle)
return windows_error(::GetLastError());
diff --git a/lib/Support/Windows/Windows.h b/lib/Support/Windows/Windows.h
index 12ddc92e7c..6e0b585b97 100644
--- a/lib/Support/Windows/Windows.h
+++ b/lib/Support/Windows/Windows.h
@@ -102,3 +102,16 @@ public:
typedef ScopedHandle<HANDLE, uintptr_t(-1),
BOOL (WINAPI*)(HANDLE), ::FindClose>
ScopedFindHandle;
+
+namespace llvm {
+template <class T>
+class SmallVectorImpl;
+
+template <class T>
+typename SmallVectorImpl<T>::const_pointer
+c_str(SmallVectorImpl<T> &str) {
+ str.push_back(0);
+ str.pop_back();
+ return str.data();
+}
+} // end namespace llvm.