r219590 - Fixed a problem in r19589.

Tyler Nowicki tyler.nowicki at gmail.com
Sun Oct 12 14:28:02 PDT 2014


Author: tnowicki
Date: Sun Oct 12 16:28:02 2014
New Revision: 219590

URL: http://llvm.org/viewvc/llvm-project?rev=219590&view=rev
Log:
Fixed a problem in r19589.

Several systems failed to compile the array allocation of the TokenArray.

Modified:
    cfe/trunk/lib/Parse/ParsePragma.cpp

Modified: cfe/trunk/lib/Parse/ParsePragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParsePragma.cpp?rev=219590&r1=219589&r2=219590&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParsePragma.cpp (original)
+++ cfe/trunk/lib/Parse/ParsePragma.cpp Sun Oct 12 16:28:02 2014
@@ -1877,8 +1877,8 @@ static bool ParseLoopHintValue(Preproces
   EOFTok.setLocation(Tok.getLocation());
   ValueList.push_back(EOFTok); // Terminates expression for parsing.
 
-  Token *TokenArray =
-      new (PP.getPreprocessorAllocator()) Token[ValueList.size()];
+  Token *TokenArray = (Token *)PP.getPreprocessorAllocator().Allocate(
+      ValueList.size() * sizeof(Token), llvm::alignOf<Token>());
   std::copy(ValueList.begin(), ValueList.end(), TokenArray);
   Info.Toks = TokenArray;
   Info.TokSize = ValueList.size();





More information about the cfe-commits mailing list