forked from OSchip/llvm-project
objective-c modern translator. Provide declaration of
"memset' lazily when is needed in translation of struct-valued methods which require checkinf of nil receivers outside their bodies. // rdar://11847319 llvm-svn: 160759
This commit is contained in:
parent
abd254e1b6
commit
1a11252f60
|
@ -3103,7 +3103,9 @@ Expr *RewriteModernObjC::SynthMsgSendStretCallExpr(FunctionDecl *MsgSendStretFla
|
|||
// build type for containing the objc_msgSend_stret object.
|
||||
static unsigned stretCount=0;
|
||||
std::string name = "__Stret"; name += utostr(stretCount);
|
||||
std::string str = "struct "; str += name;
|
||||
std::string str =
|
||||
"extern \"C\" void * __cdecl memset(void *_Dst, int _Val, size_t _Size);\n";
|
||||
str += "struct "; str += name;
|
||||
str += " {\n\t";
|
||||
str += name;
|
||||
str += "(id receiver, SEL sel";
|
||||
|
@ -5959,11 +5961,6 @@ void RewriteModernObjC::Initialize(ASTContext &context) {
|
|||
Preamble += "#define __block\n";
|
||||
Preamble += "#define __weak\n";
|
||||
}
|
||||
Preamble += "\n#if defined(_MSC_VER)\n";
|
||||
Preamble += "#include <string.h>\n";
|
||||
Preamble += "#else\n";
|
||||
Preamble += "extern \"C\" void * memset(void *b, int c, unsigned long len);\n";
|
||||
Preamble += "#endif\n";
|
||||
|
||||
// Declarations required for modern objective-c array and dictionary literals.
|
||||
Preamble += "\n#include <stdarg.h>\n";
|
||||
|
|
Loading…
Reference in New Issue