remove the last uses of Config/alloca.h
authorChris Lattner <sabre@nondot.org>
Sun, 23 Aug 2009 22:57:38 +0000 (22:57 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 23 Aug 2009 22:57:38 +0000 (22:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79873 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveVariables.cpp
lib/System/Unix/Path.inc
lib/Target/ARM/ARMJITInfo.cpp
lib/Target/Alpha/AlphaJITInfo.cpp
lib/Target/X86/X86JITInfo.cpp

index 626a76e1144a85732eb4c5a2b600a96193954b50..2da1be9ab6e5eedb8c0fe7595c197a75f40c26ce 100644 (file)
@@ -37,7 +37,6 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/Config/alloca.h"
 #include <algorithm>
 using namespace llvm;
 
index 7139f4eb9bbf0dadbad17965516d84f84cc4077f..d7aa7115cad7d15462cc5c000d1a64cbf8bba32d 100644 (file)
@@ -16,7 +16,7 @@
 //===          is guaranteed to work on *all* UNIX variants.
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Config/alloca.h"
+#include "llvm/ADT/SmallVector.h"
 #include "Unix.h"
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
@@ -400,7 +400,9 @@ Path::getSuffix() const {
 
 bool Path::getMagicNumber(std::string& Magic, unsigned len) const {
   assert(len < 1024 && "Request for magic string too long");
-  char* buf = (char*) alloca(1 + len);
+  SmallVector<char, 128> Buf;
+  Buf.resize(1 + len);
+  char* buf = Buf.data();
   int fd = ::open(path.c_str(), O_RDONLY);
   if (fd < 0)
     return false;
@@ -829,7 +831,9 @@ Path::makeUnique(bool reuse_current, std::string* ErrMsg) {
 
   // Append an XXXXXX pattern to the end of the file for use with mkstemp,
   // mktemp or our own implementation.
-  char *FNBuffer = (char*) alloca(path.size()+8);
+  SmallVector<char, 128> Buf;
+  Buf.resize(path.size()+8);
+  char *FNBuffer = Buf.data();
     path.copy(FNBuffer,path.size());
   if (isDirectory())
     strcpy(FNBuffer+path.size(), "/XXXXXX");
index 56dce5f4cdb21cd280722bcb1b7a227cd3bf40e3..0456f33ea263898821f00162d3c1999e1580321a 100644 (file)
@@ -19,7 +19,6 @@
 #include "ARMSubtarget.h"
 #include "llvm/Function.h"
 #include "llvm/CodeGen/JITCodeEmitter.h"
-#include "llvm/Config/alloca.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
index 33174a75d7c25714b221eb8294defaed97b16cff..d32813552f012fd6f13b5c8ba3a331ced2112172 100644 (file)
@@ -16,7 +16,6 @@
 #include "AlphaRelocations.h"
 #include "llvm/Function.h"
 #include "llvm/CodeGen/JITCodeEmitter.h"
-#include "llvm/Config/alloca.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
index dea34a5123ffd8001cff103b72a82db016d18fdf..5c3d101495a9f6a35e239560c0c728d771783152 100644 (file)
@@ -16,7 +16,6 @@
 #include "X86Relocations.h"
 #include "X86Subtarget.h"
 #include "llvm/Function.h"
-#include "llvm/Config/alloca.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cstdlib>