diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-13 17:10:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-13 17:10:38 +0000 |
commit | f9aba2c2b470fc0926eccc8fe6ae8c7a921908ff (patch) | |
tree | 750cb57068ca089fdf00a9d27e13ce7ca006faee | |
parent | 7a5af782707bd385c59794f107d769eb4eac6fd5 (diff) | |
download | bcm5719-llvm-f9aba2c2b470fc0926eccc8fe6ae8c7a921908ff.tar.gz bcm5719-llvm-f9aba2c2b470fc0926eccc8fe6ae8c7a921908ff.zip |
remove use of alloca.
llvm-svn: 39815
-rw-r--r-- | clang/Lex/Preprocessor.cpp | 5 |
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); } |