Fix a minor bug in the map - since this pass adds a global symbol, it must be
authorBrian Gaeke <gaeke@uiuc.edu>
Tue, 8 Jun 2004 20:08:30 +0000 (20:08 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Tue, 8 Jun 2004 20:08:30 +0000 (20:08 +0000)
accounted for in the map (at least, in its current format).

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

lib/Target/SparcV9/InternalGlobalMapper.cpp

index 8df87fd0006c7fe5db4a3ca87197ecd8fe4e14f2..7d4a40a13bea4d6bdbc38e12972506ce459981ca 100644 (file)
@@ -54,6 +54,10 @@ bool InternalGlobalMapper::run (Module &M) {
   // Populate the vector with internal global values and their names.
   for (Module::giterator i = M.gbegin (), e = M.gend (); i != e; ++i)
     maybeAddInternalValueToVector (gvvector, *i);
+  // Add an extra global for _llvm_internalGlobals itself (null,
+  // because it's not internal)
+  gvvector.push_back (ConstantPointerNull::get
+    (PointerType::get (Type::SByteTy)));
   for (Module::iterator i = M.begin (), e = M.end (); i != e; ++i)
     maybeAddInternalValueToVector (gvvector, *i);