summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorToma Tabacu <toma.tabacu@imgtec.com>2014-12-17 12:02:58 +0000
committerToma Tabacu <toma.tabacu@imgtec.com>2014-12-17 12:02:58 +0000
commit9941195a9ff05d1f29955473e0f50655803f8e92 (patch)
tree72018851c3433c2eb7a2f67a698fb37c418d7b98 /clang/lib/Basic/Targets.cpp
parent636fefe25260e5a62f048d5c24d28dbf8596ad9e (diff)
downloadbcm5719-llvm-9941195a9ff05d1f29955473e0f50655803f8e92.tar.gz
bcm5719-llvm-9941195a9ff05d1f29955473e0f50655803f8e92.zip
[mips] Always clobber $1 for MIPS inline asm.
Summary: Because GCC doesn't use $1 for code generation, inline assembly code can use $1 without having to add it to the clobbers list. LLVM, on the other hand, does not shy away from using $1, and this can cause conflicts with inline assembly which assumes GCC-like code generation. A solution to this problem is to make Clang automatically clobber $1 for all MIPS inline assembly. This is not the optimal solution, but it seems like a necessary compromise, for now. Reviewers: dsanders Reviewed By: dsanders Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6638 llvm-svn: 224428
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r--clang/lib/Basic/Targets.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 5eda616f6a9..7d069ee667f 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -5749,8 +5749,7 @@ public:
}
const char *getClobbers() const override {
- // FIXME: Implement!
- return "";
+ return "~{$1}";
}
bool handleTargetFeatures(std::vector<std::string> &Features,
OpenPOWER on IntegriCloud