From 46561ce249984ddea405ce837b53367a59fd9f3b Mon Sep 17 00:00:00 2001
From: David Blaikie <dblaikie@gmail.com>
Date: Tue, 12 Mar 2013 22:43:04 +0000
Subject: Remove unused "isMain" field from DICompileUnit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176910 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/IR/DIBuilder.cpp |  2 --
 lib/IR/DebugInfo.cpp | 18 +++++++++---------
 2 files changed, 9 insertions(+), 11 deletions(-)

(limited to 'lib/IR')

diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
index 5ee36ab..9369c2a 100644
--- a/lib/IR/DIBuilder.cpp
+++ b/lib/IR/DIBuilder.cpp
@@ -98,8 +98,6 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
     MDString::get(VMContext, Filename),
     MDString::get(VMContext, Directory),
     MDString::get(VMContext, Producer),
-    // isMain field can be removed when we remove the legacy debug info.
-    ConstantInt::get(Type::getInt1Ty(VMContext), true), // isMain
     ConstantInt::get(Type::getInt1Ty(VMContext), isOptimized),
     MDString::get(VMContext, Flags),
     ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeVer),
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp
index 134045e..1d83c8c 100644
--- a/lib/IR/DebugInfo.cpp
+++ b/lib/IR/DebugInfo.cpp
@@ -407,7 +407,7 @@ bool DICompileUnit::Verify() const {
   if (N.empty())
     return false;
   // It is possible that directory and produce string is empty.
-  return DbgNode->getNumOperands() == 15;
+  return DbgNode->getNumOperands() == 14;
 }
 
 /// Verify - Verify that an ObjC property is well formed.
@@ -687,38 +687,38 @@ StringRef DIScope::getDirectory() const {
 }
 
 DIArray DICompileUnit::getEnumTypes() const {
-  if (!DbgNode || DbgNode->getNumOperands() < 15)
+  if (!DbgNode || DbgNode->getNumOperands() < 14)
     return DIArray();
 
-  if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(10)))
+  if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(9)))
     return DIArray(N);
   return DIArray();
 }
 
 DIArray DICompileUnit::getRetainedTypes() const {
-  if (!DbgNode || DbgNode->getNumOperands() < 15)
+  if (!DbgNode || DbgNode->getNumOperands() < 14)
     return DIArray();
 
-  if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(11)))
+  if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(10)))
     return DIArray(N);
   return DIArray();
 }
 
 DIArray DICompileUnit::getSubprograms() const {
-  if (!DbgNode || DbgNode->getNumOperands() < 15)
+  if (!DbgNode || DbgNode->getNumOperands() < 14)
     return DIArray();
 
-  if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(12)))
+  if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(11)))
     return DIArray(N);
   return DIArray();
 }
 
 
 DIArray DICompileUnit::getGlobalVariables() const {
-  if (!DbgNode || DbgNode->getNumOperands() < 15)
+  if (!DbgNode || DbgNode->getNumOperands() < 14)
     return DIArray();
 
-  if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(13)))
+  if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(12)))
     return DIArray(N);
   return DIArray();
 }
-- 
cgit v1.1