aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-25 00:32:44 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-25 00:32:44 +0000
commitc6cd9afd15f0f83ee07844e592d2a698416f33ca (patch)
tree277fa0f6d130577f15f543236d5cd2475371860e /lib
parent0ca6e27138e2fe12e03284d4d820182702141a7d (diff)
Revert r166647 to rethink the patch...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Basic/Targets.cpp23
-rw-r--r--lib/Sema/SemaStmtAsm.cpp48
2 files changed, 0 insertions, 71 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 960a2858e4..ba96185f72 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -3315,29 +3315,6 @@ public:
}
return R;
}
- virtual bool validateConstraintModifier(StringRef Constraint,
- const char Modifier,
- unsigned Size) const {
- // Strip off constraint modifiers.
- while (Constraint[0] == '=' ||
- Constraint[0] == '+' ||
- Constraint[0] == '&')
- Constraint = Constraint.substr(1);
-
- switch (Constraint[0]) {
- default: break;
- case 'r': {
- switch (Modifier) {
- default: return Size == 32;
- case 'q':
- // A register of size 32 cannot fit a vector type.
- return false;
- }
- }
- }
-
- return true;
- }
virtual const char *getClobbers() const {
// FIXME: Is this really right?
return "";
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp
index 138d671470..3a5f40c74f 100644
--- a/lib/Sema/SemaStmtAsm.cpp
+++ b/lib/Sema/SemaStmtAsm.cpp
@@ -208,54 +208,6 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
return StmtError();
}
- // Validate constraints and modifiers.
- for (unsigned i = 0, e = Pieces.size(); i != e; ++i) {
- GCCAsmStmt::AsmStringPiece &Piece = Pieces[i];
- if (!Piece.isOperand()) continue;
-
- // Look for the correct constraint index.
- unsigned Idx = 0;
- unsigned ConstraintIdx = 0;
- for (unsigned i = 0, e = NS->getNumOutputs(); i != e; ++i, ++ConstraintIdx) {
- TargetInfo::ConstraintInfo &Info = OutputConstraintInfos[i];
- if (Idx == Piece.getOperandNo())
- break;
- ++Idx;
-
- if (Info.isReadWrite()) {
- if (Idx == Piece.getOperandNo())
- break;
- ++Idx;
- }
- }
-
- for (unsigned i = 0, e = NS->getNumInputs(); i != e; ++i, ++ConstraintIdx) {
- TargetInfo::ConstraintInfo &Info = InputConstraintInfos[i];
- if (Idx == Piece.getOperandNo())
- break;
- ++Idx;
-
- if (Info.isReadWrite()) {
- if (Idx == Piece.getOperandNo())
- break;
- ++Idx;
- }
- }
-
- // Now that we have the right indexes go ahead and check.
- StringLiteral *Literal = Constraints[ConstraintIdx];
- const Type *Ty = Exprs[ConstraintIdx]->getType().getTypePtr();
- if (Ty->isDependentType() || Ty->isIncompleteType())
- continue;
-
- unsigned Size = Context.getTypeSize(Ty);
- if (!Context.getTargetInfo()
- .validateConstraintModifier(Literal->getString(),
- Piece.getModifier(), Size))
- Diag(Exprs[ConstraintIdx]->getLocStart(),
- diag::warn_mismatched_size_modifier);
- }
-
// Validate tied input operands for type mismatches.
for (unsigned i = 0, e = InputConstraintInfos.size(); i != e; ++i) {
TargetInfo::ConstraintInfo &Info = InputConstraintInfos[i];