diff options
80 files changed, 1898 insertions, 1901 deletions
diff --git a/Makefile.rules b/Makefile.rules index f9b1f3d22c..5af82a82ef 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -382,8 +382,8 @@ endif # Options To Invoke Tools #---------------------------------------------------------- -CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused -Wno-long-long \ - -pedantic $(EXTRA_OPTIONS) +CompileCommonOpts := -pedantic -Wall -W -Wwrite-strings -Wno-long-long \ + -Wunused -Wno-unused-parameter $(EXTRA_OPTIONS) ifeq ($(OS),HP-UX) CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 8d4cbdb93d..d974729289 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -399,7 +399,7 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size, } if (V1Size != ~0U && V2Size != ~0U) - if (const User *GEP = isGEP(V1)) { + if (isGEP(V1)) { std::vector<Value*> GEPOperands; const Value *BasePtr = GetGEPOperands(V1, GEPOperands); diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp index 8acbe8e26b..169cd659e5 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/lib/Analysis/DataStructure/DataStructure.cpp @@ -512,7 +512,6 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset, // try merge with NewTy: struct {t1, t2, stuff...} if offset lands exactly on a field in Ty if (isa<StructType>(NewTy) && isa<StructType>(Ty)) { DEBUG(std::cerr << "Ty: " << *Ty << "\nNewTy: " << *NewTy << "@" << Offset << "\n"); - unsigned O = 0; const StructType *STy = cast<StructType>(Ty); const StructLayout &SL = *TD.getStructLayout(STy); unsigned i = SL.getElementContainingOffset(Offset); @@ -537,7 +536,6 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset, //try merge with NewTy: struct : {t1, t2, T} if offset lands on a field in Ty if (isa<StructType>(Ty)) { DEBUG(std::cerr << "Ty: " << *Ty << "\nNewTy: " << *NewTy << "@" << Offset << "\n"); - unsigned O = 0; const StructType *STy = cast<StructType>(Ty); const StructLayout &SL = *TD.getStructLayout(STy); unsigned i = SL.getElementContainingOffset(Offset); @@ -1280,9 +1278,9 @@ DSNode *DSGraph::addObjectToGraph(Value *Ptr, bool UseDeclaredType) { if (GlobalValue *GV = dyn_cast<GlobalValue>(Ptr)) { N->addGlobal(GV); - } else if (MallocInst *MI = dyn_cast<MallocInst>(Ptr)) { + } else if (isa<MallocInst>(Ptr)) { N->setHeapNodeMarker(); - } else if (AllocaInst *AI = dyn_cast<AllocaInst>(Ptr)) { + } else if (isa<AllocaInst>(Ptr)) { N->setAllocaNodeMarker(); } else { assert(0 && "Illegal memory object input!"); @@ -1777,8 +1775,10 @@ static void removeIdenticalCalls(std::list<DSCallSite> &Calls) { // Scan the call list cleaning it up as necessary... DSNodeHandle LastCalleeNode; +#if 0 Function *LastCalleeFunc = 0; unsigned NumDuplicateCalls = 0; +#endif bool LastCalleeContainsExternalFunction = false; unsigned NumDeleted = 0; @@ -2187,7 +2187,6 @@ void DSGraph::removeDeadNodes(unsigned Flags) { } while (Iterate); // Move dead aux function calls to the end of the list - unsigned CurIdx = 0; for (std::list<DSCallSite>::iterator CI = AuxFunctionCalls.begin(), E = AuxFunctionCalls.end(); CI != E; ) if (AuxFCallsAlive.count(&*CI)) diff --git a/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/lib/Analysis/DataStructure/EquivClassGraphs.cpp index 9126ef9814..e28f4210b0 100644 --- a/lib/Analysis/DataStructure/EquivClassGraphs.cpp +++ b/lib/Analysis/DataStructure/EquivClassGraphs.cpp @@ -256,8 +256,6 @@ void EquivClassGraphs::buildIndirectFunctionSets(Module &M) { for (++SI; SI != FuncECs.member_end(); ++SI) { Function *F = *SI; - DSGraph *&FG = DSInfo[F]; - DSGraph &CBUGraph = CBU->getDSGraph(*F); if (GraphsMerged.insert(&CBUGraph).second) { // Record the "folded" graph for the function. diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp index f0bb22c3bc..d9e171bea4 100644 --- a/lib/Analysis/DataStructure/Local.cpp +++ b/lib/Analysis/DataStructure/Local.cpp @@ -409,7 +409,7 @@ void GraphBuilder::visitGetElementPtrInst(User &GEP) { unsigned FieldNo = (unsigned)cast<ConstantInt>(I.getOperand())->getZExtValue(); Offset += (unsigned)TD.getStructLayout(STy)->MemberOffsets[FieldNo]; - } else if (const PointerType *PTy = dyn_cast<PointerType>(*I)) { + } else if (isa<PointerType>(*I)) { if (!isa<Constant>(I.getOperand()) || !cast<Constant>(I.getOperand())->isNullValue()) Value.getNode()->setArrayMarker(); diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp index bb3f25427c..de6cb5a6b2 100644 --- a/lib/Analysis/IPA/Andersens.cpp +++ b/lib/Analysis/IPA/Andersens.cpp @@ -374,7 +374,6 @@ Andersens::getModRefInfo(CallSite CS, Value *P, unsigned Size) { if (Function *F = CS.getCalledFunction()) if (F->isExternal()) { Node *N1 = getNode(P); - bool PointsToUniversalSet = false; if (N1->begin() == N1->end()) return NoModRef; // P doesn't point to anything. diff --git a/lib/AsmParser/Lexer.cpp.cvs b/lib/AsmParser/Lexer.cpp.cvs index 5791e2b1ea..d11bfa03b3 100644 --- a/lib/AsmParser/Lexer.cpp.cvs +++ b/lib/AsmParser/Lexer.cpp.cvs @@ -17,7 +17,7 @@ #define yylineno llvmAsmlineno #line 20 "Lexer.cpp" -/* A lexical scanner generated by flex */ +/* A lexical scanner generated by flex*/ /* Scanner skeleton version: * $Header$ @@ -28,6 +28,7 @@ #define YY_FLEX_MINOR_VERSION 5 #include <stdio.h> +#include <unistd.h> /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ @@ -41,7 +42,6 @@ #ifdef __cplusplus #include <stdlib.h> -#include <unistd.h> /* Use prototypes in function declarations. */ #define YY_USE_PROTOS @@ -153,6 +153,15 @@ extern FILE *yyin, *yyout; #define unput(c) yyunput( c, yytext_ptr ) +/* Some routines like yy_flex_realloc() are emitted as static but are + not called by all lexers. This generates warnings in some compilers, + notably GCC. Arrange to suppress these. */ +#ifdef __GNUC__ +#define YY_MAY_BE_UNUSED __attribute__((unused)) +#else +#define YY_MAY_BE_UNUSED +#endif + /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). @@ -259,7 +268,7 @@ YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED; static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer @@ -308,35 +317,35 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 114 -#define YY_END_OF_BUFFER 115 -static yyconst short int yy_acclist[192] = +#define YY_NUM_RULES 120 +#define YY_END_OF_BUFFER 121 +static yyconst short int yy_acclist[198] = { 0, - 115, 113, 114, 112, 113, 114, 112, 114, 113, 114, - 113, 114, 113, 114, 113, 114, 113, 114, 113, 114, - 105, 113, 114, 105, 113, 114, 1, 113, 114, 113, - 114, 113, 114, 113, 114, 113, 114, 113, 114, 113, - 114, 113, 114, 113, 114, 113, 114, 113, 114, 113, - 114, 113, 114, 113, 114, 113, 114, 113, 114, 113, - 114, 113, 114, 113, 114, 113, 114, 113, 114, 113, - 114, 104, 102, 101, 101, 108, 106, 110, 105, 1, - 87, 41, 69, 23, 104, 101, 101, 109, 110, 20, - 110, 111, 63, 68, 39, 34, 42, 66, 3, 54, - - 65, 25, 77, 67, 86, 81, 82, 64, 70, 103, - 110, 110, 49, 78, 79, 94, 95, 56, 22, 107, - 26, 4, 61, 55, 48, 11, 110, 36, 2, 5, - 58, 60, 50, 72, 76, 74, 75, 73, 71, 52, - 96, 51, 57, 21, 84, 93, 45, 59, 30, 24, - 44, 7, 89, 33, 92, 38, 62, 80, 88, 27, - 28, 90, 53, 85, 83, 43, 6, 29, 37, 8, - 17, 9, 10, 35, 12, 14, 13, 32, 40, 15, - 31, 91, 97, 99, 100, 16, 46, 98, 18, 47, - 19 + 121, 119, 120, 118, 119, 120, 118, 120, 119, 120, + 119, 120, 119, 120, 119, 120, 119, 120, 119, 120, + 111, 119, 120, 111, 119, 120, 1, 119, 120, 119, + 120, 119, 120, 119, 120, 119, 120, 119, 120, 119, + 120, 119, 120, 119, 120, 119, 120, 119, 120, 119, + 120, 119, 120, 119, 120, 119, 120, 119, 120, 119, + 120, 119, 120, 119, 120, 119, 120, 119, 120, 119, + 120, 110, 108, 107, 107, 114, 112, 116, 111, 1, + 93, 41, 75, 23, 110, 107, 107, 115, 116, 20, + 116, 117, 63, 74, 39, 34, 42, 66, 3, 54, + + 65, 25, 83, 70, 92, 87, 88, 64, 76, 109, + 116, 116, 49, 84, 85, 69, 100, 73, 101, 56, + 22, 113, 68, 72, 26, 4, 61, 67, 55, 71, + 48, 11, 116, 36, 2, 5, 58, 60, 50, 78, + 82, 80, 81, 79, 77, 52, 102, 51, 57, 21, + 90, 99, 45, 59, 30, 24, 44, 7, 95, 33, + 98, 38, 62, 86, 94, 27, 28, 96, 53, 91, + 89, 43, 6, 29, 37, 8, 17, 9, 10, 35, + 12, 14, 13, 32, 40, 15, 31, 97, 103, 105, + 106, 16, 46, 104, 18, 47, 19 } ; -static yyconst short int yy_accept[511] = +static yyconst short int yy_accept[527] = { 0, 1, 1, 1, 2, 4, 7, 9, 11, 13, 15, 17, 19, 21, 24, 27, 30, 32, 34, 36, 38, @@ -346,54 +355,56 @@ static yyconst short int yy_accept[511] = 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, + 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 86, 87, 89, 90, 91, 92, - 92, 93, 94, 94, 94, 95, 95, 96, 96, 97, - 97, 97, 97, 98, 98, 98, 98, 98, 98, 98, - 99, 99, 99, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 102, 103, 103, 103, 104, 104, 105, - 106, 106, 106, 106, 106, 106, 107, 107, 108, 108, - 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, + 84, 84, 84, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, + 87, 89, 90, 91, 92, 92, 93, 94, 94, 94, + 95, 95, 96, 96, 97, 97, 97, 97, 98, 98, + 98, 98, 98, 98, 98, 99, 99, 99, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 102, + 103, 103, 103, 104, 104, 105, 106, 106, 106, 106, + 106, 106, 106, 107, 107, 108, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 110, 110, 111, 112, 112, 112, 112, 113, 113, 113, 113, 113, 114, 115, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, - 116, 116, 116, 116, 116, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 118, 119, 119, 119, 120, - 120, 120, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 122, 122, 122, 123, 124, - 124, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 126, 126, 127, 127, 127, 128, 129, 129, 129, - 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, - - 130, 130, 130, 130, 131, 131, 132, 132, 132, 132, - 132, 132, 132, 133, 133, 133, 133, 133, 133, 133, - 134, 134, 134, 135, 136, 137, 138, 139, 140, 141, - 141, 141, 142, 142, 142, 142, 143, 144, 145, 145, - 145, 145, 145, 145, 146, 146, 146, 146, 146, 146, - 147, 147, 148, 148, 148, 148, 148, 148, 148, 148, - 149, 150, 151, 151, 151, 152, 152, 153, 153, 153, - 153, 154, 154, 155, 156, 157, 158, 158, 158, 159, - 159, 159, 160, 161, 162, 162, 162, 163, 164, 165, - 166, 166, 166, 166, 166, 166, 166, 167, 167, 168, - - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 170, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 171, 171, 171, 171, 171, 172, 172, 172, - 172, 172, 173, 174, 174, 174, 174, 174, 174, 175, - 175, 175, 175, 176, 176, 177, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 179, 179, 179, 179, 179, 179, 179, 179, 180, 180, - 180, 180, 180, 180, 181, 181, 181, 181, 181, 182, - 182, 182, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 184, 184, 185, 186, - - 187, 187, 188, 188, 189, 190, 191, 191, 192, 192 + 116, 116, 116, 116, 117, 117, 118, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 120, 121, 121, + 121, 122, 122, 122, 123, 123, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 125, 125, 125, 126, + 126, 126, 127, 128, 128, 129, 130, 130, 130, 130, + 130, 130, 131, 131, 131, 131, 131, 132, 132, 133, + + 133, 133, 134, 135, 135, 135, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 137, 137, 138, 138, 138, 138, 138, 138, 138, 139, + 139, 139, 139, 139, 139, 139, 140, 140, 140, 141, + 142, 143, 144, 145, 146, 147, 147, 147, 148, 148, + 148, 148, 149, 150, 151, 151, 151, 151, 151, 151, + 152, 152, 152, 152, 152, 152, 153, 153, 154, 154, + 154, 154, 154, 154, 154, 154, 155, 156, 157, 157, + 157, 158, 158, 159, 159, 159, 159, 160, 160, 161, + 162, 163, 164, 164, 164, 165, 165, 165, 166, 167, + + 168, 168, 168, 169, 170, 171, 172, 172, 172, 172, + 172, 172, 172, 173, 173, 174, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 177, 177, + 177, 177, 177, 178, 178, 178, 178, 178, 179, 180, + 180, 180, 180, 180, 180, 181, 181, 181, 181, 182, + 182, 183, 184, 184, 184, 184, 184, 184, 184, 184, + 184, 184, 184, 184, 184, 184, 185, 185, 185, 185, + 185, 185, 185, 185, 186, 18 |