summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
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
commit751e9aafa9d51c161378ae0a3a5e3502589145b9 (patch)
treeeafcc0bd9b9b725c843c89c2e17840ab922b9130 /llvm/lib/Support
parent730f51ad96f0fd8babb9db3f2145b8698ca9bd73 (diff)
downloadbcm5719-llvm-751e9aafa9d51c161378ae0a3a5e3502589145b9.tar.gz
bcm5719-llvm-751e9aafa9d51c161378ae0a3a5e3502589145b9.zip
Support: Move c_str from SmallVector back to SmallString and add a free standing
templated c_str in Windows.h to replace it. llvm-svn: 121381
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Windows/PathV2.inc2
-rw-r--r--llvm/lib/Support/Windows/Windows.h13
2 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/Support/Windows/PathV2.inc b/llvm/lib/Support/Windows/PathV2.inc
index 6a1ea939141..6b425c41d5e 100644
--- a/llvm/lib/Support/Windows/PathV2.inc
+++ b/llvm/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/llvm/lib/Support/Windows/Windows.h b/llvm/lib/Support/Windows/Windows.h
index 12ddc92e7ca..6e0b585b975 100644
--- a/llvm/lib/Support/Windows/Windows.h
+++ b/llvm/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.
OpenPOWER on IntegriCloud