зеркало из https://github.com/microsoft/clang-1.git
TargetInfo::validateAsmConstraint now takes a reference to the full constraints string. This will make it possible to support multi-character constraints. No functionality change (for now).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65696 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
ebf6443a4f
Коммит
066d2ea752
|
@ -263,7 +263,7 @@ protected:
|
|||
unsigned &NumNames) const = 0;
|
||||
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
|
||||
unsigned &NumAliases) const = 0;
|
||||
virtual bool validateAsmConstraint(char c,
|
||||
virtual bool validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &info) const= 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ bool TargetInfo::validateOutputConstraint(const char *Name,
|
|||
while (*Name) {
|
||||
switch (*Name) {
|
||||
default:
|
||||
if (!validateAsmConstraint(*Name, info)) {
|
||||
if (!validateAsmConstraint(Name, info)) {
|
||||
// FIXME: We temporarily return false
|
||||
// so we can add more constraints as we hit it.
|
||||
// Eventually, an unknown constraint should just be treated as 'g'.
|
||||
|
@ -258,7 +258,7 @@ bool TargetInfo::validateInputConstraint(const char *Name,
|
|||
// The constraint should have the same info as the respective
|
||||
// output constraint.
|
||||
info = (ConstraintInfo)(info|OutputConstraints[i]);
|
||||
} else if (!validateAsmConstraint(*Name, info)) {
|
||||
} else if (!validateAsmConstraint(Name, info)) {
|
||||
// FIXME: This error return is in place temporarily so we can
|
||||
// add more constraints as we hit it. Eventually, an unknown
|
||||
// constraint should just be treated as 'g'.
|
||||
|
|
|
@ -279,9 +279,9 @@ public:
|
|||
unsigned &NumNames) const;
|
||||
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
|
||||
unsigned &NumAliases) const;
|
||||
virtual bool validateAsmConstraint(char c,
|
||||
virtual bool validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &info) const {
|
||||
switch (c) {
|
||||
switch (*Name) {
|
||||
default: return false;
|
||||
case 'O': // Zero
|
||||
return true;
|
||||
|
@ -491,7 +491,7 @@ public:
|
|||
Aliases = GCCRegAliases;
|
||||
NumAliases = llvm::array_lengthof(GCCRegAliases);
|
||||
}
|
||||
virtual bool validateAsmConstraint(char c,
|
||||
virtual bool validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &info) const;
|
||||
virtual std::string convertConstraint(const char Constraint) const;
|
||||
virtual const char *getClobbers() const {
|
||||
|
@ -500,9 +500,9 @@ public:
|
|||
};
|
||||
|
||||
bool
|
||||
X86TargetInfo::validateAsmConstraint(char c,
|
||||
X86TargetInfo::validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &info) const {
|
||||
switch (c) {
|
||||
switch (*Name) {
|
||||
default: return false;
|
||||
case 'a': // eax.
|
||||
case 'b': // ebx.
|
||||
|
@ -782,10 +782,10 @@ public:
|
|||
Aliases = 0;
|
||||
NumAliases = 0;
|
||||
}
|
||||
virtual bool validateAsmConstraint(char c,
|
||||
virtual bool validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &info) const {
|
||||
// FIXME: Check if this is complete
|
||||
switch (c) {
|
||||
switch (*Name) {
|
||||
default:
|
||||
case 'l': // r0-r7
|
||||
case 'h': // r8-r15
|
||||
|
@ -847,7 +847,7 @@ public:
|
|||
unsigned &NumNames) const;
|
||||
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
|
||||
unsigned &NumAliases) const;
|
||||
virtual bool validateAsmConstraint(char c,
|
||||
virtual bool validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &info) const {
|
||||
// FIXME: Implement!
|
||||
return false;
|
||||
|
@ -958,7 +958,7 @@ namespace {
|
|||
virtual const char *getTargetPrefix() const {return "";}
|
||||
virtual void getGCCRegNames(const char * const *&Names,
|
||||
unsigned &NumNames) const {}
|
||||
virtual bool validateAsmConstraint(char c,
|
||||
virtual bool validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &info) const {
|
||||
return true;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче