summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2016-03-04 19:00:41 +0000
committerJames Y Knight <jyknight@google.com>2016-03-04 19:00:41 +0000
commitb214cbc7852fa1719c5d0bd3ccb9615481e03c55 (patch)
treee5fe189f5192242789a8887dcf64d3af79258831 /clang/lib/CodeGen/BackendUtil.cpp
parent31f251f1f0acae8864d08a07be4b190cea2ed4b5 (diff)
downloadbcm5719-llvm-b214cbc7852fa1719c5d0bd3ccb9615481e03c55.tar.gz
bcm5719-llvm-b214cbc7852fa1719c5d0bd3ccb9615481e03c55.zip
Make TargetInfo store an actual DataLayout instead of a string.
Use it to calculate UserLabelPrefix, instead of specifying it (often incorrectly). Note that the *actual* user label prefix has always come from the DataLayout, and is handled within LLVM. The main thing clang's TargetInfo::UserLabelPrefix did was to set the #define value. Having these be different from each-other is just silly. Differential Revision: http://reviews.llvm.org/D17183 llvm-svn: 262737
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 6c957cdd355..d5a8b1e4715 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -710,22 +710,22 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
void clang::EmitBackendOutput(DiagnosticsEngine &Diags,
const CodeGenOptions &CGOpts,
const clang::TargetOptions &TOpts,
- const LangOptions &LOpts, StringRef TDesc,
+ const LangOptions &LOpts, const llvm::DataLayout &TDesc,
Module *M, BackendAction Action,
raw_pwrite_stream *OS) {
EmitAssemblyHelper AsmHelper(Diags, CGOpts, TOpts, LOpts, M);
AsmHelper.EmitAssembly(Action, OS);
- // If an optional clang TargetInfo description string was passed in, use it to
- // verify the LLVM TargetMachine's DataLayout.
- if (AsmHelper.TM && !TDesc.empty()) {
+ // Verify clang's TargetInfo DataLayout against the LLVM TargetMachine's
+ // DataLayout.
+ if (AsmHelper.TM) {
std::string DLDesc = M->getDataLayout().getStringRepresentation();
- if (DLDesc != TDesc) {
+ if (DLDesc != TDesc.getStringRepresentation()) {
unsigned DiagID = Diags.getCustomDiagID(
DiagnosticsEngine::Error, "backend data layout '%0' does not match "
"expected target description '%1'");
- Diags.Report(DiagID) << DLDesc << TDesc;
+ Diags.Report(DiagID) << DLDesc << TDesc.getStringRepresentation();
}
}
}
OpenPOWER on IntegriCloud