[cfe-commits] r81590 - in /cfe/trunk: include/clang/AST/Decl.h lib/AST/Decl.cpp lib/AST/Expr.cpp lib/Analysis/GRExprEngine.cpp lib/CodeGen/CGExpr.cpp lib/Sema/SemaChecking.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaExpr.cpp

Douglas Gregor dgregor at apple.com
Fri Sep 11 17:22:51 PDT 2009


Author: dgregor
Date: Fri Sep 11 19:22:50 2009
New Revision: 81590

URL: http://llvm.org/viewvc/llvm-project?rev=81590&view=rev
Log:
Remove unnecessary ASTContext parameter from FunctionDecl::isBuiltinID

Modified:
    cfe/trunk/include/clang/AST/Decl.h
    cfe/trunk/lib/AST/Decl.cpp
    cfe/trunk/lib/AST/Expr.cpp
    cfe/trunk/lib/Analysis/GRExprEngine.cpp
    cfe/trunk/lib/CodeGen/CGExpr.cpp
    cfe/trunk/lib/Sema/SemaChecking.cpp
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=81590&r1=81589&r2=81590&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Fri Sep 11 19:22:50 2009
@@ -974,7 +974,7 @@
 
   virtual FunctionDecl *getCanonicalDecl();
 
-  unsigned getBuiltinID(ASTContext &Context) const;
+  unsigned getBuiltinID() const;
 
   unsigned getNumParmVarDeclsFromType() const;
 

Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=81590&r1=81589&r2=81590&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Fri Sep 11 19:22:50 2009
@@ -502,7 +502,8 @@
 /// will be 0 for functions that do not correspond to a builtin, a
 /// value of type \c Builtin::ID if in the target-independent range
 /// \c [1,Builtin::First), or a target-specific builtin value.
-unsigned FunctionDecl::getBuiltinID(ASTContext &Context) const {
+unsigned FunctionDecl::getBuiltinID() const {
+  ASTContext &Context = getASTContext();
   if (!getIdentifier() || !getIdentifier()->getBuiltinID())
     return 0;
 

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=81590&r1=81589&r2=81590&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Fri Sep 11 19:22:50 2009
@@ -325,7 +325,7 @@
   if (!FDecl->getIdentifier())
     return 0;
 
-  return FDecl->getBuiltinID(Context);
+  return FDecl->getBuiltinID();
 }
 
 QualType CallExpr::getCallReturnType() const {

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=81590&r1=81589&r2=81590&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Fri Sep 11 19:22:50 2009
@@ -1537,7 +1537,7 @@
   if (!FD)
     return false;
 
-  unsigned id = FD->getBuiltinID(getContext());
+  unsigned id = FD->getBuiltinID();
   if (!id)
     return false;
 

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=81590&r1=81589&r2=81590&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Fri Sep 11 19:22:50 2009
@@ -1202,7 +1202,7 @@
     if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(CE->getSubExpr())) {
       TargetDecl = DRE->getDecl();
       if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(TargetDecl))
-        if (unsigned builtinID = FD->getBuiltinID(getContext()))
+        if (unsigned builtinID = FD->getBuiltinID())
           return EmitBuiltinExpr(FD, builtinID, E);
     }
   }

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Fri Sep 11 19:22:50 2009
@@ -323,7 +323,7 @@
   // values (0, 1 or 2) followed by a potentially empty varags list of stuff
   // that we ignore.  Find out which row of BuiltinIndices to read from as well
   // as the number of fixed args.
-  unsigned BuiltinID = FDecl->getBuiltinID(Context);
+  unsigned BuiltinID = FDecl->getBuiltinID();
   unsigned BuiltinIndex, NumFixed = 1;
   switch (BuiltinID) {
   default: assert(0 && "Unknown overloaded atomic builtin!");

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Sep 11 19:22:50 2009
@@ -879,7 +879,7 @@
 
   // A function that has already been declared has been redeclared or defined
   // with a different type- show appropriate diagnostic
-  if (unsigned BuiltinID = Old->getBuiltinID(Context)) {
+  if (unsigned BuiltinID = Old->getBuiltinID()) {
     // The user has declared a builtin function with an incompatible
     // signature.
     if (Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID)) {
@@ -3602,7 +3602,7 @@
   }
 
   // Builtin functions cannot be defined.
-  if (unsigned BuiltinID = FD->getBuiltinID(Context)) {
+  if (unsigned BuiltinID = FD->getBuiltinID()) {
     if (!Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID)) {
       Diag(FD->getLocation(), diag::err_builtin_definition) << FD;
       FD->setInvalidDecl();
@@ -3859,7 +3859,7 @@
 
   // If this is a built-in function, map its builtin attributes to
   // actual attributes.
-  if (unsigned BuiltinID = FD->getBuiltinID(Context)) {
+  if (unsigned BuiltinID = FD->getBuiltinID()) {
     // Handle printf-formatting attributes.
     unsigned FormatIdx;
     bool HasVAListArg;

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Sep 11 19:22:50 2009
@@ -2879,7 +2879,7 @@
   if (Ovl || FunctionTemplate ||
       (getLangOptions().CPlusPlus && (FDecl || UnqualifiedName))) {
     // We don't perform ADL for implicit declarations of builtins.
-    if (FDecl && FDecl->getBuiltinID(Context) && FDecl->isImplicit())
+    if (FDecl && FDecl->getBuiltinID() && FDecl->isImplicit())
       ADL = false;
 
     // We don't perform ADL in C.
@@ -2999,7 +2999,7 @@
     if (CheckFunctionCall(FDecl, TheCall.get()))
       return ExprError();
 
-    if (unsigned BuiltinID = FDecl->getBuiltinID(Context))
+    if (unsigned BuiltinID = FDecl->getBuiltinID())
       return CheckBuiltinFunctionCall(BuiltinID, TheCall.take());
   } else if (NDecl) {
     if (CheckBlockCall(NDecl, TheCall.get()))





More information about the cfe-commits mailing list