aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CBackend/CBackend.cpp
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2007-03-28 23:08:37 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2007-03-28 23:08:37 +0000
commitab47895c6bfe3a4b95c849fe1894af6a187d92e0 (patch)
tree1262244c7e581d154bd48405ef62a91d46b64e87 /lib/Target/CBackend/CBackend.cpp
parent3c8dfcd53dc7e4b9f82e9e099d27d9d3ee70e6e3 (diff)
Fix C Backend to generate code that works with Microsoft C for the benefit of
front ends that do not depend on the GCC runtime (someday...). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35441 91177308-0d34-0410-b5e6-96231b3b80d8
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";