From: Rafael Espindola Date: Sun, 15 Jul 2012 01:05:36 +0000 (+0000) Subject: Make const the argument of getDefinition. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b044c6bc71d1fdce8998af09cf08b026fdd2189;p=clang Make const the argument of getDefinition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160226 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 11d8931320..ea032ac28e 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1754,12 +1754,12 @@ bool Sema::mergeDeclAttribute(Decl *D, InheritableAttr *Attr) { return false; } -static const Decl *getDefinition(Decl *D) { - if (TagDecl *TD = dyn_cast(D)) +static const Decl *getDefinition(const Decl *D) { + if (const TagDecl *TD = dyn_cast(D)) return TD->getDefinition(); - if (VarDecl *VD = dyn_cast(D)) + if (const VarDecl *VD = dyn_cast(D)) return VD->getDefinition(); - if (FunctionDecl *FD = dyn_cast(D)) { + if (const FunctionDecl *FD = dyn_cast(D)) { const FunctionDecl* Def; if (FD->hasBody(Def)) return Def;