summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/MicrosoftMangle.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-06-25 05:37:25 +0000
committerZachary Turner <zturner@google.com>2014-06-25 05:37:25 +0000
commit87422d9457c15af46d8f985718fd77c9c92d2b82 (patch)
tree934ecb68dd87750206092b269caa4ed6f0449c11 /clang/lib/AST/MicrosoftMangle.cpp
parentc00d875d35d62a6ae6a02c21e8707a0c6ef43610 (diff)
downloadbcm5719-llvm-87422d9457c15af46d8f985718fd77c9c92d2b82.tar.gz
bcm5719-llvm-87422d9457c15af46d8f985718fd77c9c92d2b82.zip
Don't go through the TypeSourceInfo when getting the SourceRange.
VarDecl provides a method getSourceRange(), which provides a more robust way of getting the SourceRange since the TypeSourceInfo can be null in certain cases. Reviewed by: majnemer Differential Revision: http://reviews.llvm.org/D4281 llvm-svn: 211667
Diffstat (limited to 'clang/lib/AST/MicrosoftMangle.cpp')
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index 33b81693918..c2c8da95c61 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -418,11 +418,11 @@ void MicrosoftCXXNameMangler::mangleVariableEncoding(const VarDecl *VD) {
// ::= <type> <pointee-cvr-qualifiers> # pointers, references
// Pointers and references are odd. The type of 'int * const foo;' gets
// mangled as 'QAHA' instead of 'PAHB', for example.
- TypeLoc TL = VD->getTypeSourceInfo()->getTypeLoc();
+ SourceRange SR = VD->getSourceRange();
QualType Ty = VD->getType();
if (Ty->isPointerType() || Ty->isReferenceType() ||
Ty->isMemberPointerType()) {
- mangleType(Ty, TL.getSourceRange(), QMM_Drop);
+ mangleType(Ty, SR, QMM_Drop);
manglePointerExtQualifiers(
Ty.getDesugaredType(getASTContext()).getLocalQualifiers(), nullptr);
if (const MemberPointerType *MPT = Ty->getAs<MemberPointerType>()) {
@@ -440,7 +440,7 @@ void MicrosoftCXXNameMangler::mangleVariableEncoding(const VarDecl *VD) {
else
mangleQualifiers(Ty.getQualifiers(), false);
} else {
- mangleType(Ty, TL.getSourceRange(), QMM_Drop);
+ mangleType(Ty, SR, QMM_Drop);
mangleQualifiers(Ty.getLocalQualifiers(), false);
}
}
OpenPOWER on IntegriCloud