]> granicus.if.org Git - clang/commit
Fix segmentation fault when mixing -Rpass with #line.
authorDiego Novillo <dnovillo@google.com>
Thu, 8 May 2014 13:49:54 +0000 (13:49 +0000)
committerDiego Novillo <dnovillo@google.com>
Thu, 8 May 2014 13:49:54 +0000 (13:49 +0000)
commit459bb10b61a5492e2840993d73905b97ca3375ed
treeca4f8340390202f8dd051c6962b9f08919fa44fb
parentc52c190c1e790317e6448902fbf08511fb6c1789
Fix segmentation fault when mixing -Rpass with #line.

Summary:
When using #line directives, FileManager::getFile() will return a nil
entry. This triggers an assert in translateFileLineCol().

This patch handles nil FileEntry instances by emitting a note that the
location could not be translated back to a SourceLocation. I don't
really like this solution, but we are translating presumed locations,
so some information has already been lost.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D3625

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208315 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticFrontendKinds.td
lib/CodeGen/CodeGenAction.cpp
test/Frontend/optimization-remark-line-directive.c [new file with mode: 0644]