aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CBackend/CBackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/CBackend/CBackend.cpp')
-rw-r--r--lib/Target/CBackend/CBackend.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index eeefaa27e9..05efa7da06 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -1293,7 +1293,10 @@ static void generateCompilerSpecificCode(std::ostream& Out) {
<< "#define alloca(x) __builtin_alloca(x)\n"
<< "#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n"
<< "#define alloca(x) __builtin_alloca(x)\n"
- << "#elif !defined(_MSC_VER)\n"
+ << "#elif defined(_MSC_VER)\n"
+ << "#define inline\n"
+ << "#define alloca(x) _alloca(x)\n"
+ << "#else\n"
<< "#include <alloca.h>\n"
<< "#endif\n\n";