Fix these assertions:
authorChris Lattner <sabre@nondot.org>
Sun, 23 Nov 2003 18:06:37 +0000 (18:06 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 23 Nov 2003 18:06:37 +0000 (18:06 +0000)
stkrc -e -f -o testing.bc testing.st
Global is external, but doesn't have external linkage!
[1024 x int]* %_stack_
Global is external, but doesn't have external linkage!
long* %_index_
Broken module found, compilation aborted!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10185 91177308-0d34-0410-b5e6-96231b3b80d8

projects/Stacker/lib/Makefile [new file with mode: 0644]
projects/Stacker/lib/compiler/StackerCompiler.cpp

diff --git a/projects/Stacker/lib/Makefile b/projects/Stacker/lib/Makefile
new file mode 100644 (file)
index 0000000..6973e5b
--- /dev/null
@@ -0,0 +1,20 @@
+##===- projects/sample/Makefile ----------------------------*- Makefile -*-===##
+#
+# This is a sample Makefile for a project that uses LLVM.
+#
+##===----------------------------------------------------------------------===##
+
+#
+# Indicates our relative path to the top of the project's root directory.
+#
+LEVEL = ../../..
+
+#
+# Directories that needs to be built.
+#
+DIRS = compiler runtime
+
+#
+# Include the Master Makefile that knows how to build all.
+#
+include $(LEVEL)/Makefile.common
index 6ebcae9b36584133cd20844ffbc95e139e1a55a2..4cd06461030800c5aa12036c96aa8b9cd3a57216 100644 (file)
@@ -132,7 +132,7 @@ StackerCompiler::compile(
            /*type=*/ stack_type, 
            /*isConstant=*/ false, 
            /*Linkage=*/ GlobalValue::AppendingLinkage, 
-           /*initializer=*/0
+           /*initializer=*/Constant::getNullValue(stack_type)
            /*name=*/ "_stack_",
            /*parent=*/ TheModule 
        );
@@ -144,7 +144,7 @@ StackerCompiler::compile(
            /*type=*/Type::LongTy, 
            /*isConstant=*/false,
            /*Linkage=*/GlobalValue::LinkOnceLinkage, 
-           /*initializer=*/0
+           /*initializer=*/Constant::getNullValue(Type::LongTy)
            /*name=*/"_index_",
            /*parent=*/TheModule
        );