- Update comments.
authorBill Wendling <isanbard@gmail.com>
Tue, 1 Jul 2008 22:08:01 +0000 (22:08 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 1 Jul 2008 22:08:01 +0000 (22:08 +0000)
- Don't use GlobalVariable::LinkageTypes when unsigned works.

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

include/llvm/CodeGen/MachineDebugInfoDesc.h
lib/CodeGen/MachineDebugInfoDesc.cpp
lib/CodeGen/MachineModuleInfo.cpp

index a79a12170dd6b413538cef2f2b8816678171722b..50f093d21fa7f97d7140288692eabe6967657de4 100644 (file)
@@ -7,15 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 //
 //
 //===----------------------------------------------------------------------===//
 //
-//
-//
+// Debug descriptor information for a module.
+// 
 //===----------------------------------------------------------------------===//
 
 #ifndef LLVM_CODEGEN_MACHINEDEBUGINFODESC_H
 #define LLVM_CODEGEN_MACHINEDEBUGINFODESC_H
 
 //===----------------------------------------------------------------------===//
 
 #ifndef LLVM_CODEGEN_MACHINEDEBUGINFODESC_H
 #define LLVM_CODEGEN_MACHINEDEBUGINFODESC_H
 
-#include "llvm/GlobalValue.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/DataTypes.h"
+#include <string>
 #include <vector>
 
 namespace llvm {
 #include <vector>
 
 namespace llvm {
@@ -67,7 +67,7 @@ public:
   
   /// getLinkage - get linkage appropriate for this type of descriptor.
   ///
   
   /// getLinkage - get linkage appropriate for this type of descriptor.
   ///
-  virtual GlobalValue::LinkageTypes getLinkage() const;
+  virtual unsigned getLinkage() const;
     
   //===--------------------------------------------------------------------===//
   // Subclasses should supply the following virtual methods.
     
   //===--------------------------------------------------------------------===//
   // Subclasses should supply the following virtual methods.
@@ -111,7 +111,7 @@ public:
 
   /// getLinkage - get linkage appropriate for this type of descriptor.
   ///
 
   /// getLinkage - get linkage appropriate for this type of descriptor.
   ///
-  virtual GlobalValue::LinkageTypes getLinkage() const;
+  virtual unsigned getLinkage() const;
 
   /// ApplyToFields - Target the visitor to the fields of the AnchorDesc.
   ///
 
   /// ApplyToFields - Target the visitor to the fields of the AnchorDesc.
   ///
index e293609579e5b9be5282e8716a134e028eb7fcc1..3477dd6a89bad32e8c4db259a8f8a1456ff2e2a2 100644 (file)
@@ -92,8 +92,8 @@ DebugInfoDesc *DebugInfoDesc::DescFactory(unsigned Tag) {
 }
 
 /// getLinkage - get linkage appropriate for this type of descriptor.
 }
 
 /// getLinkage - get linkage appropriate for this type of descriptor.
-GlobalValue::LinkageTypes DebugInfoDesc::getLinkage() const {
-  return GlobalValue::InternalLinkage;
+unsigned DebugInfoDesc::getLinkage() const {
+  return (unsigned)GlobalValue::InternalLinkage;
 }
 
 /// ApplyToFields - Target the vistor to the fields of the descriptor.
 }
 
 /// ApplyToFields - Target the vistor to the fields of the descriptor.
@@ -104,11 +104,10 @@ void DebugInfoDesc::ApplyToFields(DIVisitor *Visitor) {
 //===----------------------------------------------------------------------===//
 
 AnchorDesc::AnchorDesc()
 //===----------------------------------------------------------------------===//
 
 AnchorDesc::AnchorDesc()
-  : DebugInfoDesc(DW_TAG_anchor), AnchorTag(0){
-}
+  : DebugInfoDesc(DW_TAG_anchor), AnchorTag(0) {}
+
 AnchorDesc::AnchorDesc(AnchoredDesc *D)
 AnchorDesc::AnchorDesc(AnchoredDesc *D)
-  : DebugInfoDesc(DW_TAG_anchor), AnchorTag(D->getTag()) {
-}
+  : DebugInfoDesc(DW_TAG_anchor), AnchorTag(D->getTag()) {}
 
 // Implement isa/cast/dyncast.
 bool AnchorDesc::classof(const DebugInfoDesc *D) {
 
 // Implement isa/cast/dyncast.
 bool AnchorDesc::classof(const DebugInfoDesc *D) {
@@ -116,8 +115,8 @@ bool AnchorDesc::classof(const DebugInfoDesc *D) {
 }
   
 /// getLinkage - get linkage appropriate for this type of descriptor.
 }
   
 /// getLinkage - get linkage appropriate for this type of descriptor.
-GlobalValue::LinkageTypes AnchorDesc::getLinkage() const {
-  return GlobalValue::LinkOnceLinkage;
+unsigned AnchorDesc::getLinkage() const {
+  return (unsigned)GlobalValue::LinkOnceLinkage;
 }
 
 /// ApplyToFields - Target the visitor to the fields of the TransUnitDesc.
 }
 
 /// ApplyToFields - Target the visitor to the fields of the TransUnitDesc.
@@ -167,8 +166,7 @@ void AnchorDesc::dump() {
 //===----------------------------------------------------------------------===//
 
 AnchoredDesc::AnchoredDesc(unsigned T)
 //===----------------------------------------------------------------------===//
 
 AnchoredDesc::AnchoredDesc(unsigned T)
-  : DebugInfoDesc(T), Anchor(NULL) {
-}
+  : DebugInfoDesc(T), Anchor(NULL) {}
 
 /// ApplyToFields - Target the visitor to the fields of the AnchoredDesc.
 void AnchoredDesc::ApplyToFields(DIVisitor *Visitor) {
 
 /// ApplyToFields - Target the visitor to the fields of the AnchoredDesc.
 void AnchoredDesc::ApplyToFields(DIVisitor *Visitor) {
@@ -180,8 +178,7 @@ void AnchoredDesc::ApplyToFields(DIVisitor *Visitor) {
 
 CompileUnitDesc::CompileUnitDesc()
   : AnchoredDesc(DW_TAG_compile_unit), Language(0), FileName(""),
 
 CompileUnitDesc::CompileUnitDesc()
   : AnchoredDesc(DW_TAG_compile_unit), Language(0), FileName(""),
-    Directory(""), Producer("") {
-}
+    Directory(""), Producer("") {}
 
 // Implement isa/cast/dyncast.
 bool CompileUnitDesc::classof(const DebugInfoDesc *D) {
 
 // Implement isa/cast/dyncast.
 bool CompileUnitDesc::classof(const DebugInfoDesc *D) {
@@ -222,8 +219,7 @@ void CompileUnitDesc::dump() {
 
 TypeDesc::TypeDesc(unsigned T)
   : DebugInfoDesc(T), Context(NULL), Name(""), File(NULL), Line(0), Size(0),
 
 TypeDesc::TypeDesc(unsigned T)
   : DebugInfoDesc(T), Context(NULL), Name(""), File(NULL), Line(0), Size(0),
-    Align(0), Offset(0), Flags(0) {
-}
+    Align(0), Offset(0), Flags(0) {}
 
 /// ApplyToFields - Target the visitor to the fields of the TypeDesc.
 ///
 
 /// ApplyToFields - Target the visitor to the fields of the TypeDesc.
 ///
@@ -258,8 +254,7 @@ void TypeDesc::dump() {
 //===----------------------------------------------------------------------===//
 
 BasicTypeDesc::BasicTypeDesc()
 //===----------------------------------------------------------------------===//
 
 BasicTypeDesc::BasicTypeDesc()
-  : TypeDesc(DW_TAG_base_type), Encoding(0) {
-}
+  : TypeDesc(DW_TAG_base_type), Encoding(0) {}
 
 // Implement isa/cast/dyncast.
 bool BasicTypeDesc::classof(const DebugInfoDesc *D) {
 
 // Implement isa/cast/dyncast.
 bool BasicTypeDesc::classof(const DebugInfoDesc *D) {
@@ -287,8 +282,7 @@ void BasicTypeDesc::dump() {
 //===----------------------------------------------------------------------===//
 
 DerivedTypeDesc::DerivedTypeDesc(unsigned T)
 //===----------------------------------------------------------------------===//
 
 DerivedTypeDesc::DerivedTypeDesc(unsigned T)
-  : TypeDesc(T), FromType(NULL) {
-}
+  : TypeDesc(T), FromType(NULL) {}
 
 // Implement isa/cast/dyncast.
 bool DerivedTypeDesc::classof(const DebugInfoDesc *D) {
 
 // Implement isa/cast/dyncast.
 bool DerivedTypeDesc::classof(const DebugInfoDesc *D) {
@@ -331,8 +325,7 @@ void DerivedTypeDesc::dump() {
 //===----------------------------------------------------------------------===//
 
 CompositeTypeDesc::CompositeTypeDesc(unsigned T)
 //===----------------------------------------------------------------------===//
 
 CompositeTypeDesc::CompositeTypeDesc(unsigned T)
-  : DerivedTypeDesc(T), Elements() {
-}
+  : DerivedTypeDesc(T), Elements() {}
   
 // Implement isa/cast/dyncast.
 bool CompositeTypeDesc::classof(const DebugInfoDesc *D) {
   
 // Implement isa/cast/dyncast.
 bool CompositeTypeDesc::classof(const DebugInfoDesc *D) {
@@ -375,8 +368,7 @@ void CompositeTypeDesc::dump() {
 //===----------------------------------------------------------------------===//
 
 SubrangeDesc::SubrangeDesc()
 //===----------------------------------------------------------------------===//
 
 SubrangeDesc::SubrangeDesc()
-  : DebugInfoDesc(DW_TAG_subrange_type), Lo(0), Hi(0) {
-}
+  : DebugInfoDesc(DW_TAG_subrange_type), Lo(0), Hi(0) {}
 
 // Implement isa/cast/dyncast.
 bool SubrangeDesc::classof(const DebugInfoDesc *D) {
 
 // Implement isa/cast/dyncast.
 bool SubrangeDesc::classof(const DebugInfoDesc *D) {
@@ -403,8 +395,7 @@ void SubrangeDesc::dump() {
 //===----------------------------------------------------------------------===//
 
 EnumeratorDesc::EnumeratorDesc()
 //===----------------------------------------------------------------------===//
 
 EnumeratorDesc::EnumeratorDesc()
-  : DebugInfoDesc(DW_TAG_enumerator), Name(""), Value(0) {
-}
+  : DebugInfoDesc(DW_TAG_enumerator), Name(""), Value(0) {}
 
 // Implement isa/cast/dyncast.
 bool EnumeratorDesc::classof(const DebugInfoDesc *D) {
 
 // Implement isa/cast/dyncast.
 bool EnumeratorDesc::classof(const DebugInfoDesc *D) {
@@ -431,8 +422,8 @@ void EnumeratorDesc::dump() {
 //===----------------------------------------------------------------------===//
 
 VariableDesc::VariableDesc(unsigned T)
 //===----------------------------------------------------------------------===//
 
 VariableDesc::VariableDesc(unsigned T)
-  : DebugInfoDesc(T), Context(NULL), Name(""), File(NULL), Line(0), TyDesc(0) {
-}
+  : DebugInfoDesc(T), Context(NULL), Name(""), File(NULL), Line(0), TyDesc(0)
+{}
 
 // Implement isa/cast/dyncast.
 bool VariableDesc::classof(const DebugInfoDesc *D) {
 
 // Implement isa/cast/dyncast.
 bool VariableDesc::classof(const DebugInfoDesc *D) {
@@ -474,8 +465,7 @@ void VariableDesc::dump() {
 
 GlobalDesc::GlobalDesc(unsigned T)
   : AnchoredDesc(T), Context(0), Name(""), FullName(""), LinkageName(""),
 
 GlobalDesc::GlobalDesc(unsigned T)
   : AnchoredDesc(T), Context(0), Name(""), FullName(""), LinkageName(""),
-    File(NULL), Line(0), TyDesc(NULL), IsStatic(false), IsDefinition(false) {
-}
+    File(NULL), Line(0), TyDesc(NULL), IsStatic(false), IsDefinition(false) {}
 
 /// ApplyToFields - Target the visitor to the fields of the global.
 ///
 
 /// ApplyToFields - Target the visitor to the fields of the global.
 ///
@@ -495,8 +485,7 @@ void GlobalDesc::ApplyToFields(DIVisitor *Visitor) {
 //===----------------------------------------------------------------------===//
 
 GlobalVariableDesc::GlobalVariableDesc()
 //===----------------------------------------------------------------------===//
 
 GlobalVariableDesc::GlobalVariableDesc()
-  : GlobalDesc(DW_TAG_variable), Global(NULL) {
-}
+  : GlobalDesc(DW_TAG_variable), Global(NULL) {}
 
 // Implement isa/cast/dyncast.
 bool GlobalVariableDesc::classof(const DebugInfoDesc *D) {
 
 // Implement isa/cast/dyncast.
 bool GlobalVariableDesc::classof(const DebugInfoDesc *D) {
@@ -530,8 +519,7 @@ void GlobalVariableDesc::dump() {
 //===----------------------------------------------------------------------===//
 
 SubprogramDesc::SubprogramDesc()
 //===----------------------------------------------------------------------===//
 
 SubprogramDesc::SubprogramDesc()
-  : GlobalDesc(DW_TAG_subprogram) {
-}
+  : GlobalDesc(DW_TAG_subprogram) {}
 
 // Implement isa/cast/dyncast.
 bool SubprogramDesc::classof(const DebugInfoDesc *D) {
 
 // Implement isa/cast/dyncast.
 bool SubprogramDesc::classof(const DebugInfoDesc *D) {
@@ -563,8 +551,7 @@ void SubprogramDesc::dump() {
 //===----------------------------------------------------------------------===//
 
 BlockDesc::BlockDesc()
 //===----------------------------------------------------------------------===//
 
 BlockDesc::BlockDesc()
-  : DebugInfoDesc(DW_TAG_lexical_block), Context(NULL) {
-}
+  : DebugInfoDesc(DW_TAG_lexical_block), Context(NULL) {}
 
 // Implement isa/cast/dyncast.
 bool BlockDesc::classof(const DebugInfoDesc *D) {
 
 // Implement isa/cast/dyncast.
 bool BlockDesc::classof(const DebugInfoDesc *D) {
index 52737a604545d84a077177930ccf0b2bb33a5742..44e4ee36ecd8417820daded98fe43692b8febf44 100644 (file)
@@ -586,8 +586,10 @@ GlobalVariable *DISerializer::Serialize(DebugInfoDesc *DD) {
   const StructType *Ty = getTagType(DD);
 
   // Create the GlobalVariable early to prevent infinite recursion.
   const StructType *Ty = getTagType(DD);
 
   // Create the GlobalVariable early to prevent infinite recursion.
-  GlobalVariable *GV = new GlobalVariable(Ty, true, DD->getLinkage(),
-                                          NULL, DD->getDescString(), M);
+  GlobalVariable *GV =
+    new GlobalVariable(Ty, true,
+                       (GlobalValue::LinkageTypes)DD->getLinkage(),
+                       NULL, DD->getDescString(), M);
   GV->setSection("llvm.metadata");
 
   // Insert new GlobalVariable in DescGlobals map.
   GV->setSection("llvm.metadata");
 
   // Insert new GlobalVariable in DescGlobals map.