summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-07-13 17:10:38 +0000
committerChris Lattner <sabre@nondot.org>2007-07-13 17:10:38 +0000
commitf9aba2c2b470fc0926eccc8fe6ae8c7a921908ff (patch)
tree750cb57068ca089fdf00a9d27e13ce7ca006faee
parent7a5af782707bd385c59794f107d769eb4eac6fd5 (diff)
downloadbcm5719-llvm-f9aba2c2b470fc0926eccc8fe6ae8c7a921908ff.tar.gz
bcm5719-llvm-f9aba2c2b470fc0926eccc8fe6ae8c7a921908ff.zip
remove use of alloca.
llvm-svn: 39815
-rw-r--r--clang/Lex/Preprocessor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/Lex/Preprocessor.cpp b/clang/Lex/Preprocessor.cpp
index 9c2683315ff..d18a2f98135 100644
--- a/clang/Lex/Preprocessor.cpp
+++ b/clang/Lex/Preprocessor.cpp
@@ -37,7 +37,6 @@
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/SmallVector.h"
#include <iostream>
-#include <alloca.h>
using namespace clang;
//===----------------------------------------------------------------------===//
@@ -908,7 +907,9 @@ IdentifierInfo *Preprocessor::LookUpIdentifierInfo(LexerToken &Identifier,
II = getIdentifierInfo(BufPtr, BufPtr+Identifier.getLength());
} else {
// Cleaning needed, alloca a buffer, clean into it, then use the buffer.
- const char *TmpBuf = (char*)alloca(Identifier.getLength());
+ llvm::SmallVector<char, 64> IdentifierBuffer;
+ IdentifierBuffer.resize(Identifier.getLength());
+ const char *TmpBuf = &IdentifierBuffer[0];
unsigned Size = getSpelling(Identifier, TmpBuf);
II = getIdentifierInfo(TmpBuf, TmpBuf+Size);
}
OpenPOWER on IntegriCloud