[llvm-commits] [llvm] r124085 - /llvm/trunk/lib/VMCore/Value.cpp

Chris Lattner sabre at nondot.org
Sun Jan 23 13:15:29 PST 2011


Author: lattner
Date: Sun Jan 23 15:15:29 2011
New Revision: 124085

URL: http://llvm.org/viewvc/llvm-project?rev=124085&view=rev
Log:
teach Value::isDereferenceablePointer that byval arguments are always
dereferencable, noticed by inspection.

Modified:
    llvm/trunk/lib/VMCore/Value.cpp

Modified: llvm/trunk/lib/VMCore/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Value.cpp?rev=124085&r1=124084&r2=124085&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Value.cpp (original)
+++ llvm/trunk/lib/VMCore/Value.cpp Sun Jan 23 15:15:29 2011
@@ -363,6 +363,10 @@
   if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(this))
     return !GV->hasExternalWeakLinkage();
 
+  // byval arguments are ok.
+  if (const Argument *A = dyn_cast<Argument>(this))
+    return A->hasByValAttr();
+  
   // For GEPs, determine if the indexing lands within the allocated object.
   if (const GEPOperator *GEP = dyn_cast<GEPOperator>(this)) {
     // Conservatively require that the base pointer be fully dereferenceable.





More information about the llvm-commits mailing list