~ubuntu-branches/ubuntu/natty/clamav/natty-proposed

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/DerivedTypes.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-02 21:04:10 UTC
  • mfrom: (0.35.17 sid)
  • Revision ID: james.westby@ubuntu.com-20101202210410-ppgyckmylngsfa8o
Tags: 0.96.5+dfsg-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop initial signature definitions from clamav-base
  - Drop build-dep on electric-fence (in Universe)
  - Add apparmor profiles for clamd and freshclam along with maintainer
    script changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
class FunctionValType;
28
28
class ArrayValType;
29
29
class StructValType;
30
 
class UnionValType;
31
30
class PointerValType;
32
31
class VectorValType;
33
32
class IntegerValType;
52
51
  ///
53
52
  void dropAllTypeUses();
54
53
 
55
 
  /// unlockedRefineAbstractTypeTo - Internal version of refineAbstractTypeTo
56
 
  /// that performs no locking.  Only used for internal recursion.
57
 
  void unlockedRefineAbstractTypeTo(const Type *NewType);
58
 
  
59
54
public:
60
55
 
61
56
  //===--------------------------------------------------------------------===//
230
225
    return T->getTypeID() == ArrayTyID ||
231
226
           T->getTypeID() == StructTyID ||
232
227
           T->getTypeID() == PointerTyID ||
233
 
           T->getTypeID() == VectorTyID ||
234
 
           T->getTypeID() == UnionTyID;
 
228
           T->getTypeID() == VectorTyID;
235
229
  }
236
230
};
237
231
 
302
296
  bool isPacked() const { return (0 != getSubclassData()) ? true : false; }
303
297
};
304
298
 
305
 
 
306
 
/// UnionType - Class to represent union types. A union type is similar to
307
 
/// a structure, except that all member fields begin at offset 0.
308
 
///
309
 
class UnionType : public CompositeType {
310
 
  friend class TypeMap<UnionValType, UnionType>;
311
 
  UnionType(const UnionType &);                   // Do not implement
312
 
  const UnionType &operator=(const UnionType &);  // Do not implement
313
 
  UnionType(LLVMContext &C, const Type* const* Types, unsigned NumTypes);
314
 
public:
315
 
  /// UnionType::get - This static method is the primary way to create a
316
 
  /// UnionType.
317
 
  static UnionType *get(const Type* const* Types, unsigned NumTypes);
318
 
 
319
 
  /// UnionType::get - This static method is a convenience method for
320
 
  /// creating union types by specifying the elements as arguments.
321
 
  static UnionType *get(const Type *type, ...) END_WITH_NULL;
322
 
 
323
 
  /// isValidElementType - Return true if the specified type is valid as a
324
 
  /// element type.
325
 
  static bool isValidElementType(const Type *ElemTy);
326
 
  
327
 
  /// Given an element type, return the member index of that type, or -1
328
 
  /// if there is no such member type.
329
 
  int getElementTypeIndex(const Type *ElemTy) const;
330
 
 
331
 
  // Iterator access to the elements
332
 
  typedef Type::subtype_iterator element_iterator;
333
 
  element_iterator element_begin() const { return ContainedTys; }
334
 
  element_iterator element_end() const { return &ContainedTys[NumContainedTys];}
335
 
 
336
 
  // Random access to the elements
337
 
  unsigned getNumElements() const { return NumContainedTys; }
338
 
  const Type *getElementType(unsigned N) const {
339
 
    assert(N < NumContainedTys && "Element number out of range!");
340
 
    return ContainedTys[N];
341
 
  }
342
 
 
343
 
  /// getTypeAtIndex - Given an index value into the type, return the type of
344
 
  /// the element.  For a union type, this must be a constant value...
345
 
  ///
346
 
  virtual const Type *getTypeAtIndex(const Value *V) const;
347
 
  virtual const Type *getTypeAtIndex(unsigned Idx) const;
348
 
  virtual bool indexValid(const Value *V) const;
349
 
  virtual bool indexValid(unsigned Idx) const;
350
 
 
351
 
  // Implement the AbstractTypeUser interface.
352
 
  virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
353
 
  virtual void typeBecameConcrete(const DerivedType *AbsTy);
354
 
 
355
 
  // Methods for support type inquiry through isa, cast, and dyn_cast:
356
 
  static inline bool classof(const UnionType *) { return true; }
357
 
  static inline bool classof(const Type *T) {
358
 
    return T->getTypeID() == UnionTyID;
359
 
  }
360
 
};
361
 
 
362
 
 
363
299
/// SequentialType - This is the superclass of the array, pointer and vector
364
300
/// type classes.  All of these represent "arrays" in memory.  The array type
365
301
/// represents a specifically sized array, pointer types are unsized/unknown