[cfe-commits] r71589 - /cfe/trunk/lib/Sema/SemaDecl.cpp

Chris Lattner sabre at nondot.org
Tue May 12 13:55:08 PDT 2009


Author: lattner
Date: Tue May 12 15:55:07 2009
New Revision: 71589

URL: http://llvm.org/viewvc/llvm-project?rev=71589&view=rev
Log:
Method who have definitions in structs/classes are semantically inline.
Per the FIXME, it might be interesting to track whether the inline keyword
was also used on the method, but for now we don't do this.  Testcase pending.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=71589&r1=71588&r2=71589&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue May 12 15:55:07 2009
@@ -2067,6 +2067,13 @@
     }
     
     // This is a C++ method declaration.
+    
+    // FIXME: All inline method declarations are semantically inline.  We
+    // should add a new bit to keep track of whether they were declared with an
+    // inline keyword as well.
+    if (CurContext == DC && IsFunctionDefinition)
+      isInline = true;
+    
     NewFD = CXXMethodDecl::Create(Context, cast<CXXRecordDecl>(DC),
                                   D.getIdentifierLoc(), Name, R,
                                   (SC == FunctionDecl::Static), isInline);





More information about the cfe-commits mailing list