Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: lib/Transforms/NaCl/ReplacePtrsWithInts.cpp

Issue 1042643002: PNaCl: Strip `nonnull` attributes from pointer arguments. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/Transforms/NaCl/replace-ptrs-with-ints.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- ReplacePtrsWithInts.cpp - Convert pointer values to integer values--===// 1 //===- ReplacePtrsWithInts.cpp - Convert pointer values to integer values--===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This pass strips out aggregate pointer types and replaces them with 10 // This pass strips out aggregate pointer types and replaces them with
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 report_fatal_error("ReplacePtrsWithInts cannot handle " 324 report_fatal_error("ReplacePtrsWithInts cannot handle "
325 "byval, sret or nest attrs"); 325 "byval, sret or nest attrs");
326 break; 326 break;
327 // Strip these attributes because they apply only to pointers. This pass 327 // Strip these attributes because they apply only to pointers. This pass
328 // rewrites pointer arguments, thus these parameter attributes are 328 // rewrites pointer arguments, thus these parameter attributes are
329 // meaningless. Also, they are rejected by the PNaCl module verifier. 329 // meaningless. Also, they are rejected by the PNaCl module verifier.
330 case Attribute::NoCapture: 330 case Attribute::NoCapture:
331 case Attribute::NoAlias: 331 case Attribute::NoAlias:
332 case Attribute::ReadNone: 332 case Attribute::ReadNone:
333 case Attribute::ReadOnly: 333 case Attribute::ReadOnly:
334 case Attribute::NonNull:
334 break; 335 break;
335 default: 336 default:
336 AB.addAttribute(*Attr); 337 AB.addAttribute(*Attr);
337 } 338 }
338 } 339 }
339 AttrList.push_back(AttributeSet::get(Context, Index, AB)); 340 AttrList.push_back(AttributeSet::get(Context, Index, AB));
340 } 341 }
341 return AttributeSet::get(Context, AttrList); 342 return AttributeSet::get(Context, AttrList);
342 } 343 }
343 344
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 // Delete the now-unused bitcast ConstantExprs that we created so 619 // Delete the now-unused bitcast ConstantExprs that we created so
619 // that they don't interfere with StripDeadPrototypes. 620 // that they don't interfere with StripDeadPrototypes.
620 Func->removeDeadConstantUsers(); 621 Func->removeDeadConstantUsers();
621 } 622 }
622 return true; 623 return true;
623 } 624 }
624 625
625 ModulePass *llvm::createReplacePtrsWithIntsPass() { 626 ModulePass *llvm::createReplacePtrsWithIntsPass() {
626 return new ReplacePtrsWithInts(); 627 return new ReplacePtrsWithInts();
627 } 628 }
OLDNEW
« no previous file with comments | « no previous file | test/Transforms/NaCl/replace-ptrs-with-ints.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698