diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2017-06-14 10:57:56 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2017-06-14 10:57:56 +0000 |
commit | a4ab1b1c59a8836c152450637ad9e3060ee7680f (patch) | |
tree | 2b98e56c992ac53aae58cc86b7833386f5b8adf2 /clang/lib/Sema/SemaCUDA.cpp | |
parent | 3dcc9e09302ad1e190e0426a0da40f585e4fd2b4 (diff) | |
download | bcm5719-llvm-a4ab1b1c59a8836c152450637ad9e3060ee7680f.tar.gz bcm5719-llvm-a4ab1b1c59a8836c152450637ad9e3060ee7680f.zip |
Reverted 305379 (Function with unparsed body is a definition)
It broke clang-x86_64-linux-selfhost-modules-2 and some other buildbots.
llvm-svn: 305381
Diffstat (limited to 'clang/lib/Sema/SemaCUDA.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCUDA.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCUDA.cpp b/clang/lib/Sema/SemaCUDA.cpp index cac5f682275..b938ac387c4 100644 --- a/clang/lib/Sema/SemaCUDA.cpp +++ b/clang/lib/Sema/SemaCUDA.cpp @@ -629,6 +629,12 @@ static bool IsKnownEmitted(Sema &S, FunctionDecl *FD) { // emitted, because (say) the definition could include "inline". FunctionDecl *Def = FD->getDefinition(); + // We may currently be parsing the body of FD, in which case + // FD->getDefinition() will be null, but we still want to treat FD as though + // it's a definition. + if (!Def && FD->willHaveBody()) + Def = FD; + if (Def && !isDiscardableGVALinkage(S.getASTContext().GetGVALinkageForFunction(Def))) return true; |