diff options
author | John McCall <rjmccall@apple.com> | 2011-07-11 08:38:19 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-07-11 08:38:19 +0000 |
commit | 178360e1cd7ea8606f1b9673485f7d76dc3c458b (patch) | |
tree | 6fd0ba90236f1ae07be7b7e36a21549bef59675d /clang/lib/CodeGen/CodeGenFunction.h | |
parent | 61715740cd4f6fb0dc645b26028392f104fd59c9 (diff) | |
download | bcm5719-llvm-178360e1cd7ea8606f1b9673485f7d76dc3c458b.tar.gz bcm5719-llvm-178360e1cd7ea8606f1b9673485f7d76dc3c458b.zip |
Fix a lot of problems with the partial destruction of arrays:
- an off-by-one error in emission of irregular array limits for
InitListExprs
- use an EH partial-destruction cleanup within the normal
array-destruction cleanup
- get the branch destinations right for the empty check
Also some refactoring which unfortunately obscures these changes.
llvm-svn: 134890
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 7f2d8b9ed0c..968222e334a 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -1156,17 +1156,23 @@ public: typedef void Destroyer(CodeGenFunction &CGF, llvm::Value *addr, QualType ty); - void pushPartialArrayCleanup(llvm::Value *arrayBegin, - QualType elementType, - Destroyer &destroyer, - llvm::Value *arrayEndPointer); + void pushIrregularPartialArrayCleanup(llvm::Value *arrayBegin, + llvm::Value *arrayEndPointer, + QualType elementType, + Destroyer &destroyer); + void pushRegularPartialArrayCleanup(llvm::Value *arrayBegin, + llvm::Value *arrayEnd, + QualType elementType, + Destroyer &destroyer); Destroyer &getDestroyer(QualType::DestructionKind destructionKind); void pushDestroy(CleanupKind kind, llvm::Value *addr, QualType type, - Destroyer &destroyer); - void emitDestroy(llvm::Value *addr, QualType type, Destroyer &destroyer); + Destroyer &destroyer, bool useEHCleanupForArray); + void emitDestroy(llvm::Value *addr, QualType type, Destroyer &destroyer, + bool useEHCleanupForArray); void emitArrayDestroy(llvm::Value *begin, llvm::Value *end, - QualType type, Destroyer &destroyer); + QualType type, Destroyer &destroyer, + bool useEHCleanup); /// Determines whether an EH cleanup is required to destroy a type /// with the given destruction kind. |