diff options
author | Stuart Hastings <stuart@apple.com> | 2011-06-07 23:45:05 +0000 |
---|---|---|
committer | Stuart Hastings <stuart@apple.com> | 2011-06-07 23:45:05 +0000 |
commit | 7fdc6707acf52ec1e6ff9a7b6fe2b871718b2969 (patch) | |
tree | 3f8189cea234c007a6eb4cad3656c2ca8e546b3c /clang/lib/Basic/Targets.cpp | |
parent | 87717773e26109639710093665d2c192b1b169e8 (diff) | |
download | bcm5719-llvm-7fdc6707acf52ec1e6ff9a7b6fe2b871718b2969.tar.gz bcm5719-llvm-7fdc6707acf52ec1e6ff9a7b6fe2b871718b2969.zip |
Clang support for ARM Uv/Uy/Uq inline-asm constraints.
rdar://problem/9037836
llvm-svn: 132737
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r-- | clang/lib/Basic/Targets.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 779c99532cb..82f5df1cf1f 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -1121,7 +1121,7 @@ public: } virtual bool validateAsmConstraint(const char *&Name, 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 { return "~{dirflag},~{fpsr},~{flags}"; } @@ -1449,8 +1449,8 @@ X86TargetInfo::validateAsmConstraint(const char *&Name, std::string -X86TargetInfo::convertConstraint(const char Constraint) const { - switch (Constraint) { +X86TargetInfo::convertConstraint(const char *&Constraint) const { + switch (*Constraint) { case 'a': return std::string("{ax}"); case 'b': return std::string("{bx}"); case 'c': return std::string("{cx}"); @@ -1464,7 +1464,7 @@ X86TargetInfo::convertConstraint(const char Constraint) const { case 'u': // second from top of floating point stack. return std::string("{st(1)}"); // second from top of floating point stack. default: - return std::string(1, Constraint); + return std::string(1, *Constraint); } } } // end anonymous namespace @@ -2037,9 +2037,31 @@ public: case 'P': // VFP Floating point register double precision Info.setAllowsRegister(); return true; + case 'U': // a memory reference... + switch (Name[1]) { + case 'q': // ...ARMV4 ldrsb + case 'v': // ...VFP load/store (reg+constant offset) + case 'y': // ...iWMMXt load/store + Info.setAllowsMemory(); + Name++; + return true; + } } return false; } + std::string + virtual convertConstraint(const char *&Constraint) const { + std::string R; + switch (*Constraint) { + case 'U': // Two-character constraint; add "^" hint for later parsing. + R = std::string("^") + Constraint; + Constraint++; + break; + default: + return std::string(1, *Constraint); + } + return R; + } virtual const char *getClobbers() const { // FIXME: Is this really right? return ""; |