[polly] r225342 - Use explicit StringRef Type

Tobias Grosser tobias at grosser.es
Tue Jan 6 23:43:35 PST 2015


Author: grosser
Date: Wed Jan  7 01:43:34 2015
New Revision: 225342

URL: http://llvm.org/viewvc/llvm-project?rev=225342&view=rev
Log:
Use explicit StringRef Type

We previously used a Twine here, but as pointed out by David Blaikie
and Mehdi Amini storing a temporary StringRef in a Twine is not a good
idea, as the StringRef will be freed before the Twine is used leaving
a Twine that points to uninitialized memory. We now make it explicit that
we use a StringRef here.

Modified:
    polly/trunk/lib/CodeGen/IslExprBuilder.cpp

Modified: polly/trunk/lib/CodeGen/IslExprBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslExprBuilder.cpp?rev=225342&r1=225341&r2=225342&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslExprBuilder.cpp (original)
+++ polly/trunk/lib/CodeGen/IslExprBuilder.cpp Wed Jan  7 01:43:34 2015
@@ -112,7 +112,7 @@ Value *IslExprBuilder::createAccessAddre
   const ScopArrayInfo *SAI = ScopArrayInfo::getFromId(BaseId);
   Base = SAI->getBasePtr();
   assert(Base->getType()->isPointerTy() && "Access base should be a pointer");
-  auto BaseName = Base->getName();
+  StringRef BaseName = Base->getName();
 
   if (Base->getType() != SAI->getType())
     Base = Builder.CreateBitCast(Base, SAI->getType(),





More information about the llvm-commits mailing list