aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
-rw-r--r--lib/Frontend/PCHWriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index dc0ee3575c..ae8a589b60 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/lib/Frontend/PCHWriter.cpp
@@ -526,8 +526,9 @@ void PCHWriter::WriteMetadata(ASTContext &Context, const char *isysroot) {
Record.push_back(CLANG_VERSION_MAJOR);
Record.push_back(CLANG_VERSION_MINOR);
Record.push_back(isysroot != 0);
- const char *Triple = Target.getTargetTriple();
- Stream.EmitRecordWithBlob(MetaAbbrevCode, Record, Triple, strlen(Triple));
+ const std::string &TripleStr = Target.getTriple().getTriple();
+ Stream.EmitRecordWithBlob(MetaAbbrevCode, Record,
+ TripleStr.data(), TripleStr.size());
// Original file name
SourceManager &SM = Context.getSourceManager();