| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |