ARM64: add intrinsic for pmull (p64 x p64 = p128) operations.
[oota-llvm.git] / include / llvm / IR / DebugInfo.h
index a8fb24565e650a40b8d49f661de909dc21b50378..69beaada9c31e69a449dbf746a518eac80713747 100644 (file)
@@ -18,6 +18,7 @@
 #define LLVM_IR_DEBUGINFO_H
 
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/iterator_range.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
@@ -611,7 +612,6 @@ class DIGlobalVariable : public DIDescriptor {
 public:
   explicit DIGlobalVariable(const MDNode *N = 0) : DIDescriptor(N) {}
 
-  // FIXME: use DIScopeRef for LTO type uniqueing.
   DIScope getContext() const { return getFieldAs<DIScope>(2); }
   StringRef getName() const { return getStringField(3); }
   StringRef getDisplayName() const { return getStringField(4); }
@@ -645,7 +645,6 @@ class DIVariable : public DIDescriptor {
 public:
   explicit DIVariable(const MDNode *N = 0) : DIDescriptor(N) {}
 
-  // FIXME: use DIScopeRef for LTO type uniqueing.
   DIScope getContext() const { return getFieldAs<DIScope>(1); }
   StringRef getName() const { return getStringField(2); }
   DIFile getFile() const { return getFieldAs<DIFile>(3); }
@@ -766,6 +765,8 @@ public:
     return (getUnsignedField(6) & dwarf::DW_APPLE_PROPERTY_nonatomic) != 0;
   }
 
+  /// Objective-C doesn't have an ODR, so there is no benefit in storing
+  /// the type as a DITypeRef here.
   DIType getType() const { return getFieldAs<DIType>(7); }
 
   /// Verify - Verify that a derived type descriptor is well formed.
@@ -780,7 +781,7 @@ class DIImportedEntity : public DIDescriptor {
 public:
   explicit DIImportedEntity(const MDNode *N) : DIDescriptor(N) {}
   DIScope getContext() const { return getFieldAs<DIScope>(1); }
-  DIDescriptor getEntity() const { return getFieldAs<DIDescriptor>(2); }
+  DIScopeRef getEntity() const { return getFieldAs<DIScopeRef>(2); }
   unsigned getLineNumber() const { return getUnsignedField(3); }
   StringRef getName() const { return getStringField(4); }
   bool Verify() const;
@@ -853,9 +854,6 @@ private:
   /// processType - Process DIType.
   void processType(DIType DT);
 
-  /// processLexicalBlock - Process DILexicalBlock.
-  void processLexicalBlock(DILexicalBlock LB);
-
   /// processSubprogram - Process DISubprogram.
   void processSubprogram(DISubprogram SP);
 
@@ -876,17 +874,31 @@ private:
   bool addScope(DIScope Scope);
 
 public:
-  typedef SmallVectorImpl<MDNode *>::const_iterator iterator;
-  iterator compile_unit_begin() const { return CUs.begin(); }
-  iterator compile_unit_end() const { return CUs.end(); }
-  iterator subprogram_begin() const { return SPs.begin(); }
-  iterator subprogram_end() const { return SPs.end(); }
-  iterator global_variable_begin() const { return GVs.begin(); }
-  iterator global_variable_end() const { return GVs.end(); }
-  iterator type_begin() const { return TYs.begin(); }
-  iterator type_end() const { return TYs.end(); }
-  iterator scope_begin() const { return Scopes.begin(); }
-  iterator scope_end() const { return Scopes.end(); }
+  typedef SmallVectorImpl<DICompileUnit>::const_iterator compile_unit_iterator;
+  typedef SmallVectorImpl<DISubprogram>::const_iterator subprogram_iterator;
+  typedef SmallVectorImpl<DIGlobalVariable>::const_iterator global_variable_iterator;
+  typedef SmallVectorImpl<DIType>::const_iterator type_iterator;
+  typedef SmallVectorImpl<DIScope>::const_iterator scope_iterator;
+
+  iterator_range<compile_unit_iterator> compile_units() const {
+    return iterator_range<compile_unit_iterator>(CUs.begin(), CUs.end());
+  }
+
+  iterator_range<subprogram_iterator> subprograms() const {
+    return iterator_range<subprogram_iterator>(SPs.begin(), SPs.end());
+  }
+
+  iterator_range<global_variable_iterator> global_variables() const {
+    return iterator_range<global_variable_iterator>(GVs.begin(), GVs.end());
+  }
+
+  iterator_range<type_iterator> types() const {
+    return iterator_range<type_iterator>(TYs.begin(), TYs.end());
+  }
+
+  iterator_range<scope_iterator> scopes() const {
+    return iterator_range<scope_iterator>(Scopes.begin(), Scopes.end());
+  }
 
   unsigned compile_unit_count() const { return CUs.size(); }
   unsigned global_variable_count() const { return GVs.size(); }
@@ -895,11 +907,11 @@ public:
   unsigned scope_count() const { return Scopes.size(); }
 
 private:
-  SmallVector<MDNode *, 8> CUs;    // Compile Units
-  SmallVector<MDNode *, 8> SPs;    // Subprograms
-  SmallVector<MDNode *, 8> GVs;    // Global Variables;
-  SmallVector<MDNode *, 8> TYs;    // Types
-  SmallVector<MDNode *, 8> Scopes; // Scopes
+  SmallVector<DICompileUnit, 8> CUs;    // Compile Units
+  SmallVector<DISubprogram, 8> SPs;    // Subprograms
+  SmallVector<DIGlobalVariable, 8> GVs;    // Global Variables;
+  SmallVector<DIType, 8> TYs;    // Types
+  SmallVector<DIScope, 8> Scopes; // Scopes
   SmallPtrSet<MDNode *, 64> NodesSeen;
   DITypeIdentifierMap TypeIdentifierMap;
   /// Specify if TypeIdentifierMap is initialized.