search for: functiondecl

Displaying 20 results from an estimated 38 matches for "functiondecl".

2012 Mar 27
1
[LLVMdev] Cloning a FunctionDecl?
Hello, Is there a way to clone a FunctionDecl, including the body Stmt if it exists? I want to add an entirely new decl to the AST with its own copy of the body. I would like to start with a completely identical Decl and body, and then modify it to produce a new overload, such that this cloned function would appear in overload resolution for c...
2015 Jun 17
2
[LLVMdev] Inline hint for methods defined in-class
...inline, but not if they are defined in the class body. I tried the following patch, which I believe handles the in-class definition case: --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { if (!CGM.getCodeGenOpts().NoInline) { for (auto RI : FD->redecls()) - if (RI->isInlineSpecified()) { + if (RI->isInlined()) { Fn->addFnAttr(llvm::Attribute::InlineHint); break; } I...
2015 Jun 17
2
[LLVMdev] Inline hint for methods defined in-class
...ed in the class body. I tried the following > patch, which I believe handles the in-class definition > case: > > --- a/lib/CodeGen/CodeGenFunction.cpp > +++ b/lib/CodeGen/CodeGenFunction.cpp > @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, > if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { > if (!CGM.getCodeGenOpts().NoInline) { > for (auto RI : FD->redecls()) > - if (RI->isInlineSpecified()) { > + if (RI->isInlined()) { > Fn->addFnAttr(llvm::Attribute::InlineHint); >...
2015 Jun 24
4
[LLVMdev] Inline hint for methods defined in-class
..., which I believe handles the in-class definition > >> case: > >> > >> --- a/lib/CodeGen/CodeGenFunction.cpp > >> +++ b/lib/CodeGen/CodeGenFunction.cpp > >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { > >> if (!CGM.getCodeGenOpts().NoInline) { > >> for (auto RI : FD->redecls()) > >> - if (RI->isInlineSpecified()) { > >> + if (RI->isInlined()) { > >> Fn->a...
2015 Jun 24
4
[LLVMdev] Inline hint for methods defined in-class
...: >> > >> >> > >> --- a/lib/CodeGen/CodeGenFunction.cpp >> > >> +++ b/lib/CodeGen/CodeGenFunction.cpp >> > >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl >> > >> GD, >> > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> > >> for (auto RI : FD->redecls()) >> > >> - if (RI->isInlineSpecified()) { >> > >> + if (RI->isInlined())...
2015 Jul 07
6
[LLVMdev] Inline hint for methods defined in-class
...ke it easily readable for those reading it through cfe-commits. The proposed patch will add InlineHint to methods defined inside a class: --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { if (!CGM.getCodeGenOpts().NoInline) { for (auto RI : FD->redecls()) - if (RI->isInlineSpecified()) { + if (RI->isInlined()) { Fn->addFnAttr(llvm::Attribute::InlineHint); break; } H...
2015 Jun 24
2
[LLVMdev] Inline hint for methods defined in-class
...t; >> --- a/lib/CodeGen/CodeGenFunction.cpp >> >> > >> +++ b/lib/CodeGen/CodeGenFunction.cpp >> >> > >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl >> >> > >> GD, >> >> > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) >> { >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> > >> for (auto RI : FD->redecls()) >> >> > >> - if (RI->isInlineSpecified()) { >> >> &...
2015 Jun 24
6
[LLVMdev] Inline hint for methods defined in-class
...t; >> --- a/lib/CodeGen/CodeGenFunction.cpp >> >> > >> +++ b/lib/CodeGen/CodeGenFunction.cpp >> >> > >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl >> >> > >> GD, >> >> > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) >> { >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> > >> for (auto RI : FD->redecls()) >> >> > >> - if (RI->isInlineSpecified()) { >> >> &...
2020 Jun 30
5
[RFC] Semi-Automatic clang-format of files with low frequency
...quite small basic style issues, similar to the ones below. MyDeveloperDay - void HandleTranslationUnit(ASTContext& context) override { + void HandleTranslationUnit(ASTContext &context) override { if (!Instance.getLangOpts().DelayedTemplateParsing) return; - std::set<FunctionDecl*> LateParsedDecls; + std::set<FunctionDecl *> LateParsedDecls; On Tue, Jun 30, 2020 at 6:55 PM Matt Arsenault <arsenm2 at gmail.com> wrote: > > > On Jun 28, 2020, at 11:30, MyDeveloper Day via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > I’m a co...
2015 Jun 24
3
[LLVMdev] Inline hint for methods defined in-class
...> >> +++ b/lib/CodeGen/CodeGenFunction.cpp >> >> >> > >> @@ -630,7 +630,7 @@ void >> >> >> > >> CodeGenFunction::StartFunction(GlobalDecl >> >> >> > >> GD, >> >> >> > >> if (const FunctionDecl *FD = >> >> >> > >> dyn_cast_or_null<FunctionDecl>(D)) >> >> { >> >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> >> > >> for (auto RI : FD->redecls()) >> >> >>...
2015 Jun 24
3
[LLVMdev] Inline hint for methods defined in-class
....cpp >> >> >> > >> +++ b/lib/CodeGen/CodeGenFunction.cpp >> >> >> > >> @@ -630,7 +630,7 @@ void >> CodeGenFunction::StartFunction(GlobalDecl >> >> >> > >> GD, >> >> >> > >> if (const FunctionDecl *FD = >> dyn_cast_or_null<FunctionDecl>(D)) >> >> { >> >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> >> > >> for (auto RI : FD->redecls()) >> >> >> > >> - if (RI-&...
2016 Dec 21
2
DeclarationName and the StringRef.
...to append extra string to the decl name and update all his references to the updated name. , So we are constructing the DeclarationName instance as stated below code snap. and from DeclarationName instance ,we are constructing the DeclarationNameInfo and same info used to create decl spec with FunctionDecl::Create () . Question is , How do ,someone instantiate the DeclarationName instance using StringRef ,because in the current trunk code snap ,we see that the DeclarationName can be constructed using the IdentifierInfo or Objc Selector or CXXOperatorId etc as argument in the constructor . The c...
2016 Mar 15
2
[cfe-dev] GSoC AST->XML project still open?
2016 Dec 21
0
DeclarationName and the StringRef.
...e and > update all his references to the updated name. , > > So we are constructing the DeclarationName instance as stated below > code snap. > and from DeclarationName instance ,we are constructing the > DeclarationNameInfo and same info used to create decl spec > with FunctionDecl::Create () . > > Question is , > > How do ,someone instantiate the DeclarationName instance using > StringRef ,because in the current trunk code snap ,we see that > the DeclarationName can be constructed using the IdentifierInfo or > Objc Selector or CXXOperatorId etc as...
2015 Jun 24
2
[LLVMdev] Inline hint for methods defined in-class
...> >> +++ b/lib/CodeGen/CodeGenFunction.cpp >> >> >> > >> @@ -630,7 +630,7 @@ void >> >> >> > >> CodeGenFunction::StartFunction(GlobalDecl >> >> >> > >> GD, >> >> >> > >> if (const FunctionDecl *FD = >> >> >> > >> dyn_cast_or_null<FunctionDecl>(D)) >> >> { >> >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> >> > >> for (auto RI : FD->redecls()) >> >> >>...
2020 Sep 27
3
How to add a new clang-tidy module
...quot;clang/AST/ASTContext.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" + +using namespace clang::ast_matchers; + +namespace clang { +namespace tidy { +namespace misra { + +void M011Check::registerMatchers(MatchFinder *Finder) { + // FIXME: Add matchers. + Finder->addMatcher(functionDecl().bind("x"), this); +} + +void M011Check::check(const MatchFinder::MatchResult &Result) { + // FIXME: Add callback implementation. + const auto *MatchedDecl = Result.Nodes.getNodeAs<FunctionDecl>("x"); + if (!MatchedDecl->getIdentifier() || MatchedDecl->getNam...
2015 Jul 08
9
[LLVMdev] Inline hint for methods defined in-class
...t; >> >> The proposed patch will add InlineHint to methods defined inside a class: >> >> --- a/lib/CodeGen/CodeGenFunction.cpp >> +++ b/lib/CodeGen/CodeGenFunction.cpp >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { >> if (!CGM.getCodeGenOpts().NoInline) { >> for (auto RI : FD->redecls()) >> - if (RI->isInlineSpecified()) { >> + if (RI->isInlined()) { >> Fn->addFnAttr(llvm::Attribute:...
2008 Dec 18
0
[LLVMdev] Troubles with clang and llvm libraries and simple Xcode project
...rning: comparison between signed and unsigned integer expressions /usr/share/bison.simple:626: warning: comparison between signed and unsigned integer expressions ... llvm[4]: Compiling DeclSerialization.cpp for Release build DeclSerialization.cpp: In static member function 'static clang::FunctionDecl* clang::FunctionDecl::CreateImpl (llvm::Deserializer&, clang::ASTContext&)': DeclSerialization.cpp:521: warning: 'numParams' may be used uninitialized in this function .. llvm[2]: Linking Release Shared Library LTO.dylib *** Warning: Linking the shared library /code/llvm/Rele...
2015 Jul 09
2
[LLVMdev] Inline hint for methods defined in-class
...lineHint to methods defined inside a > >> class: > >> > >> --- a/lib/CodeGen/CodeGenFunction.cpp > >> +++ b/lib/CodeGen/CodeGenFunction.cpp > >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl > >> GD, > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { > >> if (!CGM.getCodeGenOpts().NoInline) { > >> for (auto RI : FD->redecls()) > >> - if (RI->isInlineSpecified()) { > >> + if (RI->isInlined()) { > >> Fn->addFnAttr(llvm::Attribute::InlineHint)...
2015 Jun 24
2
[LLVMdev] Inline hint for methods defined in-class
...>> +++ b/lib/CodeGen/CodeGenFunction.cpp >> >> >> >> > >> @@ -630,7 +630,7 @@ void >> >> CodeGenFunction::StartFunction(GlobalDecl >> >> >> >> > >> GD, >> >> >> >> > >> if (const FunctionDecl *FD = >> >> dyn_cast_or_null<FunctionDecl>(D)) >> >> >> { >> >> >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> >> >> > >> for (auto RI : FD->redecls()) >> >> >...