]> granicus.if.org Git - clang/commitdiff
Rename FunctionDecl::isInline/setInline to
authorDouglas Gregor <dgregor@apple.com>
Tue, 27 Oct 2009 21:01:01 +0000 (21:01 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 27 Oct 2009 21:01:01 +0000 (21:01 +0000)
FunctionDecl::isInlineSpecified/setInlineSpecified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h
include/clang/Frontend/DeclXML.def
lib/AST/Decl.cpp
lib/AST/DeclPrinter.cpp
lib/CodeGen/CodeGenModule.cpp
lib/Frontend/PCHReaderDecl.cpp
lib/Frontend/PCHWriterDecl.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp

index 8efd5527169e1e5f7a75c3bb1758cc7ac678e4dd..8fbddadc5f807d0d7f16f68469b62194c1190711 100644 (file)
@@ -1044,8 +1044,12 @@ public:
   StorageClass getStorageClass() const { return StorageClass(SClass); }
   void setStorageClass(StorageClass SC) { SClass = SC; }
 
-  bool isInline() const { return IsInline; }
-  void setInline(bool I) { IsInline = I; }
+  /// \brief Determine whether the "inline" keyword was specified for this
+  /// function.
+  bool isInlineSpecified() const { return IsInline; }
+                       
+  /// Set whether the "inline" keyword was specified for this function.
+  void setInlineSpecified(bool I) { IsInline = I; }
 
   bool isInlineDefinitionExternallyVisible() const;
                        
index 36323c260c9a3f8e8ce16c1fd74da2427afdf835..8b80d1dc11d8cbfd5bf2b81a2efcca796cef28bf 100644 (file)
@@ -99,7 +99,7 @@ NODE_XML(FunctionDecl, "Function")
          ENUM_XML(FunctionDecl::Static, "static")
          ENUM_XML(FunctionDecl::PrivateExtern, "__private_extern__")
   END_ENUM_XML
-  ATTRIBUTE_OPT_XML(isInline(), "inline")
+  ATTRIBUTE_OPT_XML(isInlineSpecified(), "inline")
   //ATTRIBUTE_OPT_XML(isVariadic(), "variadic")       // in the type reference
   ATTRIBUTE_XML(getNumParams(), "num_args")
   SUB_NODE_SEQUENCE_XML(ParmVarDecl)
@@ -113,7 +113,7 @@ NODE_XML(CXXMethodDecl, "CXXMethodDecl")
   ATTRIBUTE_XML(getNameAsString(), "name")
   TYPE_ATTRIBUTE_XML(getType()->getAs<FunctionType>()->getResultType())
   ATTRIBUTE_XML(getType()->getAs<FunctionType>(), "function_type")
-  ATTRIBUTE_OPT_XML(isInline(), "inline")
+  ATTRIBUTE_OPT_XML(isInlineSpecified(), "inline")
   ATTRIBUTE_OPT_XML(isStatic(), "static")       
   ATTRIBUTE_OPT_XML(isVirtual(), "virtual")       
   ATTRIBUTE_XML(getNumParams(), "num_args")
index 7b0a84c397185dcd3f5bec7b35b4a06eb1db01b6..5dccb435a5af755e6e0c4b24a46bd54fb1fe4ba2 100644 (file)
@@ -661,7 +661,7 @@ unsigned FunctionDecl::getMinRequiredArguments() const {
 /// externally visible symbol.
 bool FunctionDecl::isInlineDefinitionExternallyVisible() const {
   assert(isThisDeclarationADefinition() && "Must have the function definition");
-  assert(isInline() && "Function must be inline");
+  assert(isInlineSpecified() && "Function must be inline");
   
   if (!getASTContext().getLangOptions().C99 || hasAttr<GNUInlineAttr>()) {
     // GNU inline semantics. Based on a number of examples, we came up with the
@@ -673,7 +673,7 @@ bool FunctionDecl::isInlineDefinitionExternallyVisible() const {
     for (redecl_iterator Redecl = redecls_begin(), RedeclEnd = redecls_end();
          Redecl != RedeclEnd;
          ++Redecl) {
-      if (Redecl->isInline() && Redecl->getStorageClass() != Extern)
+      if (Redecl->isInlineSpecified() && Redecl->getStorageClass() != Extern)
         return true;
     }
     
@@ -692,7 +692,7 @@ bool FunctionDecl::isInlineDefinitionExternallyVisible() const {
     if (!Redecl->getLexicalDeclContext()->isTranslationUnit())
       continue;
     
-    if (!Redecl->isInline() || Redecl->getStorageClass() == Extern) 
+    if (!Redecl->isInlineSpecified() || Redecl->getStorageClass() == Extern) 
       return true; // Not an inline definition
   }
   
@@ -786,7 +786,7 @@ bool FunctionDecl::isImplicitlyInstantiable() const {
   if (!Pattern || !PatternDecl)
     return true;
 
-  return PatternDecl->isInline() || 
+  return PatternDecl->isInlineSpecified() || 
     (isa<CXXMethodDecl>(PatternDecl) && !PatternDecl->isOutOfLine());
 }                      
    
index 7ef30c3bb34fd8eaec09ae9571dc2d0485d2072f..d9d195016bf30939e0c3758dbbfdd30f7fc6f2d7 100644 (file)
@@ -323,7 +323,7 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
     case FunctionDecl::PrivateExtern: Out << "__private_extern__ "; break;
     }
 
-    if (D->isInline())           Out << "inline ";
+    if (D->isInlineSpecified())           Out << "inline ";
     if (D->isVirtualAsWritten()) Out << "virtual ";
   }
 
index 1cee3bb501f2175a8e02fd47f970cde5692e20cb..dd31663983bb54cf73292b1e2a6d7d02a6db5517 100644 (file)
@@ -262,7 +262,7 @@ GetLinkageForFunction(ASTContext &Context, const FunctionDecl *FD,
 
   if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
     // C++ member functions defined inside the class are always inline.
-    if (MD->isInline() || !MD->isOutOfLine())
+    if (MD->isInlineSpecified() || !MD->isOutOfLine())
       return CodeGenModule::GVA_CXXInline;
 
     return External;
@@ -272,7 +272,7 @@ GetLinkageForFunction(ASTContext &Context, const FunctionDecl *FD,
   if (FD->getStorageClass() == FunctionDecl::Static)
     return CodeGenModule::GVA_Internal;
 
-  if (!FD->isInline())
+  if (!FD->isInlineSpecified())
     return External;
 
   if (!Features.CPlusPlus || FD->hasAttr<GNUInlineAttr>()) {
index c3690fb7a16e9db9842f3d56a324695aaa0a6c1f..b9ece21f74c3e52dae756f538df34c9bdfd9d29b 100644 (file)
@@ -162,7 +162,7 @@ void PCHDeclReader::VisitFunctionDecl(FunctionDecl *FD) {
   FD->setPreviousDeclaration(
                    cast_or_null<FunctionDecl>(Reader.GetDecl(Record[Idx++])));
   FD->setStorageClass((FunctionDecl::StorageClass)Record[Idx++]);
-  FD->setInline(Record[Idx++]);
+  FD->setInlineSpecified(Record[Idx++]);
   FD->setVirtualAsWritten(Record[Idx++]);
   FD->setPure(Record[Idx++]);
   FD->setHasInheritedPrototype(Record[Idx++]);
index f1853f49a64a8af59ba1f4c4675bde3c577a55d5..8997e661a5a1d20b1c07fe6d1eb12cd0a7c26f25 100644 (file)
@@ -161,7 +161,7 @@ void PCHDeclWriter::VisitFunctionDecl(FunctionDecl *D) {
     Writer.AddStmt(D->getBody());
   Writer.AddDeclRef(D->getPreviousDeclaration(), Record);
   Record.push_back(D->getStorageClass()); // FIXME: stable encoding
-  Record.push_back(D->isInline());
+  Record.push_back(D->isInlineSpecified());
   Record.push_back(D->isVirtualAsWritten());
   Record.push_back(D->isPure());
   Record.push_back(D->hasInheritedPrototype());
index 36f95a455a90741117c16fb4e8c4a36e3e78613e..48b5c2838e0bc9c12a1082944b67c87103644793 100644 (file)
@@ -3102,7 +3102,7 @@ void Sema::CheckMain(FunctionDecl* FD) {
   // C99 6.7.4p4:  In a hosted environment, the inline function specifier
   //   shall not appear in a declaration of main.
   // static main is not an error under C99, but we should warn about it.
-  bool isInline = FD->isInline();
+  bool isInline = FD->isInlineSpecified();
   bool isStatic = FD->getStorageClass() == FunctionDecl::Static;
   if (isInline || isStatic) {
     unsigned diagID = diag::warn_unusual_main_decl;
index 090a6cd540b4f9a04d3063fbe9de753875a64b78..3995e9b11e9b627da51aaae7bf5580c73406793d 100644 (file)
@@ -901,7 +901,7 @@ static void HandleDLLImportAttr(Decl *D, const AttributeList &Attr, Sema &S) {
 
   // Currently, the dllimport attribute is ignored for inlined functions.
   // Warning is emitted.
-  if (FD->isInline()) {
+  if (FD->isInlineSpecified()) {
     S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "dllimport";
     return;
   }
@@ -946,7 +946,7 @@ static void HandleDLLExportAttr(Decl *D, const AttributeList &Attr, Sema &S) {
 
   // Currently, the dllexport attribute is ignored for inlined functions, unless
   // the -fkeep-inline-functions flag has been used. Warning is emitted;
-  if (FD->isInline()) {
+  if (FD->isInlineSpecified()) {
     // FIXME: ... unless the -fkeep-inline-functions flag has been used.
     S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "dllexport";
     return;
@@ -1693,7 +1693,7 @@ static void HandleGNUInlineAttr(Decl *d, const AttributeList &Attr, Sema &S) {
     return;
   }
 
-  if (!Fn->isInline()) {
+  if (!Fn->isInlineSpecified()) {
     S.Diag(Attr.getLoc(), diag::warn_gnu_inline_attribute_requires_inline);
     return;
   }
index 8606fb034ba0dfe387cd3726c23c3aac3d749abd..290df94861697d649635e0369142d4a758184017 100644 (file)
@@ -530,7 +530,7 @@ Decl *TemplateDeclInstantiator::VisitCXXRecordDecl(CXXRecordDecl *D) {
       FunctionDecl::Create(SemaRef.Context, DC, D->getLocation(),
                            D->getDeclName(), T, D->getDeclaratorInfo(),
                            D->getStorageClass(),
-                           D->isInline(), D->hasWrittenPrototype());
+                           D->isInlineSpecified(), D->hasWrittenPrototype());
   Function->setLexicalDeclContext(Owner);
 
   // Attach the parameters
@@ -666,14 +666,14 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D,
                                         Name, T,
                                         Constructor->getDeclaratorInfo(),
                                         Constructor->isExplicit(),
-                                        Constructor->isInline(), false);
+                                        Constructor->isInlineSpecified(), false);
   } else if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>(D)) {
     QualType ClassTy = SemaRef.Context.getTypeDeclType(Record);
     Name = SemaRef.Context.DeclarationNames.getCXXDestructorName(
                                    SemaRef.Context.getCanonicalType(ClassTy));
     Method = CXXDestructorDecl::Create(SemaRef.Context, Record,
                                        Destructor->getLocation(), Name,
-                                       T, Destructor->isInline(), false);
+                                       T, Destructor->isInlineSpecified(), false);
   } else if (CXXConversionDecl *Conversion = dyn_cast<CXXConversionDecl>(D)) {
     CanQualType ConvTy
       = SemaRef.Context.getCanonicalType(
@@ -683,12 +683,12 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D,
     Method = CXXConversionDecl::Create(SemaRef.Context, Record,
                                        Conversion->getLocation(), Name,
                                        T, Conversion->getDeclaratorInfo(),
-                                       Conversion->isInline(),
+                                       Conversion->isInlineSpecified(),
                                        Conversion->isExplicit());
   } else {
     Method = CXXMethodDecl::Create(SemaRef.Context, Record, D->getLocation(),
                                    D->getDeclName(), T, D->getDeclaratorInfo(),
-                                   D->isStatic(), D->isInline());
+                                   D->isStatic(), D->isInlineSpecified());
   }
 
   if (TemplateParams) {
@@ -1127,7 +1127,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
   //   to which they refer.
   if (Function->getTemplateSpecializationKind()
         == TSK_ExplicitInstantiationDeclaration &&
-      PatternDecl->isOutOfLine() && !PatternDecl->isInline())
+      PatternDecl->isOutOfLine() && !PatternDecl->isInlineSpecified())
     return;
 
   InstantiatingTemplate Inst(*this, PointOfInstantiation, Function);