summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2014-07-25 10:19:47 +0000
committerJames Molloy <james.molloy@arm.com>2014-07-25 10:19:47 +0000
commit8a157bf8f2117371bd9317b3eaf38956afe88781 (patch)
treee64eb91f015eb05d34e3cf28c512e2b76d4da0c2 /clang/lib/Basic
parentb4553da4814e0f0fe8335eda3347c8613f2ece3b (diff)
downloadbcm5719-llvm-8a157bf8f2117371bd9317b3eaf38956afe88781.tar.gz
bcm5719-llvm-8a157bf8f2117371bd9317b3eaf38956afe88781.zip
Revert part of r206963
Specifically the part where we removed a warning to be compatible with GCC, which has been widely regarded as a bad idea. I'm not quite happy with how obtuse this warning is, especially in the fairly common case of a 32-bit integer literal, so I've got another patch awaiting review that adds a fixit to reduce confusion. llvm-svn: 213935
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Targets.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index b0ca5a547c5..e78244d95c6 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -4503,6 +4503,33 @@ public:
return false;
}
+ 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:
+ return true;
+ case 'z':
+ case 'r': {
+ switch (Modifier) {
+ case 'x':
+ case 'w':
+ // For now assume that the person knows what they're
+ // doing with the modifier.
+ return true;
+ default:
+ // By default an 'r' constraint will be in the 'x'
+ // registers.
+ return Size == 64;
+ }
+ }
+ }
+ }
+
virtual const char *getClobbers() const { return ""; }
int getEHDataRegisterNumber(unsigned RegNo) const {
OpenPOWER on IntegriCloud