~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/InlineAsm.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/InlineAsm.h - Class to represent inline asm strings-*- 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 class represents the inline asm strings, which are Value*'s that are
 
11
// used as the callee operand of call instructions.  InlineAsm's are uniqued
 
12
// like constants, and created via InlineAsm::get(...).
 
13
//
 
14
//===----------------------------------------------------------------------===//
 
15
 
 
16
#ifndef LLVM_INLINEASM_H
 
17
#define LLVM_INLINEASM_H
 
18
 
 
19
#include "llvm/Value.h"
 
20
#include <vector>
 
21
 
 
22
namespace llvm {
 
23
 
 
24
class PointerType;
 
25
class FunctionType;
 
26
class Module;
 
27
 
 
28
class InlineAsm : public Value {
 
29
  InlineAsm(const InlineAsm &);             // do not implement
 
30
  void operator=(const InlineAsm&);         // do not implement
 
31
 
 
32
  std::string AsmString, Constraints;
 
33
  bool HasSideEffects;
 
34
  bool IsAlignStack;
 
35
  
 
36
  InlineAsm(const FunctionType *Ty, StringRef AsmString,
 
37
            StringRef Constraints, bool hasSideEffects,
 
38
            bool isAlignStack = false);
 
39
  virtual ~InlineAsm();
 
40
public:
 
41
 
 
42
  /// InlineAsm::get - Return the specified uniqued inline asm string.
 
43
  ///
 
44
  static InlineAsm *get(const FunctionType *Ty, StringRef AsmString,
 
45
                        StringRef Constraints, bool hasSideEffects,
 
46
                        bool isAlignStack = false);
 
47
  
 
48
  bool hasSideEffects() const { return HasSideEffects; }
 
49
  bool isAlignStack() const { return IsAlignStack; }
 
50
  
 
51
  /// getType - InlineAsm's are always pointers.
 
52
  ///
 
53
  const PointerType *getType() const {
 
54
    return reinterpret_cast<const PointerType*>(Value::getType());
 
55
  }
 
56
  
 
57
  /// getFunctionType - InlineAsm's are always pointers to functions.
 
58
  ///
 
59
  const FunctionType *getFunctionType() const;
 
60
  
 
61
  const std::string &getAsmString() const { return AsmString; }
 
62
  const std::string &getConstraintString() const { return Constraints; }
 
63
 
 
64
  /// Verify - This static method can be used by the parser to check to see if
 
65
  /// the specified constraint string is legal for the type.  This returns true
 
66
  /// if legal, false if not.
 
67
  ///
 
68
  static bool Verify(const FunctionType *Ty, StringRef Constraints);
 
69
 
 
70
  // Constraint String Parsing 
 
71
  enum ConstraintPrefix {
 
72
    isInput,            // 'x'
 
73
    isOutput,           // '=x'
 
74
    isClobber           // '~x'
 
75
  };
 
76
  
 
77
  struct ConstraintInfo {
 
78
    /// Type - The basic type of the constraint: input/output/clobber
 
79
    ///
 
80
    ConstraintPrefix Type;
 
81
    
 
82
    /// isEarlyClobber - "&": output operand writes result before inputs are all
 
83
    /// read.  This is only ever set for an output operand.
 
84
    bool isEarlyClobber; 
 
85
    
 
86
    /// MatchingInput - If this is not -1, this is an output constraint where an
 
87
    /// input constraint is required to match it (e.g. "0").  The value is the
 
88
    /// constraint number that matches this one (for example, if this is
 
89
    /// constraint #0 and constraint #4 has the value "0", this will be 4).
 
90
    signed char MatchingInput;
 
91
    
 
92
    /// hasMatchingInput - Return true if this is an output constraint that has
 
93
    /// a matching input constraint.
 
94
    bool hasMatchingInput() const { return MatchingInput != -1; }
 
95
    
 
96
    /// isCommutative - This is set to true for a constraint that is commutative
 
97
    /// with the next operand.
 
98
    bool isCommutative;
 
99
    
 
100
    /// isIndirect - True if this operand is an indirect operand.  This means
 
101
    /// that the address of the source or destination is present in the call
 
102
    /// instruction, instead of it being returned or passed in explicitly.  This
 
103
    /// is represented with a '*' in the asm string.
 
104
    bool isIndirect;
 
105
    
 
106
    /// Code - The constraint code, either the register name (in braces) or the
 
107
    /// constraint letter/number.
 
108
    std::vector<std::string> Codes;
 
109
    
 
110
    /// Parse - Analyze the specified string (e.g. "=*&{eax}") and fill in the
 
111
    /// fields in this structure.  If the constraint string is not understood,
 
112
    /// return true, otherwise return false.
 
113
    bool Parse(StringRef Str, 
 
114
               std::vector<InlineAsm::ConstraintInfo> &ConstraintsSoFar);
 
115
  };
 
116
  
 
117
  /// ParseConstraints - Split up the constraint string into the specific
 
118
  /// constraints and their prefixes.  If this returns an empty vector, and if
 
119
  /// the constraint string itself isn't empty, there was an error parsing.
 
120
  static std::vector<ConstraintInfo> 
 
121
    ParseConstraints(StringRef ConstraintString);
 
122
  
 
123
  /// ParseConstraints - Parse the constraints of this inlineasm object, 
 
124
  /// returning them the same way that ParseConstraints(str) does.
 
125
  std::vector<ConstraintInfo> 
 
126
  ParseConstraints() const {
 
127
    return ParseConstraints(Constraints);
 
128
  }
 
129
  
 
130
  // Methods for support type inquiry through isa, cast, and dyn_cast:
 
131
  static inline bool classof(const InlineAsm *) { return true; }
 
132
  static inline bool classof(const Value *V) {
 
133
    return V->getValueID() == Value::InlineAsmVal;
 
134
  }
 
135
 
 
136
  /// getNumOperandRegisters - Extract the number of registers field from the
 
137
  /// inline asm operand flag.
 
138
  static unsigned getNumOperandRegisters(unsigned Flag) {
 
139
    return (Flag & 0xffff) >> 3;
 
140
  }
 
141
 
 
142
  /// isUseOperandTiedToDef - Return true if the flag of the inline asm
 
143
  /// operand indicates it is an use operand that's matched to a def operand.
 
144
  static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx) {
 
145
    if ((Flag & 0x80000000) == 0)
 
146
      return false;
 
147
    Idx = (Flag & ~0x80000000) >> 16;
 
148
    return true;
 
149
  }
 
150
 
 
151
 
 
152
};
 
153
 
 
154
} // End llvm namespace
 
155
 
 
156
#endif