]> granicus.if.org Git - clang/commitdiff
Fix a fixme by allocating ShuffleVectorExprs in the Context
authorNate Begeman <natebegeman@mac.com>
Wed, 12 Aug 2009 02:10:25 +0000 (02:10 +0000)
committerNate Begeman <natebegeman@mac.com>
Wed, 12 Aug 2009 02:10:25 +0000 (02:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78780 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Expr.h
lib/Sema/SemaChecking.cpp

index 3def5721ab207d66a4362453ee97164e2c85bfb4..745ba26f70fee0009c0c1b2f78f6bb39a2caba80 100644 (file)
@@ -1727,13 +1727,13 @@ class ShuffleVectorExpr : public Expr {
   unsigned NumExprs;
 
 public:
-  ShuffleVectorExpr(Expr **args, unsigned nexpr,
+  ShuffleVectorExpr(ASTContext &C, Expr **args, unsigned nexpr,
                     QualType Type, SourceLocation BLoc, 
                     SourceLocation RP) : 
     Expr(ShuffleVectorExprClass, Type), BuiltinLoc(BLoc),
     RParenLoc(RP), NumExprs(nexpr) {
-      // FIXME: Allocate in ASTContext!
-    SubExprs = new Stmt*[nexpr];
+      
+    SubExprs = new (C) Stmt*[nexpr];
     for (unsigned i = 0; i < nexpr; i++)
       SubExprs[i] = args[i];
   }
index b35287aa31eb78a4d88e81b8f8235674984df2b3..ffe4abd73115b727587b6ffa865c2224776413b4 100644 (file)
@@ -626,8 +626,8 @@ Action::OwningExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) {
     TheCall->setArg(i, 0);
   }
 
-  return Owned(new (Context) ShuffleVectorExpr(exprs.begin(), exprs.size(),
-                                               exprs[0]->getType(),
+  return Owned(new (Context) ShuffleVectorExpr(Context, exprs.begin(),
+                                            exprs.size(), exprs[0]->getType(),
                                             TheCall->getCallee()->getLocStart(),
                                             TheCall->getRParenLoc()));
 }