~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/Analysis/MemoryBuiltins.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===- llvm/Analysis/MemoryBuiltins.h- Calls to memory builtins -*- C++ -*-===//
 
2
//
 
3
//                     The LLVM Compiler Infrastructure
 
4
//
 
5
// This file is distributed under the University of Illinois Open Source
 
6
// License. See LICENSE.TXT for details.
 
7
//
 
8
//===----------------------------------------------------------------------===//
 
9
//
 
10
// This family of functions identifies calls to builtin functions that allocate
 
11
// or free memory.  
 
12
//
 
13
//===----------------------------------------------------------------------===//
 
14
 
 
15
#ifndef LLVM_ANALYSIS_MEMORYBUILTINS_H
 
16
#define LLVM_ANALYSIS_MEMORYBUILTINS_H
 
17
 
 
18
namespace llvm {
 
19
class CallInst;
 
20
class PointerType;
 
21
class TargetData;
 
22
class Type;
 
23
class Value;
 
24
 
 
25
//===----------------------------------------------------------------------===//
 
26
//  malloc Call Utility Functions.
 
27
//
 
28
 
 
29
/// isMalloc - Returns true if the value is either a malloc call or a bitcast of 
 
30
/// the result of a malloc call
 
31
bool isMalloc(const Value *I);
 
32
 
 
33
/// extractMallocCall - Returns the corresponding CallInst if the instruction
 
34
/// is a malloc call.  Since CallInst::CreateMalloc() only creates calls, we
 
35
/// ignore InvokeInst here.
 
36
const CallInst *extractMallocCall(const Value *I);
 
37
CallInst *extractMallocCall(Value *I);
 
38
 
 
39
/// extractMallocCallFromBitCast - Returns the corresponding CallInst if the
 
40
/// instruction is a bitcast of the result of a malloc call.
 
41
const CallInst *extractMallocCallFromBitCast(const Value *I);
 
42
CallInst *extractMallocCallFromBitCast(Value *I);
 
43
 
 
44
/// isArrayMalloc - Returns the corresponding CallInst if the instruction 
 
45
/// is a call to malloc whose array size can be determined and the array size
 
46
/// is not constant 1.  Otherwise, return NULL.
 
47
const CallInst *isArrayMalloc(const Value *I, const TargetData *TD);
 
48
 
 
49
/// getMallocType - Returns the PointerType resulting from the malloc call.
 
50
/// The PointerType depends on the number of bitcast uses of the malloc call:
 
51
///   0: PointerType is the malloc calls' return type.
 
52
///   1: PointerType is the bitcast's result type.
 
53
///  >1: Unique PointerType cannot be determined, return NULL.
 
54
const PointerType *getMallocType(const CallInst *CI);
 
55
 
 
56
/// getMallocAllocatedType - Returns the Type allocated by malloc call.
 
57
/// The Type depends on the number of bitcast uses of the malloc call:
 
58
///   0: PointerType is the malloc calls' return type.
 
59
///   1: PointerType is the bitcast's result type.
 
60
///  >1: Unique PointerType cannot be determined, return NULL.
 
61
const Type *getMallocAllocatedType(const CallInst *CI);
 
62
 
 
63
/// getMallocArraySize - Returns the array size of a malloc call.  If the 
 
64
/// argument passed to malloc is a multiple of the size of the malloced type,
 
65
/// then return that multiple.  For non-array mallocs, the multiple is
 
66
/// constant 1.  Otherwise, return NULL for mallocs whose array size cannot be
 
67
/// determined.
 
68
Value *getMallocArraySize(CallInst *CI, const TargetData *TD,
 
69
                          bool LookThroughSExt = false);
 
70
                          
 
71
//===----------------------------------------------------------------------===//
 
72
//  free Call Utility Functions.
 
73
//
 
74
 
 
75
/// isFreeCall - Returns true if the value is a call to the builtin free()
 
76
bool isFreeCall(const Value *I);
 
77
 
 
78
} // End llvm namespace
 
79
 
 
80
#endif