[cfe-commits] r160759 - /cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
Fariborz Jahanian
fjahanian at apple.com
Wed Jul 25 14:48:37 PDT 2012
Author: fjahanian
Date: Wed Jul 25 16:48:36 2012
New Revision: 160759
URL: http://llvm.org/viewvc/llvm-project?rev=160759&view=rev
Log:
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
Modified:
cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
Modified: cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp?rev=160759&r1=160758&r2=160759&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp Wed Jul 25 16:48:36 2012
@@ -3103,7 +3103,9 @@
// 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 @@
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";
More information about the cfe-commits
mailing list