TargetInfo.h revision 103b71c37a3c3a3da7128c1d0232a89b1e8d0d90
15f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer//===--- TargetInfo.h - Expose information about the target -----*- C++ -*-===// 25f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer// 35f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer// The LLVM Compiler Infrastructure 45f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer// 50bc735ffcfb223c0186419547abaa5c84482663eChris Lattner// This file is distributed under the University of Illinois Open Source 60bc735ffcfb223c0186419547abaa5c84482663eChris Lattner// License. See LICENSE.TXT for details. 75f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer// 85f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer//===----------------------------------------------------------------------===// 95f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer// 102b59a2cbfdb93fcf1a4a303e1ea7753ff1c7b319Nate Begeman// This file defines the TargetInfo interface. 115f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer// 125f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer//===----------------------------------------------------------------------===// 135f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer 145f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer#ifndef LLVM_CLANG_BASIC_TARGETINFO_H 155f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer#define LLVM_CLANG_BASIC_TARGETINFO_H 165f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer 17868bd0aa9281929ef50d2e9a8c82a036906f53f5Daniel Dunbar// FIXME: Daniel isn't smart enough to use a prototype for this. 18868bd0aa9281929ef50d2e9a8c82a036906f53f5Daniel Dunbar#include "llvm/ADT/StringMap.h" 191752ee4849f4c37f5e03193e658be92650b0e65aDaniel Dunbar#include "llvm/ADT/Triple.h" 209f8eb2032030482b1d3de86e9bee725d93564302Chandler Carruth#include "llvm/System/DataTypes.h" 215414fbac5f1749c0e85a8c4eeb5dfece59c3e30aTorok Edwin#include <cassert> 225f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer#include <vector> 235f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer#include <string> 245f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer 25797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattnernamespace llvm { 26797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattnerstruct fltSemantics; 27797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattnerclass StringRef; 28797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner} 29525a05093a4816af961fe2bc6b8a81c17e2e26c2Chris Lattner 305f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencernamespace clang { 315f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencerclass Diagnostic; 32d58c03f42ebb4e548c2b53fa25b1cfe02ebb9ac0Daniel Dunbarclass LangOptions; 33103b71c37a3c3a3da7128c1d0232a89b1e8d0d90Chandler Carruthclass MacroBuilder; 34797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattnerclass SourceLocation; 357a9d49fd2bfac00e905b361ba76d26ab5b6c3b09Ted Kremenekclass SourceManager; 36d58c03f42ebb4e548c2b53fa25b1cfe02ebb9ac0Daniel Dunbarclass TargetOptions; 37d58c03f42ebb4e548c2b53fa25b1cfe02ebb9ac0Daniel Dunbar 385f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencernamespace Builtin { struct Info; } 391eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 4042e6737f2efb113563140ad794c21c7709250402Chris Lattner/// TargetInfo - This class exposes information about the current target. 415f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer/// 425f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencerclass TargetInfo { 431752ee4849f4c37f5e03193e658be92650b0e65aDaniel Dunbar llvm::Triple Triple; 440eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattnerprotected: 45cd4fc42896f926ffc081e1c4a8bf4cd647883c14Chris Lattner // Target values set by the ctor of the actual target implementation. Default 46cd4fc42896f926ffc081e1c4a8bf4cd647883c14Chris Lattner // values are specified by the TargetInfo constructor. 47b030f0272500c6c5602f587ac029ee0dc0e5a05cEli Friedman bool TLSSupported; 48927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner unsigned char PointerWidth, PointerAlign; 49927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner unsigned char IntWidth, IntAlign; 5061538a7d1336f3ef3cb81e09f11a1cbb282bcf81Eli Friedman unsigned char FloatWidth, FloatAlign; 51927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner unsigned char DoubleWidth, DoubleAlign; 5261538a7d1336f3ef3cb81e09f11a1cbb282bcf81Eli Friedman unsigned char LongDoubleWidth, LongDoubleAlign; 53927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner unsigned char LongWidth, LongAlign; 54927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner unsigned char LongLongWidth, LongLongAlign; 5577e8b53fe3ff630d8d1454db94e38bedda14d5caDaniel Dunbar const char *DescriptionString; 563fdf4678935b27c3d3fd4eb10bf9f5ab98dc0d99Chris Lattner const char *UserLabelPrefix; 57cd4fc42896f926ffc081e1c4a8bf4cd647883c14Chris Lattner const llvm::fltSemantics *FloatFormat, *DoubleFormat, *LongDoubleFormat; 58264a76cdf382c507f4d43e64c89f1503f003ac95Anton Korobeynikov unsigned char RegParmMax, SSERegParmMax; 59bbced580c92afa09cd4423a9bdc90ff61cb1e79aTed Kremenek 60cd4fc42896f926ffc081e1c4a8bf4cd647883c14Chris Lattner // TargetInfo Constructor. Default initializes all fields. 61cd4fc42896f926ffc081e1c4a8bf4cd647883c14Chris Lattner TargetInfo(const std::string &T); 621eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 631eb4433ac451dc16f4133a88af2d002ac26c58efMike Stumppublic: 64d58c03f42ebb4e548c2b53fa25b1cfe02ebb9ac0Daniel Dunbar /// CreateTargetInfo - Construct a target for the given options. 65b93292ab7f2b3d43a9e0ad6421f572d1f5a323b4Daniel Dunbar /// 66b93292ab7f2b3d43a9e0ad6421f572d1f5a323b4Daniel Dunbar /// \param Opts - The options to use to initialize the target. The target may 67b93292ab7f2b3d43a9e0ad6421f572d1f5a323b4Daniel Dunbar /// modify the options to canonicalize the target feature information to match 68b93292ab7f2b3d43a9e0ad6421f572d1f5a323b4Daniel Dunbar /// what the backend expects. 69b93292ab7f2b3d43a9e0ad6421f572d1f5a323b4Daniel Dunbar static TargetInfo* CreateTargetInfo(Diagnostic &Diags, TargetOptions &Opts); 70bbced580c92afa09cd4423a9bdc90ff61cb1e79aTed Kremenek 710eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattner virtual ~TargetInfo(); 72fb79f7cc00f9c1e04f11ed636eefb36d246b0fb8Ted Kremenek 739c4bea1fa7291035325575c02d33552a124d8ef3Chris Lattner ///===---- Target Data Type Query Methods -------------------------------===// 7431fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta enum IntType { 752b5abf515f9696912452f431c7738691cf97f4f1Chris Lattner NoInt = 0, 7631fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta SignedShort, 7731fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta UnsignedShort, 7831fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta SignedInt, 7931fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta UnsignedInt, 8031fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta SignedLong, 8131fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta UnsignedLong, 8231fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta SignedLongLong, 8331fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta UnsignedLongLong 843fa8f7491a6a6c1445768ea23ec85d3554c3ba98Chris Lattner }; 853fa8f7491a6a6c1445768ea23ec85d3554c3ba98Chris Lattnerprotected: 863c7b6e46c5f9bdbe0676c52d80df98b68b02be99Eli Friedman IntType SizeType, IntMaxType, UIntMaxType, PtrDiffType, IntPtrType, WCharType, 879cf910efc4fb7001a6d276ed2eabf01f0f0efaaaEdward O'Callaghan WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType; 883fa8f7491a6a6c1445768ea23ec85d3554c3ba98Chris Lattnerpublic: 893fa8f7491a6a6c1445768ea23ec85d3554c3ba98Chris Lattner IntType getSizeType() const { return SizeType; } 903fa8f7491a6a6c1445768ea23ec85d3554c3ba98Chris Lattner IntType getIntMaxType() const { return IntMaxType; } 913fa8f7491a6a6c1445768ea23ec85d3554c3ba98Chris Lattner IntType getUIntMaxType() const { return UIntMaxType; } 923fa8f7491a6a6c1445768ea23ec85d3554c3ba98Chris Lattner IntType getPtrDiffType(unsigned AddrSpace) const { 9331fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta return AddrSpace == 0 ? PtrDiffType : getPtrDiffTypeV(AddrSpace); 9431fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta } 956ad474f82f0cf32e13128d89fa5ad3a37ae73530Chris Lattner IntType getIntPtrType() const { return IntPtrType; } 963fa8f7491a6a6c1445768ea23ec85d3554c3ba98Chris Lattner IntType getWCharType() const { return WCharType; } 97e64ef80363c84f4f431e26b61db554c89beeddb6Chris Lattner IntType getWIntType() const { return WIntType; } 98f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith IntType getChar16Type() const { return Char16Type; } 99f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith IntType getChar32Type() const { return Char32Type; } 1003c7b6e46c5f9bdbe0676c52d80df98b68b02be99Eli Friedman IntType getInt64Type() const { return Int64Type; } 1019cf910efc4fb7001a6d276ed2eabf01f0f0efaaaEdward O'Callaghan IntType getSigAtomicType() const { return SigAtomicType; } 1025f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer 103b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner 104b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner /// getTypeWidth - Return the width (in bits) of the specified integer type 105b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner /// enum. For example, SignedInt -> getIntWidth(). 106b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner unsigned getTypeWidth(IntType T) const; 107b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner 1089099e7bcda3922cee0cffcdf21332ac4aa193ceaChris Lattner /// getTypeAlign - Return the alignment (in bits) of the specified integer 1099099e7bcda3922cee0cffcdf21332ac4aa193ceaChris Lattner /// type enum. For example, SignedInt -> getIntAlign(). 1109099e7bcda3922cee0cffcdf21332ac4aa193ceaChris Lattner unsigned getTypeAlign(IntType T) const; 1119099e7bcda3922cee0cffcdf21332ac4aa193ceaChris Lattner 112961f0708fb66375acf47f9e9bc1aecfb3f992aeaChris Lattner /// isTypeSigned - Return whether an integer types is signed. Returns true if 113b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner /// the type is signed; false otherwise. 114961f0708fb66375acf47f9e9bc1aecfb3f992aeaChris Lattner bool isTypeSigned(IntType T) const; 115b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner 116f72a44330b9d9a4b2d93e9b91cfb8ab7bd4a0643Chris Lattner /// getPointerWidth - Return the width of pointers on this target, for the 117927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner /// specified address space. 118927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner uint64_t getPointerWidth(unsigned AddrSpace) const { 119927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner return AddrSpace == 0 ? PointerWidth : getPointerWidthV(AddrSpace); 120927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner } 121927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner uint64_t getPointerAlign(unsigned AddrSpace) const { 122927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner return AddrSpace == 0 ? PointerAlign : getPointerAlignV(AddrSpace); 123927686fe8c968ca786fa44d2353eebf59c4f5b8aChris Lattner } 1241eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1259e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// getBoolWidth/Align - Return the size of '_Bool' and C++ 'bool' for this 1269e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// target, in bits. 1279e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner unsigned getBoolWidth(bool isWide = false) const { return 8; } // FIXME 1289e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner unsigned getBoolAlign(bool isWide = false) const { return 8; } // FIXME 1291eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 130f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith unsigned getCharWidth() const { return 8; } // FIXME 131f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith unsigned getCharAlign() const { return 8; } // FIXME 1321eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1339e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// getShortWidth/Align - Return the size of 'signed short' and 1341eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump /// 'unsigned short' for this target, in bits. 1359e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner unsigned getShortWidth() const { return 16; } // FIXME 1369e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner unsigned getShortAlign() const { return 16; } // FIXME 1371eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1389e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for 1399e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// this target, in bits. 1402621fd1d6d3c5eadcae246859f62738645df7540Chris Lattner unsigned getIntWidth() const { return IntWidth; } 1412621fd1d6d3c5eadcae246859f62738645df7540Chris Lattner unsigned getIntAlign() const { return IntAlign; } 1421eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1439e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// getLongWidth/Align - Return the size of 'signed long' and 'unsigned long' 1449e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// for this target, in bits. 1458059e997ee05e4aa87f7e21fed630429a140ee53Chris Lattner unsigned getLongWidth() const { return LongWidth; } 1468059e997ee05e4aa87f7e21fed630429a140ee53Chris Lattner unsigned getLongAlign() const { return LongAlign; } 1471eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1489e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// getLongLongWidth/Align - Return the size of 'signed long long' and 1499e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// 'unsigned long long' for this target, in bits. 150ec10f5886526124ba733fbd0ef8665d576285daaChris Lattner unsigned getLongLongWidth() const { return LongLongWidth; } 151ec10f5886526124ba733fbd0ef8665d576285daaChris Lattner unsigned getLongLongAlign() const { return LongLongAlign; } 1521eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 153f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith /// getWCharWidth/Align - Return the size of 'wchar_t' for this target, in 1549e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// bits. 1559184646509d015ea66e796113a8c68598681374bChris Lattner unsigned getWCharWidth() const { return getTypeWidth(WCharType); } 1569184646509d015ea66e796113a8c68598681374bChris Lattner unsigned getWCharAlign() const { return getTypeAlign(WCharType); } 157f72a44330b9d9a4b2d93e9b91cfb8ab7bd4a0643Chris Lattner 158f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith /// getChar16Width/Align - Return the size of 'char16_t' for this target, in 159f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith /// bits. 1609184646509d015ea66e796113a8c68598681374bChris Lattner unsigned getChar16Width() const { return getTypeWidth(Char16Type); } 1619184646509d015ea66e796113a8c68598681374bChris Lattner unsigned getChar16Align() const { return getTypeAlign(Char16Type); } 162f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith 163f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith /// getChar32Width/Align - Return the size of 'char32_t' for this target, in 164f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith /// bits. 1659184646509d015ea66e796113a8c68598681374bChris Lattner unsigned getChar32Width() const { return getTypeWidth(Char32Type); } 1669184646509d015ea66e796113a8c68598681374bChris Lattner unsigned getChar32Align() const { return getTypeAlign(Char32Type); } 167f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith 1689e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// getFloatWidth/Align/Format - Return the size/align/format of 'float'. 16961538a7d1336f3ef3cb81e09f11a1cbb282bcf81Eli Friedman unsigned getFloatWidth() const { return FloatWidth; } 17061538a7d1336f3ef3cb81e09f11a1cbb282bcf81Eli Friedman unsigned getFloatAlign() const { return FloatAlign; } 171b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner const llvm::fltSemantics &getFloatFormat() const { return *FloatFormat; } 1729e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner 1739e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// getDoubleWidth/Align/Format - Return the size/align/format of 'double'. 174c8b1227fa8c17d9881815e40c04e19334be536f8Nate Begeman unsigned getDoubleWidth() const { return DoubleWidth; } 175c8b1227fa8c17d9881815e40c04e19334be536f8Nate Begeman unsigned getDoubleAlign() const { return DoubleAlign; } 176b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner const llvm::fltSemantics &getDoubleFormat() const { return *DoubleFormat; } 1779e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner 1789e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// getLongDoubleWidth/Align/Format - Return the size/align/format of 'long 1799e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner /// double'. 18061538a7d1336f3ef3cb81e09f11a1cbb282bcf81Eli Friedman unsigned getLongDoubleWidth() const { return LongDoubleWidth; } 18161538a7d1336f3ef3cb81e09f11a1cbb282bcf81Eli Friedman unsigned getLongDoubleAlign() const { return LongDoubleAlign; } 182b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner const llvm::fltSemantics &getLongDoubleFormat() const { 183b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner return *LongDoubleFormat; 184cd4fc42896f926ffc081e1c4a8bf4cd647883c14Chris Lattner } 1851eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1865f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /// getIntMaxTWidth - Return the size of intmax_t and uintmax_t for this 1871eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump /// target, in bits. 1880eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattner unsigned getIntMaxTWidth() const { 1899184646509d015ea66e796113a8c68598681374bChris Lattner return getTypeWidth(IntMaxType); 1905f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer } 1911eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1923fdf4678935b27c3d3fd4eb10bf9f5ab98dc0d99Chris Lattner /// getUserLabelPrefix - This returns the default value of the 1933fdf4678935b27c3d3fd4eb10bf9f5ab98dc0d99Chris Lattner /// __USER_LABEL_PREFIX__ macro, which is the prefix given to user symbols by 1943fdf4678935b27c3d3fd4eb10bf9f5ab98dc0d99Chris Lattner /// default. On most platforms this is "_", but it is "" on some, and "." on 1953fdf4678935b27c3d3fd4eb10bf9f5ab98dc0d99Chris Lattner /// others. 1963fdf4678935b27c3d3fd4eb10bf9f5ab98dc0d99Chris Lattner const char *getUserLabelPrefix() const { 1973fdf4678935b27c3d3fd4eb10bf9f5ab98dc0d99Chris Lattner return UserLabelPrefix; 1983fdf4678935b27c3d3fd4eb10bf9f5ab98dc0d99Chris Lattner } 1991eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 2002b5abf515f9696912452f431c7738691cf97f4f1Chris Lattner /// getTypeName - Return the user string for the specified integer type enum. 2012b5abf515f9696912452f431c7738691cf97f4f1Chris Lattner /// For example, SignedShort -> "short". 2022b5abf515f9696912452f431c7738691cf97f4f1Chris Lattner static const char *getTypeName(IntType T); 2031eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 204b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner /// getTypeConstantSuffix - Return the constant suffix for the specified 205b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner /// integer type enum. For example, SignedLong -> "L". 206b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner static const char *getTypeConstantSuffix(IntType T); 207b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner 2089c4bea1fa7291035325575c02d33552a124d8ef3Chris Lattner ///===---- Other target property query methods --------------------------===// 2091eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 2109c4bea1fa7291035325575c02d33552a124d8ef3Chris Lattner /// getTargetDefines - Appends the target-specific #define values for this 2119c4bea1fa7291035325575c02d33552a124d8ef3Chris Lattner /// target set to the specified buffer. 21233328642a7a8a126918814ddcbcebf83c121ad54Chris Lattner virtual void getTargetDefines(const LangOptions &Opts, 213a99927774d07af9c6f0e1945531eadc910592945Benjamin Kramer MacroBuilder &Builder) const = 0; 2141eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 215b304f77cb621a47221f2aa2d35acdb5c730421ffChris Lattner 2165f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /// getTargetBuiltins - Return information about target-specific builtins for 2175f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /// the current primary target, and info about which builtins are non-portable 2185f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /// across the current set of primary and secondary targets. 2191eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump virtual void getTargetBuiltins(const Builtin::Info *&Records, 2200eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattner unsigned &NumRecords) const = 0; 2215f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer 222d19144b244f86227fcc2b0da794929fe83968dd5Chris Lattner /// getVAListDeclaration - Return the declaration to use for 223d19144b244f86227fcc2b0da794929fe83968dd5Chris Lattner /// __builtin_va_list, which is target-specific. 2240eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattner virtual const char *getVAListDeclaration() const = 0; 225fb5e5ba3c7708f3aef4db0ed30e8470b3ed4206aAnders Carlsson 2263346ae6bba10da0d08c8d548134ddab4e13d040fAnders Carlsson /// isValidGCCRegisterName - Returns whether the passed in string 2273346ae6bba10da0d08c8d548134ddab4e13d040fAnders Carlsson /// is a valid register name according to GCC. This is used by Sema for 2283346ae6bba10da0d08c8d548134ddab4e13d040fAnders Carlsson /// inline asm statements. 2293346ae6bba10da0d08c8d548134ddab4e13d040fAnders Carlsson bool isValidGCCRegisterName(const char *Name) const; 230d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6Anders Carlsson 231d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6Anders Carlsson // getNormalizedGCCRegisterName - Returns the "normalized" GCC register name. 232d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6Anders Carlsson // For example, on x86 it will return "ax" when "eax" is passed in. 233d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6Anders Carlsson const char *getNormalizedGCCRegisterName(const char *Name) const; 2341eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 23544def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner struct ConstraintInfo { 23644def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner enum { 23744def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner CI_None = 0x00, 23844def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner CI_AllowsMemory = 0x01, 23944def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner CI_AllowsRegister = 0x02, 240fa780fc4a4983003633c9b560387266101839923Chris Lattner CI_ReadWrite = 0x04, // "+r" output constraint (read and write). 241fa780fc4a4983003633c9b560387266101839923Chris Lattner CI_HasMatchingInput = 0x08 // This output operand has a matching input. 24244def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner }; 24344def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner unsigned Flags; 24444def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner int TiedOperand; 2451eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 2462819fa85651526d59ade4fdc9da2cadd7b132973Chris Lattner std::string ConstraintStr; // constraint: "=rm" 2472819fa85651526d59ade4fdc9da2cadd7b132973Chris Lattner std::string Name; // Operand name: [foo] with no []'s. 248432c86969eced2ce658b3f3f2aa7407c8864f21bChris Lattner public: 2492819fa85651526d59ade4fdc9da2cadd7b132973Chris Lattner ConstraintInfo(const char *str, unsigned strlen, const std::string &name) 2502819fa85651526d59ade4fdc9da2cadd7b132973Chris Lattner : Flags(0), TiedOperand(-1), ConstraintStr(str, str+strlen), Name(name) {} 2512819fa85651526d59ade4fdc9da2cadd7b132973Chris Lattner explicit ConstraintInfo(const std::string &Str, const std::string &name) 2522819fa85651526d59ade4fdc9da2cadd7b132973Chris Lattner : Flags(0), TiedOperand(-1), ConstraintStr(Str), Name(name) {} 253432c86969eced2ce658b3f3f2aa7407c8864f21bChris Lattner 254432c86969eced2ce658b3f3f2aa7407c8864f21bChris Lattner const std::string &getConstraintStr() const { return ConstraintStr; } 2552819fa85651526d59ade4fdc9da2cadd7b132973Chris Lattner const std::string &getName() const { return Name; } 25644def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner bool isReadWrite() const { return (Flags & CI_ReadWrite) != 0; } 25744def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner bool allowsRegister() const { return (Flags & CI_AllowsRegister) != 0; } 25844def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner bool allowsMemory() const { return (Flags & CI_AllowsMemory) != 0; } 2591eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 260fa780fc4a4983003633c9b560387266101839923Chris Lattner /// hasMatchingInput - Return true if this output operand has a matching 261fa780fc4a4983003633c9b560387266101839923Chris Lattner /// (tied) input operand. 262fa780fc4a4983003633c9b560387266101839923Chris Lattner bool hasMatchingInput() const { return (Flags & CI_HasMatchingInput) != 0; } 2631eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 264fa780fc4a4983003633c9b560387266101839923Chris Lattner /// hasTiedOperand() - Return true if this input operand is a matching 265fa780fc4a4983003633c9b560387266101839923Chris Lattner /// constraint that ties it to an output operand. If this returns true, 266fa780fc4a4983003633c9b560387266101839923Chris Lattner /// then getTiedOperand will indicate which output operand this is tied to. 26744def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner bool hasTiedOperand() const { return TiedOperand != -1; } 26844def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner unsigned getTiedOperand() const { 26944def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner assert(hasTiedOperand() && "Has no tied operand!"); 27044def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner return (unsigned)TiedOperand; 27144def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner } 2721eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 27344def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner void setIsReadWrite() { Flags |= CI_ReadWrite; } 27444def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner void setAllowsMemory() { Flags |= CI_AllowsMemory; } 27544def070435a2b5d67f0534f7a3a85a7389d60f2Chris Lattner void setAllowsRegister() { Flags |= CI_AllowsRegister; } 276fa780fc4a4983003633c9b560387266101839923Chris Lattner void setHasMatchingInput() { Flags |= CI_HasMatchingInput; } 2771eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 278d68876176a0d2c19e3864e7d38f6036c4f72f0a3Chris Lattner /// setTiedOperand - Indicate that this is an input operand that is tied to 279d68876176a0d2c19e3864e7d38f6036c4f72f0a3Chris Lattner /// the specified output operand. Copy over the various constraint 280d68876176a0d2c19e3864e7d38f6036c4f72f0a3Chris Lattner /// information from the output. 281d68876176a0d2c19e3864e7d38f6036c4f72f0a3Chris Lattner void setTiedOperand(unsigned N, ConstraintInfo &Output) { 282fa780fc4a4983003633c9b560387266101839923Chris Lattner Output.setHasMatchingInput(); 283d68876176a0d2c19e3864e7d38f6036c4f72f0a3Chris Lattner Flags = Output.Flags; 284d68876176a0d2c19e3864e7d38f6036c4f72f0a3Chris Lattner TiedOperand = N; 285d68876176a0d2c19e3864e7d38f6036c4f72f0a3Chris Lattner // Don't copy Name or constraint string. 286d68876176a0d2c19e3864e7d38f6036c4f72f0a3Chris Lattner } 287d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6Anders Carlsson }; 288d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6Anders Carlsson 289d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6Anders Carlsson // validateOutputConstraint, validateInputConstraint - Checks that 290d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6Anders Carlsson // a constraint is valid and provides information about it. 291d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6Anders Carlsson // FIXME: These should return a real error instead of just true/false. 292432c86969eced2ce658b3f3f2aa7407c8864f21bChris Lattner bool validateOutputConstraint(ConstraintInfo &Info) const; 2932819fa85651526d59ade4fdc9da2cadd7b132973Chris Lattner bool validateInputConstraint(ConstraintInfo *OutputConstraints, 2942819fa85651526d59ade4fdc9da2cadd7b132973Chris Lattner unsigned NumOutputs, 29545b050e72d058131e6f169fe54888bb91a003fb5Anders Carlsson ConstraintInfo &info) const; 29642e1ee0702d8267d632df0fdb5c479a582877c6fAnders Carlsson bool resolveSymbolicName(const char *&Name, 2972819fa85651526d59ade4fdc9da2cadd7b132973Chris Lattner ConstraintInfo *OutputConstraints, 2982819fa85651526d59ade4fdc9da2cadd7b132973Chris Lattner unsigned NumOutputs, unsigned &Index) const; 2991eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 3000eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattner virtual std::string convertConstraint(const char Constraint) const { 3010eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattner return std::string(1, Constraint); 3020eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattner } 3031eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 304d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6Anders Carlsson // Returns a string of target-specific clobbers, in LLVM format. 3050eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattner virtual const char *getClobbers() const = 0; 3061eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 3077a4718e813e5e99d478567a482217c7eef8572c5Devang Patel 3081752ee4849f4c37f5e03193e658be92650b0e65aDaniel Dunbar /// getTriple - Return the target triple of the primary target. 3091752ee4849f4c37f5e03193e658be92650b0e65aDaniel Dunbar const llvm::Triple &getTriple() const { 3101752ee4849f4c37f5e03193e658be92650b0e65aDaniel Dunbar return Triple; 3110eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattner } 3121eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 313ae3607684c5978dc2d877141015056c9d24f17eaTed Kremenek const char *getTargetDescription() const { 314364af81157a81cf34bb058a7d5b0185020e5164bSanjiv Gupta return DescriptionString; 3157a4718e813e5e99d478567a482217c7eef8572c5Devang Patel } 3163346ae6bba10da0d08c8d548134ddab4e13d040fAnders Carlsson 3173346ae6bba10da0d08c8d548134ddab4e13d040fAnders Carlsson struct GCCRegAlias { 3183346ae6bba10da0d08c8d548134ddab4e13d040fAnders Carlsson const char * const Aliases[5]; 3193346ae6bba10da0d08c8d548134ddab4e13d040fAnders Carlsson const char * const Register; 3203346ae6bba10da0d08c8d548134ddab4e13d040fAnders Carlsson }; 3212621fd1d6d3c5eadcae246859f62738645df7540Chris Lattner 322dcb4a1a6dd55fdf6c073d2761096f42e26be105aDaniel Dunbar virtual bool useGlobalsForAutomaticVariables() const { return false; } 323dcb4a1a6dd55fdf6c073d2761096f42e26be105aDaniel Dunbar 3246d7d8398e71a8bd121d3b46e250f1dbcfb9679d4Daniel Dunbar /// getUnicodeStringSection - Return the section to use for unicode 3256d7d8398e71a8bd121d3b46e250f1dbcfb9679d4Daniel Dunbar /// string literals, or 0 if no special section is used. 3261eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump virtual const char *getUnicodeStringSection() const { 327a9668e0b4c451a1021fe650c451b54dc98c2d18dDaniel Dunbar return 0; 328a9668e0b4c451a1021fe650c451b54dc98c2d18dDaniel Dunbar } 329a9668e0b4c451a1021fe650c451b54dc98c2d18dDaniel Dunbar 3306d7d8398e71a8bd121d3b46e250f1dbcfb9679d4Daniel Dunbar /// getCFStringSection - Return the section to use for CFString 3318e5c2b8072f4409c7c0004331d1db9652d5209c0Daniel Dunbar /// literals, or 0 if no special section is used. 3321eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump virtual const char *getCFStringSection() const { 3338e5c2b8072f4409c7c0004331d1db9652d5209c0Daniel Dunbar return "__DATA,__cfstring"; 3348e5c2b8072f4409c7c0004331d1db9652d5209c0Daniel Dunbar } 3358e5c2b8072f4409c7c0004331d1db9652d5209c0Daniel Dunbar 336797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner /// isValidSectionSpecifier - This is an optional hook that targets can 337797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner /// implement to perform semantic checking on attribute((section("foo"))) 338797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner /// specifiers. In this case, "foo" is passed in to be checked. If the 339797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner /// section specifier is invalid, the backend should return a non-empty string 340797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner /// that indicates the problem. 341797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner /// 342797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner /// This hook is a simple quality of implementation feature to catch errors 343797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner /// and give good diagnostics in cases when the assembler or code generator 344797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner /// would otherwise reject the section specifier. 345797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner /// 346797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner virtual std::string isValidSectionSpecifier(const llvm::StringRef &SR) const { 347797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner return ""; 348797c3c4f5dc4fda735e55c6b5d6270a54cf6d263Chris Lattner } 3498e5c2b8072f4409c7c0004331d1db9652d5209c0Daniel Dunbar 350a6fda124bf380479529d6a80b84b62cacd3cb707John Thompson /// setForcedLangOptions - Set forced language options. 351a6fda124bf380479529d6a80b84b62cacd3cb707John Thompson /// Apply changes to the target information with respect to certain 352a6fda124bf380479529d6a80b84b62cacd3cb707John Thompson /// language options which change the target configuration. 353a6fda124bf380479529d6a80b84b62cacd3cb707John Thompson virtual void setForcedLangOptions(LangOptions &Opts); 354a6fda124bf380479529d6a80b84b62cacd3cb707John Thompson 355868bd0aa9281929ef50d2e9a8c82a036906f53f5Daniel Dunbar /// getDefaultFeatures - Get the default set of target features for 356868bd0aa9281929ef50d2e9a8c82a036906f53f5Daniel Dunbar /// the \args CPU; this should include all legal feature strings on 357868bd0aa9281929ef50d2e9a8c82a036906f53f5Daniel Dunbar /// the target. 3581eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump virtual void getDefaultFeatures(const std::string &CPU, 35917ca3638e852ba81f389e9f896ed0420b52ae606Daniel Dunbar llvm::StringMap<bool> &Features) const { 36017ca3638e852ba81f389e9f896ed0420b52ae606Daniel Dunbar } 36117ca3638e852ba81f389e9f896ed0420b52ae606Daniel Dunbar 362018ba5ab0671d9b6eefecaffc118c869bea151a1Daniel Dunbar /// getABI - Get the ABI in use. 363018ba5ab0671d9b6eefecaffc118c869bea151a1Daniel Dunbar virtual const char *getABI() const { 364018ba5ab0671d9b6eefecaffc118c869bea151a1Daniel Dunbar return ""; 365018ba5ab0671d9b6eefecaffc118c869bea151a1Daniel Dunbar } 366018ba5ab0671d9b6eefecaffc118c869bea151a1Daniel Dunbar 367eac7c53f16bc12bcd9baac756b6f9bb77b74b0adDaniel Dunbar /// setCPU - Target the specific CPU. 368eac7c53f16bc12bcd9baac756b6f9bb77b74b0adDaniel Dunbar /// 369eac7c53f16bc12bcd9baac756b6f9bb77b74b0adDaniel Dunbar /// \return - False on error (invalid CPU name). 370eac7c53f16bc12bcd9baac756b6f9bb77b74b0adDaniel Dunbar // 371eac7c53f16bc12bcd9baac756b6f9bb77b74b0adDaniel Dunbar // FIXME: Remove this. 372eac7c53f16bc12bcd9baac756b6f9bb77b74b0adDaniel Dunbar virtual bool setCPU(const std::string &Name) { 373eac7c53f16bc12bcd9baac756b6f9bb77b74b0adDaniel Dunbar return true; 374eac7c53f16bc12bcd9baac756b6f9bb77b74b0adDaniel Dunbar } 375eac7c53f16bc12bcd9baac756b6f9bb77b74b0adDaniel Dunbar 37673b79596bac6f6169e5979d0c7241924259d2a76Daniel Dunbar /// setABI - Use the specific ABI. 37773b79596bac6f6169e5979d0c7241924259d2a76Daniel Dunbar /// 37873b79596bac6f6169e5979d0c7241924259d2a76Daniel Dunbar /// \return - False on error (invalid ABI name). 37973b79596bac6f6169e5979d0c7241924259d2a76Daniel Dunbar virtual bool setABI(const std::string &Name) { 38073b79596bac6f6169e5979d0c7241924259d2a76Daniel Dunbar return false; 38173b79596bac6f6169e5979d0c7241924259d2a76Daniel Dunbar } 38273b79596bac6f6169e5979d0c7241924259d2a76Daniel Dunbar 38317ca3638e852ba81f389e9f896ed0420b52ae606Daniel Dunbar /// setFeatureEnabled - Enable or disable a specific target feature, 38417ca3638e852ba81f389e9f896ed0420b52ae606Daniel Dunbar /// the feature name must be valid. 38517ca3638e852ba81f389e9f896ed0420b52ae606Daniel Dunbar /// 38617ca3638e852ba81f389e9f896ed0420b52ae606Daniel Dunbar /// \return - False on error (invalid feature name). 38717ca3638e852ba81f389e9f896ed0420b52ae606Daniel Dunbar virtual bool setFeatureEnabled(llvm::StringMap<bool> &Features, 38817ca3638e852ba81f389e9f896ed0420b52ae606Daniel Dunbar const std::string &Name, 38917ca3638e852ba81f389e9f896ed0420b52ae606Daniel Dunbar bool Enabled) const { 39017ca3638e852ba81f389e9f896ed0420b52ae606Daniel Dunbar return false; 391868bd0aa9281929ef50d2e9a8c82a036906f53f5Daniel Dunbar } 392868bd0aa9281929ef50d2e9a8c82a036906f53f5Daniel Dunbar 39329a790ba422cfeeea9546b6e76777d98fa73cd67Daniel Dunbar /// HandleTargetOptions - Perform initialization based on the user configured 39429a790ba422cfeeea9546b6e76777d98fa73cd67Daniel Dunbar /// set of features (e.g., +sse4). The list is guaranteed to have at most one 39529a790ba422cfeeea9546b6e76777d98fa73cd67Daniel Dunbar /// entry per feature. 396b93292ab7f2b3d43a9e0ad6421f572d1f5a323b4Daniel Dunbar /// 397b93292ab7f2b3d43a9e0ad6421f572d1f5a323b4Daniel Dunbar /// The target may modify the features list, to change which options are 398b93292ab7f2b3d43a9e0ad6421f572d1f5a323b4Daniel Dunbar /// passed onwards to the backend. 399b93292ab7f2b3d43a9e0ad6421f572d1f5a323b4Daniel Dunbar virtual void HandleTargetFeatures(std::vector<std::string> &Features) { 40016167a6e3f7dfb7ed0babc5e0baab9fd140e959dChris Lattner } 401264a76cdf382c507f4d43e64c89f1503f003ac95Anton Korobeynikov 402264a76cdf382c507f4d43e64c89f1503f003ac95Anton Korobeynikov // getRegParmMax - Returns maximal number of args passed in registers. 403264a76cdf382c507f4d43e64c89f1503f003ac95Anton Korobeynikov unsigned getRegParmMax() const { 404264a76cdf382c507f4d43e64c89f1503f003ac95Anton Korobeynikov return RegParmMax; 405264a76cdf382c507f4d43e64c89f1503f003ac95Anton Korobeynikov } 406264a76cdf382c507f4d43e64c89f1503f003ac95Anton Korobeynikov 40721fb98ee003e992b0c4e204d98a19e0ef544cae3Chris Lattner /// isTLSSupported - Whether the target supports thread-local storage. 4086a3bc6df36848188e9d0c1d978170c2b0918c6a3Chris Lattner bool isTLSSupported() const { 409b030f0272500c6c5602f587ac029ee0dc0e5a05cEli Friedman return TLSSupported; 410b030f0272500c6c5602f587ac029ee0dc0e5a05cEli Friedman } 41121fb98ee003e992b0c4e204d98a19e0ef544cae3Chris Lattner 41221fb98ee003e992b0c4e204d98a19e0ef544cae3Chris Lattner /// getEHDataRegisterNumber - Return the register number that 41321fb98ee003e992b0c4e204d98a19e0ef544cae3Chris Lattner /// __builtin_eh_return_regno would return with the specified argument. 41421fb98ee003e992b0c4e204d98a19e0ef544cae3Chris Lattner virtual int getEHDataRegisterNumber(unsigned RegNo) const { 41521fb98ee003e992b0c4e204d98a19e0ef544cae3Chris Lattner return -1; 41621fb98ee003e992b0c4e204d98a19e0ef544cae3Chris Lattner } 41721fb98ee003e992b0c4e204d98a19e0ef544cae3Chris Lattner 418b030f0272500c6c5602f587ac029ee0dc0e5a05cEli Friedman 4190eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattnerprotected: 4200e5d4ef3155651af17a90fdc07d9f80b33935c0cChris Lattner virtual uint64_t getPointerWidthV(unsigned AddrSpace) const { 4210e5d4ef3155651af17a90fdc07d9f80b33935c0cChris Lattner return PointerWidth; 4220e5d4ef3155651af17a90fdc07d9f80b33935c0cChris Lattner } 4230e5d4ef3155651af17a90fdc07d9f80b33935c0cChris Lattner virtual uint64_t getPointerAlignV(unsigned AddrSpace) const { 4240e5d4ef3155651af17a90fdc07d9f80b33935c0cChris Lattner return PointerAlign; 4250e5d4ef3155651af17a90fdc07d9f80b33935c0cChris Lattner } 42631fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta virtual enum IntType getPtrDiffTypeV(unsigned AddrSpace) const { 42731fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta return PtrDiffType; 42831fc07df7f0fc89ebf83ca05a20b29de45a7598dSanjiv Gupta } 4291eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump virtual void getGCCRegNames(const char * const *&Names, 4300eaed12e634dfd14f44620f63b8d3276fed028ddChris Lattner unsigned &NumNames) const = 0; 4311eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump virtual void getGCCRegAliases(const GCCRegAlias *&Aliases, 4323346ae6bba10da0d08c8d548134ddab4e13d040fAnders Carlsson unsigned &NumAliases) const = 0; 4331eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump virtual bool validateAsmConstraint(const char *&Name, 434d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6Anders Carlsson TargetInfo::ConstraintInfo &info) const= 0; 4355f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer}; 4365f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer 4375f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer} // end namespace clang 4385f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer 4395f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer#endif 440