PR21246: DebugInfo: Emit the appropriate type (cv qualifiers, reference-ness, etc...
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 16 Oct 2014 04:21:25 +0000 (04:21 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 16 Oct 2014 04:21:25 +0000 (04:21 +0000)
commit0f62c8d8f8338cbaeb1218e7c3b870439cebd4b9
treee3e452eb7f8d4f643e18e5b151b69af23350d3c5
parent7f52921976906112e9022006a1ca47cf80b16bc6
PR21246: DebugInfo: Emit the appropriate type (cv qualifiers, reference-ness, etc) for non-type template parameters

Plumb through the full QualType of the TemplateArgument::Declaration, as
it's insufficient to only know whether the type is a reference or
pointer (that was necessary for mangling, but insufficient for debug
info). This shouldn't increase the size of TemplateArgument as
TemplateArgument::Integer is still longer by another 32 bits.

Several bits of code were testing that the reference-ness of the
parameters matched, but this seemed to be insufficient (various other
features of the type could've mismatched and wouldn't've been caught)
and unnecessary, at least insofar as removing those tests didn't cause
anything to fail.

(Richard - perchaps you can hypothesize why any of these checks might
need to test reference-ness of the parameters (& explain why
reference-ness is part of the mangling - I would've figured that for the
reference-ness to be different, a prior template argument would have to
be different). I'd be happy to add them in/beef them up and add test
cases if there's a reason for them)

llvm-svn: 219900
12 files changed:
clang/include/clang/AST/TemplateBase.h
clang/lib/AST/ASTContext.cpp
clang/lib/AST/ASTImporter.cpp
clang/lib/AST/ItaniumMangle.cpp
clang/lib/AST/MicrosoftMangle.cpp
clang/lib/AST/TemplateBase.cpp
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/test/CodeGenCXX/debug-info-template.cpp