TargetInfo.h revision 207619
1193326Sed//===--- TargetInfo.h - Expose information about the target -----*- C++ -*-===//
2193326Sed//
3193326Sed//                     The LLVM Compiler Infrastructure
4193326Sed//
5193326Sed// This file is distributed under the University of Illinois Open Source
6193326Sed// License. See LICENSE.TXT for details.
7193326Sed//
8193326Sed//===----------------------------------------------------------------------===//
9193326Sed//
10193326Sed//  This file defines the TargetInfo interface.
11193326Sed//
12193326Sed//===----------------------------------------------------------------------===//
13193326Sed
14193326Sed#ifndef LLVM_CLANG_BASIC_TARGETINFO_H
15193326Sed#define LLVM_CLANG_BASIC_TARGETINFO_H
16193326Sed
17193326Sed// FIXME: Daniel isn't smart enough to use a prototype for this.
18193326Sed#include "llvm/ADT/StringMap.h"
19198092Srdivacky#include "llvm/ADT/Triple.h"
20198893Srdivacky#include "llvm/System/DataTypes.h"
21193326Sed#include <cassert>
22193326Sed#include <vector>
23193326Sed#include <string>
24193326Sed
25198092Srdivackynamespace llvm {
26198092Srdivackystruct fltSemantics;
27198092Srdivackyclass StringRef;
28198092Srdivacky}
29193326Sed
30193326Sednamespace clang {
31193326Sedclass Diagnostic;
32199482Srdivackyclass LangOptions;
33202379Srdivackyclass MacroBuilder;
34198092Srdivackyclass SourceLocation;
35193326Sedclass SourceManager;
36199482Srdivackyclass TargetOptions;
37199482Srdivacky
38193326Sednamespace Builtin { struct Info; }
39198092Srdivacky
40193326Sed/// TargetInfo - This class exposes information about the current target.
41193326Sed///
42193326Sedclass TargetInfo {
43198092Srdivacky  llvm::Triple Triple;
44193326Sedprotected:
45193326Sed  // Target values set by the ctor of the actual target implementation.  Default
46193326Sed  // values are specified by the TargetInfo constructor.
47193326Sed  bool TLSSupported;
48207619Srdivacky  bool NoAsmVariants;  // True if {|} are normal characters.
49193326Sed  unsigned char PointerWidth, PointerAlign;
50193326Sed  unsigned char IntWidth, IntAlign;
51193326Sed  unsigned char FloatWidth, FloatAlign;
52193326Sed  unsigned char DoubleWidth, DoubleAlign;
53193326Sed  unsigned char LongDoubleWidth, LongDoubleAlign;
54193326Sed  unsigned char LongWidth, LongAlign;
55193326Sed  unsigned char LongLongWidth, LongLongAlign;
56193326Sed  const char *DescriptionString;
57193326Sed  const char *UserLabelPrefix;
58193326Sed  const llvm::fltSemantics *FloatFormat, *DoubleFormat, *LongDoubleFormat;
59193326Sed  unsigned char RegParmMax, SSERegParmMax;
60193326Sed
61193326Sed  // TargetInfo Constructor.  Default initializes all fields.
62193326Sed  TargetInfo(const std::string &T);
63198092Srdivacky
64198092Srdivackypublic:
65199482Srdivacky  /// CreateTargetInfo - Construct a target for the given options.
66201361Srdivacky  ///
67201361Srdivacky  /// \param Opts - The options to use to initialize the target. The target may
68201361Srdivacky  /// modify the options to canonicalize the target feature information to match
69201361Srdivacky  /// what the backend expects.
70201361Srdivacky  static TargetInfo* CreateTargetInfo(Diagnostic &Diags, TargetOptions &Opts);
71193326Sed
72193326Sed  virtual ~TargetInfo();
73193326Sed
74193326Sed  ///===---- Target Data Type Query Methods -------------------------------===//
75193326Sed  enum IntType {
76193326Sed    NoInt = 0,
77193326Sed    SignedShort,
78193326Sed    UnsignedShort,
79193326Sed    SignedInt,
80193326Sed    UnsignedInt,
81193326Sed    SignedLong,
82193326Sed    UnsignedLong,
83193326Sed    SignedLongLong,
84193326Sed    UnsignedLongLong
85193326Sed  };
86193326Sedprotected:
87195341Sed  IntType SizeType, IntMaxType, UIntMaxType, PtrDiffType, IntPtrType, WCharType,
88199990Srdivacky          WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType;
89207619Srdivacky
90207619Srdivacky  /// Control whether the alignment of bit-field types is respected when laying
91207619Srdivacky  /// out structures. If true, then the alignment of the bit-field type will be
92207619Srdivacky  /// used to (a) impact the alignment of the containing structure, and (b)
93207619Srdivacky  /// ensure that the individual bit-field will not straddle an alignment
94207619Srdivacky  /// boundary.
95207619Srdivacky  unsigned UseBitFieldTypeAlignment : 1;
96207619Srdivacky
97193326Sedpublic:
98193326Sed  IntType getSizeType() const { return SizeType; }
99193326Sed  IntType getIntMaxType() const { return IntMaxType; }
100193326Sed  IntType getUIntMaxType() const { return UIntMaxType; }
101193326Sed  IntType getPtrDiffType(unsigned AddrSpace) const {
102193326Sed    return AddrSpace == 0 ? PtrDiffType : getPtrDiffTypeV(AddrSpace);
103193326Sed  }
104193326Sed  IntType getIntPtrType() const { return IntPtrType; }
105193326Sed  IntType getWCharType() const { return WCharType; }
106198398Srdivacky  IntType getWIntType() const { return WIntType; }
107198092Srdivacky  IntType getChar16Type() const { return Char16Type; }
108198092Srdivacky  IntType getChar32Type() const { return Char32Type; }
109195341Sed  IntType getInt64Type() const { return Int64Type; }
110199990Srdivacky  IntType getSigAtomicType() const { return SigAtomicType; }
111193326Sed
112198398Srdivacky
113198398Srdivacky  /// getTypeWidth - Return the width (in bits) of the specified integer type
114198398Srdivacky  /// enum. For example, SignedInt -> getIntWidth().
115198398Srdivacky  unsigned getTypeWidth(IntType T) const;
116198398Srdivacky
117199482Srdivacky  /// getTypeAlign - Return the alignment (in bits) of the specified integer
118199482Srdivacky  /// type enum. For example, SignedInt -> getIntAlign().
119199482Srdivacky  unsigned getTypeAlign(IntType T) const;
120199482Srdivacky
121198893Srdivacky  /// isTypeSigned - Return whether an integer types is signed. Returns true if
122198398Srdivacky  /// the type is signed; false otherwise.
123198893Srdivacky  bool isTypeSigned(IntType T) const;
124198398Srdivacky
125193326Sed  /// getPointerWidth - Return the width of pointers on this target, for the
126193326Sed  /// specified address space.
127193326Sed  uint64_t getPointerWidth(unsigned AddrSpace) const {
128193326Sed    return AddrSpace == 0 ? PointerWidth : getPointerWidthV(AddrSpace);
129193326Sed  }
130193326Sed  uint64_t getPointerAlign(unsigned AddrSpace) const {
131193326Sed    return AddrSpace == 0 ? PointerAlign : getPointerAlignV(AddrSpace);
132193326Sed  }
133198092Srdivacky
134193326Sed  /// getBoolWidth/Align - Return the size of '_Bool' and C++ 'bool' for this
135193326Sed  /// target, in bits.
136193326Sed  unsigned getBoolWidth(bool isWide = false) const { return 8; }  // FIXME
137193326Sed  unsigned getBoolAlign(bool isWide = false) const { return 8; }  // FIXME
138198092Srdivacky
139198092Srdivacky  unsigned getCharWidth() const { return 8; } // FIXME
140198092Srdivacky  unsigned getCharAlign() const { return 8; } // FIXME
141198092Srdivacky
142193326Sed  /// getShortWidth/Align - Return the size of 'signed short' and
143198092Srdivacky  /// 'unsigned short' for this target, in bits.
144193326Sed  unsigned getShortWidth() const { return 16; } // FIXME
145193326Sed  unsigned getShortAlign() const { return 16; } // FIXME
146198092Srdivacky
147193326Sed  /// getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for
148193326Sed  /// this target, in bits.
149193326Sed  unsigned getIntWidth() const { return IntWidth; }
150193326Sed  unsigned getIntAlign() const { return IntAlign; }
151198092Srdivacky
152193326Sed  /// getLongWidth/Align - Return the size of 'signed long' and 'unsigned long'
153193326Sed  /// for this target, in bits.
154193326Sed  unsigned getLongWidth() const { return LongWidth; }
155193326Sed  unsigned getLongAlign() const { return LongAlign; }
156198092Srdivacky
157193326Sed  /// getLongLongWidth/Align - Return the size of 'signed long long' and
158193326Sed  /// 'unsigned long long' for this target, in bits.
159193326Sed  unsigned getLongLongWidth() const { return LongLongWidth; }
160193326Sed  unsigned getLongLongAlign() const { return LongLongAlign; }
161198092Srdivacky
162198092Srdivacky  /// getWCharWidth/Align - Return the size of 'wchar_t' for this target, in
163193326Sed  /// bits.
164199482Srdivacky  unsigned getWCharWidth() const { return getTypeWidth(WCharType); }
165199482Srdivacky  unsigned getWCharAlign() const { return getTypeAlign(WCharType); }
166193326Sed
167198092Srdivacky  /// getChar16Width/Align - Return the size of 'char16_t' for this target, in
168198092Srdivacky  /// bits.
169199482Srdivacky  unsigned getChar16Width() const { return getTypeWidth(Char16Type); }
170199482Srdivacky  unsigned getChar16Align() const { return getTypeAlign(Char16Type); }
171198092Srdivacky
172198092Srdivacky  /// getChar32Width/Align - Return the size of 'char32_t' for this target, in
173198092Srdivacky  /// bits.
174199482Srdivacky  unsigned getChar32Width() const { return getTypeWidth(Char32Type); }
175199482Srdivacky  unsigned getChar32Align() const { return getTypeAlign(Char32Type); }
176198092Srdivacky
177193326Sed  /// getFloatWidth/Align/Format - Return the size/align/format of 'float'.
178193326Sed  unsigned getFloatWidth() const { return FloatWidth; }
179193326Sed  unsigned getFloatAlign() const { return FloatAlign; }
180193326Sed  const llvm::fltSemantics &getFloatFormat() const { return *FloatFormat; }
181193326Sed
182193326Sed  /// getDoubleWidth/Align/Format - Return the size/align/format of 'double'.
183193326Sed  unsigned getDoubleWidth() const { return DoubleWidth; }
184193326Sed  unsigned getDoubleAlign() const { return DoubleAlign; }
185193326Sed  const llvm::fltSemantics &getDoubleFormat() const { return *DoubleFormat; }
186193326Sed
187193326Sed  /// getLongDoubleWidth/Align/Format - Return the size/align/format of 'long
188193326Sed  /// double'.
189193326Sed  unsigned getLongDoubleWidth() const { return LongDoubleWidth; }
190193326Sed  unsigned getLongDoubleAlign() const { return LongDoubleAlign; }
191193326Sed  const llvm::fltSemantics &getLongDoubleFormat() const {
192193326Sed    return *LongDoubleFormat;
193193326Sed  }
194198092Srdivacky
195193326Sed  /// getIntMaxTWidth - Return the size of intmax_t and uintmax_t for this
196198092Srdivacky  /// target, in bits.
197193326Sed  unsigned getIntMaxTWidth() const {
198199482Srdivacky    return getTypeWidth(IntMaxType);
199193326Sed  }
200198092Srdivacky
201193326Sed  /// getUserLabelPrefix - This returns the default value of the
202193326Sed  /// __USER_LABEL_PREFIX__ macro, which is the prefix given to user symbols by
203193326Sed  /// default.  On most platforms this is "_", but it is "" on some, and "." on
204193326Sed  /// others.
205193326Sed  const char *getUserLabelPrefix() const {
206193326Sed    return UserLabelPrefix;
207193326Sed  }
208198092Srdivacky
209207619Srdivacky  bool useBitFieldTypeAlignment() const {
210207619Srdivacky    return UseBitFieldTypeAlignment;
211207619Srdivacky  }
212207619Srdivacky
213193326Sed  /// getTypeName - Return the user string for the specified integer type enum.
214193326Sed  /// For example, SignedShort -> "short".
215193326Sed  static const char *getTypeName(IntType T);
216198092Srdivacky
217198398Srdivacky  /// getTypeConstantSuffix - Return the constant suffix for the specified
218198398Srdivacky  /// integer type enum. For example, SignedLong -> "L".
219198398Srdivacky  static const char *getTypeConstantSuffix(IntType T);
220198398Srdivacky
221193326Sed  ///===---- Other target property query methods --------------------------===//
222198092Srdivacky
223193326Sed  /// getTargetDefines - Appends the target-specific #define values for this
224193326Sed  /// target set to the specified buffer.
225193326Sed  virtual void getTargetDefines(const LangOptions &Opts,
226202379Srdivacky                                MacroBuilder &Builder) const = 0;
227198092Srdivacky
228198398Srdivacky
229193326Sed  /// getTargetBuiltins - Return information about target-specific builtins for
230193326Sed  /// the current primary target, and info about which builtins are non-portable
231193326Sed  /// across the current set of primary and secondary targets.
232198092Srdivacky  virtual void getTargetBuiltins(const Builtin::Info *&Records,
233193326Sed                                 unsigned &NumRecords) const = 0;
234193326Sed
235193326Sed  /// getVAListDeclaration - Return the declaration to use for
236193326Sed  /// __builtin_va_list, which is target-specific.
237193326Sed  virtual const char *getVAListDeclaration() const = 0;
238193326Sed
239193326Sed  /// isValidGCCRegisterName - Returns whether the passed in string
240193326Sed  /// is a valid register name according to GCC. This is used by Sema for
241193326Sed  /// inline asm statements.
242203955Srdivacky  bool isValidGCCRegisterName(llvm::StringRef Name) const;
243193326Sed
244193326Sed  // getNormalizedGCCRegisterName - Returns the "normalized" GCC register name.
245193326Sed  // For example, on x86 it will return "ax" when "eax" is passed in.
246203955Srdivacky  llvm::StringRef getNormalizedGCCRegisterName(llvm::StringRef Name) const;
247198092Srdivacky
248193326Sed  struct ConstraintInfo {
249193326Sed    enum {
250193326Sed      CI_None = 0x00,
251193326Sed      CI_AllowsMemory = 0x01,
252193326Sed      CI_AllowsRegister = 0x02,
253193326Sed      CI_ReadWrite = 0x04,       // "+r" output constraint (read and write).
254193326Sed      CI_HasMatchingInput = 0x08 // This output operand has a matching input.
255193326Sed    };
256193326Sed    unsigned Flags;
257193326Sed    int TiedOperand;
258198092Srdivacky
259193326Sed    std::string ConstraintStr;  // constraint: "=rm"
260193326Sed    std::string Name;           // Operand name: [foo] with no []'s.
261193326Sed  public:
262203955Srdivacky    ConstraintInfo(llvm::StringRef ConstraintStr, llvm::StringRef Name)
263203955Srdivacky      : Flags(0), TiedOperand(-1), ConstraintStr(ConstraintStr.str()),
264203955Srdivacky      Name(Name.str()) {}
265193326Sed
266193326Sed    const std::string &getConstraintStr() const { return ConstraintStr; }
267193326Sed    const std::string &getName() const { return Name; }
268193326Sed    bool isReadWrite() const { return (Flags & CI_ReadWrite) != 0; }
269193326Sed    bool allowsRegister() const { return (Flags & CI_AllowsRegister) != 0; }
270193326Sed    bool allowsMemory() const { return (Flags & CI_AllowsMemory) != 0; }
271198092Srdivacky
272193326Sed    /// hasMatchingInput - Return true if this output operand has a matching
273193326Sed    /// (tied) input operand.
274193326Sed    bool hasMatchingInput() const { return (Flags & CI_HasMatchingInput) != 0; }
275198092Srdivacky
276193326Sed    /// hasTiedOperand() - Return true if this input operand is a matching
277193326Sed    /// constraint that ties it to an output operand.  If this returns true,
278193326Sed    /// then getTiedOperand will indicate which output operand this is tied to.
279193326Sed    bool hasTiedOperand() const { return TiedOperand != -1; }
280193326Sed    unsigned getTiedOperand() const {
281193326Sed      assert(hasTiedOperand() && "Has no tied operand!");
282193326Sed      return (unsigned)TiedOperand;
283193326Sed    }
284198092Srdivacky
285193326Sed    void setIsReadWrite() { Flags |= CI_ReadWrite; }
286193326Sed    void setAllowsMemory() { Flags |= CI_AllowsMemory; }
287193326Sed    void setAllowsRegister() { Flags |= CI_AllowsRegister; }
288193326Sed    void setHasMatchingInput() { Flags |= CI_HasMatchingInput; }
289198092Srdivacky
290193326Sed    /// setTiedOperand - Indicate that this is an input operand that is tied to
291193326Sed    /// the specified output operand.  Copy over the various constraint
292193326Sed    /// information from the output.
293193326Sed    void setTiedOperand(unsigned N, ConstraintInfo &Output) {
294193326Sed      Output.setHasMatchingInput();
295193326Sed      Flags = Output.Flags;
296193326Sed      TiedOperand = N;
297193326Sed      // Don't copy Name or constraint string.
298193326Sed    }
299193326Sed  };
300193326Sed
301193326Sed  // validateOutputConstraint, validateInputConstraint - Checks that
302193326Sed  // a constraint is valid and provides information about it.
303193326Sed  // FIXME: These should return a real error instead of just true/false.
304193326Sed  bool validateOutputConstraint(ConstraintInfo &Info) const;
305193326Sed  bool validateInputConstraint(ConstraintInfo *OutputConstraints,
306193326Sed                               unsigned NumOutputs,
307193326Sed                               ConstraintInfo &info) const;
308193326Sed  bool resolveSymbolicName(const char *&Name,
309193326Sed                           ConstraintInfo *OutputConstraints,
310193326Sed                           unsigned NumOutputs, unsigned &Index) const;
311198092Srdivacky
312193326Sed  virtual std::string convertConstraint(const char Constraint) const {
313193326Sed    return std::string(1, Constraint);
314193326Sed  }
315198092Srdivacky
316193326Sed  // Returns a string of target-specific clobbers, in LLVM format.
317193326Sed  virtual const char *getClobbers() const = 0;
318193326Sed
319198092Srdivacky
320198092Srdivacky  /// getTriple - Return the target triple of the primary target.
321198092Srdivacky  const llvm::Triple &getTriple() const {
322198092Srdivacky    return Triple;
323193326Sed  }
324198092Srdivacky
325193326Sed  const char *getTargetDescription() const {
326193326Sed    return DescriptionString;
327193326Sed  }
328193326Sed
329193326Sed  struct GCCRegAlias {
330193326Sed    const char * const Aliases[5];
331193326Sed    const char * const Register;
332193326Sed  };
333193326Sed
334193326Sed  virtual bool useGlobalsForAutomaticVariables() const { return false; }
335193326Sed
336193326Sed  /// getCFStringSection - Return the section to use for CFString
337193326Sed  /// literals, or 0 if no special section is used.
338198092Srdivacky  virtual const char *getCFStringSection() const {
339193326Sed    return "__DATA,__cfstring";
340193326Sed  }
341193326Sed
342207619Srdivacky  /// getNSStringSection - Return the section to use for NSString
343207619Srdivacky  /// literals, or 0 if no special section is used.
344207619Srdivacky  virtual const char *getNSStringSection() const {
345207619Srdivacky    return "__OBJC,__cstring_object,regular,no_dead_strip";
346207619Srdivacky  }
347207619Srdivacky
348207619Srdivacky  /// getNSStringNonFragileABISection - Return the section to use for
349207619Srdivacky  /// NSString literals, or 0 if no special section is used (NonFragile ABI).
350207619Srdivacky  virtual const char *getNSStringNonFragileABISection() const {
351207619Srdivacky    return "__DATA, __objc_stringobj, regular, no_dead_strip";
352207619Srdivacky  }
353207619Srdivacky
354198092Srdivacky  /// isValidSectionSpecifier - This is an optional hook that targets can
355198092Srdivacky  /// implement to perform semantic checking on attribute((section("foo")))
356198092Srdivacky  /// specifiers.  In this case, "foo" is passed in to be checked.  If the
357198092Srdivacky  /// section specifier is invalid, the backend should return a non-empty string
358198092Srdivacky  /// that indicates the problem.
359198092Srdivacky  ///
360198092Srdivacky  /// This hook is a simple quality of implementation feature to catch errors
361198092Srdivacky  /// and give good diagnostics in cases when the assembler or code generator
362198092Srdivacky  /// would otherwise reject the section specifier.
363198092Srdivacky  ///
364203955Srdivacky  virtual std::string isValidSectionSpecifier(llvm::StringRef SR) const {
365198092Srdivacky    return "";
366193326Sed  }
367193326Sed
368199482Srdivacky  /// setForcedLangOptions - Set forced language options.
369199482Srdivacky  /// Apply changes to the target information with respect to certain
370199482Srdivacky  /// language options which change the target configuration.
371199482Srdivacky  virtual void setForcedLangOptions(LangOptions &Opts);
372193326Sed
373193326Sed  /// getDefaultFeatures - Get the default set of target features for
374193326Sed  /// the \args CPU; this should include all legal feature strings on
375193326Sed  /// the target.
376198092Srdivacky  virtual void getDefaultFeatures(const std::string &CPU,
377193326Sed                                  llvm::StringMap<bool> &Features) const {
378193326Sed  }
379193326Sed
380198092Srdivacky  /// getABI - Get the ABI in use.
381198092Srdivacky  virtual const char *getABI() const {
382198092Srdivacky    return "";
383198092Srdivacky  }
384198092Srdivacky
385201361Srdivacky  /// setCPU - Target the specific CPU.
386201361Srdivacky  ///
387201361Srdivacky  /// \return - False on error (invalid CPU name).
388201361Srdivacky  //
389201361Srdivacky  // FIXME: Remove this.
390201361Srdivacky  virtual bool setCPU(const std::string &Name) {
391201361Srdivacky    return true;
392201361Srdivacky  }
393201361Srdivacky
394198092Srdivacky  /// setABI - Use the specific ABI.
395198092Srdivacky  ///
396198092Srdivacky  /// \return - False on error (invalid ABI name).
397198092Srdivacky  virtual bool setABI(const std::string &Name) {
398198092Srdivacky    return false;
399198092Srdivacky  }
400198092Srdivacky
401193326Sed  /// setFeatureEnabled - Enable or disable a specific target feature,
402193326Sed  /// the feature name must be valid.
403193326Sed  ///
404193326Sed  /// \return - False on error (invalid feature name).
405193326Sed  virtual bool setFeatureEnabled(llvm::StringMap<bool> &Features,
406193326Sed                                 const std::string &Name,
407193326Sed                                 bool Enabled) const {
408193326Sed    return false;
409193326Sed  }
410193326Sed
411199482Srdivacky  /// HandleTargetOptions - Perform initialization based on the user configured
412199482Srdivacky  /// set of features (e.g., +sse4). The list is guaranteed to have at most one
413199482Srdivacky  /// entry per feature.
414201361Srdivacky  ///
415201361Srdivacky  /// The target may modify the features list, to change which options are
416201361Srdivacky  /// passed onwards to the backend.
417201361Srdivacky  virtual void HandleTargetFeatures(std::vector<std::string> &Features) {
418193326Sed  }
419193326Sed
420193326Sed  // getRegParmMax - Returns maximal number of args passed in registers.
421193326Sed  unsigned getRegParmMax() const {
422193326Sed    return RegParmMax;
423193326Sed  }
424193326Sed
425198092Srdivacky  /// isTLSSupported - Whether the target supports thread-local storage.
426198092Srdivacky  bool isTLSSupported() const {
427193326Sed    return TLSSupported;
428193326Sed  }
429198092Srdivacky
430207619Srdivacky  /// hasNoAsmVariants - Return true if {|} are normal characters in the
431207619Srdivacky  /// asm string.  If this returns false (the default), then {abc|xyz} is syntax
432207619Srdivacky  /// that says that when compiling for asm variant #0, "abc" should be
433207619Srdivacky  /// generated, but when compiling for asm variant #1, "xyz" should be
434207619Srdivacky  /// generated.
435207619Srdivacky  bool hasNoAsmVariants() const {
436207619Srdivacky    return NoAsmVariants;
437207619Srdivacky  }
438207619Srdivacky
439198092Srdivacky  /// getEHDataRegisterNumber - Return the register number that
440198092Srdivacky  /// __builtin_eh_return_regno would return with the specified argument.
441198092Srdivacky  virtual int getEHDataRegisterNumber(unsigned RegNo) const {
442198092Srdivacky    return -1;
443198092Srdivacky  }
444198092Srdivacky
445193326Sed
446193326Sedprotected:
447193326Sed  virtual uint64_t getPointerWidthV(unsigned AddrSpace) const {
448193326Sed    return PointerWidth;
449193326Sed  }
450193326Sed  virtual uint64_t getPointerAlignV(unsigned AddrSpace) const {
451193326Sed    return PointerAlign;
452193326Sed  }
453193326Sed  virtual enum IntType getPtrDiffTypeV(unsigned AddrSpace) const {
454193326Sed    return PtrDiffType;
455193326Sed  }
456198092Srdivacky  virtual void getGCCRegNames(const char * const *&Names,
457193326Sed                              unsigned &NumNames) const = 0;
458198092Srdivacky  virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
459193326Sed                                unsigned &NumAliases) const = 0;
460198092Srdivacky  virtual bool validateAsmConstraint(const char *&Name,
461193326Sed                                     TargetInfo::ConstraintInfo &info) const= 0;
462193326Sed};
463193326Sed
464193326Sed}  // end namespace clang
465193326Sed
466193326Sed#endif
467