cling/lib/Interpreter/DeviceKernelInliner.cpp
Simeon Ehrig ad8d5e1137 Changes for Pull Request #284
- add Author to CUDA test cases
- optimize DeviceKernelInliner
- improve some comments
- remove deprecated opt level variables
- change interface of IncrementalCUDADeviceCompiler::process() IncrementalCUDADeviceCompiler::declare()
2019-11-07 19:29:15 +01:00

30 lines
930 B
C++

//--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// author: Simeon Ehrig <s.ehrig@hzdr.de>
//
// This file is dual-licensed: you can choose to license it under the University
// of Illinois Open Source License or the GNU Lesser General Public License. See
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
#include "DeviceKernelInliner.h"
#include <clang/AST/Attr.h>
#include <llvm/Support/Casting.h>
namespace cling {
DeviceKernelInliner::DeviceKernelInliner(clang::Sema *S) : ASTTransformer(S) {}
ASTTransformer::Result DeviceKernelInliner::Transform(clang::Decl *D) {
if (clang::FunctionDecl* F = llvm::dyn_cast<clang::FunctionDecl>(D)) {
if (F->hasAttr<clang::CUDADeviceAttr>()) {
F->setInlineSpecified(true);
}
}
return Result(D, true);
}
} // namespace cling