diff options
| author | John McCall <rjmccall@apple.com> | 2016-03-11 04:30:43 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2016-03-11 04:30:43 +0000 |
| commit | f26e73df7568e0d3cb3976c86e646e98d3db6789 (patch) | |
| tree | 10d7163ad47e6bdaa567014552e58ef3ea32a1c7 /clang/lib/CodeGen/CGBuilder.h | |
| parent | c56a8b32840eec263276cd4eddf84a09d1d42e3f (diff) | |
| download | bcm5719-llvm-f26e73df7568e0d3cb3976c86e646e98d3db6789.tar.gz bcm5719-llvm-f26e73df7568e0d3cb3976c86e646e98d3db6789.zip | |
Add a coerce-and-expand ABIArgInfo as a generalization of some
of the things we do with Expand / Direct.
NFC for now, but this will be used by swiftcall expansion.
llvm-svn: 263192
Diffstat (limited to 'clang/lib/CodeGen/CGBuilder.h')
| -rw-r--r-- | clang/lib/CodeGen/CGBuilder.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuilder.h b/clang/lib/CodeGen/CGBuilder.h index 489f3413d4b..baba30d5bf6 100644 --- a/clang/lib/CodeGen/CGBuilder.h +++ b/clang/lib/CodeGen/CGBuilder.h @@ -10,6 +10,7 @@ #ifndef LLVM_CLANG_LIB_CODEGEN_CGBUILDER_H #define LLVM_CLANG_LIB_CODEGEN_CGBUILDER_H +#include "llvm/IR/DataLayout.h" #include "llvm/IR/IRBuilder.h" #include "Address.h" #include "CodeGenTypeCache.h" @@ -194,6 +195,12 @@ public: Addr.getPointer(), Index, Name), Addr.getAlignment().alignmentAtOffset(Offset)); } + Address CreateStructGEP(Address Addr, unsigned Index, + const llvm::StructLayout *Layout, + const llvm::Twine &Name = "") { + auto Offset = CharUnits::fromQuantity(Layout->getElementOffset(Index)); + return CreateStructGEP(Addr, Index, Offset, Name); + } /// Given /// %addr = [n x T]* ... |

