diff options
72 files changed, 1188 insertions, 1363 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 803e5e8dec..f2a56ac17d 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -89,11 +89,11 @@ public: /// arguments. bool isVarArg() const; - /// isExternal - Is the body of this function unknown? (The basic block list - /// is empty if so.) This is true for external functions, defined as forward - /// "declare"ations + /// isDeclaration - Is the body of this function unknown? (The basic block + /// list is empty if so.) This is true for function declarations, but not + /// true for function definitions. /// - virtual bool isExternal() const { return BasicBlocks.empty(); } + virtual bool isDeclaration() const { return BasicBlocks.empty(); } /// getIntrinsicID - This method returns the ID number of the specified /// function, or Intrinsic::not_intrinsic if the function is not an diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index 5b6431837b..b2c9acdaf9 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -113,9 +113,9 @@ public: /// Override from Constant class. virtual void destroyConstant(); - /// isExternal - Return true if the primary definition of this global value is - /// outside of the current translation unit... - virtual bool isExternal() const = 0; + /// isDeclaration - Return true if the primary definition of this global + /// value is outside of the current translation unit... + virtual bool isDeclaration() const = 0; /// getParent - Get the module that this global value is contained inside /// of... diff --git a/include/llvm/GlobalVariable.h b/include/llvm/GlobalVariable.h index 5e31c6bd19..3bf82492bc 100644 --- a/include/llvm/GlobalVariable.h +++ b/include/llvm/GlobalVariable.h @@ -58,17 +58,16 @@ public: Constant *Initializer, const std::string &Name, GlobalVariable *InsertBefore); - /// isExternal - Is this global variable lacking an initializer? If so, the - /// global variable is defined in some other translation unit, and is thus - /// externally defined here. - /// - virtual bool isExternal() const { return getNumOperands() == 0; } + /// isDeclaration - Is this global variable lacking an initializer? If so, + /// the global variable is defined in some other translation unit, and is thus + /// only a declaration here. + virtual bool isDeclaration() const { return getNumOperands() == 0; } /// hasInitializer - Unless a global variable isExternal(), it has an /// initializer. The initializer for the global variable/constant is held by /// Initializer if an initializer is specified. /// - inline bool hasInitializer() const { return !isExternal(); } + inline bool hasInitializer() const { return !isDeclaration(); } /// getInitializer - Return the initializer for this global variable. It is /// illegal to call this method if the global is external, because we cannot diff --git a/lib/Analysis/AliasDebugger.cpp b/lib/Analysis/AliasDebugger.cpp index ddbb7bde4c..d9da70d521 100644 --- a/lib/Analysis/AliasDebugger.cpp +++ b/lib/Analysis/AliasDebugger.cpp @@ -48,7 +48,7 @@ namespace { for(Module::iterator I = M.begin(), E = M.end(); I != E; ++I){ Vals.insert(&*I); - if(!I->isExternal()) { + if(!I->isDeclaration()) { for (Function::arg_iterator AI = I->arg_begin(), AE = I->arg_end(); AI != AE; ++AI) Vals.insert(&*AI); diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index a0c8a798af..2626ce085b 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -823,7 +823,7 @@ static ManagedStatic<std::vector<const char*> > OnlyReadsMemoryTable; AliasAnalysis::ModRefBehavior BasicAliasAnalysis::getModRefBehavior(Function *F, CallSite CS, std::vector<PointerAccessInfo> *Info) { - if (!F->isExternal()) return UnknownModRefBehavior; + if (!F->isDeclaration()) return UnknownModRefBehavior; static bool Initialized = false; if (!Initialized) { diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp index 805e771e54..b6855f6503 100644 --- a/lib/Analysis/IPA/Andersens.cpp +++ b/lib/Analysis/IPA/Andersens.cpp @@ -367,7 +367,7 @@ Andersens::getModRefInfo(CallSite CS, Value *P, unsigned Size) { // program and modify stuff. We ignore this technical niggle for now. This // is, after all, a "research quality" implementation of Andersen's analysis. if (Function *F = CS.getCalledFunction()) - if (F->isExternal()) { + if (F->isDeclaration()) { Node *N1 = getNode(P); if (N1->begin() == N1->end()) @@ -599,7 +599,7 @@ void Andersens::AddConstraintsForNonInternalLinkage(Function *F) { /// constraints and return true. If this is a call to an unknown function, /// return false. bool Andersens::AddConstraintsForExternalCall(CallSite CS, Function *F) { - assert(F->isExternal() && "Not an external function!"); + assert(F->isDeclaration() && "Not an external function!"); // These functions don't induce any points-to constraints. if (F->getName() == "atoi" || F->getName() == "atof" || @@ -724,7 +724,7 @@ void Andersens::CollectConstraints(Module &M) { if (!F->hasInternalLinkage()) AddConstraintsForNonInternalLinkage(F); - if (!F->isExternal()) { + if (!F->isDeclaration()) { // Scan the function body, creating a memory object for each heap/stack // allocation in the body of the function and a node to represent all // pointer values defined by instructions and used as operands. @@ -883,7 +883,7 @@ void Andersens::visitVAArg(VAArgInst &I) { void Andersens::AddConstraintsForCall(CallSite CS, Function *F) { // If this is a call to an external function, handle it directly to get some // taste of context sensitivity. - if (F->isExternal() && AddConstraintsForExternalCall(CS, F)) + if (F->isDeclaration() && AddConstraintsForExternalCall(CS, F)) return; if (isa<PointerType>(CS.getType())) { diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp index dcaeaf9d33..f69696ebc9 100644 --- a/lib/Analysis/IPA/CallGraph.cpp +++ b/lib/Analysis/IPA/CallGraph.cpp @@ -133,7 +133,7 @@ private: // If this function is not defined in this translation unit, it could call // anything. - if (F->isExternal() && !F->getIntrinsicID()) + if (F->isDeclaration() && !F->getIntrinsicID()) Node->addCalledFunction(CallSite(), CallsExternalNode); // Loop over all of the users of the function... looking for callers... diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index e34d03bbdd..6ac040b56f 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/lib/Analysis/IPA/GlobalsModRef.cpp @@ -300,7 +300,7 @@ bool GlobalsModRef::AnalyzeIndirectGlobalMemory(GlobalValue *GV) { // Okay, easy case. } else if (CallInst *CI = dyn_cast<CallInst>(Ptr)) { Function *F = CI->getCalledFunction(); - if (!F || !F->isExternal()) return false; // Too hard to analyze. + if (!F || !F->isDeclaration()) return false; // Too hard to analyze. if (F->getName() != "calloc") return false; // Not calloc. } else { return false; // Too hard to analyze. @@ -341,7 +341,7 @@ void GlobalsModRef::AnalyzeCallGraph(CallGraph &CG, Module &M) { if ((*I).size() != 1) { AnalyzeSCC(*I); } else if (Function *F = (*I)[0]->getFunction()) { - if (!F->isExternal()) { + if (!F->isDeclaration()) { // Nonexternal function. AnalyzeSCC(*I); } else { diff --git a/lib/Analysis/ProfileInfoLoader.cpp b/lib/Analysis/ProfileInfoLoader.cpp index b1ed235c10..23ceb52d8e 100644 --- a/lib/Analysis/ProfileInfoLoader.cpp +++ b/lib/Analysis/ProfileInfoLoader.cpp @@ -164,7 +164,7 @@ void ProfileInfoLoader::getFunctionCounts(std::vector<std::pair<Function*, unsigned Counter = 0; for (Module::iterator I = M.begin(), E = M.end(); I != E && Counter != FunctionCounts.size(); ++I) - if (!I->isExternal()) + if (!I->isDeclaration()) Counts.push_back(std::make_pair(I, FunctionCounts[Counter++])); } diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs index fdd664365b..f11f291e10 100644 --- a/lib/AsmParser/llvmAsmParser.cpp.cvs +++ b/lib/AsmParser/llvmAsmParser.cpp.cvs @@ -1,9 +1,7 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 2.1. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,21 +18,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -47,7 +37,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.3" +#define YYBISON_VERSION "2.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -340,7 +330,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 14 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1230,10 +1220,9 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) { # define YYTOKEN_TABLE 0 #endif -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 885 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" -{ +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 885 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1277,10 +1266,9 @@ typedef union YYSTYPE llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} -/* Line 187 of yacc.c. */ -#line 1283 "llvmAsmParser.tab.c" - YYSTYPE; +} YYSTYPE; +/* Line 196 of yacc.c. */ +#line 1272 "llvmAsmParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1291,56 +1279,23 @@ typedef union YYSTYPE /* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 1296 "llvmAsmParser.tab.c" +/* Line 219 of yacc.c. */ +#line 1284 "llvmAsmParser.tab.c" -#ifdef short -# undef short +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ #endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t #endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t #endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int #endif -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS @@ -1353,32 +1308,7 @@ typedef short int yytype_int16; # endif #endif -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE +#if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -1386,76 +1316,64 @@ YYID (i) # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if defined (__STDC__) || defined (__cplusplus) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif +# define YYINCLUDED_STDLIB_H # endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif +# ifdef __cplusplus +extern "C" { # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H & |