diff options
author | Amara Emerson <amara.emerson@arm.com> | 2016-11-10 14:44:30 +0000 |
---|---|---|
committer | Amara Emerson <amara.emerson@arm.com> | 2016-11-10 14:44:30 +0000 |
commit | 652795db166b08b83f32449944ceea728850b141 (patch) | |
tree | 850c605ebc154614a44263c639a58ef180f8703f /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 7723f97d6ad076112cc78d9bd2d43050e7dda8a5 (diff) | |
download | bcm5719-llvm-652795db166b08b83f32449944ceea728850b141.tar.gz bcm5719-llvm-652795db166b08b83f32449944ceea728850b141.zip |
Add the loop end location to the loop metadata. This additional information
can be used to improve the locations when generating remarks for loops.
Depends on the companion LLVM change r286227.
Patch by Florian Hahn.
Differential Revision: https://reviews.llvm.org/D25764
llvm-svn: 286456
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 538b50d56d4..aac8f0af860 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -2080,3 +2080,10 @@ void CodeGenFunction::EmitSanitizerStatReport(llvm::SanitizerStatKind SSK) { IRB.SetCurrentDebugLocation(Builder.getCurrentDebugLocation()); CGM.getSanStats().create(IRB, SSK); } + +llvm::DebugLoc CodeGenFunction::SourceLocToDebugLoc(SourceLocation Location) { + if (CGDebugInfo *DI = getDebugInfo()) + return DI->SourceLocToDebugLoc(Location); + + return llvm::DebugLoc(); +} |