summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-26 12:59:39 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-26 12:59:39 +0000
commitdf649f3da55f6efebfec2114c6392961d506f9f8 (patch)
tree10c5db5495e8e6e7534c8c0b49fb6911ea2c3499 /clang/lib/CodeGen/CodeGenModule.h
parentd3f21d165f89eae9021d1f3026455754233ce6db (diff)
downloadbcm5719-llvm-df649f3da55f6efebfec2114c6392961d506f9f8.tar.gz
bcm5719-llvm-df649f3da55f6efebfec2114c6392961d506f9f8.zip
Emit memmove, not memcpy, for structure copies; this is unfortunately
required for correctness in cases of copying a struct to itself or to an overlapping struct (itself for cases like *a = *a, and overlapping is possible with unions). Hopefully, this won't end up being a perf issue; LLVM *should* be able to optimize memmove to memcpy in a lot of cases, and for small copies the generated code *should* be mostly comparable. (In reality, LLVM is currently horrible at optimizing memmove, but that's a bug, not a fundamental issue.) gcc currently generates wrong code; that's http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667. llvm-svn: 51566
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index bc216e4f485..992a3bf3c22 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -59,6 +59,7 @@ class CodeGenModule {
CGDebugInfo *DebugInfo;
llvm::Function *MemCpyFn;
+ llvm::Function *MemMoveFn;
llvm::Function *MemSetFn;
llvm::DenseMap<const Decl*, llvm::Constant*> GlobalDeclMap;
std::vector<const NamedDecl*> StaticDecls;
@@ -101,6 +102,7 @@ public:
/// array containing the literal. The result is pointer to array type.
llvm::Constant *GetAddrOfConstantString(const std::string& str);
llvm::Function *getMemCpyFn();
+ llvm::Function *getMemMoveFn();
llvm::Function *getMemSetFn();
llvm::Function *getIntrinsic(unsigned IID, const llvm::Type **Tys = 0,
unsigned NumTys = 0);
OpenPOWER on IntegriCloud