diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-12 00:22:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-12 00:22:50 +0000 |
commit | 15fc956ca0936fb8ac06c463093ee0ed4a2262cb (patch) | |
tree | 2baf055af35c5debcc5c395d9a88e2b8c5d5b678 /clang/lib | |
parent | 16618f2157100d72e59301892ab035911963d1ee (diff) | |
download | bcm5719-llvm-15fc956ca0936fb8ac06c463093ee0ed4a2262cb.tar.gz bcm5719-llvm-15fc956ca0936fb8ac06c463093ee0ed4a2262cb.zip |
Remove unnecessary ASTContext parameter from FunctionDecl::isBuiltinID
llvm-svn: 81590
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 3 | ||||
-rw-r--r-- | clang/lib/AST/Expr.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 4 |
7 files changed, 11 insertions, 10 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index ab8de1d5fea..444ee4a7770 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -502,7 +502,8 @@ bool FunctionDecl::isGlobal() const { /// 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; diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index fb79f4d0f24..fa020de7a37 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -325,7 +325,7 @@ unsigned CallExpr::isBuiltinCall(ASTContext &Context) const { if (!FDecl->getIdentifier()) return 0; - return FDecl->getBuiltinID(Context); + return FDecl->getBuiltinID(); } QualType CallExpr::getCallReturnType() const { diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index c4ca0ea9c13..8214199f42c 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/lib/Analysis/GRExprEngine.cpp @@ -1537,7 +1537,7 @@ bool GRExprEngine::EvalBuiltinFunction(const FunctionDecl *FD, CallExpr *CE, if (!FD) return false; - unsigned id = FD->getBuiltinID(getContext()); + unsigned id = FD->getBuiltinID(); if (!id) return false; diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 33a84036ef7..c6d5b24b11b 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -1202,7 +1202,7 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E) { 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); } } diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 5faafada50d..a8a6095079f 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -323,7 +323,7 @@ bool Sema::SemaBuiltinAtomicOverloaded(CallExpr *TheCall) { // 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!"); diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index a1bcb638928..40ef66306b3 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -879,7 +879,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) { // 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 @@ Sema::DeclPtrTy Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) { } // 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 @@ void Sema::AddKnownFunctionAttributes(FunctionDecl *FD) { // 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; diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 509f45c7833..11bd323011f 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2879,7 +2879,7 @@ Sema::ActOnCallExpr(Scope *S, ExprArg fn, SourceLocation LParenLoc, 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 @@ Sema::ActOnCallExpr(Scope *S, ExprArg fn, SourceLocation LParenLoc, 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())) |