diff options
author | Chris Lattner <sabre@nondot.org> | 2011-01-23 21:15:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-01-23 21:15:29 +0000 |
commit | 9879965f4bea123d3ddfa1461d5540dc622454d3 (patch) | |
tree | 8b5f63b400c1984d96f5488fae827ff29f9a5ce5 /llvm/lib/VMCore/Value.cpp | |
parent | 1e7a9ee7d0f1ca59f624ce87fedcff93d98f8f80 (diff) | |
download | bcm5719-llvm-9879965f4bea123d3ddfa1461d5540dc622454d3.tar.gz bcm5719-llvm-9879965f4bea123d3ddfa1461d5540dc622454d3.zip |
teach Value::isDereferenceablePointer that byval arguments are always
dereferencable, noticed by inspection.
llvm-svn: 124085
Diffstat (limited to 'llvm/lib/VMCore/Value.cpp')
-rw-r--r-- | llvm/lib/VMCore/Value.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp index 38438265dd6..29f6a8094f0 100644 --- a/llvm/lib/VMCore/Value.cpp +++ b/llvm/lib/VMCore/Value.cpp @@ -363,6 +363,10 @@ bool Value::isDereferenceablePointer() const { 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. |