зеркало из 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;
|
unsigned &NumNames) const = 0;
|
||||||
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
|
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
|
||||||
unsigned &NumAliases) const = 0;
|
unsigned &NumAliases) const = 0;
|
||||||
virtual bool validateAsmConstraint(char c,
|
virtual bool validateAsmConstraint(const char *&Name,
|
||||||
TargetInfo::ConstraintInfo &info) const= 0;
|
TargetInfo::ConstraintInfo &info) const= 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ bool TargetInfo::validateOutputConstraint(const char *Name,
|
||||||
while (*Name) {
|
while (*Name) {
|
||||||
switch (*Name) {
|
switch (*Name) {
|
||||||
default:
|
default:
|
||||||
if (!validateAsmConstraint(*Name, info)) {
|
if (!validateAsmConstraint(Name, info)) {
|
||||||
// FIXME: We temporarily return false
|
// FIXME: We temporarily return false
|
||||||
// so we can add more constraints as we hit it.
|
// so we can add more constraints as we hit it.
|
||||||
// Eventually, an unknown constraint should just be treated as 'g'.
|
// 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
|
// The constraint should have the same info as the respective
|
||||||
// output constraint.
|
// output constraint.
|
||||||
info = (ConstraintInfo)(info|OutputConstraints[i]);
|
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
|
// FIXME: This error return is in place temporarily so we can
|
||||||
// add more constraints as we hit it. Eventually, an unknown
|
// add more constraints as we hit it. Eventually, an unknown
|
||||||
// constraint should just be treated as 'g'.
|
// constraint should just be treated as 'g'.
|
||||||
|
|
|
@ -279,9 +279,9 @@ public:
|
||||||
unsigned &NumNames) const;
|
unsigned &NumNames) const;
|
||||||
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
|
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
|
||||||
unsigned &NumAliases) const;
|
unsigned &NumAliases) const;
|
||||||
virtual bool validateAsmConstraint(char c,
|
virtual bool validateAsmConstraint(const char *&Name,
|
||||||
TargetInfo::ConstraintInfo &info) const {
|
TargetInfo::ConstraintInfo &info) const {
|
||||||
switch (c) {
|
switch (*Name) {
|
||||||
default: return false;
|
default: return false;
|
||||||
case 'O': // Zero
|
case 'O': // Zero
|
||||||
return true;
|
return true;
|
||||||
|
@ -491,7 +491,7 @@ public:
|
||||||
Aliases = GCCRegAliases;
|
Aliases = GCCRegAliases;
|
||||||
NumAliases = llvm::array_lengthof(GCCRegAliases);
|
NumAliases = llvm::array_lengthof(GCCRegAliases);
|
||||||
}
|
}
|
||||||
virtual bool validateAsmConstraint(char c,
|
virtual bool validateAsmConstraint(const char *&Name,
|
||||||
TargetInfo::ConstraintInfo &info) const;
|
TargetInfo::ConstraintInfo &info) const;
|
||||||
virtual std::string convertConstraint(const char Constraint) const;
|
virtual std::string convertConstraint(const char Constraint) const;
|
||||||
virtual const char *getClobbers() const {
|
virtual const char *getClobbers() const {
|
||||||
|
@ -500,9 +500,9 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
bool
|
bool
|
||||||
X86TargetInfo::validateAsmConstraint(char c,
|
X86TargetInfo::validateAsmConstraint(const char *&Name,
|
||||||
TargetInfo::ConstraintInfo &info) const {
|
TargetInfo::ConstraintInfo &info) const {
|
||||||
switch (c) {
|
switch (*Name) {
|
||||||
default: return false;
|
default: return false;
|
||||||
case 'a': // eax.
|
case 'a': // eax.
|
||||||
case 'b': // ebx.
|
case 'b': // ebx.
|
||||||
|
@ -782,10 +782,10 @@ public:
|
||||||
Aliases = 0;
|
Aliases = 0;
|
||||||
NumAliases = 0;
|
NumAliases = 0;
|
||||||
}
|
}
|
||||||
virtual bool validateAsmConstraint(char c,
|
virtual bool validateAsmConstraint(const char *&Name,
|
||||||
TargetInfo::ConstraintInfo &info) const {
|
TargetInfo::ConstraintInfo &info) const {
|
||||||
// FIXME: Check if this is complete
|
// FIXME: Check if this is complete
|
||||||
switch (c) {
|
switch (*Name) {
|
||||||
default:
|
default:
|
||||||
case 'l': // r0-r7
|
case 'l': // r0-r7
|
||||||
case 'h': // r8-r15
|
case 'h': // r8-r15
|
||||||
|
@ -847,7 +847,7 @@ public:
|
||||||
unsigned &NumNames) const;
|
unsigned &NumNames) const;
|
||||||
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
|
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
|
||||||
unsigned &NumAliases) const;
|
unsigned &NumAliases) const;
|
||||||
virtual bool validateAsmConstraint(char c,
|
virtual bool validateAsmConstraint(const char *&Name,
|
||||||
TargetInfo::ConstraintInfo &info) const {
|
TargetInfo::ConstraintInfo &info) const {
|
||||||
// FIXME: Implement!
|
// FIXME: Implement!
|
||||||
return false;
|
return false;
|
||||||
|
@ -958,7 +958,7 @@ namespace {
|
||||||
virtual const char *getTargetPrefix() const {return "";}
|
virtual const char *getTargetPrefix() const {return "";}
|
||||||
virtual void getGCCRegNames(const char * const *&Names,
|
virtual void getGCCRegNames(const char * const *&Names,
|
||||||
unsigned &NumNames) const {}
|
unsigned &NumNames) const {}
|
||||||
virtual bool validateAsmConstraint(char c,
|
virtual bool validateAsmConstraint(const char *&Name,
|
||||||
TargetInfo::ConstraintInfo &info) const {
|
TargetInfo::ConstraintInfo &info) const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче