diff options
author | Yaron Keren <yaron.keren@gmail.com> | 2016-07-13 19:04:51 +0000 |
---|---|---|
committer | Yaron Keren <yaron.keren@gmail.com> | 2016-07-13 19:04:51 +0000 |
commit | 18c3d0674e4ac0f821a4cf6f9257e7523fd0773b (patch) | |
tree | 1c3943a10b3cb091b277895048ea4989ed5c834d /clang/lib/Sema/SemaLookup.cpp | |
parent | eff2aa70fc4cbe49afd17745be24c0f882e673e2 (diff) | |
download | bcm5719-llvm-18c3d0674e4ac0f821a4cf6f9257e7523fd0773b.tar.gz bcm5719-llvm-18c3d0674e4ac0f821a4cf6f9257e7523fd0773b.zip |
Implement FunctionDecl::getDefinition() to be consistent with
VarDecl, TagDecl, EnumDecl, RecordDecl, CXXRecordDecl.
Use getDefinition in two locations to make the code more readable.
llvm-svn: 275303
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index 9160a3f6741..e2550824fb6 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -4936,8 +4936,8 @@ void Sema::diagnoseTypo(const TypoCorrection &Correction, static NamedDecl *getDefinitionToImport(NamedDecl *D) { if (VarDecl *VD = dyn_cast<VarDecl>(D)) return VD->getDefinition(); - if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) - return FD->isDefined(FD) ? const_cast<FunctionDecl*>(FD) : nullptr; + if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) + return FD->getDefinition(); if (TagDecl *TD = dyn_cast<TagDecl>(D)) return TD->getDefinition(); if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(D)) |