From lattner at cs.uiuc.edu Mon Nov 22 01:25:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 01:25:00 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/Emitter.cpp Message-ID: <200411220725.BAA03032@kain.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: Emitter.cpp updated: 1.52 -> 1.53 --- Log message: Support targets that require stubs for external functions better --- Diffs of the changes: (+18 -2) Index: llvm/lib/ExecutionEngine/JIT/Emitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.52 llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.53 --- llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.52 Sat Nov 20 21:44:32 2004 +++ llvm/lib/ExecutionEngine/JIT/Emitter.cpp Mon Nov 22 01:24:43 2004 @@ -151,9 +151,22 @@ void *&Stub = FunctionToStubMap[F]; if (Stub) return Stub; + // Call the lazy resolver function unless we already KNOW it is an external + // function, in which case we just skip the lazy resolution step. + void *Actual = (void*)LazyResolverFn; + if (F->hasExternalLinkage()) + Actual = TheJIT->getPointerToFunction(F); + // Otherwise, codegen a new stub. For now, the stub will call the lazy // resolver function. - Stub = TheJIT->getJITInfo().emitFunctionStub((void*)LazyResolverFn, MCE); + Stub = TheJIT->getJITInfo().emitFunctionStub(Actual, MCE); + + if (F->hasExternalLinkage()) { + // If we are getting the stub for an external function, we really want the + // address of the stub in the GlobalAddressMap for the JIT, not the address + // of the external function. + TheJIT->updateGlobalMapping(F, Stub); + } DEBUG(std::cerr << "JIT: Stub emitted at [" << Stub << "] for function '" << F->getName() << "\n"); @@ -274,7 +287,10 @@ if (F->hasExternalLinkage()) { // If this is an external function pointer, we can force the JIT to // 'compile' it, which really just adds it to the map. - return TheJIT->getPointerToFunction(F); + if (DoesntNeedStub) + return TheJIT->getPointerToFunction(F); + + return getJITResolver(this).getFunctionStub(F); } // Okay, the function has not been compiled yet, if the target callback From reid at x10sys.com Mon Nov 22 06:38:49 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 22 Nov 2004 06:38:49 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Message-ID: <200411221238.GAA05843@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ExecutionEngine: ExecutionEngine.h updated: 1.28 -> 1.29 --- Log message: Implement a missing function called by JIT/Emitter.cpp but never defined. NOTE: Its not clear that this implementation is correct. CHRIS: Please review this! --- Diffs of the changes: (+7 -0) Index: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h diff -u llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.28 llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.29 --- llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.28 Sun Nov 7 17:58:02 2004 +++ llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Mon Nov 22 06:38:36 2004 @@ -93,6 +93,13 @@ } } + /// FIXME: I have no idea if this is right, I just implemented it to get + /// the build to compile because it is called by JIT/Emitter.cpp. + void updateGlobalMapping(const GlobalValue *GV, void*Addr) { + GlobalAddressMap[GV] = Addr; + GlobalAddressReverseMap[Addr] = GV; + } + /// getPointerToGlobalIfAvailable - This returns the address of the specified /// global value if it is available, otherwise it returns null. /// From criswell at cs.uiuc.edu Mon Nov 22 10:31:20 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 22 Nov 2004 10:31:20 -0600 Subject: [llvm-commits] CVS: poolalloc/include/poolalloc/Support/ Message-ID: <200411221631.KAA01379@choi.cs.uiuc.edu> Changes in directory poolalloc/include/poolalloc/Support: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/poolalloc/include/poolalloc/Support added to the repository --- Diffs of the changes: (+0 -0) From criswell at cs.uiuc.edu Mon Nov 22 10:32:50 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 22 Nov 2004 10:32:50 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/MallocAllocator.h Message-ID: <200411221632.KAA01404@choi.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: MallocAllocator.h (r1.10) removed --- Log message: Moved into the poolalloc tree. --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Mon Nov 22 10:55:08 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 10:55:08 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Message-ID: <200411221655.iAMGt8nA004966@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/ExecutionEngine: ExecutionEngine.h updated: 1.29 -> 1.30 --- Log message: This is the proper code for this method, thanks to Reid for getting CVS working again. --- Diffs of the changes: (+14 -5) Index: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h diff -u llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.29 llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.30 --- llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.29 Mon Nov 22 06:38:36 2004 +++ llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Mon Nov 22 10:54:54 2004 @@ -93,11 +93,20 @@ } } - /// FIXME: I have no idea if this is right, I just implemented it to get - /// the build to compile because it is called by JIT/Emitter.cpp. - void updateGlobalMapping(const GlobalValue *GV, void*Addr) { - GlobalAddressMap[GV] = Addr; - GlobalAddressReverseMap[Addr] = GV; + /// updateGlobalMapping - Replace an existing mapping for GV with a new + /// address. This updates both maps as required. + void updateGlobalMapping(const GlobalValue *GV, void *Addr) { + void *&CurVal = GlobalAddressMap[GV]; + if (CurVal && !GlobalAddressReverseMap.empty()) + GlobalAddressReverseMap.erase(CurVal); + CurVal = Addr; + + // If we are using the reverse mapping, add it too + if (!GlobalAddressReverseMap.empty()) { + const GlobalValue *&V = GlobalAddressReverseMap[Addr]; + assert((V == 0 || GV == 0) && "GlobalMapping already established!"); + V = GV; + } } /// getPointerToGlobalIfAvailable - This returns the address of the specified From criswell at cs.uiuc.edu Mon Nov 22 10:55:40 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 22 Nov 2004 10:55:40 -0600 Subject: [llvm-commits] CVS: poolalloc/runtime/FreeListAllocator/PageManager.cpp Message-ID: <200411221655.KAA15680@choi.cs.uiuc.edu> Changes in directory poolalloc/runtime/FreeListAllocator: PageManager.cpp updated: 1.8 -> 1.9 --- Log message: Move MallocAllocator.h into the poolalloc source tree. --- Diffs of the changes: (+1 -1) Index: poolalloc/runtime/FreeListAllocator/PageManager.cpp diff -u poolalloc/runtime/FreeListAllocator/PageManager.cpp:1.8 poolalloc/runtime/FreeListAllocator/PageManager.cpp:1.9 --- poolalloc/runtime/FreeListAllocator/PageManager.cpp:1.8 Wed Nov 3 23:03:42 2004 +++ poolalloc/runtime/FreeListAllocator/PageManager.cpp Mon Nov 22 10:55:30 2004 @@ -15,9 +15,9 @@ #ifndef _POSIX_MAPPED_FILES #define _POSIX_MAPPED_FILES #endif -#include "llvm/Support/MallocAllocator.h" #include "llvm/Config/unistd.h" #include "llvm/Config/sys/mman.h" +#include "poolalloc/Support/MallocAllocator.h" #include #include #include From criswell at cs.uiuc.edu Mon Nov 22 10:55:44 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 22 Nov 2004 10:55:44 -0600 Subject: [llvm-commits] CVS: poolalloc/runtime/PoolAllocator/PageManager.cpp Message-ID: <200411221655.KAA15687@choi.cs.uiuc.edu> Changes in directory poolalloc/runtime/PoolAllocator: PageManager.cpp updated: 1.9 -> 1.10 --- Log message: Move MallocAllocator.h into the poolalloc source tree. --- Diffs of the changes: (+1 -1) Index: poolalloc/runtime/PoolAllocator/PageManager.cpp diff -u poolalloc/runtime/PoolAllocator/PageManager.cpp:1.9 poolalloc/runtime/PoolAllocator/PageManager.cpp:1.10 --- poolalloc/runtime/PoolAllocator/PageManager.cpp:1.9 Wed Nov 3 23:02:35 2004 +++ poolalloc/runtime/PoolAllocator/PageManager.cpp Mon Nov 22 10:55:33 2004 @@ -15,9 +15,9 @@ #ifndef _POSIX_MAPPED_FILES #define _POSIX_MAPPED_FILES #endif -#include "llvm/Support/MallocAllocator.h" #include "llvm/Config/unistd.h" #include "llvm/Config/sys/mman.h" +#include "poolalloc/Support/MallocAllocator.h" #include #include #include From tbrethou at cs.uiuc.edu Mon Nov 22 11:16:24 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Mon, 22 Nov 2004 11:16:24 -0600 Subject: [llvm-commits] CVS: llvm/utils/NightlyTest.pl Message-ID: <200411221716.LAA19583@zion.cs.uiuc.edu> Changes in directory llvm/utils: NightlyTest.pl updated: 1.71 -> 1.72 --- Log message: Changed to catch stderror of dejagnu and fixed missing quote. --- Diffs of the changes: (+1 -1) Index: llvm/utils/NightlyTest.pl diff -u llvm/utils/NightlyTest.pl:1.71 llvm/utils/NightlyTest.pl:1.72 --- llvm/utils/NightlyTest.pl:1.71 Sat Nov 20 18:10:12 2004 +++ llvm/utils/NightlyTest.pl Mon Nov 22 11:16:01 2004 @@ -551,7 +551,7 @@ #Run the feature and regression tests, results are put into testrun.sum #Full log in testrun.log - system "time -p gmake $MAKEOPTS check-dejagnu >& $dejagnu_output"; + system "time -p gmake $MAKEOPTS check-dejagnu > $dejagnu_output 2>&1"; #Extract time of dejagnu tests my $DejagnuTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$dejagnu_output"; From criswell at cs.uiuc.edu Mon Nov 22 11:16:40 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 22 Nov 2004 11:16:40 -0600 Subject: [llvm-commits] CVS: llvm/docs/GettingStarted.html Message-ID: <200411221716.LAA15783@choi.cs.uiuc.edu> Changes in directory llvm/docs: GettingStarted.html updated: 1.78 -> 1.79 --- Log message: Fixed typo. --- Diffs of the changes: (+3 -3) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.78 llvm/docs/GettingStarted.html:1.79 --- llvm/docs/GettingStarted.html:1.78 Fri Nov 19 19:27:40 2004 +++ llvm/docs/GettingStarted.html Mon Nov 22 11:16:26 2004 @@ -397,8 +397,8 @@
  • cvs -d :pserver:anoncvs at cvs.codesourcery.com:/home/qm/Repository co -r release-2-0-3 qm
  • -
  • Only the C and C++ languages needed so there's no need - to build the other languages for LLVM's purposes. See +
  • Only the C and C++ languages are needed so there's no + need to build the other languages for LLVM's purposes. See below for specific version info.
  • You only need CVS if you intend to build from the @@ -1438,7 +1438,7 @@ Chris Lattner
    Reid Spencer
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/11/20 01:27:40 $ + Last modified: $Date: 2004/11/22 17:16:26 $ From lattner at cs.uiuc.edu Mon Nov 22 11:18:19 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 11:18:19 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/IntrinsicInst.h Message-ID: <200411221718.iAMHIJaB005059@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: IntrinsicInst.h updated: 1.3 -> 1.4 --- Log message: Add a new debug intrinsic parent class. Patch contributed by Michael McCracken, thanks! --- Diffs of the changes: (+28 -4) Index: llvm/include/llvm/IntrinsicInst.h diff -u llvm/include/llvm/IntrinsicInst.h:1.3 llvm/include/llvm/IntrinsicInst.h:1.4 --- llvm/include/llvm/IntrinsicInst.h:1.3 Thu Nov 18 15:41:16 2004 +++ llvm/include/llvm/IntrinsicInst.h Mon Nov 22 11:18:05 2004 @@ -42,11 +42,37 @@ static Value *StripPointerCasts(Value *Ptr); }; - /// DbgStopPointInst - This represent llvm.dbg.stoppoint instructions. + /// DbgInfoIntrinsic - This is the common base class for debug info intrinsics /// - struct DbgStopPointInst : public IntrinsicInst { + struct DbgInfoIntrinsic : public IntrinsicInst { Value *getChain() const { return const_cast(getOperand(1)); } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const DbgInfoIntrinsic *) { return true; } + static inline bool classof(const CallInst *I) { + if (const Function *CF = I->getCalledFunction()) + switch (CF->getIntrinsicID()) { + case Intrinsic::dbg_stoppoint: + case Intrinsic::dbg_region_start: + case Intrinsic::dbg_region_end: + case Intrinsic::dbg_func_start: + case Intrinsic::dbg_declare: + return true; + default: break; + } + return false; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } + }; + + + /// DbgStopPointInst - This represent llvm.dbg.stoppoint instructions. + /// + struct DbgStopPointInst : public DbgInfoIntrinsic { + unsigned getLineNo() const { return cast(getOperand(2))->getRawValue(); } @@ -68,8 +94,6 @@ } }; - - /// MemIntrinsic - This is the common base class for memset/memcpy/memmove. /// struct MemIntrinsic : public IntrinsicInst { From lattner at cs.uiuc.edu Mon Nov 22 11:18:48 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 11:18:48 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnroll.cpp Message-ID: <200411221718.iAMHIm6Y005070@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnroll.cpp updated: 1.13 -> 1.14 --- Log message: Do not consider debug intrinsics in the size computations for loop unrolling. Patch contributed by Michael McCracken! --- Diffs of the changes: (+3 -0) Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.13 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.14 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.13 Mon Oct 18 09:38:48 2004 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Mon Nov 22 11:18:36 2004 @@ -28,6 +28,7 @@ #include "llvm/Support/Debug.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/IntrinsicInst.h" #include #include #include @@ -86,6 +87,8 @@ // Ignore PHI nodes in the header. } else if (I->hasOneUse() && I->use_back() == Term) { // Ignore instructions only used by the loop terminator. + } else if (DbgInfoIntrinsic *DbgI = dyn_cast(I)) { + // Ignore debug instructions } else { ++Size; } From lattner at cs.uiuc.edu Mon Nov 22 11:21:56 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 11:21:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/InlineSimple.cpp Message-ID: <200411221721.iAMHLu2p005286@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: InlineSimple.cpp updated: 1.67 -> 1.68 --- Log message: Ignore debugger intrinsics when doing inlining size computations. --- Diffs of the changes: (+2 -1) Index: llvm/lib/Transforms/IPO/InlineSimple.cpp diff -u llvm/lib/Transforms/IPO/InlineSimple.cpp:1.67 llvm/lib/Transforms/IPO/InlineSimple.cpp:1.68 --- llvm/lib/Transforms/IPO/InlineSimple.cpp:1.67 Tue Nov 9 02:05:23 2004 +++ llvm/lib/Transforms/IPO/InlineSimple.cpp Mon Nov 22 11:21:44 2004 @@ -13,6 +13,7 @@ #include "Inliner.h" #include "llvm/Instructions.h" +#include "llvm/IntrinsicInst.h" #include "llvm/Function.h" #include "llvm/Type.h" #include "llvm/Support/CallSite.h" @@ -147,7 +148,7 @@ for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB) { for (BasicBlock::const_iterator II = BB->begin(), E = BB->end(); II != E; ++II) { - ++NumInsts; + if (!isa(II)) ++NumInsts; // If there is an alloca in the body of the function, we cannot currently // inline the function without the risk of exploding the stack. From lattner at cs.uiuc.edu Mon Nov 22 11:24:10 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 11:24:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/TailDuplication.cpp Message-ID: <200411221724.iAMHOAhX005440@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: TailDuplication.cpp updated: 1.26 -> 1.27 --- Log message: Do not count debugger intrinsics in size estimation. --- Diffs of the changes: (+6 -2) Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.26 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.27 --- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.26 Mon Nov 1 01:05:07 2004 +++ llvm/lib/Transforms/Scalar/TailDuplication.cpp Mon Nov 22 11:23:57 2004 @@ -22,6 +22,7 @@ #include "llvm/Constant.h" #include "llvm/Function.h" #include "llvm/Instructions.h" +#include "llvm/IntrinsicInst.h" #include "llvm/Pass.h" #include "llvm/Type.h" #include "llvm/Support/CFG.h" @@ -107,8 +108,11 @@ BasicBlock::iterator I = Dest->begin(); while (isa(*I)) ++I; - for (unsigned Size = 0; I != Dest->end(); ++Size, ++I) - if (Size == Threshold) return false; // The block is too large... + for (unsigned Size = 0; I != Dest->end(); ++I) { + if (Size == Threshold) return false; // The block is too large. + // Only count instructions that are not debugger intrinsics. + if (!isa(I)) ++Size; + } // Do not tail duplicate a block that has thousands of successors into a block // with a single successor if the block has many other predecessors. This can From tbrethou at cs.uiuc.edu Mon Nov 22 12:36:28 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Mon, 22 Nov 2004 12:36:28 -0600 (CST) Subject: [llvm-commits] CVS: llvm/utils/NightlyTest.pl NightlyTestTemplate.html Message-ID: <200411221836.MAA27900@kain.cs.uiuc.edu> Changes in directory llvm/utils: NightlyTest.pl updated: 1.72 -> 1.73 NightlyTestTemplate.html updated: 1.33 -> 1.34 --- Log message: Moved dejagnu log link to the template. --- Diffs of the changes: (+1 -3) Index: llvm/utils/NightlyTest.pl diff -u llvm/utils/NightlyTest.pl:1.72 llvm/utils/NightlyTest.pl:1.73 --- llvm/utils/NightlyTest.pl:1.72 Mon Nov 22 11:16:01 2004 +++ llvm/utils/NightlyTest.pl Mon Nov 22 12:36:12 2004 @@ -297,9 +297,6 @@ push(@lines, "\n"); close SRCHFILE; - #add link to complete testing log - push(@lines, "

    A complete log of testing Feature and Regression is available for further analysis.

    \n"); - my $content = join("", at lines); return "$content
  • \n"; } Index: llvm/utils/NightlyTestTemplate.html diff -u llvm/utils/NightlyTestTemplate.html:1.33 llvm/utils/NightlyTestTemplate.html:1.34 --- llvm/utils/NightlyTestTemplate.html:1.33 Sat Nov 20 18:02:40 2004 +++ llvm/utils/NightlyTestTemplate.html Mon Nov 22 12:36:12 2004 @@ -265,6 +265,7 @@
    $DejagnuTestResults +

    A complete log of testing Feature and Regression is available for further analysis.

    From reid at x10sys.com Mon Nov 22 12:41:02 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 22 Nov 2004 12:41:02 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411221841.MAA16074@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.251 -> 1.252 --- Log message: Add a note about the name change of libraries. --- Diffs of the changes: (+6 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.251 llvm/docs/ReleaseNotes.html:1.252 --- llvm/docs/ReleaseNotes.html:1.251 Thu Nov 18 15:25:11 2004 +++ llvm/docs/ReleaseNotes.html Mon Nov 22 12:40:51 2004 @@ -150,6 +150,11 @@ linking to libstdc++
  • include/{Support,Config} -> include/llvm/{Support,Config}
  • +
  • The names of the libraries generated by compiling LLVM source have been + changed to ensure they do not conflict with other packages upon installation. + Each LLVM library is now prefixed with LLVM and uses mixed clase. For example, + the library libasmparser.a in 1.3 has become + libLLVMAsmParser.a in release 1.4.
  • @@ -662,7 +667,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/11/18 21:25:11 $ + Last modified: $Date: 2004/11/22 18:40:51 $ From lattner at cs.uiuc.edu Mon Nov 22 13:06:36 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 13:06:36 -0600 Subject: [llvm-commits] CVS: llvm/test/Makefile Message-ID: <200411221906.iAMJ6aW5007804@apoc.cs.uiuc.edu> Changes in directory llvm/test: Makefile updated: 1.68 -> 1.69 --- Log message: Don't stop make if there are XFAIL or XPASSes --- Diffs of the changes: (+1 -1) Index: llvm/test/Makefile diff -u llvm/test/Makefile:1.68 llvm/test/Makefile:1.69 --- llvm/test/Makefile:1.68 Sat Nov 13 17:36:18 2004 +++ llvm/test/Makefile Mon Nov 22 13:06:22 2004 @@ -124,7 +124,7 @@ endif check-dejagnu: site.exp - PATH=$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH) \ + -PATH=$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH) \ $(RUNTEST) $(RUNTESTFLAGS) From lattner at cs.uiuc.edu Mon Nov 22 13:11:54 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 13:11:54 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c 2003-02-12-NonlocalGoto.c 2003-08-30-AggregateInitializer.c 2004-01-01-UnknownInitSize.c 2004-03-07-BitfieldCrash.c Message-ID: <200411221911.iAMJBsJC008454@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2003-01-30-UnionInit.c updated: 1.3 -> 1.4 2003-02-12-NonlocalGoto.c updated: 1.4 -> 1.5 2003-08-30-AggregateInitializer.c updated: 1.3 -> 1.4 2004-01-01-UnknownInitSize.c updated: 1.3 -> 1.4 2004-03-07-BitfieldCrash.c updated: 1.3 -> 1.4 --- Log message: These tests really are failing, do not let them accidentally be XPASS. Note that apparently 'failing command | succeeding command' is a fail on csh but not on sh. :( --- Diffs of the changes: (+5 -5) Index: llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c diff -u llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c:1.3 llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c:1.4 --- llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c:1.3 Sat Nov 6 16:41:00 2004 +++ llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c Mon Nov 22 13:11:39 2004 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o /dev/null // XFAIL: linux,sun,darwin Index: llvm/test/Regression/CFrontend/2003-02-12-NonlocalGoto.c diff -u llvm/test/Regression/CFrontend/2003-02-12-NonlocalGoto.c:1.4 llvm/test/Regression/CFrontend/2003-02-12-NonlocalGoto.c:1.5 --- llvm/test/Regression/CFrontend/2003-02-12-NonlocalGoto.c:1.4 Sat Nov 6 16:41:00 2004 +++ llvm/test/Regression/CFrontend/2003-02-12-NonlocalGoto.c Mon Nov 22 13:11:40 2004 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o /dev/null // XFAIL: * /* It is unlikely that LLVM will ever support nested functions, but if it does, Index: llvm/test/Regression/CFrontend/2003-08-30-AggregateInitializer.c diff -u llvm/test/Regression/CFrontend/2003-08-30-AggregateInitializer.c:1.3 llvm/test/Regression/CFrontend/2003-08-30-AggregateInitializer.c:1.4 --- llvm/test/Regression/CFrontend/2003-08-30-AggregateInitializer.c:1.3 Sat Nov 6 16:41:00 2004 +++ llvm/test/Regression/CFrontend/2003-08-30-AggregateInitializer.c Mon Nov 22 13:11:40 2004 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o /dev/null // XFAIL: linux,sun,darwin struct istruct { Index: llvm/test/Regression/CFrontend/2004-01-01-UnknownInitSize.c diff -u llvm/test/Regression/CFrontend/2004-01-01-UnknownInitSize.c:1.3 llvm/test/Regression/CFrontend/2004-01-01-UnknownInitSize.c:1.4 --- llvm/test/Regression/CFrontend/2004-01-01-UnknownInitSize.c:1.3 Sat Nov 6 16:41:00 2004 +++ llvm/test/Regression/CFrontend/2004-01-01-UnknownInitSize.c Mon Nov 22 13:11:40 2004 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o /dev/null /* * This regression test ensures that the C front end can compile initializers Index: llvm/test/Regression/CFrontend/2004-03-07-BitfieldCrash.c diff -u llvm/test/Regression/CFrontend/2004-03-07-BitfieldCrash.c:1.3 llvm/test/Regression/CFrontend/2004-03-07-BitfieldCrash.c:1.4 --- llvm/test/Regression/CFrontend/2004-03-07-BitfieldCrash.c:1.3 Sat Nov 6 16:41:00 2004 +++ llvm/test/Regression/CFrontend/2004-03-07-BitfieldCrash.c Mon Nov 22 13:11:40 2004 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o /dev/null /* * XFAIL: linux From lattner at cs.uiuc.edu Mon Nov 22 13:15:41 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 13:15:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp Message-ID: <200411221915.iAMJFfBR008796@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.68 -> 1.69 --- Log message: Fix test/Regression/CFrontend/2003-11-01-EmptyStructCrash.c --- Diffs of the changes: (+1 -0) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.68 llvm/lib/VMCore/ConstantFolding.cpp:1.69 --- llvm/lib/VMCore/ConstantFolding.cpp:1.68 Wed Nov 17 11:59:35 2004 +++ llvm/lib/VMCore/ConstantFolding.cpp Mon Nov 22 13:15:27 2004 @@ -574,6 +574,7 @@ const Type *ElTy = PTy->getElementType(); while (ElTy != DPTy->getElementType()) { if (const StructType *STy = dyn_cast(ElTy)) { + if (STy->getNumElements() == 0) break; ElTy = STy->getElementType(0); IdxList.push_back(Constant::getNullValue(Type::UIntTy)); } else if (const SequentialType *STy = dyn_cast(ElTy)) { From lattner at cs.uiuc.edu Mon Nov 22 13:19:25 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 13:19:25 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/FunctionResolve/2003-08-23-ArgumentWarning.ll Message-ID: <200411221919.iAMJJPoM009010@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/FunctionResolve: 2003-08-23-ArgumentWarning.ll updated: 1.3 -> 1.4 --- Log message: This was fixed --- Diffs of the changes: (+0 -1) Index: llvm/test/Regression/Transforms/FunctionResolve/2003-08-23-ArgumentWarning.ll diff -u llvm/test/Regression/Transforms/FunctionResolve/2003-08-23-ArgumentWarning.ll:1.3 llvm/test/Regression/Transforms/FunctionResolve/2003-08-23-ArgumentWarning.ll:1.4 --- llvm/test/Regression/Transforms/FunctionResolve/2003-08-23-ArgumentWarning.ll:1.3 Sat Nov 6 14:38:27 2004 +++ llvm/test/Regression/Transforms/FunctionResolve/2003-08-23-ArgumentWarning.ll Mon Nov 22 13:19:11 2004 @@ -1,4 +1,3 @@ -; XFAIL: * ; RUN: llvm-as < %s | opt -funcresolve -disable-output 2>&1 | not grep WARNING declare int %foo(int *%X) From lattner at cs.uiuc.edu Mon Nov 22 13:24:25 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 13:24:25 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll and.ll Message-ID: <200411221924.iAMJOP3M009507@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: 2004-11-22-Missed-and-fold.ll added (r1.1) and.ll updated: 1.24 -> 1.25 --- Log message: Pull out failing test into a seperate file, which is xfailed --- Diffs of the changes: (+9 -6) Index: llvm/test/Regression/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll:1.1 *** /dev/null Mon Nov 22 13:24:21 2004 --- llvm/test/Regression/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll Mon Nov 22 13:24:11 2004 *************** *** 0 **** --- 1,9 ---- + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and + ; XFAIL: * + + sbyte %test21(sbyte %A) { + %C = shr sbyte %A, ubyte 7 ;; sign extend + %D = and sbyte %C, 1 ;; chop off sign + ret sbyte %D + } + Index: llvm/test/Regression/Transforms/InstCombine/and.ll diff -u llvm/test/Regression/Transforms/InstCombine/and.ll:1.24 llvm/test/Regression/Transforms/InstCombine/and.ll:1.25 --- llvm/test/Regression/Transforms/InstCombine/and.ll:1.24 Fri Oct 8 00:03:25 2004 +++ llvm/test/Regression/Transforms/InstCombine/and.ll Mon Nov 22 13:24:11 2004 @@ -137,12 +137,6 @@ ret ubyte %D } -sbyte %test21(sbyte %A) { - %C = shr sbyte %A, ubyte 7 ;; sign extend - %D = and sbyte %C, 1 ;; chop off sign - ret sbyte %D -} - bool %test22(int %A) { %B = seteq int %A, 1 %C = setge int %A, 3 From lattner at cs.uiuc.edu Mon Nov 22 13:25:58 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 13:25:58 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/pow.ll Message-ID: <200411221925.iAMJPwOD009553@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: pow.ll updated: 1.6 -> 1.7 --- Log message: %p is expanded by dejagnu, avoid it in the test. --- Diffs of the changes: (+1 -1) Index: llvm/test/Regression/Transforms/InstCombine/pow.ll diff -u llvm/test/Regression/Transforms/InstCombine/pow.ll:1.6 llvm/test/Regression/Transforms/InstCombine/pow.ll:1.7 --- llvm/test/Regression/Transforms/InstCombine/pow.ll:1.6 Sat Nov 6 14:38:27 2004 +++ llvm/test/Regression/Transforms/InstCombine/pow.ll Mon Nov 22 13:25:45 2004 @@ -2,7 +2,7 @@ ; ; Equivalent to: http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01786.html ; XFAIL: * -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'call double %pow' +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'call double .pow' declare double %pow(double, double) From lattner at cs.uiuc.edu Mon Nov 22 13:50:56 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 13:50:56 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/ExecutionEngine/test-call.ll Message-ID: <200411221950.iAMJounE013908@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/ExecutionEngine: test-call.ll updated: 1.6 -> 1.7 --- Log message: Exit only with a value from 0-255. --- Diffs of the changes: (+3 -2) Index: llvm/test/Regression/ExecutionEngine/test-call.ll diff -u llvm/test/Regression/ExecutionEngine/test-call.ll:1.6 llvm/test/Regression/ExecutionEngine/test-call.ll:1.7 --- llvm/test/Regression/ExecutionEngine/test-call.ll:1.6 Sat Nov 6 17:32:43 2004 +++ llvm/test/Regression/ExecutionEngine/test-call.ll Mon Nov 22 13:50:41 2004 @@ -5,8 +5,9 @@ declare void %exit(int) int %test(sbyte %C, short %S) { - %X = cast short %S to int - ret int %X + %X = cast short %S to ubyte + %Y = cast ubyte %X to int + ret int %Y } void %FP(void(int) * %F) { From lattner at cs.uiuc.edu Mon Nov 22 14:24:41 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 14:24:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9JITInfo.cpp Message-ID: <200411222024.iAMKOftm018174@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9JITInfo.cpp added (r1.1) --- Log message: Implement the Sparc JIT interfaces, including relocation support. --- Diffs of the changes: (+354 -0) Index: llvm/lib/Target/SparcV9/SparcV9JITInfo.cpp diff -c /dev/null llvm/lib/Target/SparcV9/SparcV9JITInfo.cpp:1.1 *** /dev/null Mon Nov 22 14:24:37 2004 --- llvm/lib/Target/SparcV9/SparcV9JITInfo.cpp Mon Nov 22 14:24:27 2004 *************** *** 0 **** --- 1,354 ---- + //===-- SparcJITInfo.cpp - Implement the JIT interfaces for SparcV9 -------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the JIT interfaces for the SparcV9 target. + // + //===----------------------------------------------------------------------===// + + #define DEBUG_TYPE "jit" + #include "SparcV9JITInfo.h" + #include "SparcV9Relocations.h" + #include "llvm/CodeGen/MachineCodeEmitter.h" + #include "llvm/Config/alloca.h" + #include "llvm/Support/Debug.h" + using namespace llvm; + + /// JITCompilerFunction - This contains the address of the JIT function used to + /// compile a function lazily. + static TargetJITInfo::JITCompilerFn JITCompilerFunction; + + /// BUILD_SETHI/BUILD_ORI/BUILD_BA/BUILD_CALL - These macros build sparc machine + /// instructions using lots of magic defined by the Sparc ISA. + #define BUILD_SETHI(RD, C) (((RD) << 25) | (4 << 22) | (C & ((1 << 22)-1))) + #define BUILD_ORI(RS, C, RD) ((2 << 30) | (RD << 25) | (2 << 19) | (RS << 14) |\ + (1 << 13) | (C & ((1 << 12)-1))) + #define BUILD_BA(DISP) ((8 << 25) | (2 << 22) | (DISP & ((1 << 22)-1))) + #define BUILD_CALL(OFFSET) ((1 << 30) | (OFFSET & (1 << 30)-1)) + + static void InsertJumpAtAddr(int64_t JumpTarget, unsigned *Addr) { + // If the target function is close enough to fit into the 19bit disp of + // BA, we should use this version, as it's much cheaper to generate. + int64_t BranchTarget = (JumpTarget-(intptr_t)Addr) >> 2; + if (BranchTarget < (1 << 19) && BranchTarget > -(1 << 19)) { + // ba + Addr[0] = BUILD_BA(BranchTarget); + + // nop + Addr[1] = 0x01000000; + } else { + enum { G0 = 0, G1 = 1, G5 = 5 }; + // Get address to branch into %g1, using %g5 as a temporary + // + // sethi %uhi(Target), %g5 ;; get upper 22 bits of Target into %g5 + Addr[0] = BUILD_SETHI(G5, JumpTarget >> 42); + // or %g5, %ulo(Target), %g5 ;; get 10 lower bits of upper word into %1 + Addr[1] = BUILD_ORI(G5, JumpTarget >> 32, G5); + // sllx %g5, 32, %g5 ;; shift those 10 bits to the upper word + Addr[2] = 0x8B297020; + // sethi %hi(Target), %g1 ;; extract bits 10-31 into the dest reg + Addr[3] = BUILD_SETHI(G1, JumpTarget >> 10); + // or %g5, %g1, %g1 ;; get upper word (in %g5) into %g1 + Addr[4] = 0x82114001; + // or %g1, %lo(Target), %g1 ;; get lowest 10 bits of Target into %g1 + Addr[5] = BUILD_ORI(G1, JumpTarget, G1); + + // jmpl %g1, %g0, %g0 ;; indirect branch on %g1 + Addr[6] = 0x81C00001; + // nop ;; delay slot + Addr[7] = 0x01000000; + } + } + + void SparcV9JITInfo::replaceMachineCodeForFunction (void *Old, void *New) { + InsertJumpAtAddr((intptr_t)New, (unsigned*)Old); + } + + + static void SaveRegisters(uint64_t DoubleFP[], uint64_t CC[], + uint64_t Globals[]) { + #if defined(__sparcv9) + + __asm__ __volatile__ (// Save condition-code registers + "stx %%fsr, %0;\n\t" + "rd %%fprs, %1;\n\t" + "rd %%ccr, %2;\n\t" + : "=m"(CC[0]), "=r"(CC[1]), "=r"(CC[2])); + + __asm__ __volatile__ (// Save globals g1 and g5 + "stx %%g1, %0;\n\t" + "stx %%g5, %0;\n\t" + : "=m"(Globals[0]), "=m"(Globals[1])); + + // GCC says: `asm' only allows up to thirty parameters! + __asm__ __volatile__ (// Save Single/Double FP registers, part 1 + "std %%f0, %0;\n\t" "std %%f2, %1;\n\t" + "std %%f4, %2;\n\t" "std %%f6, %3;\n\t" + "std %%f8, %4;\n\t" "std %%f10, %5;\n\t" + "std %%f12, %6;\n\t" "std %%f14, %7;\n\t" + "std %%f16, %8;\n\t" "std %%f18, %9;\n\t" + "std %%f20, %10;\n\t" "std %%f22, %11;\n\t" + "std %%f24, %12;\n\t" "std %%f26, %13;\n\t" + "std %%f28, %14;\n\t" "std %%f30, %15;\n\t" + : "=m"(DoubleFP[ 0]), "=m"(DoubleFP[ 1]), + "=m"(DoubleFP[ 2]), "=m"(DoubleFP[ 3]), + "=m"(DoubleFP[ 4]), "=m"(DoubleFP[ 5]), + "=m"(DoubleFP[ 6]), "=m"(DoubleFP[ 7]), + "=m"(DoubleFP[ 8]), "=m"(DoubleFP[ 9]), + "=m"(DoubleFP[10]), "=m"(DoubleFP[11]), + "=m"(DoubleFP[12]), "=m"(DoubleFP[13]), + "=m"(DoubleFP[14]), "=m"(DoubleFP[15])); + + __asm__ __volatile__ (// Save Double FP registers, part 2 + "std %%f32, %0;\n\t" "std %%f34, %1;\n\t" + "std %%f36, %2;\n\t" "std %%f38, %3;\n\t" + "std %%f40, %4;\n\t" "std %%f42, %5;\n\t" + "std %%f44, %6;\n\t" "std %%f46, %7;\n\t" + "std %%f48, %8;\n\t" "std %%f50, %9;\n\t" + "std %%f52, %10;\n\t" "std %%f54, %11;\n\t" + "std %%f56, %12;\n\t" "std %%f58, %13;\n\t" + "std %%f60, %14;\n\t" "std %%f62, %15;\n\t" + : "=m"(DoubleFP[16]), "=m"(DoubleFP[17]), + "=m"(DoubleFP[18]), "=m"(DoubleFP[19]), + "=m"(DoubleFP[20]), "=m"(DoubleFP[21]), + "=m"(DoubleFP[22]), "=m"(DoubleFP[23]), + "=m"(DoubleFP[24]), "=m"(DoubleFP[25]), + "=m"(DoubleFP[26]), "=m"(DoubleFP[27]), + "=m"(DoubleFP[28]), "=m"(DoubleFP[29]), + "=m"(DoubleFP[30]), "=m"(DoubleFP[31])); + #else + std::cerr << "ERROR: RUNNING CODE THAT ONLY WORKS ON A SPARCV9 HOST!\n"; + abort(); + #endif + } + + static void RestoreRegisters(uint64_t DoubleFP[], uint64_t CC[], + uint64_t Globals[]) { + #if defined(__sparcv9) + + __asm__ __volatile__ (// Restore condition-code registers + "ldx %0, %%fsr;\n\t" + "wr %1, 0, %%fprs;\n\t" + "wr %2, 0, %%ccr;\n\t" + :: "m"(CC[0]), "r"(CC[1]), "r"(CC[2])); + + __asm__ __volatile__ (// Restore globals g1 and g5 + "ldx %0, %%g1;\n\t" + "ldx %0, %%g5;\n\t" + :: "m"(Globals[0]), "m"(Globals[1])); + + // GCC says: `asm' only allows up to thirty parameters! + __asm__ __volatile__ (// Restore Single/Double FP registers, part 1 + "ldd %0, %%f0;\n\t" "ldd %1, %%f2;\n\t" + "ldd %2, %%f4;\n\t" "ldd %3, %%f6;\n\t" + "ldd %4, %%f8;\n\t" "ldd %5, %%f10;\n\t" + "ldd %6, %%f12;\n\t" "ldd %7, %%f14;\n\t" + "ldd %8, %%f16;\n\t" "ldd %9, %%f18;\n\t" + "ldd %10, %%f20;\n\t" "ldd %11, %%f22;\n\t" + "ldd %12, %%f24;\n\t" "ldd %13, %%f26;\n\t" + "ldd %14, %%f28;\n\t" "ldd %15, %%f30;\n\t" + :: "m"(DoubleFP[0]), "m"(DoubleFP[1]), + "m"(DoubleFP[2]), "m"(DoubleFP[3]), + "m"(DoubleFP[4]), "m"(DoubleFP[5]), + "m"(DoubleFP[6]), "m"(DoubleFP[7]), + "m"(DoubleFP[8]), "m"(DoubleFP[9]), + "m"(DoubleFP[10]), "m"(DoubleFP[11]), + "m"(DoubleFP[12]), "m"(DoubleFP[13]), + "m"(DoubleFP[14]), "m"(DoubleFP[15])); + + __asm__ __volatile__ (// Restore Double FP registers, part 2 + "ldd %0, %%f32;\n\t" "ldd %1, %%f34;\n\t" + "ldd %2, %%f36;\n\t" "ldd %3, %%f38;\n\t" + "ldd %4, %%f40;\n\t" "ldd %5, %%f42;\n\t" + "ldd %6, %%f44;\n\t" "ldd %7, %%f46;\n\t" + "ldd %8, %%f48;\n\t" "ldd %9, %%f50;\n\t" + "ldd %10, %%f52;\n\t" "ldd %11, %%f54;\n\t" + "ldd %12, %%f56;\n\t" "ldd %13, %%f58;\n\t" + "ldd %14, %%f60;\n\t" "ldd %15, %%f62;\n\t" + :: "m"(DoubleFP[16]), "m"(DoubleFP[17]), + "m"(DoubleFP[18]), "m"(DoubleFP[19]), + "m"(DoubleFP[20]), "m"(DoubleFP[21]), + "m"(DoubleFP[22]), "m"(DoubleFP[23]), + "m"(DoubleFP[24]), "m"(DoubleFP[25]), + "m"(DoubleFP[26]), "m"(DoubleFP[27]), + "m"(DoubleFP[28]), "m"(DoubleFP[29]), + "m"(DoubleFP[30]), "m"(DoubleFP[31])); + #else + std::cerr << "ERROR: RUNNING CODE THAT ONLY WORKS ON A SPARCV9 HOST!\n"; + abort(); + #endif + } + + + static void CompilationCallback() { + // Local space to save the registers + uint64_t DoubleFP[32]; + uint64_t CC[3]; + uint64_t Globals[2]; + + SaveRegisters(DoubleFP, CC, Globals); + + unsigned *CameFrom = (unsigned*)__builtin_return_address(0); + unsigned *CameFrom1 = (unsigned*)__builtin_return_address(1); + + int64_t Target = (intptr_t)JITCompilerFunction(CameFrom); + + DEBUG(std::cerr << "In callback! Addr=" << (void*)CameFrom << "\n"); + + // If we can rewrite the ORIGINAL caller, we eliminate the whole need for a + // trampoline function stub!! + unsigned OrigCallInst = *CameFrom1; + int64_t OrigTarget = (Target-(intptr_t)CameFrom1) >> 2; + if ((OrigCallInst >> 30) == 1 && + (OrigTarget <= (1 << 30) && OrigTarget >= -(1 << 30))) { + // The original call instruction was CALL , which means we can + // overwrite it directly, since the offset will fit into 30 bits + *CameFrom1 = BUILD_CALL(OrigTarget); + //++OverwrittenCalls; + } else { + //++UnmodifiedCalls; + } + + // Rewrite the call target so that we don't fault every time we execute it. + // + unsigned OrigStubCallInst = *CameFrom; + + // Subtract enough to overwrite up to the 'save' instruction + // This depends on whether we made a short call (1 instruction) or the + // farCall (7 instructions) + int Offset = ((OrigStubCallInst >> 30) == 1) ? 1 : 7; + unsigned *CodeBegin = CameFrom - Offset; + + // FIXME: __builtin_frame_address doesn't work if frame pointer elimination + // has been performed. Having a variable sized alloca disables frame pointer + // elimination currently, even if it's dead. This is a gross hack. + alloca(42+Offset); + + // Make sure that what we're about to overwrite is indeed "save". + if (*CodeBegin != 0x9DE3BF40) { + std::cerr << "About to overwrite smthg not a save instr!"; + abort(); + } + + // Overwrite it + InsertJumpAtAddr(Target, CodeBegin); + + // Flush the I-Cache: FLUSH clears out a doubleword at a given address + // Self-modifying code MUST clear out the I-Cache to be portable + #if defined(__sparcv9) + for (int i = -Offset*4, e = 32-((int64_t)Offset*4); i < e; i += 8) + __asm__ __volatile__ ("flush %%i7 + %0" : : "r" (i)); + #endif + + // Change the return address to re-execute the restore, then the jump. + DEBUG(std::cerr << "Callback returning to: 0x" + << std::hex << (CameFrom-Offset*4-12) << "\n"); + #if defined(__sparcv9) + __asm__ __volatile__ ("sub %%i7, %0, %%i7" : : "r" (Offset*4+12)); + #endif + + RestoreRegisters(DoubleFP, CC, Globals); + } + + + /// emitStubForFunction - This method is used by the JIT when it needs to emit + /// the address of a function for a function whose code has not yet been + /// generated. In order to do this, it generates a stub which jumps to the lazy + /// function compiler, which will eventually get fixed to call the function + /// directly. + /// + void *SparcV9JITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { + if (Fn != CompilationCallback) { + // If this is just a call to an external function, + MCE.startFunctionStub(4*8); + unsigned *Stub = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); + for (unsigned i = 0; i != 8; ++i) + MCE.emitWord(0); + InsertJumpAtAddr((intptr_t)Fn, Stub); + return MCE.finishFunctionStub(0); // 1 instr past the restore + } + + MCE.startFunctionStub(44); + MCE.emitWord(0x81e82000); // restore %g0, 0, %g0 + MCE.emitWord(0x9DE3BF40); // save %sp, -192, %sp + + int64_t CurrPC = MCE.getCurrentPCValue(); + int64_t Addr = (intptr_t)Fn; + int64_t CallTarget = (Addr-CurrPC) >> 2; + if (CallTarget < (1 << 29) && CallTarget > -(1 << 29)) { + // call CallTarget + MCE.emitWord((0x01 << 30) | CallTarget); + } else { + enum {G5 = 5, G1 = 1 }; + // Otherwise, we need to emit a sequence of instructions to call a distant + // function. We use %g5 as a temporary, and compute the value into %g1 + + // sethi %uhi(Target), %g5 ;; get upper 22 bits of Target into %g5 + MCE.emitWord(BUILD_SETHI(G5, Addr >> 42)); + // or %g5, %ulo(Target), %g5 ;; get 10 lower bits of upper word into %1 + MCE.emitWord(BUILD_ORI(G5, Addr >> 32, G5)); + // sllx %g5, 32, %g5 ;; shift those 10 bits to the upper word + MCE.emitWord(0x8B297020); + // sethi %hi(Target), %g1 ;; extract bits 10-31 into the dest reg + MCE.emitWord(BUILD_SETHI(G1, Addr >> 10)); + // or %g5, %g1, %g1 ;; get upper word (in %g5) into %g1 + MCE.emitWord(0x82114001); + // or %g1, %lo(Target), %g1 ;; get lowest 10 bits of Target into %g1 + MCE.emitWord(BUILD_ORI(G1, Addr, G1)); + + // call %g1 ;; indirect call on %g1 + MCE.emitWord(0x9FC04000); + } + + // nop ;; call delay slot + MCE.emitWord(0x1000000); + + // FIXME: Should have a restore and return! + + MCE.emitWord(0xDEADBEEF); // marker so that we know it's really a stub + return (char*)MCE.finishFunctionStub(0)+4; // 1 instr past the restore + } + + + + TargetJITInfo::LazyResolverFn + SparcV9JITInfo::getLazyResolverFunction(JITCompilerFn F) { + JITCompilerFunction = F; + return CompilationCallback; + } + + void SparcV9JITInfo::relocate(void *Function, MachineRelocation *MR, + unsigned NumRelocs) { + for (unsigned i = 0; i != NumRelocs; ++i, ++MR) { + unsigned *RelocPos = (unsigned*)Function + MR->getMachineCodeOffset()/4; + intptr_t ResultPtr = (intptr_t)MR->getResultPointer(); + switch ((V9::RelocationType)MR->getRelocationType()) { + default: assert(0 && "Unknown relocation type!"); + case V9::reloc_pcrel_call: + ResultPtr = (ResultPtr-(intptr_t)RelocPos) >> 2; // PC relative. + assert((ResultPtr < (1 << 29) && ResultPtr > -(1 << 29)) && + "reloc_pcrel_call is out of range!"); + // The high two bits of the call are always set to 01. + *RelocPos = (1 << 30) | (ResultPtr & ((1 << 30)-1)) ; + break; + case V9::reloc_sethi_hh: + case V9::reloc_sethi_lm: + ResultPtr >>= (MR->getRelocationType() == V9::reloc_sethi_hh ? 32 : 0); + ResultPtr >>= 10; + ResultPtr &= (1 << 22)-1; + *RelocPos |= (unsigned)ResultPtr; + break; + case V9::reloc_or_hm: + case V9::reloc_or_lo: + ResultPtr >>= (MR->getRelocationType() == V9::reloc_or_hm ? 32 : 0); + ResultPtr &= (1 << 12)-1; + *RelocPos |= (unsigned)ResultPtr; + break; + } + } + } From lattner at cs.uiuc.edu Mon Nov 22 14:24:54 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 14:24:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9JITInfo.h Message-ID: <200411222024.iAMKOsEQ018185@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9JITInfo.h updated: 1.6 -> 1.7 --- Log message: New methods implemented --- Diffs of the changes: (+18 -0) Index: llvm/lib/Target/SparcV9/SparcV9JITInfo.h diff -u llvm/lib/Target/SparcV9/SparcV9JITInfo.h:1.6 llvm/lib/Target/SparcV9/SparcV9JITInfo.h:1.7 --- llvm/lib/Target/SparcV9/SparcV9JITInfo.h:1.6 Fri Nov 19 22:19:47 2004 +++ llvm/lib/Target/SparcV9/SparcV9JITInfo.h Mon Nov 22 14:24:42 2004 @@ -38,6 +38,24 @@ /// code. /// virtual void replaceMachineCodeForFunction (void *Old, void *New); + + + /// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a + /// small native function that simply calls the function at the specified + /// address. Return the address of the resultant function. + virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter &MCE); + + /// getLazyResolverFunction - This method is used to initialize the JIT, + /// giving the target the function that should be used to compile a + /// function, and giving the JIT the target function used to do the lazy + /// resolving. + virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn); + + /// relocate - Before the JIT can run a block of code that has been emitted, + /// it must rewrite the code to contain the actual addresses of any + /// referenced global symbols. + virtual void relocate(void *Function, MachineRelocation *MR, + unsigned NumRelocs); }; } From lattner at cs.uiuc.edu Mon Nov 22 14:25:22 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 14:25:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp SparcV9CodeEmitter.h Message-ID: <200411222025.iAMKPMXG018200@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9CodeEmitter.cpp updated: 1.74 -> 1.75 SparcV9CodeEmitter.h updated: 1.18 -> 1.19 --- Log message: Remove JIT-specific code from the code emitter. --- Diffs of the changes: (+35 -569) Index: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp diff -u llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.74 llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.75 --- llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.74 Sat Nov 20 17:53:26 2004 +++ llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp Mon Nov 22 14:25:10 2004 @@ -31,22 +31,13 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/Debug.h" -#include "llvm/ADT/hash_set" -#include "llvm/ADT/Statistic.h" #include "SparcV9Internals.h" #include "SparcV9TargetMachine.h" #include "SparcV9RegInfo.h" #include "SparcV9CodeEmitter.h" +#include "SparcV9Relocations.h" #include "MachineFunctionInfo.h" -#include "llvm/Config/alloca.h" - -namespace llvm { - -namespace { - Statistic<> OverwrittenCalls("call-ovwr", "Number of over-written calls"); - Statistic<> UnmodifiedCalls("call-skip", "Number of unmodified calls"); - Statistic<> CallbackCalls("callback", "Number CompilationCallback() calls"); -} +using namespace llvm; bool SparcV9TargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM, MachineCodeEmitter &MCE) { @@ -55,424 +46,8 @@ return false; } -namespace { - class JITResolver { - SparcV9CodeEmitter &SparcV9; - MachineCodeEmitter &MCE; - - /// LazyCodeGenMap - Keep track of call sites for functions that are to be - /// lazily resolved. - /// - std::map LazyCodeGenMap; - - /// LazyResolverMap - Keep track of the lazy resolver created for a - /// particular function so that we can reuse them if necessary. - /// - std::map LazyResolverMap; - - public: - enum CallType { ShortCall, FarCall }; - - private: - /// We need to keep track of whether we used a simple call or a far call - /// (many instructions) in sequence. This means we need to keep track of - /// what type of stub we generate. - static std::map LazyCallFlavor; - - public: - JITResolver(SparcV9CodeEmitter &V9, - MachineCodeEmitter &mce) : SparcV9(V9), MCE(mce) {} - uint64_t getLazyResolver(Function *F); - uint64_t addFunctionReference(uint64_t Address, Function *F); - void deleteFunctionReference(uint64_t Address); - void addCallFlavor(uint64_t Address, CallType Flavor) { - LazyCallFlavor[Address] = Flavor; - } - - // Utility functions for accessing data from static callback - uint64_t getCurrentPCValue() { - return MCE.getCurrentPCValue(); - } - unsigned getBinaryCodeForInstr(MachineInstr &MI) { - return SparcV9.getBinaryCodeForInstr(MI); - } - - inline void insertFarJumpAtAddr(int64_t Value, uint64_t Addr); - void insertJumpAtAddr(int64_t Value, uint64_t &Addr); - - private: - uint64_t emitStubForFunction(Function *F); - static void SaveRegisters(uint64_t DoubleFP[], uint64_t CC[], - uint64_t Globals[]); - static void RestoreRegisters(uint64_t DoubleFP[], uint64_t CC[], - uint64_t Globals[]); - static void CompilationCallback(); - uint64_t resolveFunctionReference(uint64_t RetAddr); - - }; - - JITResolver *TheJITResolver; - std::map JITResolver::LazyCallFlavor; -} - -/// addFunctionReference - This method is called when we need to emit the -/// address of a function that has not yet been emitted, so we don't know the -/// address. Instead, we emit a call to the CompilationCallback method, and -/// keep track of where we are. -/// -uint64_t JITResolver::addFunctionReference(uint64_t Address, Function *F) { - LazyCodeGenMap[Address] = F; - return (intptr_t)&JITResolver::CompilationCallback; -} - -/// deleteFunctionReference - If we are emitting a far call, we already added a -/// reference to the function, but it is now incorrect, since the address to the -/// JIT resolver is too far away to be a simple call instruction. This is used -/// to remove the address from the map. -/// -void JITResolver::deleteFunctionReference(uint64_t Address) { - std::map::iterator I = LazyCodeGenMap.find(Address); - assert(I != LazyCodeGenMap.end() && "Not in map!"); - LazyCodeGenMap.erase(I); -} - -uint64_t JITResolver::resolveFunctionReference(uint64_t RetAddr) { - std::map::iterator I = LazyCodeGenMap.find(RetAddr); - assert(I != LazyCodeGenMap.end() && "Not in map!"); - Function *F = I->second; - LazyCodeGenMap.erase(I); - return MCE.forceCompilationOf(F); -} - -uint64_t JITResolver::getLazyResolver(Function *F) { - std::map::iterator I = LazyResolverMap.lower_bound(F); - if (I != LazyResolverMap.end() && I->first == F) return I->second; - - uint64_t Stub = emitStubForFunction(F); - LazyResolverMap.insert(I, std::make_pair(F, Stub)); - return Stub; -} - -void JITResolver::insertJumpAtAddr(int64_t JumpTarget, uint64_t &Addr) { - DEBUG(std::cerr << "Emitting a jump to 0x" << std::hex << JumpTarget << "\n"); - - // If the target function is close enough to fit into the 19bit disp of - // BA, we should use this version, as it's much cheaper to generate. - int64_t BranchTarget = (JumpTarget-Addr) >> 2; - if (BranchTarget >= (1 << 19) || BranchTarget <= -(1 << 19)) { - TheJITResolver->insertFarJumpAtAddr(JumpTarget, Addr); - } else { - // ba - MachineInstr *I = BuildMI(V9::BA, 1).addSImm(BranchTarget); - *((unsigned*)(intptr_t)Addr) = getBinaryCodeForInstr(*I); - Addr += 4; - delete I; - - // nop - I = BuildMI(V9::NOP, 0); - *((unsigned*)(intptr_t)Addr) = getBinaryCodeForInstr(*I); - delete I; - } -} - -void JITResolver::insertFarJumpAtAddr(int64_t Target, uint64_t Addr) { - static const unsigned - o6 = SparcV9IntRegClass::o6, g0 = SparcV9IntRegClass::g0, - g1 = SparcV9IntRegClass::g1, g5 = SparcV9IntRegClass::g5; - - MachineInstr* BinaryCode[] = { - // - // Get address to branch into %g1, using %g5 as a temporary - // - // sethi %uhi(Target), %g5 ;; get upper 22 bits of Target into %g5 - BuildMI(V9::SETHI, 2).addSImm(Target >> 42).addReg(g5), - // or %g5, %ulo(Target), %g5 ;; get 10 lower bits of upper word into %g5 - BuildMI(V9::ORi, 3).addReg(g5).addSImm((Target >> 32) & 0x03ff).addReg(g5), - // sllx %g5, 32, %g5 ;; shift those 10 bits to the upper word - BuildMI(V9::SLLXi6, 3).addReg(g5).addSImm(32).addReg(g5), - // sethi %hi(Target), %g1 ;; extract bits 10-31 into the dest reg - BuildMI(V9::SETHI, 2).addSImm((Target >> 10) & 0x03fffff).addReg(g1), - // or %g5, %g1, %g1 ;; get upper word (in %g5) into %g1 - BuildMI(V9::ORr, 3).addReg(g5).addReg(g1).addReg(g1), - // or %g1, %lo(Target), %g1 ;; get lowest 10 bits of Target into %g1 - BuildMI(V9::ORi, 3).addReg(g1).addSImm(Target & 0x03ff).addReg(g1), - // jmpl %g1, %g0, %g0 ;; indirect branch on %g1 - BuildMI(V9::JMPLRETr, 3).addReg(g1).addReg(g0).addReg(g0), - // nop ;; delay slot - BuildMI(V9::NOP, 0) - }; - - for (unsigned i=0, e=sizeof(BinaryCode)/sizeof(BinaryCode[0]); i!=e; ++i) { - *((unsigned*)(intptr_t)Addr) = getBinaryCodeForInstr(*BinaryCode[i]); - delete BinaryCode[i]; - Addr += 4; - } -} - -void JITResolver::SaveRegisters(uint64_t DoubleFP[], uint64_t CC[], - uint64_t Globals[]) { -#if defined(__sparcv9) - - __asm__ __volatile__ (// Save condition-code registers - "stx %%fsr, %0;\n\t" - "rd %%fprs, %1;\n\t" - "rd %%ccr, %2;\n\t" - : "=m"(CC[0]), "=r"(CC[1]), "=r"(CC[2])); - - __asm__ __volatile__ (// Save globals g1 and g5 - "stx %%g1, %0;\n\t" - "stx %%g5, %0;\n\t" - : "=m"(Globals[0]), "=m"(Globals[1])); - - // GCC says: `asm' only allows up to thirty parameters! - __asm__ __volatile__ (// Save Single/Double FP registers, part 1 - "std %%f0, %0;\n\t" "std %%f2, %1;\n\t" - "std %%f4, %2;\n\t" "std %%f6, %3;\n\t" - "std %%f8, %4;\n\t" "std %%f10, %5;\n\t" - "std %%f12, %6;\n\t" "std %%f14, %7;\n\t" - "std %%f16, %8;\n\t" "std %%f18, %9;\n\t" - "std %%f20, %10;\n\t" "std %%f22, %11;\n\t" - "std %%f24, %12;\n\t" "std %%f26, %13;\n\t" - "std %%f28, %14;\n\t" "std %%f30, %15;\n\t" - : "=m"(DoubleFP[ 0]), "=m"(DoubleFP[ 1]), - "=m"(DoubleFP[ 2]), "=m"(DoubleFP[ 3]), - "=m"(DoubleFP[ 4]), "=m"(DoubleFP[ 5]), - "=m"(DoubleFP[ 6]), "=m"(DoubleFP[ 7]), - "=m"(DoubleFP[ 8]), "=m"(DoubleFP[ 9]), - "=m"(DoubleFP[10]), "=m"(DoubleFP[11]), - "=m"(DoubleFP[12]), "=m"(DoubleFP[13]), - "=m"(DoubleFP[14]), "=m"(DoubleFP[15])); - - __asm__ __volatile__ (// Save Double FP registers, part 2 - "std %%f32, %0;\n\t" "std %%f34, %1;\n\t" - "std %%f36, %2;\n\t" "std %%f38, %3;\n\t" - "std %%f40, %4;\n\t" "std %%f42, %5;\n\t" - "std %%f44, %6;\n\t" "std %%f46, %7;\n\t" - "std %%f48, %8;\n\t" "std %%f50, %9;\n\t" - "std %%f52, %10;\n\t" "std %%f54, %11;\n\t" - "std %%f56, %12;\n\t" "std %%f58, %13;\n\t" - "std %%f60, %14;\n\t" "std %%f62, %15;\n\t" - : "=m"(DoubleFP[16]), "=m"(DoubleFP[17]), - "=m"(DoubleFP[18]), "=m"(DoubleFP[19]), - "=m"(DoubleFP[20]), "=m"(DoubleFP[21]), - "=m"(DoubleFP[22]), "=m"(DoubleFP[23]), - "=m"(DoubleFP[24]), "=m"(DoubleFP[25]), - "=m"(DoubleFP[26]), "=m"(DoubleFP[27]), - "=m"(DoubleFP[28]), "=m"(DoubleFP[29]), - "=m"(DoubleFP[30]), "=m"(DoubleFP[31])); -#else - std::cerr << "ERROR: RUNNING CODE THAT ONLY WORKS ON A SPARCV9 HOST!\n"; - abort(); -#endif -} - - -void JITResolver::RestoreRegisters(uint64_t DoubleFP[], uint64_t CC[], - uint64_t Globals[]) -{ -#if defined(__sparcv9) - - __asm__ __volatile__ (// Restore condition-code registers - "ldx %0, %%fsr;\n\t" - "wr %1, 0, %%fprs;\n\t" - "wr %2, 0, %%ccr;\n\t" - :: "m"(CC[0]), "r"(CC[1]), "r"(CC[2])); - - __asm__ __volatile__ (// Restore globals g1 and g5 - "ldx %0, %%g1;\n\t" - "ldx %0, %%g5;\n\t" - :: "m"(Globals[0]), "m"(Globals[1])); - - // GCC says: `asm' only allows up to thirty parameters! - __asm__ __volatile__ (// Restore Single/Double FP registers, part 1 - "ldd %0, %%f0;\n\t" "ldd %1, %%f2;\n\t" - "ldd %2, %%f4;\n\t" "ldd %3, %%f6;\n\t" - "ldd %4, %%f8;\n\t" "ldd %5, %%f10;\n\t" - "ldd %6, %%f12;\n\t" "ldd %7, %%f14;\n\t" - "ldd %8, %%f16;\n\t" "ldd %9, %%f18;\n\t" - "ldd %10, %%f20;\n\t" "ldd %11, %%f22;\n\t" - "ldd %12, %%f24;\n\t" "ldd %13, %%f26;\n\t" - "ldd %14, %%f28;\n\t" "ldd %15, %%f30;\n\t" - :: "m"(DoubleFP[0]), "m"(DoubleFP[1]), - "m"(DoubleFP[2]), "m"(DoubleFP[3]), - "m"(DoubleFP[4]), "m"(DoubleFP[5]), - "m"(DoubleFP[6]), "m"(DoubleFP[7]), - "m"(DoubleFP[8]), "m"(DoubleFP[9]), - "m"(DoubleFP[10]), "m"(DoubleFP[11]), - "m"(DoubleFP[12]), "m"(DoubleFP[13]), - "m"(DoubleFP[14]), "m"(DoubleFP[15])); - - __asm__ __volatile__ (// Restore Double FP registers, part 2 - "ldd %0, %%f32;\n\t" "ldd %1, %%f34;\n\t" - "ldd %2, %%f36;\n\t" "ldd %3, %%f38;\n\t" - "ldd %4, %%f40;\n\t" "ldd %5, %%f42;\n\t" - "ldd %6, %%f44;\n\t" "ldd %7, %%f46;\n\t" - "ldd %8, %%f48;\n\t" "ldd %9, %%f50;\n\t" - "ldd %10, %%f52;\n\t" "ldd %11, %%f54;\n\t" - "ldd %12, %%f56;\n\t" "ldd %13, %%f58;\n\t" - "ldd %14, %%f60;\n\t" "ldd %15, %%f62;\n\t" - :: "m"(DoubleFP[16]), "m"(DoubleFP[17]), - "m"(DoubleFP[18]), "m"(DoubleFP[19]), - "m"(DoubleFP[20]), "m"(DoubleFP[21]), - "m"(DoubleFP[22]), "m"(DoubleFP[23]), - "m"(DoubleFP[24]), "m"(DoubleFP[25]), - "m"(DoubleFP[26]), "m"(DoubleFP[27]), - "m"(DoubleFP[28]), "m"(DoubleFP[29]), - "m"(DoubleFP[30]), "m"(DoubleFP[31])); -#else - std::cerr << "ERROR: RUNNING CODE THAT ONLY WORKS ON A SPARCV9 HOST!\n"; - abort(); -#endif -} - -void JITResolver::CompilationCallback() { - // Local space to save the registers - uint64_t DoubleFP[32]; - uint64_t CC[3]; - uint64_t Globals[2]; - - SaveRegisters(DoubleFP, CC, Globals); - ++CallbackCalls; - - uint64_t CameFrom = (uint64_t)(intptr_t)__builtin_return_address(0); - uint64_t CameFrom1 = (uint64_t)(intptr_t)__builtin_return_address(1); - int64_t Target = (int64_t)TheJITResolver->resolveFunctionReference(CameFrom); - DEBUG(std::cerr << "In callback! Addr=0x" << std::hex << CameFrom << "\n"); - register int64_t returnAddr = 0; -#if defined(__sparcv9) - __asm__ __volatile__ ("add %%i7, %%g0, %0" : "=r" (returnAddr) : ); - DEBUG(std::cerr << "Read i7 (return addr) = " - << std::hex << returnAddr << ", value: " - << std::hex << *(unsigned*)returnAddr << "\n"); -#else - std::cerr << "ERROR: RUNNING CODE THAT ONLY WORKS ON A SPARCV9 HOST!\n"; - abort(); -#endif - - // If we can rewrite the ORIGINAL caller, we eliminate the whole need for a - // trampoline function stub!! - unsigned OrigCallInst = *((unsigned*)(intptr_t)CameFrom1); - int64_t OrigTarget = (Target-CameFrom1) >> 2; - if ((OrigCallInst & (1 << 30)) && - (OrigTarget <= (1 << 30) && OrigTarget >= -(1 << 30))) - { - // The original call instruction was CALL , which means we can - // overwrite it directly, since the offset will fit into 30 bits - MachineInstr *C = BuildMI(V9::CALL, 1).addSImm(OrigTarget); - *((unsigned*)(intptr_t)CameFrom1)=TheJITResolver->getBinaryCodeForInstr(*C); - delete C; - ++OverwrittenCalls; - } else { - ++UnmodifiedCalls; - } - - // Rewrite the call target so that we don't fault every time we execute it. - // - - static const unsigned o6 = SparcV9IntRegClass::o6; - - // Subtract enough to overwrite up to the 'save' instruction - // This depends on whether we made a short call (1 instruction) or the - // farCall (7 instructions) - uint64_t Offset = (LazyCallFlavor[CameFrom] == ShortCall) ? 4 : 28; - uint64_t CodeBegin = CameFrom - Offset; - - // FIXME FIXME FIXME FIXME: __builtin_frame_address doesn't work if frame - // pointer elimination has been performed. Having a variable sized alloca - // disables frame pointer elimination currently, even if it's dead. This is - // a gross hack. - alloca(42+Offset); - // FIXME FIXME FIXME FIXME - - // Make sure that what we're about to overwrite is indeed "save" - MachineInstr *SV =BuildMI(V9::SAVEi, 3).addReg(o6).addSImm(-192).addReg(o6); - unsigned SaveInst = TheJITResolver->getBinaryCodeForInstr(*SV); - delete SV; - unsigned CodeInMem = *(unsigned*)(intptr_t)CodeBegin; - if (CodeInMem != SaveInst) { - std::cerr << "About to overwrite smthg not a save instr!"; - abort(); - } - // Overwrite it - TheJITResolver->insertJumpAtAddr(Target, CodeBegin); - - // Flush the I-Cache: FLUSH clears out a doubleword at a given address - // Self-modifying code MUST clear out the I-Cache to be portable -#if defined(__sparcv9) - for (int i = -Offset, e = 32-((int64_t)Offset); i < e; i += 8) - __asm__ __volatile__ ("flush %%i7 + %0" : : "r" (i)); -#endif - - // Change the return address to re-execute the restore, then the jump. - DEBUG(std::cerr << "Callback returning to: 0x" - << std::hex << (CameFrom-Offset-12) << "\n"); -#if defined(__sparcv9) - __asm__ __volatile__ ("sub %%i7, %0, %%i7" : : "r" (Offset+12)); -#endif - - RestoreRegisters(DoubleFP, CC, Globals); -} - -/// emitStubForFunction - This method is used by the JIT when it needs to emit -/// the address of a function for a function whose code has not yet been -/// generated. In order to do this, it generates a stub which jumps to the lazy -/// function compiler, which will eventually get fixed to call the function -/// directly. -/// -uint64_t JITResolver::emitStubForFunction(Function *F) { - MCE.startFunctionStub(44); - - DEBUG(std::cerr << "Emitting stub at addr: 0x" - << std::hex << MCE.getCurrentPCValue() << "\n"); - - unsigned o6 = SparcV9IntRegClass::o6, g0 = SparcV9IntRegClass::g0; - - // restore %g0, 0, %g0 - MachineInstr *R = BuildMI(V9::RESTOREi, 3).addMReg(g0).addSImm(0) - .addMReg(g0, MachineOperand::Def); - SparcV9.emitWord(SparcV9.getBinaryCodeForInstr(*R)); - delete R; - - // save %sp, -192, %sp - MachineInstr *SV = BuildMI(V9::SAVEi, 3).addReg(o6).addSImm(-192).addReg(o6); - SparcV9.emitWord(SparcV9.getBinaryCodeForInstr(*SV)); - delete SV; - - int64_t CurrPC = MCE.getCurrentPCValue(); - int64_t Addr = (int64_t)addFunctionReference(CurrPC, F); - int64_t CallTarget = (Addr-CurrPC) >> 2; - if (CallTarget >= (1 << 29) || CallTarget <= -(1 << 29)) { - // Since this is a far call, the actual address of the call is shifted - // by the number of instructions it takes to calculate the exact address - deleteFunctionReference(CurrPC); - SparcV9.emitFarCall(Addr, F); - } else { - // call CallTarget ;; invoke the callback - MachineInstr *Call = BuildMI(V9::CALL, 1).addSImm(CallTarget); - SparcV9.emitWord(SparcV9.getBinaryCodeForInstr(*Call)); - delete Call; - - // nop ;; call delay slot - MachineInstr *Nop = BuildMI(V9::NOP, 0); - SparcV9.emitWord(SparcV9.getBinaryCodeForInstr(*Nop)); - delete Nop; - - addCallFlavor(CurrPC, ShortCall); - } - - SparcV9.emitWord(0xDEADBEEF); // marker so that we know it's really a stub - return (intptr_t)MCE.finishFunctionStub(F)+4; /* 1 instr past the restore */ -} - SparcV9CodeEmitter::SparcV9CodeEmitter(TargetMachine &tm, - MachineCodeEmitter &M): TM(tm), MCE(M) -{ - TheJITResolver = new JITResolver(*this, M); -} - -SparcV9CodeEmitter::~SparcV9CodeEmitter() { - delete TheJITResolver; -} + MachineCodeEmitter &M): TM(tm), MCE(M) {} void SparcV9CodeEmitter::emitWord(unsigned Val) { MCE.emitWord(Val); @@ -550,62 +125,12 @@ } -// WARNING: if the call used the delay slot to do meaningful work, that's not -// being accounted for, and the behavior will be incorrect!! -inline void SparcV9CodeEmitter::emitFarCall(uint64_t Target, Function *F) { - static const unsigned o6 = SparcV9IntRegClass::o6, - o7 = SparcV9IntRegClass::o7, g0 = SparcV9IntRegClass::g0, - g1 = SparcV9IntRegClass::g1, g5 = SparcV9IntRegClass::g5; - - MachineInstr* BinaryCode[] = { - // - // Get address to branch into %g1, using %g5 as a temporary - // - // sethi %uhi(Target), %g5 ;; get upper 22 bits of Target into %g5 - BuildMI(V9::SETHI, 2).addSImm(Target >> 42).addReg(g5), - // or %g5, %ulo(Target), %g5 ;; get 10 lower bits of upper word into %1 - BuildMI(V9::ORi, 3).addReg(g5).addSImm((Target >> 32) & 0x03ff).addReg(g5), - // sllx %g5, 32, %g5 ;; shift those 10 bits to the upper word - BuildMI(V9::SLLXi6, 3).addReg(g5).addSImm(32).addReg(g5), - // sethi %hi(Target), %g1 ;; extract bits 10-31 into the dest reg - BuildMI(V9::SETHI, 2).addSImm((Target >> 10) & 0x03fffff).addReg(g1), - // or %g5, %g1, %g1 ;; get upper word (in %g5) into %g1 - BuildMI(V9::ORr, 3).addReg(g5).addReg(g1).addReg(g1), - // or %g1, %lo(Target), %g1 ;; get lowest 10 bits of Target into %g1 - BuildMI(V9::ORi, 3).addReg(g1).addSImm(Target & 0x03ff).addReg(g1), - // jmpl %g1, %g0, %o7 ;; indirect call on %g1 - BuildMI(V9::JMPLRETr, 3).addReg(g1).addReg(g0).addReg(o7), - // nop ;; delay slot - BuildMI(V9::NOP, 0) - }; - - for (unsigned i=0, e=sizeof(BinaryCode)/sizeof(BinaryCode[0]); i!=e; ++i) { - // This is where we save the return address in the LazyResolverMap!! - if (i == 6 && F != 0) { // Do this right before the JMPL - uint64_t CurrPC = MCE.getCurrentPCValue(); - TheJITResolver->addFunctionReference(CurrPC, F); - // Remember that this is a far call, to subtract appropriate offset later - TheJITResolver->addCallFlavor(CurrPC, JITResolver::FarCall); - } - - emitWord(getBinaryCodeForInstr(*BinaryCode[i])); - delete BinaryCode[i]; - } -} - -void SparcV9JITInfo::replaceMachineCodeForFunction (void *Old, void *New) { - assert (TheJITResolver && - "Can only call replaceMachineCodeForFunction from within JIT"); - uint64_t Target = (uint64_t)(intptr_t)New; - uint64_t CodeBegin = (uint64_t)(intptr_t)Old; - TheJITResolver->insertJumpAtAddr(Target, CodeBegin); -} int64_t SparcV9CodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) { int64_t rv = 0; // Return value; defaults to 0 for unhandled cases // or things that get fixed up later by the JIT. - if (MO.isPCRelativeDisp()) { + if (MO.isPCRelativeDisp() || MO.isGlobalAddress()) { DEBUG(std::cerr << "PCRelativeDisp: "); Value *V = MO.getVRegValue(); if (BasicBlock *BB = dyn_cast(V)) { @@ -617,48 +142,35 @@ // So undo that: give the instruction (CI - PC) / 4 rv = (CI->getRawValue() - MCE.getCurrentPCValue()) / 4; } else if (GlobalValue *GV = dyn_cast(V)) { - // same as MO.isGlobalAddress() - DEBUG(std::cerr << "GlobalValue: "); - // external function calls, etc.? - if (Function *F = dyn_cast(GV)) { - DEBUG(std::cerr << "Function: "); - // NOTE: This results in stubs being generated even for - // external, native functions, which is not optimal. See PR103. - rv = (int64_t)MCE.getGlobalValueAddress(F); - if (rv == 0) { - DEBUG(std::cerr << "not yet generated\n"); - // Function has not yet been code generated! - TheJITResolver->addFunctionReference(MCE.getCurrentPCValue(), F); - // Delayed resolution... - rv = TheJITResolver->getLazyResolver(F); - } else { - DEBUG(std::cerr << "already generated: 0x" << std::hex << rv << "\n"); - } - } else { - rv = (int64_t)MCE.getGlobalValueAddress(GV); - DEBUG(std::cerr << "Global addr: 0x" << std::hex << rv << "\n"); - } - // The real target of the call is Addr = PC + (rv * 4) - // So undo that: give the instruction (Addr - PC) / 4 + unsigned Reloc; + bool isLocal = false; if (MI.getOpcode() == V9::CALL) { - int64_t CurrPC = MCE.getCurrentPCValue(); - DEBUG(std::cerr << "rv addr: 0x" << std::hex << rv << "\n" - << "curr PC: 0x" << std::hex << CurrPC << "\n"); - int64_t CallInstTarget = (rv - CurrPC) >> 2; - if (CallInstTarget >= (1<<29) || CallInstTarget <= -(1<<29)) { - DEBUG(std::cerr << "Making far call!\n"); - // address is out of bounds for the 30-bit call, - // make an indirect jump-and-link - emitFarCall(rv); - // this invalidates the instruction so that the call with an incorrect - // address will not be emitted - rv = 0; - } else { - // The call fits into 30 bits, so just return the corrected address - rv = CallInstTarget; - } - DEBUG(std::cerr << "returning addr: 0x" << rv << "\n"); + Reloc = V9::reloc_pcrel_call; +#if 0 // FIXME: No need to emit stubs for internal functions. + if (!GV->hasExternalLinkage() && isa(GV)) + isLocal = true; +#endif + } else if (MI.getOpcode() == V9::SETHI) { + if (MO.isHiBits64()) + Reloc = V9::reloc_sethi_hh; + else if (MO.isHiBits32()) + Reloc = V9::reloc_sethi_lm; + else + assert(0 && "Unknown relocation!"); + } else if (MI.getOpcode() == V9::ORi) { + if (MO.isLoBits32()) + Reloc = V9::reloc_or_lo; + else if (MO.isLoBits64()) + Reloc = V9::reloc_or_hm; + else + assert(0 && "Unknown relocation!"); + } else { + assert(0 && "Unknown relocation!"); } + + MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), Reloc, GV, + 0, isLocal)); + rv = 0; } else { std::cerr << "ERROR: PC relative disp unhandled:" << MO << "\n"; abort(); @@ -677,11 +189,6 @@ } else if (MO.isImmediate()) { rv = MO.getImmedValue(); DEBUG(std::cerr << "immed: " << rv << "\n"); - } else if (MO.isGlobalAddress()) { - DEBUG(std::cerr << "GlobalAddress: not PC-relative\n"); - rv = (int64_t) - (intptr_t)getGlobalAddress(cast(MO.getVRegValue()), - MI, MO.isPCRelative()); } else if (MO.isMachineBasicBlock()) { // Duplicate code of the above case for VirtualRegister, BasicBlock... // It should really hit this case, but SparcV9 backend uses VRegs instead @@ -784,47 +291,12 @@ void SparcV9CodeEmitter::emitBasicBlock(MachineBasicBlock &MBB) { currBB = MBB.getBasicBlock(); BBLocations[currBB] = MCE.getCurrentPCValue(); - for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I){ - unsigned binCode = getBinaryCodeForInstr(*I); - if (binCode == (1 << 30)) { - // this is an invalid call: the addr is out of bounds. that means a code - // sequence has already been emitted, and this is a no-op - DEBUG(std::cerr << "Call suppressed: already emitted far call.\n"); - } else { - emitWord(binCode); - } - } + for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I) + emitWord(getBinaryCodeForInstr(*I)); } -void* SparcV9CodeEmitter::getGlobalAddress(GlobalValue *V, MachineInstr &MI, - bool isPCRelative) -{ - if (isPCRelative) { // must be a call, this is a major hack! - // Try looking up the function to see if it is already compiled! - if (void *Addr = (void*)(intptr_t)MCE.getGlobalValueAddress(V)) { - intptr_t CurByte = MCE.getCurrentPCValue(); - // The real target of the call is Addr = PC + (target * 4) - // CurByte is the PC, Addr we just received - return (void*) (((long)Addr - (long)CurByte) >> 2); - } else { - if (Function *F = dyn_cast(V)) { - // Function has not yet been code generated! - TheJITResolver->addFunctionReference(MCE.getCurrentPCValue(), - cast(V)); - // Delayed resolution... - return - (void*)(intptr_t)TheJITResolver->getLazyResolver(cast(V)); - } else { - std::cerr << "Unhandled global: " << *V << "\n"; - abort(); - } - } - } else { - return (void*)(intptr_t)MCE.getGlobalValueAddress(V); - } -} +namespace llvm { #include "SparcV9CodeEmitter.inc" - } // End llvm namespace Index: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.h diff -u llvm/lib/Target/SparcV9/SparcV9CodeEmitter.h:1.18 llvm/lib/Target/SparcV9/SparcV9CodeEmitter.h:1.19 --- llvm/lib/Target/SparcV9/SparcV9CodeEmitter.h:1.18 Thu Apr 15 15:23:13 2004 +++ llvm/lib/Target/SparcV9/SparcV9CodeEmitter.h Mon Nov 22 14:25:10 2004 @@ -41,7 +41,7 @@ public: SparcV9CodeEmitter(TargetMachine &T, MachineCodeEmitter &M); - ~SparcV9CodeEmitter(); + ~SparcV9CodeEmitter() {} const char *getPassName() const { return "SparcV9 Machine Code Emitter"; } @@ -59,12 +59,6 @@ /// unsigned getBinaryCodeForInstr(MachineInstr &MI); - /// emitFarCall - produces a code sequence to make a call to a destination - /// that does not fit in the 30 bits that a call instruction allows. - /// If the function F is non-null, this also saves the return address in - /// the LazyResolver map of the JITResolver. - void emitFarCall(uint64_t Addr, Function *F = 0); - private: /// getMachineOpValue - /// From tbrethou at cs.uiuc.edu Mon Nov 22 14:41:40 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Mon, 22 Nov 2004 14:41:40 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp ModuloScheduling.cpp ModuloScheduling.h Message-ID: <200411222041.OAA10893@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/ModuloScheduling: MSSchedule.cpp updated: 1.8 -> 1.9 ModuloScheduling.cpp updated: 1.34 -> 1.35 ModuloScheduling.h updated: 1.19 -> 1.20 --- Log message: Fixed a bug where I was trying to ModuloSchedule a loop with no instructions but a terminator. Fixed a bug in the schedule generation that was always using the start cycle. --- Diffs of the changes: (+32 -9) Index: llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp diff -u llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp:1.8 llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp:1.9 --- llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp:1.8 Fri Oct 29 19:39:07 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp Mon Nov 22 14:41:23 2004 @@ -54,6 +54,9 @@ int currentCycle = cycle; bool success = true; + //map for easy backtracking, resource num at a certain cycle + //std::map backtrackMap; + //Get resource usage for this instruction InstrRUsage rUsage = msi->getInstrRUsage(node->getInst()->getOpcode()); std::vector > resources = rUsage.resourcesByCycle; @@ -74,8 +77,11 @@ std::map::iterator resourceUse = resourcesForCycle->second.find(resourceNum); if(resourceUse != resourcesForCycle->second.end()) { //Check if there are enough of this resource and if so, increase count and move on - if(resourceUse->second < CPUResource::getCPUResource(resourceNum)->maxNumUsers) + if(resourceUse->second < CPUResource::getCPUResource(resourceNum)->maxNumUsers) { ++resourceUse->second; + //Document that we increased the usage count for this resource at this cycle + + } else { success = false; } @@ -89,7 +95,8 @@ //Create a new map and put in our resource std::map resourceMap; resourceMap[resourceNum] = 1; - resourceNumPerCycle[cycle] = resourceMap; + resourceNumPerCycle[currentCycle] = resourceMap; + } if(!success) break; Index: llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp diff -u llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.34 llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.35 --- llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.34 Tue Nov 16 15:31:37 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp Mon Nov 22 14:41:24 2004 @@ -1,4 +1,3 @@ - //===-- ModuloScheduling.cpp - ModuloScheduling ----------------*- C++ -*-===// // // The LLVM Compiler Infrastructure @@ -25,6 +24,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/GraphWriter.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/ADT/Statistic.h" #include #include #include @@ -62,6 +62,9 @@ //Graph Traits for printing out the dependence graph namespace llvm { + Statistic<> ValidLoops("modulosched-validLoops", "Number of candidate loops modulo-scheduled"); + Statistic<> MSLoops("modulosched-schedLoops", "Number of loops successfully modulo-scheduled"); + Statistic<> IncreasedII("modulosched-increasedII", "Number of times we had to increase II"); template<> struct DOTGraphTraits : public DefaultDOTGraphTraits { @@ -136,8 +139,10 @@ //Iterate over BasicBlocks and put them into our worklist if they are valid for (MachineFunction::iterator BI = MF.begin(); BI != MF.end(); ++BI) - if(MachineBBisValid(BI)) + if(MachineBBisValid(BI)) { Worklist.push_back(&*BI); + ++ValidLoops; + } defaultInst = 0; @@ -217,7 +222,7 @@ //stage > 0 if(schedule.getMaxStage() != 0) { reconstructLoop(*BI); - numMS++; + ++MSLoops; Changed = true; } else @@ -241,9 +246,6 @@ //delete(*BI); } - - DEBUG(std::cerr << "Number of Loop Candidates: " << Worklist.size() << "\n Number ModuloScheduled: " << numMS << "\n"); - return Changed; } @@ -254,6 +256,10 @@ for(unsigned opNum = 0; opNum < I->getNumOperands(); ++opNum) { const MachineOperand &mOp = I->getOperand(opNum); if(mOp.getType() == MachineOperand::MO_VirtualRegister && mOp.isDef()) { + //assert if this is the second def we have seen + DEBUG(std::cerr << "Putting " << *(mOp.getVRegValue()) << " into map\n"); + assert(!defMap.count(mOp.getVRegValue()) && "Def already in the map"); + defMap[mOp.getVRegValue()] = &*I; } @@ -265,6 +271,7 @@ } } } + assert(defaultInst && "We must have a default instruction to use as our main point to add to machine code for instruction\n"); } @@ -286,6 +293,10 @@ if(!isLoop) return false; + //Check size of our basic block.. make sure we have more then just the terminator in it + if(BI->getBasicBlock()->size() == 1) + return false; + //Get Target machine instruction info const TargetInstrInfo *TMI = target.getInstrInfo(); @@ -705,7 +716,7 @@ //Get final distance calc distance += node->getInEdge(last).getIteDiff(); - + DEBUG(std::cerr << "Reccurrence Distance: " << distance << "\n"); //Adjust II until we get close to the inequality delay - II*distance <= 0 @@ -1187,6 +1198,7 @@ success = scheduleNode(*I, EarlyStart, EarlyStart + II - 1); if(!success) { + ++IncreasedII; ++II; schedule.clear(); break; @@ -1199,6 +1211,7 @@ success = schedule.constructKernel(II); DEBUG(std::cerr << "Done Constructing Schedule Kernel\n"); if(!success) { + ++IncreasedII; ++II; schedule.clear(); } @@ -1267,6 +1280,8 @@ MSchedGraphNode *branch = 0; MSchedGraphNode *BAbranch = 0; + schedule.print(std::cerr); + for(MSSchedule::kernel_iterator I = schedule.kernel_begin(), E = schedule.kernel_end(); I != E; ++I) { maxStageCount = std::max(maxStageCount, I->second); Index: llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h diff -u llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h:1.19 llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h:1.20 --- llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h:1.19 Tue Nov 16 15:31:37 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h Mon Nov 22 14:41:24 2004 @@ -113,6 +113,7 @@ public: ModuloSchedulingPass(TargetMachine &targ) : target(targ) {} virtual bool runOnFunction(Function &F); + virtual const char* getPassName() const { return "ModuloScheduling"; } }; } From lattner at cs.uiuc.edu Mon Nov 22 15:25:24 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 15:25:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp Message-ID: <200411222125.iAMLPO9w018475@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9CodeEmitter.cpp updated: 1.75 -> 1.76 --- Log message: Implement a disgusting hack to work around broken machine code emission of the RDCCR instruction. This fixes a bunch of programs with the JIT. --- Diffs of the changes: (+12 -1) Index: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp diff -u llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.75 llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.76 --- llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.75 Mon Nov 22 14:25:10 2004 +++ llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp Mon Nov 22 15:25:10 2004 @@ -292,7 +292,18 @@ currBB = MBB.getBasicBlock(); BBLocations[currBB] = MCE.getCurrentPCValue(); for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I) - emitWord(getBinaryCodeForInstr(*I)); + if (I->getOpcode() != V9::RDCCR) { + emitWord(getBinaryCodeForInstr(*I)); + } else { + // FIXME: The tblgen produced code emitter cannot deal with the fact that + // machine operand #0 of the RDCCR instruction should be ignored. This is + // really a bug in the representation of the RDCCR instruction (which has + // no need to explicitly represent the CCR dest), but we hack around it + // here. + unsigned RegNo = getMachineOpValue(*I, I->getOperand(1)); + RegNo &= (1<<5)-1; + emitWord((RegNo << 25) | 2168487936U); + } } From lattner at cs.uiuc.edu Mon Nov 22 15:26:14 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 15:26:14 -0600 (CST) Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Olden/voronoi/defines.h Message-ID: <200411222126.PAA11809@kain.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Olden/voronoi: defines.h updated: 1.3 -> 1.4 --- Log message: Remove unused typedef --- Diffs of the changes: (+0 -1) Index: llvm-test/MultiSource/Benchmarks/Olden/voronoi/defines.h diff -u llvm-test/MultiSource/Benchmarks/Olden/voronoi/defines.h:1.3 llvm-test/MultiSource/Benchmarks/Olden/voronoi/defines.h:1.4 --- llvm-test/MultiSource/Benchmarks/Olden/voronoi/defines.h:1.3 Sun Jan 12 18:54:55 2003 +++ llvm-test/MultiSource/Benchmarks/Olden/voronoi/defines.h Mon Nov 22 15:25:58 2004 @@ -3,7 +3,6 @@ #include typedef int BOOLEAN; -typedef unsigned long long uint64_t; typedef unsigned long uptrint; struct edge_rec { From lattner at cs.uiuc.edu Mon Nov 22 15:42:52 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 15:42:52 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp Message-ID: <200411222142.PAA12421@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9CodeEmitter.cpp updated: 1.76 -> 1.77 --- Log message: Remove some dead vars and some useless namespacification --- Diffs of the changes: (+1 -10) Index: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp diff -u llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.76 llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.77 --- llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.76 Mon Nov 22 15:25:10 2004 +++ llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp Mon Nov 22 15:42:40 2004 @@ -143,13 +143,8 @@ rv = (CI->getRawValue() - MCE.getCurrentPCValue()) / 4; } else if (GlobalValue *GV = dyn_cast(V)) { unsigned Reloc; - bool isLocal = false; if (MI.getOpcode() == V9::CALL) { Reloc = V9::reloc_pcrel_call; -#if 0 // FIXME: No need to emit stubs for internal functions. - if (!GV->hasExternalLinkage() && isa(GV)) - isLocal = true; -#endif } else if (MI.getOpcode() == V9::SETHI) { if (MO.isHiBits64()) Reloc = V9::reloc_sethi_hh; @@ -168,8 +163,7 @@ assert(0 && "Unknown relocation!"); } - MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), Reloc, GV, - 0, isLocal)); + MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), Reloc, GV)); rv = 0; } else { std::cerr << "ERROR: PC relative disp unhandled:" << MO << "\n"; @@ -306,8 +300,5 @@ } } - -namespace llvm { #include "SparcV9CodeEmitter.inc" -} // End llvm namespace From lattner at cs.uiuc.edu Mon Nov 22 15:46:09 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 15:46:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200411222146.iAMLk9GF023006@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.13 -> 1.14 --- Log message: This chunk of code needs to be rewritten --- Diffs of the changes: (+3 -28) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.13 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.14 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.13 Fri Nov 19 22:14:44 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Mon Nov 22 15:45:54 2004 @@ -274,34 +274,9 @@ } else if (MO.isImmediate()) { rv = MO.getImmedValue(); } else if (MO.isGlobalAddress()) { - GlobalValue *GV = MO.getGlobal(); - rv = MCE.getGlobalValueAddress(GV); - if (rv == 0) { - if (Function *F = dyn_cast(GV)) { - if (F->isExternal()) - rv = getAddressOfExternalFunction(F); - else { - // Function has not yet been code generated! Use lazy resolution. - getResolver(MCE).addFunctionReference(MCE.getCurrentPCValue(), F); - rv = getResolver(MCE).getLazyResolver(F); - } - } else if (GlobalVariable *GVar = dyn_cast(GV)) { - if (GVar->isExternal()) { - rv = MCE.getGlobalValueAddress(MO.getSymbolName()); - if (!rv) { - std::cerr << "PPC32CodeEmitter: External global addr not found: " - << *GVar; - abort(); - } - } else { - std::cerr << "PPC32CodeEmitter: global addr not found: " << *GVar; - abort(); - } - } - } - if (MO.isPCRelative()) { // Global variable reference - rv = (rv - MCE.getCurrentPCValue()) >> 2; - } + //GlobalValue *GV = MO.getGlobal(); + // FIXME: Emit a relocation here. + rv = 0; } else if (MO.isMachineBasicBlock()) { const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock(); unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); From lattner at cs.uiuc.edu Mon Nov 22 15:48:15 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 15:48:15 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineCodeEmitter.h Message-ID: <200411222148.iAMLmFuE027145@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineCodeEmitter.h updated: 1.23 -> 1.24 --- Log message: These methods are now obsolete --- Diffs of the changes: (+0 -10) Index: llvm/include/llvm/CodeGen/MachineCodeEmitter.h diff -u llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.23 llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.24 --- llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.23 Sat Nov 20 17:52:43 2004 +++ llvm/include/llvm/CodeGen/MachineCodeEmitter.h Mon Nov 22 15:48:01 2004 @@ -89,16 +89,6 @@ /// noted with this interface. virtual void addRelocation(const MachineRelocation &MR) = 0; - /// getGlobalValueAddress - This method is used to get the address of the - /// specified global value. In some cases, however, the address may not yet - /// be known at the point that the method is called (for example, getting the - /// address of a function which has not yet been code generated). If this is - /// the case, the function returns zero, and the callee has to be able to - /// handle the situation. - /// - virtual uint64_t getGlobalValueAddress(GlobalValue *V) = 0; - virtual uint64_t getGlobalValueAddress(const char *SymName) = 0; - // getConstantPoolEntryAddress - Return the address of the 'Index' entry in // the constant pool that was last emitted with the 'emitConstantPool' method. // From lattner at cs.uiuc.edu Mon Nov 22 15:48:31 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 15:48:31 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineCodeEmitter.cpp Message-ID: <200411222148.iAMLmVgT027371@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineCodeEmitter.cpp updated: 1.20 -> 1.21 --- Log message: These methods are obsolete --- Diffs of the changes: (+0 -8) Index: llvm/lib/CodeGen/MachineCodeEmitter.cpp diff -u llvm/lib/CodeGen/MachineCodeEmitter.cpp:1.20 llvm/lib/CodeGen/MachineCodeEmitter.cpp:1.21 --- llvm/lib/CodeGen/MachineCodeEmitter.cpp:1.20 Sat Nov 20 17:52:52 2004 +++ llvm/lib/CodeGen/MachineCodeEmitter.cpp Mon Nov 22 15:48:19 2004 @@ -51,8 +51,6 @@ std::cout << " "; } - uint64_t getGlobalValueAddress(GlobalValue *V) { return 0; } - uint64_t getGlobalValueAddress(const char *Name) { return 0; } uint64_t getConstantPoolEntryAddress(unsigned Num) { return 0; } uint64_t getCurrentPCValue() { return 0; } uint64_t getCurrentPCOffset() { return 0; } @@ -150,12 +148,6 @@ void emitWordAt(unsigned W, unsigned *Ptr) { MCE.emitWordAt(W, Ptr); } - uint64_t getGlobalValueAddress(GlobalValue *V) { - return MCE.getGlobalValueAddress(V); - } - uint64_t getGlobalValueAddress(const char *Name) { - return MCE.getGlobalValueAddress(Name); - } uint64_t getConstantPoolEntryAddress(unsigned Num) { return MCE.getConstantPoolEntryAddress(Num); } From lattner at cs.uiuc.edu Mon Nov 22 15:48:45 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 15:48:45 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/Emitter.cpp Message-ID: <200411222148.iAMLmjij027790@apoc.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: Emitter.cpp updated: 1.53 -> 1.54 --- Log message: These methods are obsolete --- Diffs of the changes: (+1 -21) Index: llvm/lib/ExecutionEngine/JIT/Emitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.53 llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.54 --- llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.53 Mon Nov 22 01:24:43 2004 +++ llvm/lib/ExecutionEngine/JIT/Emitter.cpp Mon Nov 22 15:48:33 2004 @@ -169,7 +169,7 @@ } DEBUG(std::cerr << "JIT: Stub emitted at [" << Stub << "] for function '" - << F->getName() << "\n"); + << F->getName() << "'\n"); // Finally, keep track of the stub-to-Function mapping so that the // JITCompilerFn knows which function to compile! @@ -250,8 +250,6 @@ virtual uint64_t getCurrentPCValue(); virtual uint64_t getCurrentPCOffset(); - virtual uint64_t getGlobalValueAddress(GlobalValue *V); - virtual uint64_t getGlobalValueAddress(const char *Name); virtual uint64_t getConstantPoolEntryAddress(unsigned Entry); // forceCompilationOf - Force the compilation of the specified function, and @@ -398,24 +396,6 @@ *Ptr = W; } -uint64_t Emitter::getGlobalValueAddress(GlobalValue *V) { - // Try looking up the function to see if it is already compiled, if not return - // 0. - if (Function *F = dyn_cast(V)) { - void *Addr = TheJIT->getPointerToGlobalIfAvailable(F); - if (Addr == 0 && F->hasExternalLinkage()) { - // Do not output stubs for external functions. - Addr = TheJIT->getPointerToFunction(F); - } - return (intptr_t)Addr; - } else { - return (intptr_t)TheJIT->getOrEmitGlobalVariable(cast(V)); - } -} -uint64_t Emitter::getGlobalValueAddress(const char *Name) { - return (intptr_t)TheJIT->getPointerToNamedFunction(Name); -} - // getConstantPoolEntryAddress - Return the address of the 'ConstantNum' entry // in the constant pool that was last emitted with the 'emitConstantPool' // method. From lattner at cs.uiuc.edu Mon Nov 22 15:51:54 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 15:51:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200411222151.iAMLpsCi031304@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.14 -> 1.15 --- Log message: Disable this. --- Diffs of the changes: (+4 -2) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.14 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.15 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.14 Mon Nov 22 15:45:54 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Mon Nov 22 15:51:40 2004 @@ -78,7 +78,8 @@ assert(I != LazyCodeGenMap.end() && "Not in map!"); Function *F = I->second; LazyCodeGenMap.erase(I); - return MCE.forceCompilationOf(F); + // FIXME: this needs to be rewritten. + return 0; //MCE.forceCompilationOf(F); } /// emitStubForFunction - This method is used by the JIT when it needs to emit @@ -220,8 +221,9 @@ static std::map ExternalFn2Addr; std::map::iterator Addr = ExternalFn2Addr.find(F); + // FIXME: this needs to be rewritten. if (Addr == ExternalFn2Addr.end()) - ExternalFn2Addr[F] = MCE.forceCompilationOf(F); + ExternalFn2Addr[F] = 0; //MCE.forceCompilationOf(F); return ExternalFn2Addr[F]; } From lattner at cs.uiuc.edu Mon Nov 22 15:54:28 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 15:54:28 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineCodeEmitter.h Message-ID: <200411222154.iAMLsSaa001915@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineCodeEmitter.h updated: 1.24 -> 1.25 --- Log message: Fix the FIXME, nuke the JIT specific forceCompilationOf method. --- Diffs of the changes: (+0 -7) Index: llvm/include/llvm/CodeGen/MachineCodeEmitter.h diff -u llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.24 llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.25 --- llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.24 Mon Nov 22 15:48:01 2004 +++ llvm/include/llvm/CodeGen/MachineCodeEmitter.h Mon Nov 22 15:54:14 2004 @@ -94,13 +94,6 @@ // virtual uint64_t getConstantPoolEntryAddress(unsigned Index) = 0; - // forceCompilationOf - Force the compilation of the specified function, and - // return its address, because we REALLY need the address now. - // - // FIXME: This is JIT specific! - // - virtual uint64_t forceCompilationOf(Function *F) = 0; - /// createDebugEmitter - Return a dynamically allocated machine /// code emitter, which just prints the opcodes and fields out the cout. This /// can be used for debugging users of the MachineCodeEmitter interface. From lattner at cs.uiuc.edu Mon Nov 22 15:54:39 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 15:54:39 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineCodeEmitter.cpp Message-ID: <200411222154.iAMLsdfO001933@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineCodeEmitter.cpp updated: 1.21 -> 1.22 --- Log message: Fix the FIXME, nuke the JIT specific forceCompilationOf method. --- Diffs of the changes: (+0 -18) Index: llvm/lib/CodeGen/MachineCodeEmitter.cpp diff -u llvm/lib/CodeGen/MachineCodeEmitter.cpp:1.21 llvm/lib/CodeGen/MachineCodeEmitter.cpp:1.22 --- llvm/lib/CodeGen/MachineCodeEmitter.cpp:1.21 Mon Nov 22 15:48:19 2004 +++ llvm/lib/CodeGen/MachineCodeEmitter.cpp Mon Nov 22 15:54:26 2004 @@ -54,15 +54,6 @@ uint64_t getConstantPoolEntryAddress(unsigned Num) { return 0; } uint64_t getCurrentPCValue() { return 0; } uint64_t getCurrentPCOffset() { return 0; } - - // forceCompilationOf - Force the compilation of the specified function, and - // return its address, because we REALLY need the address now. - // - // FIXME: This is JIT specific! - // - virtual uint64_t forceCompilationOf(Function *F) { - return 0; - } }; class FilePrinterEmitter : public MachineCodeEmitter { @@ -160,15 +151,6 @@ void addRelocation(const MachineRelocation &MR) { return MCE.addRelocation(MR); } - - // forceCompilationOf - Force the compilation of the specified function, and - // return its address, because we REALLY need the address now. - // - // FIXME: This is JIT specific! - // - virtual uint64_t forceCompilationOf(Function *F) { - return MCE.forceCompilationOf(F); - } }; } From lattner at cs.uiuc.edu Mon Nov 22 15:54:47 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 15:54:47 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/Emitter.cpp Message-ID: <200411222154.iAMLslNv001941@apoc.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: Emitter.cpp updated: 1.54 -> 1.55 --- Log message: Fix the FIXME, nuke the JIT specific forceCompilationOf method. --- Diffs of the changes: (+0 -11) Index: llvm/lib/ExecutionEngine/JIT/Emitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.54 llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.55 --- llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.54 Mon Nov 22 15:48:33 2004 +++ llvm/lib/ExecutionEngine/JIT/Emitter.cpp Mon Nov 22 15:54:35 2004 @@ -252,13 +252,6 @@ virtual uint64_t getCurrentPCOffset(); virtual uint64_t getConstantPoolEntryAddress(unsigned Entry); - // forceCompilationOf - Force the compilation of the specified function, and - // return its address, because we REALLY need the address now. - // - // FIXME: This is JIT specific! - // - virtual uint64_t forceCompilationOf(Function *F); - private: void *getPointerToGlobal(GlobalValue *GV, void *Reference, bool NoNeedStub); }; @@ -417,10 +410,6 @@ return (intptr_t)CurByte-(intptr_t)CurBlock; } -uint64_t Emitter::forceCompilationOf(Function *F) { - return (intptr_t)TheJIT->getPointerToFunction(F); -} - // getPointerToNamedFunction - This function is used as a global wrapper to // JIT::getPointerToNamedFunction for the purpose of resolving symbols when // bugpoint is debugging the JIT. In that scenario, we are loading an .so and From lattner at cs.uiuc.edu Mon Nov 22 16:00:39 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 16:00:39 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Message-ID: <200411222200.iAMM0dlu003484@apoc.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: JITEmitter.cpp updated: 1.55 -> 1.56 --- Log message: Rename Emitter.cpp -> JITEmitter.cpp --- Diffs of the changes: (+20 -20) Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.55 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.56 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.55 Mon Nov 22 15:54:35 2004 +++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Mon Nov 22 16:00:25 2004 @@ -1,4 +1,4 @@ -//===-- Emitter.cpp - Write machine code to executable memory -------------===// +//===-- JITEmitter.cpp - Write machine code to executable memory ----------===// // // The LLVM Compiler Infrastructure // @@ -209,12 +209,12 @@ //===----------------------------------------------------------------------===// -// JIT MachineCodeEmitter code. +// JITEmitter code. // namespace { - /// Emitter - The JIT implementation of the MachineCodeEmitter, which is used - /// to output functions to memory for execution. - class Emitter : public MachineCodeEmitter { + /// JITEmitter - The JIT implementation of the MachineCodeEmitter, which is + /// used to output functions to memory for execution. + class JITEmitter : public MachineCodeEmitter { JITMemoryManager MemMgr; // CurBlock - The start of the current block of memory. CurByte - The @@ -233,7 +233,7 @@ /// emitted. std::vector Relocations; public: - Emitter(JIT &jit) { TheJIT = &jit; } + JITEmitter(JIT &jit) { TheJIT = &jit; } virtual void startFunction(MachineFunction &F); virtual void finishFunction(MachineFunction &F); @@ -258,11 +258,11 @@ } MachineCodeEmitter *JIT::createEmitter(JIT &jit) { - return new Emitter(jit); + return new JITEmitter(jit); } -void *Emitter::getPointerToGlobal(GlobalValue *V, void *Reference, - bool DoesntNeedStub) { +void *JITEmitter::getPointerToGlobal(GlobalValue *V, void *Reference, + bool DoesntNeedStub) { if (GlobalVariable *GV = dyn_cast(V)) { /// FIXME: If we straightened things out, this could actually emit the /// global immediately instead of queuing it for codegen later! @@ -294,12 +294,12 @@ return getJITResolver(this).getFunctionStub(F); } -void Emitter::startFunction(MachineFunction &F) { +void JITEmitter::startFunction(MachineFunction &F) { CurByte = CurBlock = MemMgr.startFunctionBody(); TheJIT->addGlobalMapping(F.getFunction(), CurBlock); } -void Emitter::finishFunction(MachineFunction &F) { +void JITEmitter::finishFunction(MachineFunction &F) { MemMgr.endFunctionBody(CurByte); ConstantPoolAddresses.clear(); NumBytes += CurByte-CurBlock; @@ -329,7 +329,7 @@ Relocations.clear(); } -void Emitter::emitConstantPool(MachineConstantPool *MCP) { +void JITEmitter::emitConstantPool(MachineConstantPool *MCP) { const std::vector &Constants = MCP->getConstants(); if (Constants.empty()) return; @@ -362,30 +362,30 @@ } } -void Emitter::startFunctionStub(unsigned StubSize) { +void JITEmitter::startFunctionStub(unsigned StubSize) { SavedCurBlock = CurBlock; SavedCurByte = CurByte; CurByte = CurBlock = MemMgr.allocateStub(StubSize); } -void *Emitter::finishFunctionStub(const Function *F) { +void *JITEmitter::finishFunctionStub(const Function *F) { NumBytes += CurByte-CurBlock; std::swap(CurBlock, SavedCurBlock); CurByte = SavedCurByte; return SavedCurBlock; } -void Emitter::emitByte(unsigned char B) { +void JITEmitter::emitByte(unsigned char B) { *CurByte++ = B; // Write the byte to memory } -void Emitter::emitWord(unsigned W) { +void JITEmitter::emitWord(unsigned W) { // This won't work if the endianness of the host and target don't agree! (For // a JIT this can't happen though. :) *(unsigned*)CurByte = W; CurByte += sizeof(unsigned); } -void Emitter::emitWordAt(unsigned W, unsigned *Ptr) { +void JITEmitter::emitWordAt(unsigned W, unsigned *Ptr) { *Ptr = W; } @@ -393,7 +393,7 @@ // in the constant pool that was last emitted with the 'emitConstantPool' // method. // -uint64_t Emitter::getConstantPoolEntryAddress(unsigned ConstantNum) { +uint64_t JITEmitter::getConstantPoolEntryAddress(unsigned ConstantNum) { assert(ConstantNum < ConstantPoolAddresses.size() && "Invalid ConstantPoolIndex!"); return (intptr_t)ConstantPoolAddresses[ConstantNum]; @@ -402,11 +402,11 @@ // getCurrentPCValue - This returns the address that the next emitted byte // will be output to. // -uint64_t Emitter::getCurrentPCValue() { +uint64_t JITEmitter::getCurrentPCValue() { return (intptr_t)CurByte; } -uint64_t Emitter::getCurrentPCOffset() { +uint64_t JITEmitter::getCurrentPCOffset() { return (intptr_t)CurByte-(intptr_t)CurBlock; } From lattner at cs.uiuc.edu Mon Nov 22 16:10:12 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 16:10:12 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411222210.iAMMACFb003531@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.252 -> 1.253 --- Log message: Add a note about the JIT changes. --- Diffs of the changes: (+3 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.252 llvm/docs/ReleaseNotes.html:1.253 --- llvm/docs/ReleaseNotes.html:1.252 Mon Nov 22 12:40:51 2004 +++ llvm/docs/ReleaseNotes.html Mon Nov 22 16:09:58 2004 @@ -111,6 +111,8 @@
  • llvmgcc and llvmg++ now emit source line number information when '-g' is passed in. This information can be used with llvm-db or other tools and passes.
  • +
  • The target-to-JIT interfaces are + now much simpler and more powerful.
  • @@ -667,7 +669,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/11/22 18:40:51 $ + Last modified: $Date: 2004/11/22 22:09:58 $ From lattner at cs.uiuc.edu Mon Nov 22 16:25:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 16:25:44 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86JITInfo.cpp Message-ID: <200411222225.iAMMPimB004318@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86JITInfo.cpp updated: 1.2 -> 1.3 --- Log message: Do not push two return addresses on the stack when we call external functions who have their addresses taken. This fixes test-call.ll --- Diffs of the changes: (+16 -10) Index: llvm/lib/Target/X86/X86JITInfo.cpp diff -u llvm/lib/Target/X86/X86JITInfo.cpp:1.2 llvm/lib/Target/X86/X86JITInfo.cpp:1.3 --- llvm/lib/Target/X86/X86JITInfo.cpp:1.2 Sat Nov 20 21:46:06 2004 +++ llvm/lib/Target/X86/X86JITInfo.cpp Mon Nov 22 16:25:30 2004 @@ -18,16 +18,6 @@ #include "llvm/Config/alloca.h" using namespace llvm; -void *X86JITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { - MCE.startFunctionStub(6); - MCE.emitByte(0xE8); // Call with 32 bit pc-rel destination... - - MCE.emitWord((intptr_t)Fn-MCE.getCurrentPCValue()-4); - - MCE.emitByte(0xCD); // Interrupt - Just a marker identifying the stub! - return MCE.finishFunctionStub(0); -} - void X86JITInfo::replaceMachineCodeForFunction(void *Old, void *New) { unsigned char *OldByte = (unsigned char *)Old; *OldByte++ = 0xE9; // Emit JMP opcode. @@ -113,6 +103,22 @@ return CompilationCallback; } +void *X86JITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { + if (Fn != CompilationCallback) { + MCE.startFunctionStub(5); + MCE.emitByte(0xE9); + MCE.emitWord((intptr_t)Fn-MCE.getCurrentPCValue()-4); + return MCE.finishFunctionStub(0); + } + + MCE.startFunctionStub(6); + MCE.emitByte(0xE8); // Call with 32 bit pc-rel destination... + + MCE.emitWord((intptr_t)Fn-MCE.getCurrentPCValue()-4); + + MCE.emitByte(0xCD); // Interrupt - Just a marker identifying the stub! + return MCE.finishFunctionStub(0); +} /// relocate - Before the JIT can run a block of code that has been emitted, /// it must rewrite the code to contain the actual addresses of any From lattner at persephone.cs.uiuc.edu Mon Nov 22 17:07:26 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 17:07:26 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Message-ID: <20041122230726.031D773181C@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrInfo.td updated: 1.42 -> 1.43 --- Log message: Comment out a couple of unused instructions. --- Diffs of the changes: (+3 -2) Index: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.42 llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.43 --- llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.42 Mon Nov 15 15:20:09 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Mon Nov 22 17:07:01 2004 @@ -57,9 +57,10 @@ let isBranch = 1, isTerminator = 1 in { def COND_BRANCH : Pseudo<(ops), "; COND_BRANCH">; def B : IForm<18, 0, 0, 0, 0, (ops target:$func), "b $func">; - def BA : IForm<18, 1, 0, 0, 0, (ops target:$func), "ba $func">; +//def BA : IForm<18, 1, 0, 0, 0, (ops target:$func), "ba $func">; def BL : IForm<18, 0, 1, 0, 0, (ops target:$func), "bl $func">; - def BLA : IForm<18, 1, 1, 0, 0, (ops target:$func), "bla $func">; +//def BLA : IForm<18, 1, 1, 0, 0, (ops target:$func), "bla $func">; + // FIXME: 4*CR# needs to be added to the BI field! // This will only work for CR0 as it stands now def BLT : BForm_ext<16, 0, 0, 12, 0, 0, 0, (ops CRRC:$crS, target:$block), From lattner at persephone.cs.uiuc.edu Mon Nov 22 17:07:39 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 17:07:39 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <20041122230739.3048A731821@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.15 -> 1.16 --- Log message: Remove some dead code --- Diffs of the changes: (+0 -76) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.15 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.16 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.15 Mon Nov 22 15:51:40 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Mon Nov 22 17:07:22 2004 @@ -24,82 +24,6 @@ using namespace llvm; namespace { - class JITResolver { - MachineCodeEmitter &MCE; - - // LazyCodeGenMap - Keep track of call sites for functions that are to be - // lazily resolved. - std::map LazyCodeGenMap; - - // LazyResolverMap - Keep track of the lazy resolver created for a - // particular function so that we can reuse them if necessary. - std::map LazyResolverMap; - - public: - JITResolver(MachineCodeEmitter &mce) : MCE(mce) {} - unsigned getLazyResolver(Function *F); - unsigned addFunctionReference(unsigned Address, Function *F); - - private: - unsigned emitStubForFunction(Function *F); - static void CompilationCallback(); - unsigned resolveFunctionReference(unsigned RetAddr); - }; - - static JITResolver &getResolver(MachineCodeEmitter &MCE) { - static JITResolver *TheJITResolver = 0; - if (TheJITResolver == 0) - TheJITResolver = new JITResolver(MCE); - return *TheJITResolver; - } -} - -unsigned JITResolver::getLazyResolver(Function *F) { - std::map::iterator I = LazyResolverMap.lower_bound(F); - if (I != LazyResolverMap.end() && I->first == F) return I->second; - - unsigned Stub = emitStubForFunction(F); - LazyResolverMap.insert(I, std::make_pair(F, Stub)); - return Stub; -} - -/// addFunctionReference - This method is called when we need to emit the -/// address of a function that has not yet been emitted, so we don't know the -/// address. Instead, we emit a call to the CompilationCallback method, and -/// keep track of where we are. -/// -unsigned JITResolver::addFunctionReference(unsigned Address, Function *F) { - LazyCodeGenMap[Address] = F; - return (intptr_t)&JITResolver::CompilationCallback; -} - -unsigned JITResolver::resolveFunctionReference(unsigned RetAddr) { - std::map::iterator I = LazyCodeGenMap.find(RetAddr); - assert(I != LazyCodeGenMap.end() && "Not in map!"); - Function *F = I->second; - LazyCodeGenMap.erase(I); - // FIXME: this needs to be rewritten. - return 0; //MCE.forceCompilationOf(F); -} - -/// emitStubForFunction - This method is used by the JIT when it needs to emit -/// the address of a function for a function whose code has not yet been -/// generated. In order to do this, it generates a stub which jumps to the lazy -/// function compiler, which will eventually get fixed to call the function -/// directly. -/// -unsigned JITResolver::emitStubForFunction(Function *F) { - std::cerr << "PPC32CodeEmitter::emitStubForFunction() unimplemented!\n"; - abort(); - return 0; -} - -void JITResolver::CompilationCallback() { - std::cerr << "PPC32CodeEmitter: CompilationCallback() unimplemented!"; - abort(); -} - -namespace { class PPC32CodeEmitter : public MachineFunctionPass { TargetMachine &TM; MachineCodeEmitter &MCE; From tbrethou at cs.uiuc.edu Mon Nov 22 22:22:45 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Mon, 22 Nov 2004 22:22:45 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp Message-ID: <200411230422.WAA21890@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9BurgISel.cpp updated: 1.10 -> 1.11 --- Log message: Changed the CreateCodeToLoadConst function to preserve SSA form. This basically means adding extra tmp instructions for intermediate values. --- Diffs of the changes: (+24 -7) Index: llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp diff -u llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.10 llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.11 --- llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.10 Sat Oct 16 13:14:10 2004 +++ llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp Mon Nov 22 22:22:29 2004 @@ -1111,22 +1111,39 @@ MI->getOperand(0).markHi64(); mvec.push_back(MI); + //Create another tmp register for the SETX sequence to preserve SSA + TmpInstruction* tmpReg2 = + new TmpInstruction(mcfi, PointerType::get(val->getType())); + MI = BuildMI(V9::ORi, 3).addReg(tmpReg).addConstantPoolIndex(CPI) - .addRegDef(tmpReg); + .addRegDef(tmpReg2); MI->getOperand(1).markLo64(); mvec.push_back(MI); - mvec.push_back(BuildMI(V9::SLLXi6, 3).addReg(tmpReg).addZImm(32) - .addRegDef(tmpReg)); + //Create another tmp register for the SETX sequence to preserve SSA + TmpInstruction* tmpReg3 = + new TmpInstruction(mcfi, PointerType::get(val->getType())); + + mvec.push_back(BuildMI(V9::SLLXi6, 3).addReg(tmpReg2).addZImm(32) + .addRegDef(tmpReg3)); MI = BuildMI(V9::SETHI, 2).addConstantPoolIndex(CPI).addRegDef(addrReg); MI->getOperand(0).markHi32(); mvec.push_back(MI); - MI = BuildMI(V9::ORr, 3).addReg(addrReg).addReg(tmpReg).addRegDef(addrReg); + // Create another TmpInstruction for the address register + TmpInstruction* addrReg2 = + new TmpInstruction(mcfi, PointerType::get(val->getType())); + + + MI = BuildMI(V9::ORr, 3).addReg(addrReg).addReg(tmpReg3).addRegDef(addrReg2); mvec.push_back(MI); - MI = BuildMI(V9::ORi, 3).addReg(addrReg).addConstantPoolIndex(CPI) - .addRegDef(addrReg); + // Create another TmpInstruction for the address register + TmpInstruction* addrReg3 = + new TmpInstruction(mcfi, PointerType::get(val->getType())); + + MI = BuildMI(V9::ORi, 3).addReg(addrReg2).addConstantPoolIndex(CPI) + .addRegDef(addrReg3); MI->getOperand(1).markLo32(); mvec.push_back(MI); @@ -1134,7 +1151,7 @@ unsigned Opcode = ChooseLoadInstruction(val->getType()); Opcode = convertOpcodeFromRegToImm(Opcode); mvec.push_back(BuildMI(Opcode, 3) - .addReg(addrReg).addSImm((int64_t)0).addRegDef(dest)); + .addReg(addrReg3).addSImm((int64_t)0).addRegDef(dest)); } } From gaeke at cs.uiuc.edu Mon Nov 22 22:39:51 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon, 22 Nov 2004 22:39:51 -0600 (CST) Subject: [llvm-commits] CVS: reopt/lib/WholeReoptimizer/Makefile Message-ID: <200411230439.WAA27878@kain.cs.uiuc.edu> Changes in directory reopt/lib/WholeReoptimizer: Makefile updated: 1.6 -> 1.7 --- Log message: ModuloSched must now be linked in with the SparcV9 target --- Diffs of the changes: (+1 -0) Index: reopt/lib/WholeReoptimizer/Makefile diff -u reopt/lib/WholeReoptimizer/Makefile:1.6 reopt/lib/WholeReoptimizer/Makefile:1.7 --- reopt/lib/WholeReoptimizer/Makefile:1.6 Mon Nov 8 15:28:17 2004 +++ reopt/lib/WholeReoptimizer/Makefile Mon Nov 22 22:39:39 2004 @@ -10,6 +10,7 @@ # Object files that contain common LLVM code the Reoptimizer depends on REOPTIMIZER_LLVMOBJS = $(LLVMLibDir)/LLVMCore.o $(LLVMLibDir)/LLVMBCReader.o \ $(LLVMLibDir)/LLVMBCWriter.o $(LLVMLibDir)/LLVMSparcV9.o \ + $(LLVMLibDir)/LLVMSparcV9ModuloSched.o \ $(LLVMLibDir)/LLVMSparcV9LiveVar.o $(LLVMLibDir)/LLVMSparcV9InstrSched.o \ $(LLVMLibDir)/LLVMCodeGen.o $(LLVMLibDir)/LLVMExecutionEngine.o \ $(LLVMLibDir)/LLVMJIT.o $(LLVMLibDir)/LLVMInterpreter.o From gaeke at cs.uiuc.edu Mon Nov 22 22:40:15 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon, 22 Nov 2004 22:40:15 -0600 (CST) Subject: [llvm-commits] CVS: reopt/test/TEST.reopt.Makefile Message-ID: <200411230440.WAA27897@kain.cs.uiuc.edu> Changes in directory reopt/test: TEST.reopt.Makefile updated: 1.29 -> 1.30 --- Log message: Fix tool & lib pathnames for reopt tests. --- Diffs of the changes: (+2 -2) Index: reopt/test/TEST.reopt.Makefile diff -u reopt/test/TEST.reopt.Makefile:1.29 reopt/test/TEST.reopt.Makefile:1.30 --- reopt/test/TEST.reopt.Makefile:1.29 Tue Nov 9 15:39:21 2004 +++ reopt/test/TEST.reopt.Makefile Mon Nov 22 22:40:05 2004 @@ -23,9 +23,9 @@ TESTNAME = $* -REOPTLIBDIR = $(PROJECT_DIR)/lib/$(CONFIGURATION) +REOPTLIBDIR = $(LLVM_OBJ_ROOT)/projects/reopt/$(CONFIGURATION)/lib -REOPTLLC = $(PROJECT_DIR)/tools/$(CONFIGURATION)/reopt-llc +REOPTLLC = $(LLVM_OBJ_ROOT)/projects/reopt/$(CONFIGURATION)/bin/reopt-llc # Libraries that contain the Reoptimizer itself REOPTIMIZER_LIB = $(REOPTLIBDIR)/libwholereoptimizer.a From lattner at persephone.cs.uiuc.edu Mon Nov 22 23:54:25 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 23:54:25 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Message-ID: <20041123055425.ED0AA73ABDC@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrInfo.td updated: 1.43 -> 1.44 --- Log message: LA is really addi. Be consistent with operand ordering to avoid confusing the code emitter --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.43 llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.44 --- llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.43 Mon Nov 22 17:07:01 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Mon Nov 22 23:54:08 2004 @@ -113,7 +113,7 @@ "addic. $rD, $rA, $imm">; def ADDIS : DForm_2<15, 0, 0, (ops GPRC:$rD, GPRC:$rA, s16imm:$imm), "addis $rD, $rA, $imm">; -def LA : DForm_2<14, 0, 0, (ops GPRC:$rD, symbolLo:$sym, GPRC:$rA), +def LA : DForm_2<14, 0, 0, (ops GPRC:$rD, GPRC:$rA, symbolLo:$sym), "la $rD, $sym($rA)">; def LOADHiAddr : DForm_2<15, 0, 0, (ops GPRC:$rD, GPRC:$rA, symbolHi:$sym), "addis $rD, $rA, $sym">; From lattner at persephone.cs.uiuc.edu Mon Nov 22 23:54:42 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 23:54:42 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Message-ID: <20041123055442.6C1B373ABE6@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32ISelSimple.cpp updated: 1.108 -> 1.109 --- Log message: LA is really addi. Be consistent with operand ordering to avoid confusing the code emitter --- Diffs of the changes: (+6 -4) Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.108 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.109 --- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.108 Sat Nov 20 23:14:06 2004 +++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Mon Nov 22 23:54:25 2004 @@ -698,14 +698,16 @@ unsigned GlobalBase = makeAnotherReg(Type::IntTy); unsigned TmpReg = makeAnotherReg(GV->getType()); - unsigned Opcode = (GV->hasWeakLinkage() - || GV->isExternal() - || dyn_cast(GV)) ? PPC::LWZ : PPC::LA; // Move value at base + distance into return reg BuildMI(*MBB, IP, PPC::LOADHiAddr, 2, TmpReg) .addReg(getGlobalBaseReg(MBB, IP)).addGlobalAddress(GV); - BuildMI(*MBB, IP, Opcode, 2, R).addGlobalAddress(GV).addReg(TmpReg); + + if (GV->hasWeakLinkage() || GV->isExternal() || dyn_cast(GV)) { + BuildMI(*MBB, IP, PPC::LWZ, 2, R).addGlobalAddress(GV).addReg(TmpReg); + } else { + BuildMI(*MBB, IP, PPC::LA, 2, R).addReg(TmpReg).addGlobalAddress(GV); + } // Add the GV to the list of things whose addresses have been taken. TM.AddressTaken.insert(GV); From lattner at persephone.cs.uiuc.edu Mon Nov 22 23:55:55 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 23:55:55 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCTargetMachine.h Message-ID: <20041123055555.51D6473ABFB@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCTargetMachine.h updated: 1.9 -> 1.10 --- Log message: Do not provide the non-specialized PowerPCJITInfo object, it is pretty useless. Instead, let derived classes provide specialized ones. --- Diffs of the changes: (+1 -9) Index: llvm/lib/Target/PowerPC/PowerPCTargetMachine.h diff -u llvm/lib/Target/PowerPC/PowerPCTargetMachine.h:1.9 llvm/lib/Target/PowerPC/PowerPCTargetMachine.h:1.10 --- llvm/lib/Target/PowerPC/PowerPCTargetMachine.h:1.9 Sat Sep 4 00:00:00 2004 +++ llvm/lib/Target/PowerPC/PowerPCTargetMachine.h Mon Nov 22 23:55:38 2004 @@ -15,7 +15,6 @@ #define POWERPC_TARGETMACHINE_H #include "PowerPCFrameInfo.h" -#include "PowerPCJITInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/PassManager.h" #include @@ -27,19 +26,12 @@ class PowerPCTargetMachine : public TargetMachine { PowerPCFrameInfo FrameInfo; - PowerPCJITInfo JITInfo; protected: PowerPCTargetMachine(const std::string &name, IntrinsicLowering *IL, - const TargetData &TD, const PowerPCFrameInfo &TFI, - const PowerPCJITInfo &TJI); + const TargetData &TD, const PowerPCFrameInfo &TFI); public: virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } - virtual TargetJITInfo *getJITInfo() { - return &JITInfo; - } - - static unsigned getJITMatchQuality(); virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out); From lattner at persephone.cs.uiuc.edu Mon Nov 22 23:56:57 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 23:56:57 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32TargetMachine.h Message-ID: <20041123055657.9670173AC15@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32TargetMachine.h updated: 1.5 -> 1.6 --- Log message: Move JITInfo from PPCTM to PPC32TM --- Diffs of the changes: (+8 -0) Index: llvm/lib/Target/PowerPC/PPC32TargetMachine.h diff -u llvm/lib/Target/PowerPC/PPC32TargetMachine.h:1.5 llvm/lib/Target/PowerPC/PPC32TargetMachine.h:1.6 --- llvm/lib/Target/PowerPC/PPC32TargetMachine.h:1.5 Sat Sep 4 00:00:00 2004 +++ llvm/lib/Target/PowerPC/PPC32TargetMachine.h Mon Nov 22 23:56:40 2004 @@ -15,6 +15,7 @@ #define POWERPC32_TARGETMACHINE_H #include "PowerPCTargetMachine.h" +#include "PPC32JITInfo.h" #include "PPC32InstrInfo.h" #include "llvm/PassManager.h" @@ -24,6 +25,7 @@ class PPC32TargetMachine : public PowerPCTargetMachine { PPC32InstrInfo InstrInfo; + PPC32JITInfo JITInfo; public: PPC32TargetMachine(const Module &M, IntrinsicLowering *IL); @@ -31,6 +33,12 @@ virtual const MRegisterInfo *getRegisterInfo() const { return &InstrInfo.getRegisterInfo(); } + + virtual TargetJITInfo *getJITInfo() { + return &JITInfo; + } + + static unsigned getJITMatchQuality(); static unsigned getModuleMatchQuality(const Module &M); From lattner at persephone.cs.uiuc.edu Mon Nov 22 23:57:07 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 23:57:07 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Message-ID: <20041123055707.88B4473AC1D@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCTargetMachine.cpp updated: 1.37 -> 1.38 --- Log message: Move JITInfo from PPCTM to PPC32TM --- Diffs of the changes: (+11 -6) Index: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.37 llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.38 --- llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.37 Fri Nov 19 22:17:17 2004 +++ llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Mon Nov 22 23:56:25 2004 @@ -52,12 +52,11 @@ PowerPCTargetMachine::PowerPCTargetMachine(const std::string &name, IntrinsicLowering *IL, const TargetData &TD, - const PowerPCFrameInfo &TFI, - const PowerPCJITInfo &TJI) - : TargetMachine(name, IL, TD), FrameInfo(TFI), JITInfo(TJI) + const PowerPCFrameInfo &TFI) + : TargetMachine(name, IL, TD), FrameInfo(TFI) {} -unsigned PowerPCTargetMachine::getJITMatchQuality() { +unsigned PPC32TargetMachine::getJITMatchQuality() { return 0; #if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) return 10; @@ -132,6 +131,12 @@ PM.add(createPPC32ISelSimple(TM)); PM.add(createRegisterAllocator()); PM.add(createPrologEpilogCodeInserter()); + + // Must run branch selection immediately preceding the asm printer + PM.add(createPPCBranchSelectionPass()); + + if (PrintMachineCode) + PM.add(createMachineFunctionPrinterPass(&std::cerr)); } void PowerPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) { @@ -143,14 +148,14 @@ PPC32TargetMachine::PPC32TargetMachine(const Module &M, IntrinsicLowering *IL) : PowerPCTargetMachine(PPC32ID, IL, TargetData(PPC32ID,false,4,4,4,4,4,4,2,1,4), - PowerPCFrameInfo(*this, false), PPC32JITInfo(*this)) {} + PowerPCFrameInfo(*this, false)), JITInfo(*this) {} /// PPC64TargetMachine ctor - Create a LP64 architecture model /// PPC64TargetMachine::PPC64TargetMachine(const Module &M, IntrinsicLowering *IL) : PowerPCTargetMachine(PPC64ID, IL, TargetData(PPC64ID,false,8,4,4,4,4,4,2,1,4), - PowerPCFrameInfo(*this, true), PPC64JITInfo(*this)) {} + PowerPCFrameInfo(*this, true)) {} unsigned PPC32TargetMachine::getModuleMatchQuality(const Module &M) { if (M.getEndianness() == Module::BigEndian && From lattner at persephone.cs.uiuc.edu Mon Nov 22 23:57:55 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 23:57:55 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32Relocations.h Message-ID: <20041123055755.942A073AC3E@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32Relocations.h added (r1.1) --- Log message: Initial checkin of the 32-bit PPC relocation types --- Diffs of the changes: (+38 -0) Index: llvm/lib/Target/PowerPC/PPC32Relocations.h diff -c /dev/null llvm/lib/Target/PowerPC/PPC32Relocations.h:1.1 *** /dev/null Mon Nov 22 23:57:48 2004 --- llvm/lib/Target/PowerPC/PPC32Relocations.h Mon Nov 22 23:57:38 2004 *************** *** 0 **** --- 1,38 ---- + //===- PPC32Relocations.h - PPC32 Code Relocations --------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the PowerPC 32-bit target-specific relocation types. + // + //===----------------------------------------------------------------------===// + + #ifndef PPC32RELOCATIONS_H + #define PPC32RELOCATIONS_H + + #include "llvm/CodeGen/MachineRelocation.h" + + namespace llvm { + namespace PPC { + enum RelocationType { + // reloc_pcrel_bx - PC relative relocation, for the b or bl instructions. + reloc_pcrel_bx, + + // reloc_absolute_loadhi - Absolute relocation, for the loadhi instruction + // (which is really addis). Add the high 16-bits of the specified global + // address into the immediate field of the addis. + reloc_absolute_loadhi, + + // reloc_absolute_la - Absolute relocation, for the la instruction (which + // is really an addi). Add the low 16-bits of teh specified global + // address into the immediate field of the addi. + reloc_absolute_la, + }; + } + } + + #endif From lattner at persephone.cs.uiuc.edu Mon Nov 22 23:58:14 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Mon, 22 Nov 2004 23:58:14 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.h Message-ID: <20041123055814.CB09173AC70@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.h updated: 1.3 -> 1.4 --- Log message: Implement all of the methods --- Diffs of the changes: (+5 -0) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.h diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.h:1.3 llvm/lib/Target/PowerPC/PPC32JITInfo.h:1.4 --- llvm/lib/Target/PowerPC/PPC32JITInfo.h:1.3 Fri Nov 19 22:14:44 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.h Mon Nov 22 23:57:57 2004 @@ -24,6 +24,11 @@ public: PPC32JITInfo(TargetMachine &tm) : PowerPCJITInfo(tm) {} + virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter &MCE); + virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn); + virtual void relocate(void *Function, MachineRelocation *MR, + unsigned NumRelocs); + /// replaceMachineCodeForFunction - Make it so that calling the function /// whose machine code is at OLD turns into a call to NEW, perhaps by /// overwriting OLD with a branch to NEW. This is used for self-modifying From reid at x10sys.com Tue Nov 23 00:00:04 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 00:00:04 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200411230600.AAA18874@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.238 -> 1.239 --- Log message: Allow configuration files to be themselves configured and found in the OBJ dir instead of only in the SRC dir. --- Diffs of the changes: (+7 -1) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.238 llvm/Makefile.rules:1.239 --- llvm/Makefile.rules:1.238 Thu Nov 18 14:04:39 2004 +++ llvm/Makefile.rules Mon Nov 22 23:59:53 2004 @@ -432,7 +432,13 @@ install-local:: $(sysconfdir) $(CONFIG_FILES) $(Echo) Installing Configuration Files To $(sysconfdir) $(Verb)for file in $(CONFIG_FILES); do \ - $(INSTALL) $(BUILD_SRC_DIR)/$${file} $(sysconfdir) ; \ + if test -f $(BUILD_OBJ_DIR)/$${file} ; then \ + $(INSTALL) $(BUILD_OBJ_DIR)/$${file} $(sysconfdir) ; \ + elif test -f $(BUILD_SRC_DIR)/$${file} ; then \ + $(INSTALL) $(BUILD_SRC_DIR)/$${file} $(sysconfdir) ; \ + else \ + $(ECHO) Error: cannot find config file $${file}. ; \ + fi \ done uninstall-local:: From lattner at persephone.cs.uiuc.edu Tue Nov 23 00:00:10 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 00:00:10 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <20041123060010.7180473AD45@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.16 -> 1.17 --- Log message: Emit relocations for the global variable using instructions. This gets us LA, LOADHiAddr, CALLpcrel, and MovePCtoLR working, though the constant pool probably is not right. --- Diffs of the changes: (+44 -48) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.16 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.17 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.16 Mon Nov 22 17:07:22 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Mon Nov 22 23:59:53 2004 @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#include "PPC32JITInfo.h" #include "PPC32TargetMachine.h" +#include "PPC32Relocations.h" #include "PowerPC.h" #include "llvm/Module.h" #include "llvm/CodeGen/MachineCodeEmitter.h" @@ -28,6 +28,10 @@ TargetMachine &TM; MachineCodeEmitter &MCE; + /// MovePCtoLROffset - When/if we see a MovePCtoLR instruction, we record + /// its address in the function into this pointer. + void *MovePCtoLROffset; + // Tracks which instruction references which BasicBlock std::vector > > BBRefs; @@ -36,9 +40,7 @@ /// getMachineOpValue - evaluates the MachineOperand of a given MachineInstr /// - int64_t getMachineOpValue(MachineInstr &MI, MachineOperand &MO); - - unsigned getAddressOfExternalFunction(Function *F); + int getMachineOpValue(MachineInstr &MI, MachineOperand &MO); public: PPC32CodeEmitter(TargetMachine &T, MachineCodeEmitter &M) @@ -78,9 +80,6 @@ /// bool PPC32TargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM, MachineCodeEmitter &MCE) { - // Keep as `true' until this is a functional JIT to allow llvm-gcc to build - return true; - // Machine code emitter pass for PowerPC PM.add(new PPC32CodeEmitter(*this, MCE)); // Delete machine code for this function after emitting it @@ -89,6 +88,7 @@ } bool PPC32CodeEmitter::runOnMachineFunction(MachineFunction &MF) { + MovePCtoLROffset = 0; MCE.startFunction(MF); MCE.emitConstantPool(MF.getConstantPool()); for (MachineFunction::iterator BB = MF.begin(), E = MF.end(); BB != E; ++BB) @@ -97,11 +97,11 @@ // Resolve branches to BasicBlocks for the entire function for (unsigned i = 0, e = BBRefs.size(); i != e; ++i) { - long Location = BBLocations[BBRefs[i].first]; + intptr_t Location = BBLocations[BBRefs[i].first]; unsigned *Ref = BBRefs[i].second.first; MachineInstr *MI = BBRefs[i].second.second; - DEBUG(std::cerr << "Fixup @ " << std::hex << Ref << " to 0x" << Location - << " in instr: " << std::dec << *MI); + DEBUG(std::cerr << "Fixup @ " << (void*)Ref << " to " << (void*)Location + << " in instr: " << *MI); for (unsigned ii = 0, ee = MI->getNumOperands(); ii != ee; ++ii) { MachineOperand &op = MI->getOperand(ii); if (op.isPCRelativeDisp()) { @@ -129,28 +129,22 @@ for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I){ MachineInstr &MI = *I; unsigned Opcode = MI.getOpcode(); - if (Opcode == PPC::IMPLICIT_DEF) - continue; // pseudo opcode, no side effects - else if (Opcode == PPC::MovePCtoLR) { - // This can be simplified: the resulting 32-bit code is 0x48000005 - MachineInstr *MI = BuildMI(PPC::BL, 1).addImm(1); - emitWord(getBinaryCodeForInstr(*MI)); - delete MI; - } else + switch (MI.getOpcode()) { + default: emitWord(getBinaryCodeForInstr(*I)); + break; + case PPC::IMPLICIT_DEF: + break; // pseudo opcode, no side effects + case PPC::MovePCtoLR: + assert(MovePCtoLROffset == 0 && + "Multiple MovePCtoLR instructions in the function?"); + MovePCtoLROffset = (void*)(intptr_t)MCE.getCurrentPCValue(); + emitWord(0x48000005); // bl 1 + break; + } } } -unsigned PPC32CodeEmitter::getAddressOfExternalFunction(Function *F) { - static std::map ExternalFn2Addr; - std::map::iterator Addr = ExternalFn2Addr.find(F); - - // FIXME: this needs to be rewritten. - if (Addr == ExternalFn2Addr.end()) - ExternalFn2Addr[F] = 0; //MCE.forceCompilationOf(F); - return ExternalFn2Addr[F]; -} - static unsigned enumRegToMachineReg(unsigned enumReg) { switch (enumReg) { case PPC::R0 : case PPC::F0 : return 0; @@ -191,18 +185,28 @@ } } -int64_t PPC32CodeEmitter::getMachineOpValue(MachineInstr &MI, - MachineOperand &MO) { - int64_t rv = 0; // Return value; defaults to 0 for unhandled cases +int PPC32CodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) { + + int rv = 0; // Return value; defaults to 0 for unhandled cases // or things that get fixed up later by the JIT. if (MO.isRegister()) { rv = enumRegToMachineReg(MO.getReg()); } else if (MO.isImmediate()) { rv = MO.getImmedValue(); } else if (MO.isGlobalAddress()) { - //GlobalValue *GV = MO.getGlobal(); - // FIXME: Emit a relocation here. - rv = 0; + unsigned Reloc; + if (MI.getOpcode() == PPC::CALLpcrel) + Reloc = PPC::reloc_pcrel_bx; + else if (MI.getOpcode() == PPC::LOADHiAddr) { + Reloc = PPC::reloc_absolute_loadhi; + } else if (MI.getOpcode() == PPC::LA) { + Reloc = PPC::reloc_absolute_la; + } else { + assert(0 && "Unknown instruction for relocation!"); + } + MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), + Reloc, MO.getGlobal(), + -((intptr_t)MovePCtoLROffset+4))); } else if (MO.isMachineBasicBlock()) { const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock(); unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); @@ -210,9 +214,6 @@ } else if (MO.isConstantPoolIndex()) { unsigned index = MO.getConstantPoolIndex(); rv = MCE.getConstantPoolEntryAddress(index); - } else if (MO.isFrameIndex()) { - std::cerr << "PPC32CodeEmitter: error: Frame index unhandled!\n"; - abort(); } else { std::cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n"; abort(); @@ -221,23 +222,18 @@ // Special treatment for global symbols: constants and vars if (MO.isConstantPoolIndex() || MO.isGlobalAddress()) { unsigned Opcode = MI.getOpcode(); - int64_t MBBLoc = BBLocations[MI.getParent()->getBasicBlock()]; + assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); + if (Opcode == PPC::LOADHiAddr) { - // LoadHiAddr wants hi16(addr - mbb) - rv = (rv - MBBLoc) >> 16; + // LoadHiAddr wants hi16(addr - &MovePCtoLR) + rv >>= 16; } else if (Opcode == PPC::LWZ || Opcode == PPC::LA || Opcode == PPC::LFS || Opcode == PPC::LFD) { - // These load opcodes want lo16(addr - mbb) - rv = (rv - MBBLoc) & 0xffff; + // These load opcodes want lo16(addr - &MovePCtoLR) + rv &= 0xffff; } } - return rv; -} - -void PPC32JITInfo::replaceMachineCodeForFunction (void *Old, void *New) { - std::cerr << "PPC32JITInfo::replaceMachineCodeForFunction not implemented\n"; - abort(); } #include "PPC32GenCodeEmitter.inc" From lattner at persephone.cs.uiuc.edu Tue Nov 23 00:02:23 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 00:02:23 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Message-ID: <20041123060223.5F61573AD76@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.cpp added (r1.1) --- Log message: Initial implementation of the JIT interfaces. Relocation is done and stubs for external functions work. CompilationCallback has not been written, and stubs for internal functions are not generated yet. This means you can call printf and exit, and use global variables, but cannot call functions local to a module yet. --- Diffs of the changes: (+117 -0) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -c /dev/null llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.1 *** /dev/null Tue Nov 23 00:02:16 2004 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Tue Nov 23 00:02:06 2004 *************** *** 0 **** --- 1,117 ---- + //===-- PPC32JITInfo.cpp - Implement the JIT interfaces for the PowerPC ---===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the JIT interfaces for the 32-bit PowerPC target. + // + //===----------------------------------------------------------------------===// + + #define DEBUG_TYPE "jit" + #include "PPC32JITInfo.h" + #include "PPC32Relocations.h" + #include "llvm/CodeGen/MachineCodeEmitter.h" + #include "llvm/Config/alloca.h" + using namespace llvm; + + static TargetJITInfo::JITCompilerFn JITCompilerFunction; + + #define BUILD_ADDIS(RD,RS,IMM16) \ + ((15 << 26) | ((RD) << 21) | ((RS) << 16) | ((IMM16) & 65535)) + #define BUILD_ORI(RD,RS,UIMM16) \ + ((24 << 26) | ((RS) << 21) | ((RD) << 16) | ((UIMM16) & 65535)) + #define BUILD_MTSPR(RS,SPR) \ + ((31 << 26) | ((RS) << 21) | ((SPR) << 16) | (467 << 1)) + #define BUILD_BCCTRx(BO,BI,LINK) \ + ((19 << 26) | ((BO) << 21) | ((BI) << 16) | (528 << 1) | ((LINK) & 1)) + + // Pseudo-ops + #define BUILD_LIS(RD,IMM16) BUILD_ADDIS(RD,0,IMM16) + #define BUILD_MTCTR(RS) BUILD_MTSPR(RS,9) + #define BUILD_BCTR(LINK) BUILD_BCCTRx(20,0,LINK) + + static void CompilationCallback() { + //JITCompilerFunction + assert(0 && "CompilationCallback not implemented yet!"); + } + + + TargetJITInfo::LazyResolverFn + PPC32JITInfo::getLazyResolverFunction(JITCompilerFn Fn) { + return CompilationCallback; + } + + static void EmitBranchToAt(void *At, void *To) { + intptr_t Addr = (intptr_t)To; + + // FIXME: should special case the short branch case. + unsigned *AtI = (unsigned*)At; + + AtI[0] = BUILD_LIS(12, Addr >> 16); // lis r12, hi16(address) + AtI[1] = BUILD_ORI(12, 12, Addr); // ori r12, r12, low16(address) + AtI[2] = BUILD_MTCTR(12); // mtctr r12 + AtI[3] = BUILD_BCTR(0); // bctr + } + + void *PPC32JITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { + // If this is just a call to an external function, emit a branch instead of a + // call. The code is the same except for one bit of the last instruction. + if (Fn != CompilationCallback) { + MCE.startFunctionStub(4*4); + void *Addr = (void*)(intptr_t)MCE.getCurrentPCValue(); + MCE.emitWord(0); + MCE.emitWord(0); + MCE.emitWord(0); + MCE.emitWord(0); + EmitBranchToAt(Addr, Fn); + return MCE.finishFunctionStub(0); + } + + MCE.startFunctionStub(4*4); + return MCE.finishFunctionStub(0); + } + + + void PPC32JITInfo::relocate(void *Function, MachineRelocation *MR, + unsigned NumRelocs) { + for (unsigned i = 0; i != NumRelocs; ++i, ++MR) { + unsigned *RelocPos = (unsigned*)Function + MR->getMachineCodeOffset()/4; + intptr_t ResultPtr = (intptr_t)MR->getResultPointer(); + switch ((PPC::RelocationType)MR->getRelocationType()) { + default: assert(0 && "Unknown relocation type!"); + case PPC::reloc_pcrel_bx: + // PC-relative relocation for b and bl instructions. + ResultPtr = (ResultPtr-(intptr_t)RelocPos) >> 2; + assert(ResultPtr >= -(1 << 23) && ResultPtr < (1 << 23) && + "Relocation out of range!"); + *RelocPos |= (ResultPtr & ((1 << 24)-1)) << 2; + break; + case PPC::reloc_absolute_loadhi: // Relocate high bits into addis + case PPC::reloc_absolute_la: // Relocate low bits into addi + ResultPtr += MR->getConstantVal(); + + if (MR->getRelocationType() == PPC::reloc_absolute_loadhi) { + // If the low part will have a carry (really a borrow) from the low + // 16-bits into the high 16, add a bit to borrow from. + if (((int)ResultPtr << 16) < 0) + ResultPtr += 1 << 16; + ResultPtr >>= 16; + } + + // Do the addition then mask, so the addition does not overflow the 16-bit + // immediate section of the instruction. + unsigned LowBits = (*RelocPos + ResultPtr) & 65535; + unsigned HighBits = *RelocPos & ~65535; + *RelocPos = LowBits | HighBits; // Slam into low 16-bits + break; + } + } + } + + void PPC32JITInfo::replaceMachineCodeForFunction(void *Old, void *New) { + EmitBranchToAt(Old, New); + } From lattner at persephone.cs.uiuc.edu Tue Nov 23 00:06:09 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 00:06:09 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Message-ID: <20041123060609.A6E0D73AE07@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32ISelSimple.cpp updated: 1.109 -> 1.110 --- Log message: Simplify code a bit --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.109 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.110 --- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.109 Mon Nov 22 23:54:25 2004 +++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Tue Nov 23 00:05:44 2004 @@ -703,7 +703,7 @@ BuildMI(*MBB, IP, PPC::LOADHiAddr, 2, TmpReg) .addReg(getGlobalBaseReg(MBB, IP)).addGlobalAddress(GV); - if (GV->hasWeakLinkage() || GV->isExternal() || dyn_cast(GV)) { + if (GV->hasWeakLinkage() || GV->isExternal() || isa(GV)) { BuildMI(*MBB, IP, PPC::LWZ, 2, R).addGlobalAddress(GV).addReg(TmpReg); } else { BuildMI(*MBB, IP, PPC::LA, 2, R).addReg(TmpReg).addGlobalAddress(GV); From lattner at cs.uiuc.edu Tue Nov 23 00:27:17 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 00:27:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Message-ID: <200411230627.iAN6RHQ5004954@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.cpp updated: 1.1 -> 1.2 --- Log message: Implement the stub needed to get into compilation callback. --- Diffs of the changes: (+14 -5) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.1 llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.2 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.1 Tue Nov 23 00:02:06 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Tue Nov 23 00:27:02 2004 @@ -45,7 +45,7 @@ return CompilationCallback; } -static void EmitBranchToAt(void *At, void *To) { +static void EmitBranchToAt(void *At, void *To, bool isCall) { intptr_t Addr = (intptr_t)To; // FIXME: should special case the short branch case. @@ -54,7 +54,7 @@ AtI[0] = BUILD_LIS(12, Addr >> 16); // lis r12, hi16(address) AtI[1] = BUILD_ORI(12, 12, Addr); // ori r12, r12, low16(address) AtI[2] = BUILD_MTCTR(12); // mtctr r12 - AtI[3] = BUILD_BCTR(0); // bctr + AtI[3] = BUILD_BCTR(isCall); // bctr/bctrl } void *PPC32JITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { @@ -67,11 +67,20 @@ MCE.emitWord(0); MCE.emitWord(0); MCE.emitWord(0); - EmitBranchToAt(Addr, Fn); + EmitBranchToAt(Addr, Fn, false); return MCE.finishFunctionStub(0); } - MCE.startFunctionStub(4*4); + MCE.startFunctionStub(4*7); + MCE.emitWord(0x9421ffe0); // stwu r1,-32(r1) + MCE.emitWord(0x7d6802a6); // mflr r11 + MCE.emitWord(0x91610028); // stw r11, 40(r1) + void *Addr = (void*)(intptr_t)MCE.getCurrentPCValue(); + MCE.emitWord(0); + MCE.emitWord(0); + MCE.emitWord(0); + MCE.emitWord(0); + EmitBranchToAt(Addr, Fn, true/*is call*/); return MCE.finishFunctionStub(0); } @@ -113,5 +122,5 @@ } void PPC32JITInfo::replaceMachineCodeForFunction(void *Old, void *New) { - EmitBranchToAt(Old, New); + EmitBranchToAt(Old, New, false); } From lattner at cs.uiuc.edu Tue Nov 23 00:51:28 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 00:51:28 -0600 Subject: [llvm-commits] CVS: llvm/utils/NightlyTest.gnuplot Message-ID: <200411230651.iAN6pSvc004998@apoc.cs.uiuc.edu> Changes in directory llvm/utils: NightlyTest.gnuplot updated: 1.11 -> 1.12 --- Log message: Change formats, as suggested by Duraid --- Diffs of the changes: (+1 -1) Index: llvm/utils/NightlyTest.gnuplot diff -u llvm/utils/NightlyTest.gnuplot:1.11 llvm/utils/NightlyTest.gnuplot:1.12 --- llvm/utils/NightlyTest.gnuplot:1.11 Tue Jul 6 12:04:09 2004 +++ llvm/utils/NightlyTest.gnuplot Tue Nov 23 00:51:14 2004 @@ -5,7 +5,7 @@ set xlabel "Date" set ylabel "Lines of Code" set xdata time -set timefmt "%Y-%m-%d:" +set timefmt "%Y-%m-%d-%H:%M:%S:" set format x "%b %d, %Y" ## Various labels for the graph From lattner at cs.uiuc.edu Tue Nov 23 00:55:19 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 00:55:19 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Message-ID: <200411230655.iAN6tJxd005018@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.cpp updated: 1.2 -> 1.3 --- Log message: Implement the first hunk of CompilationCallback. The pieces missing are the ones noted, which require funny PPC specific inline assembly. If some angel felt the desire to help me, I think this is that last bit missing for JIT support (however, generic code emitter might night work right with the constant pool yet). --- Diffs of the changes: (+54 -10) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.2 llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.3 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.2 Tue Nov 23 00:27:02 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Tue Nov 23 00:55:05 2004 @@ -34,16 +34,6 @@ #define BUILD_MTCTR(RS) BUILD_MTSPR(RS,9) #define BUILD_BCTR(LINK) BUILD_BCCTRx(20,0,LINK) -static void CompilationCallback() { - //JITCompilerFunction - assert(0 && "CompilationCallback not implemented yet!"); -} - - -TargetJITInfo::LazyResolverFn -PPC32JITInfo::getLazyResolverFunction(JITCompilerFn Fn) { - return CompilationCallback; -} static void EmitBranchToAt(void *At, void *To, bool isCall) { intptr_t Addr = (intptr_t)To; @@ -57,6 +47,60 @@ AtI[3] = BUILD_BCTR(isCall); // bctr/bctrl } +static void CompilationCallback() { + // FIXME: Should save R3-R10 and F1-F13 onto the stack, just like the Sparc + // version does. + //int IntRegs[8]; + //uint64_t FPRegs[13]; + unsigned *CameFromStub = (unsigned*)__builtin_return_address(0); + unsigned *CameFromOrig = (unsigned*)__builtin_return_address(1); + + // Adjust our pointers to the branches, not the return addresses. + --CameFromStub; --CameFromOrig; + + void *Target = JITCompilerFunction(CameFromStub); + + // Check to see if CameFromOrig[-1] is a 'bl' instruction, and if we can + // rewrite it to branch directly to the destination. If so, rewrite it so it + // does not need to go through the stub anymore. + unsigned CameFromOrigInst = *CameFromOrig; + if ((CameFromOrigInst >> 26) == 18) { // Direct call. + intptr_t Offset = ((intptr_t)Target-(intptr_t)CameFromOrig) >> 2; + if (Offset >= -(1 << 23) && Offset < (1 << 23)) { // In range? + // FIXME: hasn't been tested at all. + // Clear the original target out: + CameFromOrigInst &= (63 << 26) | 3; + CameFromOrigInst |= Offset << 2; + *CameFromOrig = CameFromOrigInst; + } + } + + // Locate the start of the stub. If this is a short call, adjust backwards + // the short amount, otherwise the full amount. + bool isShortStub = (*CameFromStub >> 26) == 18; + CameFromStub -= isShortStub ? 3 : 7; + + // Rewrite the stub with an unconditional branch to the target, for any users + // who took the address of the stub. + EmitBranchToAt(CameFromStub, Target, false); + + + // FIXME: Need to restore the registers from IntRegs/FPRegs. + + // FIXME: Need to pop two frames off of the stack and return to a place where + // we magically reexecute the call, or jump directly to the caller. This + // requires inline asm majik. + assert(0 && "CompilationCallback not finished yet!"); +} + + + +TargetJITInfo::LazyResolverFn +PPC32JITInfo::getLazyResolverFunction(JITCompilerFn Fn) { + JITCompilerFunction = Fn; + return CompilationCallback; +} + void *PPC32JITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { // If this is just a call to an external function, emit a branch instead of a // call. The code is the same except for one bit of the last instruction. From lattner at cs.uiuc.edu Tue Nov 23 00:56:30 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 00:56:30 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Message-ID: <200411230656.iAN6uUb7005035@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCTargetMachine.cpp updated: 1.38 -> 1.39 --- Log message: Be really paranoid about not breaking stuff yet --- Diffs of the changes: (+1 -0) Index: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.38 llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.39 --- llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.38 Mon Nov 22 23:56:25 2004 +++ llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Tue Nov 23 00:56:18 2004 @@ -114,6 +114,7 @@ } void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) { + return true; // FIXME: Implement efficient support for garbage collection intrinsics. PM.add(createLowerGCPass()); From lattner at cs.uiuc.edu Tue Nov 23 00:56:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 00:56:43 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200411230656.iAN6uhKX005045@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.17 -> 1.18 --- Log message: Fix a minor bug --- Diffs of the changes: (+2 -1) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.17 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.18 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.17 Mon Nov 22 23:59:53 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Tue Nov 23 00:56:31 2004 @@ -220,7 +220,8 @@ } // Special treatment for global symbols: constants and vars - if (MO.isConstantPoolIndex() || MO.isGlobalAddress()) { + if ((MO.isConstantPoolIndex() || MO.isGlobalAddress()) && + MI.getOpcode() != PPC::CALLpcrel) { unsigned Opcode = MI.getOpcode(); assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); From natebegeman at mac.com Tue Nov 23 04:04:59 2004 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 23 Nov 2004 04:04:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Message-ID: <200411231004.EAA10696@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCTargetMachine.cpp updated: 1.39 -> 1.40 --- Log message: Don't return value from void function. This is only temporary anyway while the JIT is made to work! --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.39 llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.40 --- llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.39 Tue Nov 23 00:56:18 2004 +++ llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Tue Nov 23 04:04:49 2004 @@ -114,7 +114,7 @@ } void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) { - return true; + return; // FIXME: Implement efficient support for garbage collection intrinsics. PM.add(createLowerGCPass()); From lattner at cs.uiuc.edu Tue Nov 23 09:56:53 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 09:56:53 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200411231556.iANFurEd007399@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.18 -> 1.19 --- Log message: Squelch a bogus warning. --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.18 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.19 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.18 Tue Nov 23 00:56:31 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Tue Nov 23 09:56:38 2004 @@ -194,7 +194,7 @@ } else if (MO.isImmediate()) { rv = MO.getImmedValue(); } else if (MO.isGlobalAddress()) { - unsigned Reloc; + unsigned Reloc = 0; if (MI.getOpcode() == PPC::CALLpcrel) Reloc = PPC::reloc_pcrel_bx; else if (MI.getOpcode() == PPC::LOADHiAddr) { From lattner at cs.uiuc.edu Tue Nov 23 09:57:13 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 09:57:13 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp Message-ID: <200411231557.iANFvDIk007414@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9CodeEmitter.cpp updated: 1.77 -> 1.78 --- Log message: Squelch a bogus warning --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp diff -u llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.77 llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.78 --- llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.77 Mon Nov 22 15:42:40 2004 +++ llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp Tue Nov 23 09:57:01 2004 @@ -142,7 +142,7 @@ // So undo that: give the instruction (CI - PC) / 4 rv = (CI->getRawValue() - MCE.getCurrentPCValue()) / 4; } else if (GlobalValue *GV = dyn_cast(V)) { - unsigned Reloc; + unsigned Reloc = 0; if (MI.getOpcode() == V9::CALL) { Reloc = V9::reloc_pcrel_call; } else if (MI.getOpcode() == V9::SETHI) { From reid at x10sys.com Tue Nov 23 10:24:33 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 10:24:33 -0600 Subject: [llvm-commits] CVS: llvm/utils/NightlyTest.pl Message-ID: <200411231624.KAA07514@zion.cs.uiuc.edu> Changes in directory llvm/utils: NightlyTest.pl updated: 1.73 -> 1.74 --- Log message: Make sure the timing output is also sent to the log file for dejagnu, not the log file of the NightlyTest.pl script. --- Diffs of the changes: (+1 -1) Index: llvm/utils/NightlyTest.pl diff -u llvm/utils/NightlyTest.pl:1.73 llvm/utils/NightlyTest.pl:1.74 --- llvm/utils/NightlyTest.pl:1.73 Mon Nov 22 12:36:12 2004 +++ llvm/utils/NightlyTest.pl Tue Nov 23 10:23:50 2004 @@ -548,7 +548,7 @@ #Run the feature and regression tests, results are put into testrun.sum #Full log in testrun.log - system "time -p gmake $MAKEOPTS check-dejagnu > $dejagnu_output 2>&1"; + system "(time -p gmake $MAKEOPTS check-dejagnu) > $dejagnu_output 2>&1"; #Extract time of dejagnu tests my $DejagnuTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$dejagnu_output"; From lattner at cs.uiuc.edu Tue Nov 23 12:48:09 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 12:48:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCJITInfo.h Message-ID: <200411231848.iANIm9gG008512@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCJITInfo.h updated: 1.3 -> 1.4 --- Log message: This method is dead --- Diffs of the changes: (+0 -7) Index: llvm/lib/Target/PowerPC/PowerPCJITInfo.h diff -u llvm/lib/Target/PowerPC/PowerPCJITInfo.h:1.3 llvm/lib/Target/PowerPC/PowerPCJITInfo.h:1.4 --- llvm/lib/Target/PowerPC/PowerPCJITInfo.h:1.3 Fri Nov 19 22:17:17 2004 +++ llvm/lib/Target/PowerPC/PowerPCJITInfo.h Tue Nov 23 12:47:55 2004 @@ -30,13 +30,6 @@ /// is not supported for this target. /// virtual void addPassesToJITCompile(FunctionPassManager &PM); - - /// replaceMachineCodeForFunction - Make it so that calling the function - /// whose machine code is at OLD turns into a call to NEW, perhaps by - /// overwriting OLD with a branch to NEW. This is used for self-modifying - /// code. - /// - virtual void replaceMachineCodeForFunction(void *Old, void *New); }; } From lattner at cs.uiuc.edu Tue Nov 23 12:48:25 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 12:48:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Message-ID: <200411231848.iANImPw5008518@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCTargetMachine.cpp updated: 1.40 -> 1.41 --- Log message: Remove this method. --- Diffs of the changes: (+0 -5) Index: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.40 llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.41 --- llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.40 Tue Nov 23 04:04:49 2004 +++ llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Tue Nov 23 12:47:42 2004 @@ -114,7 +114,6 @@ } void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) { - return; // FIXME: Implement efficient support for garbage collection intrinsics. PM.add(createLowerGCPass()); @@ -140,10 +139,6 @@ PM.add(createMachineFunctionPrinterPass(&std::cerr)); } -void PowerPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) { - assert(0 && "Cannot execute PowerPCJITInfo::replaceMachineCodeForFunction()"); -} - /// PowerPCTargetMachine ctor - Create an ILP32 architecture model /// PPC32TargetMachine::PPC32TargetMachine(const Module &M, IntrinsicLowering *IL) From lattner at cs.uiuc.edu Tue Nov 23 12:50:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 12:50:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Message-ID: <200411231850.iANIo1Z6008534@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.cpp updated: 1.3 -> 1.4 --- Log message: Initial implementation of exiting CompilationCallback This should save all argument registers on entry and restore on exit, despite that, simple things seem to work!!! --- Diffs of the changes: (+24 -9) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.3 llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.4 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.3 Tue Nov 23 00:55:05 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Tue Nov 23 12:49:46 2004 @@ -54,16 +54,19 @@ //uint64_t FPRegs[13]; unsigned *CameFromStub = (unsigned*)__builtin_return_address(0); unsigned *CameFromOrig = (unsigned*)__builtin_return_address(1); + unsigned *CCStackPtr = (unsigned*)__builtin_frame_address(0); +//unsigned *StubStackPtr = (unsigned*)__builtin_frame_address(1); + unsigned *OrigStackPtr = (unsigned*)__builtin_frame_address(2); - // Adjust our pointers to the branches, not the return addresses. - --CameFromStub; --CameFromOrig; + // Adjust pointer to the branch, not the return address. + --CameFromStub; void *Target = JITCompilerFunction(CameFromStub); // Check to see if CameFromOrig[-1] is a 'bl' instruction, and if we can // rewrite it to branch directly to the destination. If so, rewrite it so it // does not need to go through the stub anymore. - unsigned CameFromOrigInst = *CameFromOrig; + unsigned CameFromOrigInst = CameFromOrig[-1]; if ((CameFromOrigInst >> 26) == 18) { // Direct call. intptr_t Offset = ((intptr_t)Target-(intptr_t)CameFromOrig) >> 2; if (Offset >= -(1 << 23) && Offset < (1 << 23)) { // In range? @@ -71,26 +74,38 @@ // Clear the original target out: CameFromOrigInst &= (63 << 26) | 3; CameFromOrigInst |= Offset << 2; - *CameFromOrig = CameFromOrigInst; + CameFromOrig[-1] = CameFromOrigInst; } } // Locate the start of the stub. If this is a short call, adjust backwards // the short amount, otherwise the full amount. bool isShortStub = (*CameFromStub >> 26) == 18; - CameFromStub -= isShortStub ? 3 : 7; + CameFromStub -= isShortStub ? 2 : 6; // Rewrite the stub with an unconditional branch to the target, for any users // who took the address of the stub. EmitBranchToAt(CameFromStub, Target, false); + // Change the SP so that we pop two stack frames off when we return. + *CCStackPtr = (intptr_t)OrigStackPtr; + + // Put the address of the stub and the LR value that originally came into the + // stub in a place that is easy to get on the stack after we restore all regs. + CCStackPtr[2] = (intptr_t)CameFromStub; + CCStackPtr[1] = (intptr_t)CameFromOrig; // FIXME: Need to restore the registers from IntRegs/FPRegs. - // FIXME: Need to pop two frames off of the stack and return to a place where - // we magically reexecute the call, or jump directly to the caller. This - // requires inline asm majik. - assert(0 && "CompilationCallback not finished yet!"); + // Note, this is not a standard epilog! +#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) + __asm__ __volatile__ ("lwz r0,4(r1)\n" // Get CameFromOrig (LR into stub) + "mtlr r0\n" // Put it in the LR register + "lwz r0,8(r1)\n" // Get "CameFromStub" + "mtctr r0\n" // Put it into the CTR register + "lwz r1,0(r1)\n" // Pop two frames off + "bctr\n" ::); // Return to stub! +#endif } From lattner at cs.uiuc.edu Tue Nov 23 13:00:13 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 13:00:13 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200411231900.iANJ0DEr008561@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.19 -> 1.20 --- Log message: Enumerate CR registers --- Diffs of the changes: (+8 -8) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.19 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.20 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.19 Tue Nov 23 09:56:38 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Tue Nov 23 12:59:59 2004 @@ -147,14 +147,14 @@ static unsigned enumRegToMachineReg(unsigned enumReg) { switch (enumReg) { - case PPC::R0 : case PPC::F0 : return 0; - case PPC::R1 : case PPC::F1 : return 1; - case PPC::R2 : case PPC::F2 : return 2; - case PPC::R3 : case PPC::F3 : return 3; - case PPC::R4 : case PPC::F4 : return 4; - case PPC::R5 : case PPC::F5 : return 5; - case PPC::R6 : case PPC::F6 : return 6; - case PPC::R7 : case PPC::F7 : return 7; + case PPC::R0 : case PPC::F0 : case PPC::CR0: return 0; + case PPC::R1 : case PPC::F1 : case PPC::CR1: return 1; + case PPC::R2 : case PPC::F2 : case PPC::CR2: return 2; + case PPC::R3 : case PPC::F3 : case PPC::CR3: return 3; + case PPC::R4 : case PPC::F4 : case PPC::CR4: return 4; + case PPC::R5 : case PPC::F5 : case PPC::CR5: return 5; + case PPC::R6 : case PPC::F6 : case PPC::CR6: return 6; + case PPC::R7 : case PPC::F7 : case PPC::CR7: return 7; case PPC::R8 : case PPC::F8 : return 8; case PPC::R9 : case PPC::F9 : return 9; case PPC::R10: case PPC::F10: return 10; From gaeke at cs.uiuc.edu Tue Nov 23 13:22:41 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 23 Nov 2004 13:22:41 -0600 (CST) Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile Message-ID: <200411231922.NAA21337@kain.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/Shootout-C++: Makefile updated: 1.11 -> 1.12 --- Log message: Make Shootout-C++/echo work on Solaris. --- Diffs of the changes: (+4 -0) Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile:1.11 llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile:1.12 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile:1.11 Wed Sep 1 09:33:26 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile Tue Nov 23 13:22:25 2004 @@ -7,3 +7,7 @@ FP_TOLERANCE = 0.00000001 include $(LEVEL)/SingleSource/Makefile.singlesrc + +ifeq ($(OS),SunOS) +LDFLAGS += -lsocket -lnsl +endif From lattner at cs.uiuc.edu Tue Nov 23 13:23:46 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 13:23:46 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Message-ID: <200411231923.iANJNkwO008608@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrFormats.td updated: 1.22 -> 1.23 --- Log message: Fix encoding of rlwinm? --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.22 llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.23 --- llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.22 Sat Oct 23 01:08:38 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Tue Nov 23 13:23:32 2004 @@ -586,8 +586,8 @@ class MForm_1 opcode, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : I { let ArgCount = 5; - bits<5> RS; bits<5> RA; + bits<5> RS; bits<5> RB; bits<5> MB; bits<5> ME; From lattner at cs.uiuc.edu Tue Nov 23 13:24:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 13:24:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Message-ID: <200411231924.iANJO1OW008614@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrInfo.td updated: 1.44 -> 1.45 --- Log message: Fix encodings --- Diffs of the changes: (+2 -2) Index: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.44 llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.45 --- llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.44 Mon Nov 22 23:54:08 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Tue Nov 23 13:23:18 2004 @@ -92,7 +92,7 @@ // register and an immediate are of this type. // let isLoad = 1 in { -def LBZ : DForm_1<35, 0, 0, (ops GPRC:$rD, s16imm:$disp, GPRC:$rA), +def LBZ : DForm_1<34, 0, 0, (ops GPRC:$rD, s16imm:$disp, GPRC:$rA), "lbz $rD, $disp($rA)">; def LHA : DForm_1<42, 0, 0, (ops GPRC:$rD, s16imm:$disp, GPRC:$rA), "lha $rD, $disp($rA)">; @@ -102,7 +102,7 @@ "lmw $rD, $disp($rA)">; def LWZ : DForm_1<32, 0, 0, (ops GPRC:$rD, symbolLo:$disp, GPRC:$rA), "lwz $rD, $disp($rA)">; -def LWZU : DForm_1<33, 0, 0, (ops GPRC:$rD, symbolLo:$disp, GPRC:$rA), +def LWZU : DForm_1<35, 0, 0, (ops GPRC:$rD, symbolLo:$disp, GPRC:$rA), "lwzu $rD, $disp($rA)">; } def ADDI : DForm_2<14, 0, 0, (ops GPRC:$rD, GPRC:$rA, s16imm:$imm), From brukman at cs.uiuc.edu Tue Nov 23 13:26:35 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 23 Nov 2004 13:26:35 -0600 Subject: [llvm-commits] CVS: llvm/docs/GettingStarted.html Message-ID: <200411231926.NAA07278@zion.cs.uiuc.edu> Changes in directory llvm/docs: GettingStarted.html updated: 1.79 -> 1.80 --- Log message: We also provide a source distribution of the GCC front-end --- Diffs of the changes: (+5 -1) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.79 llvm/docs/GettingStarted.html:1.80 --- llvm/docs/GettingStarted.html:1.79 Mon Nov 22 11:16:26 2004 +++ llvm/docs/GettingStarted.html Tue Nov 23 13:26:24 2004 @@ -570,6 +570,10 @@
    This is the source code to the LLVM suite.

    +

    cfrontend-1.3.source.tar.gz +
    This is the source release of the GCC front end. +

    +

    cfrontend-1.3.sparc-sun-solaris2.8.tar.gz
    This is the binary release of the GCC front end for Solaris/Sparc.

    @@ -1438,7 +1442,7 @@ Chris Lattner
    Reid Spencer
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/11/22 17:16:26 $ + Last modified: $Date: 2004/11/23 19:26:24 $ From gaeke at cs.uiuc.edu Tue Nov 23 14:15:20 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 23 Nov 2004 14:15:20 -0600 (CST) Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/Shootout-C++/echo.cpp Message-ID: <200411232015.OAA26859@kain.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/Shootout-C++: echo.cpp (r1.4) removed --- Log message: This is a networking benchmark, and it doesn't really work on solaris, so let's just drop it. --- Diffs of the changes: (+0 -0) From gaeke at cs.uiuc.edu Tue Nov 23 14:15:53 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 23 Nov 2004 14:15:53 -0600 (CST) Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile Message-ID: <200411232015.OAA26937@kain.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/Shootout-C++: Makefile updated: 1.12 -> 1.13 --- Log message: -lsocket -lnsl are no longer necessary now that echo.cpp is gone. --- Diffs of the changes: (+0 -4) Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile:1.12 llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile:1.13 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile:1.12 Tue Nov 23 13:22:25 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/Makefile Tue Nov 23 14:15:39 2004 @@ -7,7 +7,3 @@ FP_TOLERANCE = 0.00000001 include $(LEVEL)/SingleSource/Makefile.singlesrc - -ifeq ($(OS),SunOS) -LDFLAGS += -lsocket -lnsl -endif From lattner at cs.uiuc.edu Tue Nov 23 14:37:55 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 14:37:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPC.td PPC32.td PPC64.td PowerPCInstrInfo.h Message-ID: <200411232037.iANKbtou008730@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPC.td updated: 1.10 -> 1.11 PPC32.td updated: 1.2 -> 1.3 PPC64.td updated: 1.3 -> 1.4 PowerPCInstrInfo.h updated: 1.7 -> 1.8 --- Log message: Get rid of flags that are dead --- Diffs of the changes: (+38 -52) Index: llvm/lib/Target/PowerPC/PowerPC.td diff -u llvm/lib/Target/PowerPC/PowerPC.td:1.10 llvm/lib/Target/PowerPC/PowerPC.td:1.11 --- llvm/lib/Target/PowerPC/PowerPC.td:1.10 Thu Oct 14 00:54:38 2004 +++ llvm/lib/Target/PowerPC/PowerPC.td Tue Nov 23 14:37:41 2004 @@ -24,9 +24,8 @@ def PowerPCInstrInfo : InstrInfo { let PHIInst = PHI; - let TSFlagsFields = ["ArgCount", "Arg0Type", "Arg1Type", "Arg2Type", - "Arg3Type", "Arg4Type", "VMX", "PPC64"]; - let TSFlagsShifts = [ 0, 3, 8, 13, 18, 23, 28, 29 ]; + let TSFlagsFields = [ "VMX", "PPC64" ]; + let TSFlagsShifts = [ 0, 1 ]; let isLittleEndianEncoding = 1; } Index: llvm/lib/Target/PowerPC/PPC32.td diff -u llvm/lib/Target/PowerPC/PPC32.td:1.2 llvm/lib/Target/PowerPC/PPC32.td:1.3 --- llvm/lib/Target/PowerPC/PPC32.td:1.2 Thu Oct 14 00:54:38 2004 +++ llvm/lib/Target/PowerPC/PPC32.td Tue Nov 23 14:37:41 2004 @@ -24,9 +24,8 @@ def PowerPCInstrInfo : InstrInfo { let PHIInst = PHI; - let TSFlagsFields = ["ArgCount", "Arg0Type", "Arg1Type", "Arg2Type", - "Arg3Type", "Arg4Type", "VMX", "PPC64"]; - let TSFlagsShifts = [ 0, 3, 8, 13, 18, 23, 28, 29 ]; + let TSFlagsFields = [ "VMX", "PPC64" ]; + let TSFlagsShifts = [ 0, 1 ]; let isLittleEndianEncoding = 1; } Index: llvm/lib/Target/PowerPC/PPC64.td diff -u llvm/lib/Target/PowerPC/PPC64.td:1.3 llvm/lib/Target/PowerPC/PPC64.td:1.4 --- llvm/lib/Target/PowerPC/PPC64.td:1.3 Thu Oct 14 00:54:38 2004 +++ llvm/lib/Target/PowerPC/PPC64.td Tue Nov 23 14:37:41 2004 @@ -24,9 +24,8 @@ def PowerPCInstrInfo : InstrInfo { let PHIInst = PHI; - let TSFlagsFields = ["ArgCount", "Arg0Type", "Arg1Type", "Arg2Type", - "Arg3Type", "Arg4Type", "VMX", "PPC64"]; - let TSFlagsShifts = [ 0, 3, 8, 13, 18, 23, 28, 29 ]; + let TSFlagsFields = [ "VMX", "PPC64" ]; + let TSFlagsShifts = [ 0, 1 ]; let isLittleEndianEncoding = 1; } Index: llvm/lib/Target/PowerPC/PowerPCInstrInfo.h diff -u llvm/lib/Target/PowerPC/PowerPCInstrInfo.h:1.7 llvm/lib/Target/PowerPC/PowerPCInstrInfo.h:1.8 --- llvm/lib/Target/PowerPC/PowerPCInstrInfo.h:1.7 Tue Aug 17 00:00:46 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrInfo.h Tue Nov 23 14:37:41 2004 @@ -18,49 +18,38 @@ #include "llvm/Target/TargetInstrInfo.h" namespace llvm { - -namespace PPCII { - enum { - ArgCountShift = 0, - ArgCountMask = 7, - - Arg0TypeShift = 3, - Arg1TypeShift = 8, - Arg2TypeShift = 13, - Arg3TypeShift = 18, - Arg4TypeShift = 23, - VMX = 1<<28, - PPC64 = 1<<29, - ArgTypeMask = 31 - }; - - enum { - None = 0, - Gpr = 1, - Gpr0 = 2, - Simm16 = 3, - Zimm16 = 4, - PCRelimm24 = 5, - Imm24 = 6, - Imm5 = 7, - PCRelimm14 = 8, - Imm14 = 9, - Imm2 = 10, - Crf = 11, - Imm3 = 12, - Imm1 = 13, - Fpr = 14, - Imm4 = 15, - Imm8 = 16, - Disimm16 = 17, - Disimm14 = 18, - Spr = 19, - Sgr = 20, - Imm15 = 21, - Vpr = 22 - }; -} - + namespace PPCII { + enum { + VMX = 1 << 0, + PPC64 = 1 << 1, + }; + + enum { + None = 0, + Gpr = 1, + Gpr0 = 2, + Simm16 = 3, + Zimm16 = 4, + PCRelimm24 = 5, + Imm24 = 6, + Imm5 = 7, + PCRelimm14 = 8, + Imm14 = 9, + Imm2 = 10, + Crf = 11, + Imm3 = 12, + Imm1 = 13, + Fpr = 14, + Imm4 = 15, + Imm8 = 16, + Disimm16 = 17, + Disimm14 = 18, + Spr = 19, + Sgr = 20, + Imm15 = 21, + Vpr = 22 + }; + } } #endif From lattner at cs.uiuc.edu Tue Nov 23 14:41:49 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 14:41:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Message-ID: <200411232041.iANKfnMG008794@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrFormats.td updated: 1.23 -> 1.24 --- Log message: Remove argtype and argcount magic, which was used by the old asmprinter. --- Diffs of the changes: (+0 -189) Index: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.23 llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.24 --- llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.23 Tue Nov 23 13:23:32 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Tue Nov 23 14:41:34 2004 @@ -46,12 +46,6 @@ : Instruction { field bits<32> Inst; - bits<3> ArgCount; - bits<5> Arg0Type; - bits<5> Arg1Type; - bits<5> Arg2Type; - bits<5> Arg3Type; - bits<5> Arg4Type; bit PPC64 = ppc64; bit VMX = vmx; @@ -67,13 +61,6 @@ dag OL, string asmstr> : I { bits<24> LI; - let ArgCount = 1; - let Arg0Type = Imm24.Value; - let Arg1Type = 0; - let Arg2Type = 0; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-29} = LI; let Inst{30} = aa; let Inst{31} = lk; @@ -86,13 +73,6 @@ bits<5> BI; bits<14> BD; - let ArgCount = 3; - let Arg0Type = Imm5.Value; - let Arg1Type = Imm5.Value; - let Arg2Type = PCRelimm14.Value; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-10} = BO; let Inst{11-15} = BI; let Inst{16-29} = BD; @@ -103,10 +83,6 @@ class BForm_ext opcode, bit aa, bit lk, bits<5> bo, bits<5> bi, bit ppc64, bit vmx, dag OL, string asmstr> : BForm { - let ArgCount = 2; - let Arg2Type = Imm5.Value; - let Arg1Type = PCRelimm14.Value; - let Arg2Type = 0; let BO = bo; let BI = bi; } @@ -118,13 +94,6 @@ bits<5> B; bits<16> C; - let ArgCount = 3; - let Arg0Type = Gpr.Value; - let Arg1Type = Gpr.Value; - let Arg2Type = Simm16.Value; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-10} = A; let Inst{11-15} = B; let Inst{16-31} = C; @@ -136,13 +105,6 @@ bits<16> C; bits<5> B; - let ArgCount = 3; - let Arg0Type = Gpr.Value; - let Arg1Type = Disimm16.Value; - let Arg2Type = Gpr.Value; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-10} = A; let Inst{11-15} = B; let Inst{16-31} = C; @@ -156,13 +118,6 @@ bits<5> A; bits<16> B; - let ArgCount = 2; - let Arg0Type = Gpr.Value; - let Arg1Type = Simm16.Value; - let Arg2Type = 0; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-10} = A; let Inst{11-15} = 0; let Inst{16-31} = B; @@ -177,10 +132,6 @@ class DForm_4_zero opcode, bit ppc64, bit vmx, dag OL, string asmstr> : DForm_1 { - let ArgCount = 0; - let Arg0Type = 0; - let Arg1Type = 0; - let Arg2Type = 0; let A = 0; let B = 0; let C = 0; @@ -193,13 +144,6 @@ bits<5> RA; bits<16> I; - let ArgCount = 4; - let Arg0Type = Imm3.Value; - let Arg1Type = Imm1.Value; - let Arg2Type = Gpr.Value; - let Arg3Type = Simm16.Value; - let Arg4Type = 0; - let Inst{6-8} = BF; let Inst{9} = 0; let Inst{10} = L; @@ -210,11 +154,6 @@ class DForm_5_ext opcode, bit ppc64, bit vmx, dag OL, string asmstr> : DForm_5 { let L = ppc64; - let ArgCount = 3; - let Arg0Type = Imm3.Value; - let Arg1Type = Gpr.Value; - let Arg2Type = Simm16.Value; - let Arg3Type = 0; } class DForm_6 opcode, bit ppc64, bit vmx, dag OL, string asmstr> @@ -223,21 +162,14 @@ class DForm_6_ext opcode, bit ppc64, bit vmx, dag OL, string asmstr> : DForm_6 { let L = ppc64; - let ArgCount = 3; - let Arg0Type = Imm3.Value; - let Arg1Type = Gpr.Value; - let Arg2Type = Simm16.Value; - let Arg3Type = 0; } class DForm_8 opcode, bit ppc64, bit vmx, dag OL, string asmstr> : DForm_1 { - let Arg0Type = Fpr.Value; } class DForm_9 opcode, bit ppc64, bit vmx, dag OL, string asmstr> : DForm_1 { - let Arg0Type = Fpr.Value; } // 1.7.5 DS-Form @@ -247,13 +179,6 @@ bits<14> DS; bits<5> RA; - let ArgCount = 3; - let Arg0Type = Gpr.Value; - let Arg1Type = Disimm14.Value; - let Arg2Type = Gpr.Value; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-10} = RST; let Inst{11-15} = RA; let Inst{16-29} = DS; @@ -272,13 +197,6 @@ bits<5> A; bits<5> B; - let ArgCount = 3; - let Arg0Type = Gpr.Value; - let Arg1Type = Gpr.Value; - let Arg2Type = Gpr.Value; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-10} = RST; let Inst{11-15} = A; let Inst{16-20} = B; @@ -294,9 +212,6 @@ class XForm_5 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> : XForm_base_r3xo { - let ArgCount = 1; - let Arg1Type = 0; - let Arg2Type = 0; let A = 0; let B = 0; } @@ -312,14 +227,11 @@ class XForm_10 opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : XForm_base_r3xo { - let Arg2Type = Imm5.Value; } class XForm_11 opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : XForm_base_r3xo { - let ArgCount = 2; - let Arg2Type = 0; let B = 0; } @@ -330,13 +242,6 @@ bits<5> RA; bits<5> RB; - let ArgCount = 4; - let Arg0Type = Imm3.Value; - let Arg1Type = Imm1.Value; - let Arg2Type = Gpr.Value; - let Arg3Type = Gpr.Value; - let Arg4Type = 0; - let Inst{6-8} = BF; let Inst{9} = 0; let Inst{10} = L; @@ -349,10 +254,6 @@ class XForm_16_ext opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> : XForm_16 { - let ArgCount = 3; - let Arg1Type = Gpr.Value; - let Arg2Type = Gpr.Value; - let Arg3Type = 0; let L = ppc64; } @@ -362,13 +263,6 @@ bits<5> FRA; bits<5> FRB; - let ArgCount = 3; - let Arg0Type = Imm3.Value; - let Arg1Type = Fpr.Value; - let Arg2Type = Fpr.Value; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-8} = BF; let Inst{9-10} = 0; let Inst{11-15} = FRA; @@ -380,34 +274,23 @@ class XForm_25 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> : XForm_base_r3xo { - let Arg0Type = Fpr.Value; - let Arg1Type = Gpr0.Value; } class XForm_26 opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : XForm_base_r3xo { - let ArgCount = 2; - let Arg0Type = Fpr.Value; - let Arg1Type = Fpr.Value; - let Arg2Type = 0; let A = 0; } class XForm_28 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> : XForm_base_r3xo { - let Arg0Type = Fpr.Value; - let Arg1Type = Gpr0.Value; } // 1.7.7 XL-Form class XLForm_1 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> : XForm_base_r3xo { - let Arg0Type = Imm5.Value; - let Arg1Type = Imm5.Value; - let Arg2Type = Imm5.Value; } class XLForm_2 opcode, bits<10> xo, bit lk, bit ppc64, bit vmx, @@ -416,13 +299,6 @@ bits<5> BI; bits<2> BH; - let ArgCount = 3; - let Arg0Type = Imm5.Value; - let Arg1Type = Imm5.Value; - let Arg2Type = Imm2.Value; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-10} = BO; let Inst{11-15} = BI; let Inst{16-18} = 0; @@ -435,10 +311,6 @@ bits<5> bi, bit lk, bit ppc64, bit vmx, dag OL, string asmstr> : XLForm_2 { - let ArgCount = 0; - let Arg0Type = 0; - let Arg1Type = 0; - let Arg2Type = 0; let BO = bo; let BI = bi; let BH = 0; @@ -450,13 +322,6 @@ bits<5> ST; bits<10> SPR; - let ArgCount = 2; - let Arg0Type = Imm5.Value; - let Arg1Type = Gpr.Value; - let Arg2Type = 0; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-10} = ST; let Inst{11-20} = SPR; let Inst{21-30} = xo; @@ -466,9 +331,6 @@ class XFXForm_1_ext opcode, bits<10> xo, bits<10> spr, bit ppc64, bit vmx, dag OL, string asmstr> : XFXForm_1 { - let ArgCount = 1; - let Arg0Type = Gpr.Value; - let Arg1Type = 0; let SPR = spr; } @@ -479,9 +341,6 @@ class XFXForm_7_ext opcode, bits<10> xo, bits<10> spr, bit ppc64, bit vmx, dag OL, string asmstr> : XFXForm_7 { - let ArgCount = 1; - let Arg0Type = Gpr.Value; - let Arg1Type = 0; let SPR = spr; } @@ -492,13 +351,6 @@ bits<5> A; bits<6> SH; - let ArgCount = 3; - let Arg0Type = Gpr.Value; - let Arg1Type = Gpr.Value; - let Arg2Type = Imm6.Value; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-10} = RS; let Inst{11-15} = A; let Inst{16-20} = SH{1-5}; @@ -514,13 +366,6 @@ bits<5> RA; bits<5> RB; - let ArgCount = 3; - let Arg0Type = Gpr.Value; - let Arg1Type = Gpr.Value; - let Arg2Type = Gpr.Value; - let Arg3Type = 0; - let Arg4Type = 0; - let Inst{6-10} = RT; let Inst{11-15} = RA; let Inst{16-20} = RB; @@ -539,25 +384,17 @@ class XOForm_3 opcode, bits<9> xo, bit oe, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : XOForm_1 { - let ArgCount = 2; let RB = 0; } // 1.7.12 A-Form class AForm_1 opcode, bits<5> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : I { - let ArgCount = 4; bits<5> FRT; bits<5> FRA; bits<5> FRB; bits<5> FRC; - let Arg0Type = Fpr.Value; - let Arg1Type = Fpr.Value; - let Arg2Type = Fpr.Value; - let Arg3Type = Fpr.Value; - let Arg4Type = 0; - let Inst{6-10} = FRT; let Inst{11-15} = FRA; let Inst{16-20} = FRB; @@ -569,35 +406,24 @@ class AForm_2 opcode, bits<5> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : AForm_1 { - let ArgCount = 3; - let Arg3Type = 0; let FRC = 0; } class AForm_3 opcode, bits<5> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : AForm_1 { - let ArgCount = 3; - let Arg3Type = 0; let FRB = 0; } // 1.7.13 M-Form class MForm_1 opcode, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : I { - let ArgCount = 5; bits<5> RA; bits<5> RS; bits<5> RB; bits<5> MB; bits<5> ME; - let Arg0Type = Gpr.Value; - let Arg1Type = Gpr.Value; - let Arg2Type = Gpr.Value; - let Arg3Type = Imm5.Value; - let Arg4Type = Imm5.Value; - let Inst{6-10} = RS; let Inst{11-15} = RA; let Inst{16-20} = RB; @@ -609,24 +435,16 @@ class MForm_2 opcode, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : MForm_1 { - let Arg2Type = Imm5.Value; } // 1.7.14 MD-Form class MDForm_1 opcode, bits<3> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : I { - let ArgCount = 4; bits<5> RS; bits<5> RA; bits<6> SH; bits<6> MBE; - let Arg0Type = Gpr.Value; - let Arg1Type = Gpr.Value; - let Arg2Type = Imm6.Value; - let Arg3Type = Imm6.Value; - let Arg4Type = 0; - let Inst{6-10} = RS; let Inst{11-15} = RA; let Inst{16-20} = SH{1-5}; @@ -639,15 +457,8 @@ //===----------------------------------------------------------------------===// class Pseudo : I<0, 0, 0, OL, asmstr> { - let ArgCount = 0; let PPC64 = 0; let VMX = 0; - let Arg0Type = Pseudo.Value; - let Arg1Type = Pseudo.Value; - let Arg2Type = Pseudo.Value; - let Arg3Type = Pseudo.Value; - let Arg4Type = 0; - let Inst{31-0} = 0; } From lattner at cs.uiuc.edu Tue Nov 23 15:17:49 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 15:17:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Message-ID: <200411232117.iANLHnOJ009019@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrFormats.td updated: 1.24 -> 1.25 --- Log message: Fix the encoding of OR, AND and many other instructions --- Diffs of the changes: (+11 -1) Index: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.24 llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.25 --- llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.24 Tue Nov 23 14:41:34 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Tue Nov 23 15:17:35 2004 @@ -218,7 +218,17 @@ class XForm_6 opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> - : XForm_base_r3xo; + : I { + bits<5> A; + bits<5> RST; + bits<5> B; + + let Inst{6-10} = RST; + let Inst{11-15} = A; + let Inst{16-20} = B; + let Inst{21-30} = xo; + let Inst{31} = rc; +} class XForm_8 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> From natebegeman at mac.com Tue Nov 23 15:34:29 2004 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 23 Nov 2004 15:34:29 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Message-ID: <200411232134.PAA09568@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.cpp updated: 1.4 -> 1.5 --- Log message: Save/Restore arg regs and nonvolatile regs the compiler might use during CompilationCallback --- Diffs of the changes: (+29 -12) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.4 llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.5 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.4 Tue Nov 23 12:49:46 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Tue Nov 23 15:34:18 2004 @@ -48,10 +48,22 @@ } static void CompilationCallback() { - // FIXME: Should save R3-R10 and F1-F13 onto the stack, just like the Sparc - // version does. - //int IntRegs[8]; - //uint64_t FPRegs[13]; + // Save R3-R31, since we want to restore arguments and nonvolatile regs used + // by the compiler. We also save and restore the FP regs, although this is + // probably just paranoia (gcc is unlikely to emit code that uses them for + // for this function. +#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) + unsigned IntRegs[29]; + double FPRegs[13]; + __asm__ __volatile__ ( + "stmw r3, 0(%0)\n" + "stfd f1, 0(%1)\n" "stfd f2, 8(%1)\n" "stfd f3, 16(%1)\n" + "stfd f4, 24(%1)\n" "stfd f5, 32(%1)\n" "stfd f6, 40(%1)\n" + "stfd f7, 48(%1)\n" "stfd f8, 56(%1)\n" "stfd f9, 64(%1)\n" + "stfd f10, 72(%1)\n" "stfd f11, 80(%1)\n" "stfd f12, 88(%1)\n" + "stfd f13, 96(%1)\n" :: "r" (IntRegs), "r" (FPRegs) ); +#endif + unsigned *CameFromStub = (unsigned*)__builtin_return_address(0); unsigned *CameFromOrig = (unsigned*)__builtin_return_address(1); unsigned *CCStackPtr = (unsigned*)__builtin_frame_address(0); @@ -95,16 +107,21 @@ CCStackPtr[2] = (intptr_t)CameFromStub; CCStackPtr[1] = (intptr_t)CameFromOrig; - // FIXME: Need to restore the registers from IntRegs/FPRegs. - // Note, this is not a standard epilog! #if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) - __asm__ __volatile__ ("lwz r0,4(r1)\n" // Get CameFromOrig (LR into stub) - "mtlr r0\n" // Put it in the LR register - "lwz r0,8(r1)\n" // Get "CameFromStub" - "mtctr r0\n" // Put it into the CTR register - "lwz r1,0(r1)\n" // Pop two frames off - "bctr\n" ::); // Return to stub! + __asm__ __volatile__ ( + "lfd f1, 0(%0)\n" "lfd f2, 8(%0)\n" "lfd f3, 16(%0)\n" + "lfd f4, 24(%0)\n" "lfd f5, 32(%0)\n" "lfd f6, 40(%0)\n" + "lfd f7, 48(%0)\n" "lfd f8, 56(%0)\n" "lfd f9, 64(%0)\n" + "lfd f10, 72(%0)\n" "lfd f11, 80(%0)\n" "lfd f12, 88(%0)\n" + "lfd f13, 96(%0)\n" "lmw r3, 0(%1)\n" + "lwz r0,4(r1)\n" // Get CameFromOrig (LR into stub) + "mtlr r0\n" // Put it in the LR register + "lwz r0,8(r1)\n" // Get "CameFromStub" + "mtctr r0\n" // Put it into the CTR register + "lwz r1,0(r1)\n" // Pop two frames off + "bctr\n" :: // Return to stub! + "r" (FPRegs), "r" (IntRegs)); #endif } From natebegeman at mac.com Tue Nov 23 15:37:33 2004 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 23 Nov 2004 15:37:33 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Message-ID: <200411232137.PAA09602@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.cpp updated: 1.5 -> 1.6 --- Log message: Use the correct register class as a constaint to gcc's inline assembly, so that we don't end up trying to use r0 as a base register. --- Diffs of the changes: (+2 -2) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.5 llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.6 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.5 Tue Nov 23 15:34:18 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Tue Nov 23 15:37:22 2004 @@ -61,7 +61,7 @@ "stfd f4, 24(%1)\n" "stfd f5, 32(%1)\n" "stfd f6, 40(%1)\n" "stfd f7, 48(%1)\n" "stfd f8, 56(%1)\n" "stfd f9, 64(%1)\n" "stfd f10, 72(%1)\n" "stfd f11, 80(%1)\n" "stfd f12, 88(%1)\n" - "stfd f13, 96(%1)\n" :: "r" (IntRegs), "r" (FPRegs) ); + "stfd f13, 96(%1)\n" :: "b" (IntRegs), "b" (FPRegs) ); #endif unsigned *CameFromStub = (unsigned*)__builtin_return_address(0); @@ -121,7 +121,7 @@ "mtctr r0\n" // Put it into the CTR register "lwz r1,0(r1)\n" // Pop two frames off "bctr\n" :: // Return to stub! - "r" (FPRegs), "r" (IntRegs)); + "b" (FPRegs), "b" (IntRegs)); #endif } From lattner at cs.uiuc.edu Tue Nov 23 16:06:40 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 16:06:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Message-ID: <200411232206.iANM6eLw009100@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrInfo.td updated: 1.45 -> 1.46 --- Log message: Fix encoding of blr and bctr --- Diffs of the changes: (+2 -2) Index: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.45 llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.46 --- llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.45 Tue Nov 23 13:23:18 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Tue Nov 23 16:06:24 2004 @@ -16,8 +16,8 @@ let isTerminator = 1 in { let isReturn = 1 in - def BLR : XLForm_2_ext<19, 16, 20, 31, 1, 0, 0, (ops), "blr">; - def BCTR : XLForm_2_ext<19, 528, 20, 31, 1, 0, 0, (ops), "bctr">; + def BLR : XLForm_2_ext<19, 16, 20, 0, 0, 0, 0, (ops), "blr">; + def BCTR : XLForm_2_ext<19, 528, 20, 0, 0, 0, 0, (ops), "bctr">; } def u5imm : Operand { From criswell at cs.uiuc.edu Tue Nov 23 16:06:42 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue, 23 Nov 2004 16:06:42 -0600 Subject: [llvm-commits] CVS: llvm/docs/GettingStarted.html Message-ID: <200411232206.QAA18645@choi.cs.uiuc.edu> Changes in directory llvm/docs: GettingStarted.html updated: 1.80 -> 1.81 --- Log message: Added remark about GCC 3.2.2. Someone with more knowledge of the problem can elaborate. --- Diffs of the changes: (+3 -2) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.80 llvm/docs/GettingStarted.html:1.81 --- llvm/docs/GettingStarted.html:1.80 Tue Nov 23 13:26:24 2004 +++ llvm/docs/GettingStarted.html Tue Nov 23 16:06:24 2004 @@ -458,10 +458,11 @@ problems in the STL that effectively prevent it from compiling LLVM.

    +

    GCC 3.2.2: This version of GCC fails to compile LLVM.

    +

    GCC 3.3.2: This version of GCC suffered from a serious bug which causes it to crash in the "convert_from_eh_region_ranges_1" GCC function.

    - @@ -1442,7 +1443,7 @@ Chris Lattner
    Reid Spencer
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/11/23 19:26:24 $ + Last modified: $Date: 2004/11/23 22:06:24 $ From reid at x10sys.com Tue Nov 23 16:35:49 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 16:35:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveReader.cpp Message-ID: <200411232235.QAA10172@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: ArchiveReader.cpp updated: 1.31 -> 1.32 --- Log message: Allow reading of member names that begin with an _ character. --- Diffs of the changes: (+2 -1) Index: llvm/lib/Bytecode/Archive/ArchiveReader.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.31 llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.32 --- llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.31 Sat Nov 20 01:29:40 2004 +++ llvm/lib/Bytecode/Archive/ArchiveReader.cpp Tue Nov 23 16:35:39 2004 @@ -157,8 +157,9 @@ (0 == memcmp(Hdr->name, ARFILE_BSD4_SYMTAB_NAME, 16))) { pathname.assign(ARFILE_BSD4_SYMTAB_NAME); flags |= ArchiveMember::BSD4SymbolTableFlag; + break; } - break; + /* FALL THROUGH */ default: char* slash = (char*) memchr(Hdr->name, '/', 16); From reid at x10sys.com Tue Nov 23 16:55:19 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 16:55:19 -0600 Subject: [llvm-commits] CVS: llvm-test/Makefile.rules Message-ID: <200411232255.QAA10513@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.rules updated: 1.3 -> 1.4 --- Log message: Don't depend on obscure compiler options to generate paths into the makefile when perfectly legitimate configured values will suffice. This change enables the llvm-test suite to be compiled with llvm-gcc or with llvmc configured to use llvm-gcc's cc1 and cc1plus compiler tools. --- Diffs of the changes: (+1 -1) Index: llvm-test/Makefile.rules diff -u llvm-test/Makefile.rules:1.3 llvm-test/Makefile.rules:1.4 --- llvm-test/Makefile.rules:1.3 Thu Nov 18 15:38:09 2004 +++ llvm-test/Makefile.rules Tue Nov 23 16:55:08 2004 @@ -261,7 +261,7 @@ LLVMAS := $(LLVMTOOLCURRENT)/llvm-as$(EXEEXT) # Find the location of the platform specific LLVM GCC libraries -LLVMGCCLIBDIR=$(dir $(shell $(LLVMGCC) -print-file-name=libgcc.a)) +LLVMGCCLIBDIR=$(LLVMGCCDIR)/lib/gcc/$(LLVMGCCARCH) # LLVM Tool Definitions (LLVMGCC, LLVMGXX, LLVMAS are provided by # Makefile.rules) LLI = $(LLVMTOOLCURRENT)/lli$(EXEEXT) From reid at x10sys.com Tue Nov 23 17:33:19 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 17:33:19 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/c.in cpp.in ll.in st.in Message-ID: <200411232333.RAA11215@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: c.in added (r1.1) cpp.in added (r1.1) ll.in added (r1.1) st.in added (r1.1) --- Log message: Configurable language configuration files. --- Diffs of the changes: (+203 -0) Index: llvm/tools/llvmc/c.in diff -c /dev/null llvm/tools/llvmc/c.in:1.1 *** /dev/null Tue Nov 23 17:33:18 2004 --- llvm/tools/llvmc/c.in Tue Nov 23 17:33:08 2004 *************** *** 0 **** --- 1,64 ---- + # Stacker Configuration File For llvmc + + ########################################################## + # Language definitions + ########################################################## + lang.name=C + lang.opt1=-O1 + lang.opt2=-O2 + lang.opt3=-O3 + lang.opt4=-O3 + lang.opt5=-O3 + lang.libs=@LLVMGCCDIR@/lib @LLVMGCCDIR@/bytecode-libs \ + @LLVMGCCDIR@/lib/gcc/@LLVMGCCARCH@ + + ########################################################## + # Pre-processor definitions + ########################################################## + + # Stacker doesn't have a preprocessor but the following + # allows the -E option to be supported + preprocessor.command=g++ -E %in% -o %out% %incls% %defs% + preprocessor.required=false + + ########################################################## + # Translator definitions + ########################################################## + + # To compile stacker source, we just run the stacker + # compiler with a default stack size of 2048 entries. + translator.command=@LLVMCC1@ -quiet %in% -o %out% \ + %opt% %incls% %defs% %WOpts% %fOpts% %MOpts% %args% + + # stkrc doesn't preprocess but we set this to true so + # that we don't run the cp command by default. + translator.preprocesses=true + + # The translator is required to run. + translator.required=true + + # Output of the translator is assembly + translator.output=assembly + + ########################################################## + # Optimizer definitions + ########################################################## + + # For optimization, we use the LLVM "opt" program + optimizer.command=@LLVM_BINDIR@/gccas %in% -o %out% %args% + + optimizer.required = true + + # opt doesn't translate + optimizer.translates = false + + # opt doesn't preprocess + optimizer.preprocesses=false + + # opt produces bytecode + optimizer.output = bytecode + + ########################################################## + # Assembler definitions + ########################################################## + assembler.command=llc %in% -o %out% %target% %time% %stats% Index: llvm/tools/llvmc/cpp.in diff -c /dev/null llvm/tools/llvmc/cpp.in:1.1 *** /dev/null Tue Nov 23 17:33:19 2004 --- llvm/tools/llvmc/cpp.in Tue Nov 23 17:33:08 2004 *************** *** 0 **** --- 1,64 ---- + # Stacker Configuration File For llvmc + + ########################################################## + # Language definitions + ########################################################## + lang.name=C++ + lang.opt1=-O1 + lang.opt2=-O2 + lang.opt3=-O3 + lang.opt4=-O3 + lang.opt5=-O3 + lang.libs=@LLVMGCCDIR@/lib @LLVMGCCDIR@/bytecode-libs \ + @LLVMGCCDIR@/lib/gcc/@LLVMGCCARCH@ + + ########################################################## + # Pre-processor definitions + ########################################################## + + # Stacker doesn't have a preprocessor but the following + # allows the -E option to be supported + preprocessor.command=g++ -E %in% -o %out% %incls% %defs% + preprocessor.required=false + + ########################################################## + # Translator definitions + ########################################################## + + # To compile stacker source, we just run the stacker + # compiler with a default stack size of 2048 entries. + translator.command=@LLVMCC1PLUS@ -quiet %in% -o %out% \ + %opt% %incls% %defs% %WOpts% %fOpts% %MOpts% %args% + + # stkrc doesn't preprocess but we set this to true so + # that we don't run the cp command by default. + translator.preprocesses=true + + # The translator is required to run. + translator.required=true + + # stkrc doesn't handle the -On options + translator.output=assembly + + ########################################################## + # Optimizer definitions + ########################################################## + + # For optimization, we use the LLVM "opt" program + optimizer.command=@LLVM_BINDIR@/gccas %in% -o %out% %args% + + optimizer.required = true + + # opt doesn't translate + optimizer.translates = false + + # opt doesn't preprocess + optimizer.preprocesses=false + + # opt produces bytecode + optimizer.output = bytecode + + ########################################################## + # Assembler definitions + ########################################################## + assembler.command=llc %in% -o %out% %target% %time% %stats% Index: llvm/tools/llvmc/ll.in diff -c /dev/null llvm/tools/llvmc/ll.in:1.1 *** /dev/null Tue Nov 23 17:33:19 2004 --- llvm/tools/llvmc/ll.in Tue Nov 23 17:33:08 2004 *************** *** 0 **** --- 1,12 ---- + # LLVM Assembly Config File For llvmc + version="1.0" + lang.name=LLVM Assembly + preprocessor.command= + preprocessor.required=false + translator.command=@bindir@/llvm-as %in% -o %out% + translator.optimizes=no + translator.preprocesses=true + translator.required=TRUE + optimizer.command=@bindir@/opt %in% -o %out% %opt% %args% + optimizer.translates=no + assembler.command=@bindir@/llc %in% -o %out% Index: llvm/tools/llvmc/st.in diff -c /dev/null llvm/tools/llvmc/st.in:1.1 *** /dev/null Tue Nov 23 17:33:19 2004 --- llvm/tools/llvmc/st.in Tue Nov 23 17:33:08 2004 *************** *** 0 **** --- 1,63 ---- + # Stacker Configuration File For llvmc + + ########################################################## + # Language definitions + ########################################################## + lang.name=Stacker + lang.opt1=-O1 + lang.opt2=-O2 + lang.opt3=-O3 + lang.opt4=-O4 + lang.opt5=-O5 + + ########################################################## + # Pre-processor definitions + ########################################################## + + # Stacker doesn't have a preprocessor but the following + # allows the -E option to be supported + preprocessor.command=cp %in% %out% + preprocessor.required=false + + ########################################################## + # Translator definitions + ########################################################## + + # To compile stacker source, we just run the stacker + # compiler with a default stack size of 2048 entries. + translator.command=@bindir@/stkrc -s 2048 %in% -f -o %out% %opt% \ + %time% %stats% %args% + + # stkrc doesn't preprocess but we set this to true so + # that we don't run the cp command by default. + translator.preprocesses=true + + # The translator is required to run. + translator.required=false + + # stkrc doesn't handle the -On options + translator.output=bytecode + + ########################################################## + # Optimizer definitions + ########################################################## + + # For optimization, we use the LLVM "opt" program + optimizer.command=@bindir@/stkrc -s 2048 %in% -f -o %out% %opt% \ + %time% %stats% %args% + + optimizer.required = yes + + # opt doesn't translate + optimizer.translates = yes + + # opt doesn't preprocess + optimizer.preprocesses=yes + + # opt produces bytecode + optimizer.output = bc + + ########################################################## + # Assembler definitions + ########################################################## + assembler.command=llc %in% -o %out% %target% %time% %stats% From reid at x10sys.com Tue Nov 23 17:35:26 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 17:35:26 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/ConfigLexer.l Message-ID: <200411232335.RAA11257@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: ConfigLexer.l updated: 1.10 -> 1.11 --- Log message: Handle space, separators, bad substitutions, and library search path better than before. --- Diffs of the changes: (+7 -6) Index: llvm/tools/llvmc/ConfigLexer.l diff -u llvm/tools/llvmc/ConfigLexer.l:1.10 llvm/tools/llvmc/ConfigLexer.l:1.11 --- llvm/tools/llvmc/ConfigLexer.l:1.10 Wed Oct 27 23:04:38 2004 +++ llvm/tools/llvmc/ConfigLexer.l Tue Nov 23 17:35:16 2004 @@ -79,6 +79,7 @@ ASSEMBLER assembler|Assembler|ASSEMBLER COMMAND command|Command|COMMAND LANG lang|Lang|LANG +LIBS libs|Libs|LIBS LINKER linker|Linker|LINKER NAME name|Name|NAME OPT1 opt1|Opt1|OPT1 @@ -100,7 +101,7 @@ Bytecode bc|BC|bytecode|Bytecode|BYTECODE Assembly asm|ASM|assembly|Assembly|ASSEMBLY -BadSubst \%[^iots][a-zA-Z]\% +BadSubst \%[a-zA-Z]*\% Comment \#[^\r\n]*\r?\n NewLine \r?\n Eq \= @@ -113,7 +114,7 @@ %% -{White} { /* Ignore whitespace */ } +{White} { if (ConfigLexerState.in_value) return SPACE; } {Comment} { /* Ignore comments */ ConfigLexerState.in_value = false; @@ -134,9 +135,12 @@ return EQUALS; } +{Sep} { return SEPARATOR; } + {VERSION} { return handleNameContext(VERSION_TOK); } {LANG} { return handleNameContext(LANG); } +{LIBS} { return handleNameContext(LIBS); } {NAME} { return handleNameContext(NAME); } {OPT1} { return handleNameContext(OPT1); } {OPT2} { return handleNameContext(OPT2); } @@ -173,7 +177,6 @@ %fOpts% { return handleSubstitution(FOPTS_SUBST); } %MOpts% { return handleSubstitution(MOPTS_SUBST); } %WOpts% { return handleSubstitution(WOPTS_SUBST); } -{BadSubst} { YY_FATAL_ERROR("Invalid substitution token"); } {Assembly} { return handleValueContext(ASSEMBLY); } {Bytecode} { return handleValueContext(BYTECODE); } @@ -186,8 +189,6 @@ --ConfigLexerState.StringVal.end()); return STRING; } -{Sep} { if (ConfigLexerState.in_value) { ConfigLexerState.StringVal = yytext; - return OPTION; } } - +{BadSubst} { YY_FATAL_ERROR("Invalid substitution token"); } %% From reid at x10sys.com Tue Nov 23 17:36:01 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 17:36:01 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/ConfigLexer.h Message-ID: <200411232336.RAA11274@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: ConfigLexer.h updated: 1.10 -> 1.11 --- Log message: SPACE is a legitimate token now, to separate option words. --- Diffs of the changes: (+1 -0) Index: llvm/tools/llvmc/ConfigLexer.h diff -u llvm/tools/llvmc/ConfigLexer.h:1.10 llvm/tools/llvmc/ConfigLexer.h:1.11 --- llvm/tools/llvmc/ConfigLexer.h:1.10 Wed Oct 27 23:06:15 2004 +++ llvm/tools/llvmc/ConfigLexer.h Tue Nov 23 17:35:50 2004 @@ -84,6 +84,7 @@ PREPROCESSOR, ///< The name "preprocessor" (and variants) REQUIRED, ///< The name "required" (and variants) SEPARATOR, ///< A configuration item separator + SPACE, ///< Space between options STATS_SUBST, ///< The stats substitution item %stats% STRING, ///< A quoted string TARGET_SUBST, ///< The substitition item %target% From reid at x10sys.com Tue Nov 23 17:37:37 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 17:37:37 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/Configuration.cpp Message-ID: <200411232337.RAA11306@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: Configuration.cpp updated: 1.15 -> 1.16 --- Log message: Make various adjustments to parsing so that the separator character doesn't terminate options or paths, so that SPACE tokens legally separate options on a command line, and so that the lang.libs paths are parsed properly. --- Diffs of the changes: (+156 -36) Index: llvm/tools/llvmc/Configuration.cpp diff -u llvm/tools/llvmc/Configuration.cpp:1.15 llvm/tools/llvmc/Configuration.cpp:1.16 --- llvm/tools/llvmc/Configuration.cpp:1.15 Fri Nov 5 16:15:36 2004 +++ llvm/tools/llvmc/Configuration.cpp Tue Nov 23 17:37:26 2004 @@ -112,33 +112,44 @@ eatLineRemnant(); } + bool parseCompleteItem(std::string& result) { + result.clear(); + while (next_is_real()) { + switch (token ) { + case STRING : + case OPTION : + result += ConfigLexerState.StringVal; + break; + case SEPARATOR: + result += "."; + break; + case SPACE: + return true; + default: + return false; + } + } + return false; + } + std::string parseName() { std::string result; if (next() == EQUALS) { - while (next_is_real()) { - switch (token ) { - case STRING : - case OPTION : - result += ConfigLexerState.StringVal + " "; - break; - default: - error("Invalid name"); - break; - } - } + if (parseCompleteItem(result)) + eatLineRemnant(); if (result.empty()) error("Name exepected"); - else - result.erase(result.size()-1,1); } else - error("= expected"); + error("Expecting '='"); return result; } bool parseBoolean() { bool result = true; if (next() == EQUALS) { - if (next() == FALSETOK) { + if (next() == SPACE) + next(); + if (token == FALSETOK) { result = false; } else if (token != TRUETOK) { error("Expecting boolean value"); @@ -166,6 +177,9 @@ case STATS_SUBST: optList.push_back("%stats%"); break; case TIME_SUBST: optList.push_back("%time%"); break; case VERBOSE_SUBST: optList.push_back("%verbose%"); break; + case FOPTS_SUBST: optList.push_back("%fOpts%"); break; + case MOPTS_SUBST: optList.push_back("%Mopts%"); break; + case WOPTS_SUBST: optList.push_back("%Wopts%"); break; default: return false; } @@ -187,19 +201,34 @@ } void parseVersion() { - if (next() == EQUALS) { - while (next_is_real()) { - if (token == STRING || token == OPTION) - confDat->version = ConfigLexerState.StringVal; - else - error("Expecting a version string"); - } - } else + if (next() != EQUALS) error("Expecting '='"); + while (next_is_real()) { + if (token == STRING || token == OPTION) + confDat->version = ConfigLexerState.StringVal; + else + error("Expecting a version string"); + } + } + + void parseLibs() { + if (next() != EQUALS) + error("Expecting '='"); + std::string lib; + while (parseCompleteItem(lib)) { + if (!lib.empty()) { + confDat->libpaths.push_back(lib); + } + } } void parseLang() { + if (next() != SEPARATOR) + error("Expecting '.'"); switch (next() ) { + case LIBS: + parseLibs(); + break; case NAME: confDat->langName = parseName(); break; @@ -225,24 +254,103 @@ } } + bool parseProgramName(std::string& str) { + str.clear(); + do { + switch (token) { + case OPTION: + case STRING: + case ARGS_SUBST: + case DEFS_SUBST: + case IN_SUBST: + case INCLS_SUBST: + case LIBS_SUBST: + case OPT_SUBST: + case OUT_SUBST: + case STATS_SUBST: + case TARGET_SUBST: + case TIME_SUBST: + case VERBOSE_SUBST: + case FOPTS_SUBST: + case MOPTS_SUBST: + case WOPTS_SUBST: + str += ConfigLexerState.StringVal; + break; + case SEPARATOR: + str += "."; + break; + case ASSEMBLY: + str += "assembly"; + break; + case BYTECODE: + str += "bytecode"; + break; + case TRUETOK: + str += "true"; + break; + case FALSETOK: + str += "false"; + break; + default: + break; + } + next(); + } while (token != SPACE && token != EOFTOK && token != EOLTOK && + token != ERRORTOK); + return !str.empty(); + } + void parseCommand(CompilerDriver::Action& action) { - if (next() == EQUALS) { - if (next() == EOLTOK) { + if (next() != EQUALS) + error("Expecting '='"); + switch (next()) { + case EOLTOK: // no value (valid) action.program.clear(); action.args.clear(); - } else { - if (token == STRING || token == OPTION) { - action.program.setFile(ConfigLexerState.StringVal); - } else { + break; + case SPACE: + next(); + /* FALL THROUGH */ + default: + { + std::string progname; + if (parseProgramName(progname)) + action.program.setFile(progname); + else error("Expecting a program name"); - } + + // Get the options + std::string anOption; while (next_is_real()) { - if (token == STRING || token == OPTION) { - action.args.push_back(ConfigLexerState.StringVal); - } else if (!parseSubstitution(action.args)) { - error("Expecting a program argument or substitution", false); - break; + switch (token) { + case STRING: + case OPTION: + anOption += ConfigLexerState.StringVal; + break; + case ASSEMBLY: + anOption += "assembly"; + break; + case BYTECODE: + anOption += "bytecode"; + break; + case TRUETOK: + anOption += "true"; + break; + case FALSETOK: + anOption += "false"; + break; + case SEPARATOR: + anOption += "."; + break; + case SPACE: + action.args.push_back(anOption); + anOption.clear(); + break; + default: + if (!parseSubstitution(action.args)) + error("Expecting a program argument or substitution", false); + break; } } } @@ -250,6 +358,8 @@ } void parsePreprocessor() { + if (next() != SEPARATOR) + error("Expecting '.'"); switch (next()) { case COMMAND: parseCommand(confDat->PreProcessor); @@ -269,7 +379,9 @@ bool parseOutputFlag() { if (next() == EQUALS) { - if (next() == ASSEMBLY) { + if (next() == SPACE) + next(); + if (token == ASSEMBLY) { return true; } else if (token == BYTECODE) { return false; @@ -287,6 +399,8 @@ } void parseTranslator() { + if (next() != SEPARATOR) + error("Expecting '.'"); switch (next()) { case COMMAND: parseCommand(confDat->Translator); @@ -319,6 +433,8 @@ } void parseOptimizer() { + if (next() != SEPARATOR) + error("Expecting '.'"); switch (next()) { case COMMAND: parseCommand(confDat->Optimizer); @@ -356,6 +472,8 @@ } void parseAssembler() { + if (next() != SEPARATOR) + error("Expecting '.'"); switch(next()) { case COMMAND: parseCommand(confDat->Assembler); @@ -367,6 +485,8 @@ } void parseLinker() { + if (next() != SEPARATOR) + error("Expecting '.'"); switch(next()) { case LIBS: break; //FIXME From llvm at cs.uiuc.edu Tue Nov 23 17:38:19 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Tue, 23 Nov 2004 17:38:19 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/cpp ll st Message-ID: <200411232338.RAA11320@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: cpp (r1.1) removed ll (r1.5) removed st (r1.8) removed --- Log message: Removed in favor of configurable (*.in) versions. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Tue Nov 23 17:38:57 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 17:38:57 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/Makefile Message-ID: <200411232338.RAA11343@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: Makefile updated: 1.8 -> 1.9 --- Log message: Add the c and cpp configuration files. --- Diffs of the changes: (+2 -2) Index: llvm/tools/llvmc/Makefile diff -u llvm/tools/llvmc/Makefile:1.8 llvm/tools/llvmc/Makefile:1.9 --- llvm/tools/llvmc/Makefile:1.8 Wed Oct 27 19:11:43 2004 +++ llvm/tools/llvmc/Makefile Tue Nov 23 17:38:46 2004 @@ -9,7 +9,7 @@ LEVEL = ../.. TOOLNAME = llvmc USEDLIBS = LLVMBCReader LLVMCore LLVMSupport.a LLVMSystem.a -CONFIG_FILES = st ll -EXTRA_DIST = st ll +CONFIG_FILES = c cpp ll st +EXTRA_DIST = c cpp ll st include $(LEVEL)/Makefile.common From reid at x10sys.com Tue Nov 23 17:40:17 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 17:40:17 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.h Message-ID: <200411232340.RAA11371@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: CompilerDriver.h updated: 1.14 -> 1.15 --- Log message: Configuration data now supports a vector of library paths. Add the GetPathForLinkageItem method to the interface so full paths can be generated for a given linkage item. --- Diffs of the changes: (+7 -0) Index: llvm/tools/llvmc/CompilerDriver.h diff -u llvm/tools/llvmc/CompilerDriver.h:1.14 llvm/tools/llvmc/CompilerDriver.h:1.15 --- llvm/tools/llvmc/CompilerDriver.h:1.14 Fri Nov 5 16:15:36 2004 +++ llvm/tools/llvmc/CompilerDriver.h Tue Nov 23 17:40:06 2004 @@ -94,6 +94,7 @@ std::string version; ///< The version number. std::string langName; ///< The name of the source language StringTable opts; ///< The o10n options for each level + StringVector libpaths; ///< The library paths Action PreProcessor; ///< PreProcessor command line Action Translator; ///< Translator command line Action Optimizer; ///< Optimizer command line @@ -188,6 +189,12 @@ /// @brief Set the list of -W options to be passed through virtual void setWPassThrough(const StringVector& fOpts) = 0; + /// @brief Determine where a linkage file is located in the file system + virtual sys::Path GetPathForLinkageItem( + const std::string& link_item, ///< Item to be sought + bool native = false ///< Looking for native? + ) = 0; + /// @} }; } From reid at x10sys.com Tue Nov 23 17:45:59 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 17:45:59 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.cpp Message-ID: <200411232345.RAA11433@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: CompilerDriver.cpp updated: 1.18 -> 1.19 --- Log message: * Don't pass empty arguments to ExecuteAndWait because it can cause the sub-tool to start reading its standard input instead of the specified input. * Clean up ouput of path names on error. * Extend GetPathForLinkageItem to always search the LibraryPaths and thus make it suitable for an interface function (required by llvmc.cpp). * Implement support for language-specific default library paths. --- Diffs of the changes: (+56 -41) Index: llvm/tools/llvmc/CompilerDriver.cpp diff -u llvm/tools/llvmc/CompilerDriver.cpp:1.18 llvm/tools/llvmc/CompilerDriver.cpp:1.19 --- llvm/tools/llvmc/CompilerDriver.cpp:1.18 Sat Nov 20 14:39:33 2004 +++ llvm/tools/llvmc/CompilerDriver.cpp Tue Nov 23 17:45:49 2004 @@ -176,6 +176,7 @@ virtual void setWPassThrough(const StringVector& WOpts) { WOptions = WOpts; } + /// @} /// @name Functions /// @{ @@ -261,8 +262,9 @@ break; case 'f': if (*PI == "%fOpts%") { - action->args.insert(action->args.end(), fOptions.begin(), - fOptions.end()); + if (!fOptions.empty()) + action->args.insert(action->args.end(), fOptions.begin(), + fOptions.end()); } else found = false; break; @@ -331,16 +333,19 @@ found = false; break; case 'M': - if (*PI == "%Mopts") { - action->args.insert(action->args.end(), MOptions.begin(), - MOptions.end()); + if (*PI == "%Mopts%") { + if (!MOptions.empty()) + action->args.insert(action->args.end(), MOptions.begin(), + MOptions.end()); } else found = false; break; case 'W': - if (*PI == "%Wopts") { - action->args.insert(action->args.end(), WOptions.begin(), - WOptions.end()); + if (*PI == "%Wopts%") { + for (StringVector::iterator I = WOptions.begin(), + E = WOptions.end(); I != E ; ++I ) { + action->args.push_back( std::string("-W") + *I ); + } } else found = false; break; @@ -354,12 +359,12 @@ (*PI)[PI->length()-1] == '%') { throw std::string("Invalid substitution token: '") + *PI + "' for command '" + pat->program.get() + "'"; - } else { + } else if (!PI->empty()) { // It's not a legal substitution, just pass it through action->args.push_back(*PI); } } - } else { + } else if (!PI->empty()) { // Its not a substitution, just put it in the action action->args.push_back(*PI); } @@ -378,11 +383,12 @@ sys::Path progpath = sys::Program::FindProgramByName( action->program.get()); if (progpath.isEmpty()) - throw std::string("Can't find program '"+progpath.get()+"'"); + throw std::string("Can't find program '"+action->program.get()+"'"); else if (progpath.executable()) action->program = progpath; else - throw std::string("Program '"+progpath.get()+"' is not executable."); + throw std::string("Program '"+action->program.get()+ + "' is not executable."); // Invoke the program if (isSet(TIME_ACTIONS_FLAG)) { @@ -403,31 +409,39 @@ /// This method tries various variants of a linkage item's file /// name to see if it can find an appropriate file to link with - /// in the directory specified. + /// in the directories of the LibraryPaths. llvm::sys::Path GetPathForLinkageItem(const std::string& link_item, - const sys::Path& dir, bool native = false) { - sys::Path fullpath(dir); - fullpath.appendFile(link_item); - if (native) { - fullpath.appendSuffix("a"); - } else { - fullpath.appendSuffix("bc"); - if (fullpath.readable()) - return fullpath; - fullpath.elideSuffix(); - fullpath.appendSuffix("o"); - if (fullpath.readable()) - return fullpath; - fullpath = dir; - fullpath.appendFile(std::string("lib") + link_item); - fullpath.appendSuffix("a"); - if (fullpath.readable()) - return fullpath; - fullpath.elideSuffix(); - fullpath.appendSuffix("so"); + sys::Path fullpath; + fullpath.setFile(link_item); + if (fullpath.readable()) + return fullpath; + for (PathVector::iterator PI = LibraryPaths.begin(), + PE = LibraryPaths.end(); PI != PE; ++PI) { + fullpath.setDirectory(PI->get()); + fullpath.appendFile(link_item); if (fullpath.readable()) return fullpath; + if (native) { + fullpath.appendSuffix("a"); + } else { + fullpath.appendSuffix("bc"); + if (fullpath.readable()) + return fullpath; + fullpath.elideSuffix(); + fullpath.appendSuffix("o"); + if (fullpath.readable()) + return fullpath; + fullpath = *PI; + fullpath.appendFile(std::string("lib") + link_item); + fullpath.appendSuffix("a"); + if (fullpath.readable()) + return fullpath; + fullpath.elideSuffix(); + fullpath.appendSuffix("so"); + if (fullpath.readable()) + return fullpath; + } } // Didn't find one. @@ -446,17 +460,12 @@ // we must track down the file in the lib search path. sys::Path fullpath; if (!link_item.readable()) { - // First, look for the library using the -L arguments specified + // look for the library using the -L arguments specified // on the command line. - PathVector::iterator PI = LibraryPaths.begin(); - PathVector::iterator PE = LibraryPaths.end(); - while (PI != PE && fullpath.isEmpty()) { - fullpath = GetPathForLinkageItem(link_item.get(),*PI); - ++PI; - } + fullpath = GetPathForLinkageItem(link_item.get()); // If we didn't find the file in any of the library search paths - // so we have to bail. No where else to look. + // we have to bail. No where else to look. if (fullpath.isEmpty()) { err = std::string("Can't find linkage item '") + link_item.get() + "'"; @@ -584,6 +593,12 @@ if (isSet(DEBUG_FLAG)) DumpConfigData(cd,I->second); + // Add the config data's library paths to the end of the list + for (StringVector::iterator LPI = cd->libpaths.begin(), + LPE = cd->libpaths.end(); LPI != LPE; ++LPI){ + LibraryPaths.push_back(sys::Path(*LPI)); + } + // Initialize the input and output files sys::Path InFile(I->first); sys::Path OutFile(I->first.getBasename()); From reid at x10sys.com Tue Nov 23 17:48:09 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 17:48:09 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/llvmc.cpp Message-ID: <200411232348.RAA11463@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: llvmc.cpp updated: 1.19 -> 1.20 --- Log message: * Adjust the options to make them either accept multiple occurrences or be optional so that compatibility with GCC is accomplished. * Implement the -print-file-name option in an attempt to provide the same functionality as GCC. Unfortunately, without loading the cpp or c config files, this option won't help much. --- Diffs of the changes: (+22 -5) Index: llvm/tools/llvmc/llvmc.cpp diff -u llvm/tools/llvmc/llvmc.cpp:1.19 llvm/tools/llvmc/llvmc.cpp:1.20 --- llvm/tools/llvmc/llvmc.cpp:1.19 Sat Nov 20 14:45:33 2004 +++ llvm/tools/llvmc/llvmc.cpp Tue Nov 23 17:47:58 2004 @@ -27,7 +27,7 @@ //===------------------------------------------------------------------------=== //=== PHASE OPTIONS //===------------------------------------------------------------------------=== -cl::opt FinalPhase( +cl::opt FinalPhase(cl::Optional, cl::desc("Choose final phase of compilation:"), cl::init(CompilerDriver::LINKING), cl::values( @@ -46,7 +46,7 @@ //===------------------------------------------------------------------------=== //=== OPTIMIZATION OPTIONS //===------------------------------------------------------------------------=== -cl::opt OptLevel( +cl::opt OptLevel(cl::ZeroOrMore, cl::desc("Choose level of optimization to apply:"), cl::init(CompilerDriver::OPT_FAST_COMPILE), cl::values( @@ -152,6 +152,10 @@ cl::opt StripOutput("strip", cl::init(false), cl::desc("Strip all symbols from linked output file")); +cl::opt PrintFileName("print-file-name", cl::Optional, + cl::value_desc("filename"), + cl::desc("Print the full path for the option's value")); + //===------------------------------------------------------------------------=== //=== INFORMATION OPTIONS //===------------------------------------------------------------------------=== @@ -201,7 +205,7 @@ //=== POSITIONAL OPTIONS //===------------------------------------------------------------------------=== -static cl::list Files(cl::Positional, cl::OneOrMore, +static cl::list Files(cl::Positional, cl::ZeroOrMore, cl::desc("[Sources/objects/libraries]")); static cl::list Languages("x", cl::ZeroOrMore, @@ -234,6 +238,17 @@ } // end anonymous namespace +void handleTerminatingOptions(CompilerDriver* CD) { + if (!PrintFileName.empty()) { + sys::Path path = CD->GetPathForLinkageItem(PrintFileName,false); + std::string p = path.get(); + if (p.empty()) + std::cout << "Can't locate '" << PrintFileName << "'.\n"; + else + std::cout << p << "\n"; + exit(0); + } +} /// @brief The main program for llvmc int main(int argc, char **argv) { @@ -256,8 +271,6 @@ if (OutputFilename.empty()) if (OptLevel == CompilerDriver::LINKING) OutputFilename = "a.out"; - else - throw std::string("An output file must be specified. Please use the -o option"); // Construct the ConfigDataProvider object LLVMC_ConfigDataProvider Provider; @@ -309,6 +322,10 @@ if (!LinkerToolOpts.empty()) CD->setPhaseArgs(CompilerDriver::LINKING, LinkerToolOpts); + // Check for options that cause us to terminate before any significant work + // is done. + handleTerminatingOptions(CD); + // Prepare the list of files to be compiled by the CompilerDriver. CompilerDriver::InputList InpList; std::vector::iterator fileIt = Files.begin(); From reid at x10sys.com Tue Nov 23 17:48:56 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 17:48:56 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200411232348.RAA11488@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.136 -> 1.137 --- Log message: Add the configurable configuration files for llvmc. --- Diffs of the changes: (+5 -1) Index: llvm/configure diff -u llvm/configure:1.136 llvm/configure:1.137 --- llvm/configure:1.136 Thu Nov 18 03:47:36 2004 +++ llvm/configure Tue Nov 23 17:48:45 2004 @@ -1603,7 +1603,7 @@ ac_config_headers="$ac_config_headers include/llvm/Config/config.h" - ac_config_files="$ac_config_files Makefile.config" + ac_config_files="$ac_config_files Makefile.config tools/llvmc/st tools/llvmc/cpp tools/llvmc/ll tools/llvmc/c" ac_config_headers="$ac_config_headers include/llvm/Support/DataTypes.h" @@ -25074,6 +25074,10 @@ case "$ac_config_target" in # Handling of arguments. "Makefile.config" ) CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; + "tools/llvmc/st" ) CONFIG_FILES="$CONFIG_FILES tools/llvmc/st" ;; + "tools/llvmc/cpp" ) CONFIG_FILES="$CONFIG_FILES tools/llvmc/cpp" ;; + "tools/llvmc/ll" ) CONFIG_FILES="$CONFIG_FILES tools/llvmc/ll" ;; + "tools/llvmc/c" ) CONFIG_FILES="$CONFIG_FILES tools/llvmc/c" ;; "lib/System/platform" ) CONFIG_LINKS="$CONFIG_LINKS lib/System/platform:lib/System/$platform_type" ;; "Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; "Makefile.common" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.common" ;; From reid at x10sys.com Tue Nov 23 17:48:56 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 17:48:56 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200411232348.RAA11485@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.129 -> 1.130 --- Log message: Add the configurable configuration files for llvmc. --- Diffs of the changes: (+2 -1) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.129 llvm/autoconf/configure.ac:1.130 --- llvm/autoconf/configure.ac:1.129 Thu Nov 18 03:47:37 2004 +++ llvm/autoconf/configure.ac Tue Nov 23 17:48:45 2004 @@ -43,7 +43,8 @@ AC_CONFIG_HEADERS(include/llvm/Config/config.h) dnl Configure other output file -AC_CONFIG_FILES(Makefile.config) +AC_CONFIG_FILES([Makefile.config tools/llvmc/st tools/llvmc/cpp tools/llvmc/ll + tools/llvmc/c]) AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h]) AC_CONFIG_HEADERS([include/llvm/ADT/hash_map]) AC_CONFIG_HEADERS([include/llvm/ADT/hash_set]) From reid at x10sys.com Tue Nov 23 18:02:08 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 23 Nov 2004 18:02:08 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/Makefile Message-ID: <200411240002.SAA11649@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: Makefile updated: 1.9 -> 1.10 --- Log message: Make sure additional C++ suffixes are recognized by llvmc. --- Diffs of the changes: (+7 -0) Index: llvm/tools/llvmc/Makefile diff -u llvm/tools/llvmc/Makefile:1.9 llvm/tools/llvmc/Makefile:1.10 --- llvm/tools/llvmc/Makefile:1.9 Tue Nov 23 17:38:46 2004 +++ llvm/tools/llvmc/Makefile Tue Nov 23 18:01:57 2004 @@ -13,3 +13,10 @@ EXTRA_DIST = c cpp ll st include $(LEVEL)/Makefile.common + +install:: + @$(ECHO) Installing additional C++ configuration clones + $(Verb)$(INSTALL) $(BUILD_OBJ_DIR)/cpp $(sysconfdir)/cc + $(Verb)$(INSTALL) $(BUILD_OBJ_DIR)/cpp $(sysconfdir)/c++ + $(Verb)$(INSTALL) $(BUILD_OBJ_DIR)/cpp $(sysconfdir)/cxx + $(Verb)$(INSTALL) $(BUILD_OBJ_DIR)/cpp $(sysconfdir)/C From natebegeman at mac.com Tue Nov 23 18:16:48 2004 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 23 Nov 2004 18:16:48 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Message-ID: <200411240016.SAA11782@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrInfo.td updated: 1.46 -> 1.47 --- Log message: Fix encoding of bctrl, and remove some unused instructions --- Diffs of the changes: (+2 -5) Index: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.46 llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.47 --- llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.46 Tue Nov 23 16:06:24 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Tue Nov 23 18:16:37 2004 @@ -1,3 +1,4 @@ + //===- PowerPCInstrInfo.td - The PowerPC Instruction Set -----*- tablegen -*-=// // // The LLVM Compiler Infrastructure @@ -85,7 +86,7 @@ CR0,CR1,CR5,CR6,CR7] in { // Convenient aliases for call instructions def CALLpcrel : IForm<18, 0, 1, 0, 0, (ops target:$func), "bl $func">; - def CALLindirect : XLForm_2_ext<19, 528, 20, 31, 1, 0, 0, (ops), "bctrl">; + def CALLindirect : XLForm_2_ext<19, 528, 20, 0, 1, 0, 0, (ops), "bctrl">; } // D-Form instructions. Most instructions that perform an operation on a @@ -130,12 +131,8 @@ "stmw $rS, $disp($rA)">; def STB : DForm_3<38, 0, 0, (ops GPRC:$rS, s16imm:$disp, GPRC:$rA), "stb $rS, $disp($rA)">; -def STBU : DForm_3<39, 0, 0, (ops GPRC:$rS, s16imm:$disp, GPRC:$rA), - "stbu $rS, $disp($rA)">; def STH : DForm_3<44, 0, 0, (ops GPRC:$rS, s16imm:$disp, GPRC:$rA), "sth $rS, $disp($rA)">; -def STHU : DForm_3<45, 0, 0, (ops GPRC:$rS, s16imm:$disp, GPRC:$rA), - "sthu $rS, $disp($rA)">; def STW : DForm_3<36, 0, 0, (ops GPRC:$rS, s16imm:$disp, GPRC:$rA), "stw $rS, $disp($rA)">; def STWU : DForm_3<37, 0, 0, (ops GPRC:$rS, s16imm:$disp, GPRC:$rA), From lattner at cs.uiuc.edu Tue Nov 23 19:15:33 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 19:15:33 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Message-ID: <200411240115.iAO1FXqU009320@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrFormats.td updated: 1.25 -> 1.26 --- Log message: Branch instructions explicitly represent CRx in them. bEcause of this, encode them explicitly as well. --- Diffs of the changes: (+6 -4) Index: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.25 llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.26 --- llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.25 Tue Nov 23 15:17:35 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Tue Nov 23 19:15:19 2004 @@ -70,21 +70,23 @@ class BForm opcode, bit aa, bit lk, bit ppc64, bit vmx, dag OL, string asmstr> : I { bits<5> BO; - bits<5> BI; + bits<3> CRNum; + bits<2> BICode; bits<14> BD; let Inst{6-10} = BO; - let Inst{11-15} = BI; + let Inst{11-13} = CRNum; + let Inst{14-15} = BICode; let Inst{16-29} = BD; let Inst{30} = aa; let Inst{31} = lk; } -class BForm_ext opcode, bit aa, bit lk, bits<5> bo, bits<5> bi, +class BForm_ext opcode, bit aa, bit lk, bits<5> bo, bits<2> bicode, bit ppc64, bit vmx, dag OL, string asmstr> : BForm { let BO = bo; - let BI = bi; + let BICode = bicode; } // 1.7.4 D-Form From lattner at cs.uiuc.edu Tue Nov 23 19:35:26 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 19:35:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200411240135.iAO1ZQkd009353@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.20 -> 1.21 --- Log message: Rewrite branches more closely to correct. This makes more stuff pass, and stops the infinite loops! --- Diffs of the changes: (+15 -20) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.20 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.21 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.20 Tue Nov 23 12:59:59 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Tue Nov 23 19:35:12 2004 @@ -33,8 +33,7 @@ void *MovePCtoLROffset; // Tracks which instruction references which BasicBlock - std::vector > > BBRefs; + std::vector > BBRefs; // Tracks where each BasicBlock starts std::map BBLocations; @@ -98,24 +97,20 @@ // Resolve branches to BasicBlocks for the entire function for (unsigned i = 0, e = BBRefs.size(); i != e; ++i) { intptr_t Location = BBLocations[BBRefs[i].first]; - unsigned *Ref = BBRefs[i].second.first; - MachineInstr *MI = BBRefs[i].second.second; + unsigned *Ref = BBRefs[i].second; DEBUG(std::cerr << "Fixup @ " << (void*)Ref << " to " << (void*)Location - << " in instr: " << *MI); - for (unsigned ii = 0, ee = MI->getNumOperands(); ii != ee; ++ii) { - MachineOperand &op = MI->getOperand(ii); - if (op.isPCRelativeDisp()) { - // the instruction's branch target is made such that it branches to - // PC + (branchTarget * 4), so undo that arithmetic here: - // Location is the target of the branch - // Ref is the location of the instruction, and hence the PC - int64_t branchTarget = (Location - (long)Ref) >> 2; - MI->SetMachineOperandConst(ii, MachineOperand::MO_SignExtendedImmed, - branchTarget); - unsigned fixedInstr = PPC32CodeEmitter::getBinaryCodeForInstr(*MI); - MCE.emitWordAt(fixedInstr, Ref); - break; - } + << "\n"); + unsigned Instr = *Ref; + intptr_t BranchTargetDisp = (Location - (intptr_t)Ref) >> 2; + + switch (Instr >> 26) { + default: assert(0 && "Unknown branch user!"); + case 18: // This is B or BL + *Ref |= (BranchTargetDisp & ((1 << 24)-1)) << 2; + break; + case 16: // This is BLT,BLE,BEQ,BGE,BGT,BNE, or other bcx instruction + *Ref |= (BranchTargetDisp & ((1 << 14)-1)) << 2; + break; } } BBRefs.clear(); @@ -210,7 +205,7 @@ } else if (MO.isMachineBasicBlock()) { const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock(); unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); - BBRefs.push_back(std::make_pair(BB, std::make_pair(CurrPC, &MI))); + BBRefs.push_back(std::make_pair(BB, CurrPC)); } else if (MO.isConstantPoolIndex()) { unsigned index = MO.getConstantPoolIndex(); rv = MCE.getConstantPoolEntryAddress(index); From tbrethou at cs.uiuc.edu Tue Nov 23 19:49:26 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Tue, 23 Nov 2004 19:49:26 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp ModuloScheduling.cpp Message-ID: <200411240149.TAA28774@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/ModuloScheduling: MSSchedule.cpp updated: 1.9 -> 1.10 ModuloScheduling.cpp updated: 1.35 -> 1.36 --- Log message: Forced branches to be first to be scheduled. --- Diffs of the changes: (+105 -71) Index: llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp diff -u llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp:1.9 llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp:1.10 --- llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp:1.9 Mon Nov 22 14:41:23 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp Tue Nov 23 19:49:10 2004 @@ -23,7 +23,9 @@ //First, check if the cycle has a spot free to start if(schedule.find(cycle) != schedule.end()) { + //Check if we have a free issue slot at this cycle if (schedule[cycle].size() < numIssue) { + //Now check if all the resources in their respective cycles are available if(resourcesFree(node, cycle)) { schedule[cycle].push_back(node); DEBUG(std::cerr << "Found spot in map, and there is an issue slot\n"); @@ -44,45 +46,43 @@ DEBUG(std::cerr << "All issue slots taken\n"); return true; - + } bool MSSchedule::resourcesFree(MSchedGraphNode *node, int cycle) { - + //Get Resource usage for this instruction const TargetSchedInfo *msi = node->getParent()->getTarget()->getSchedInfo(); int currentCycle = cycle; bool success = true; - - //map for easy backtracking, resource num at a certain cycle - //std::map backtrackMap; - - //Get resource usage for this instruction - InstrRUsage rUsage = msi->getInstrRUsage(node->getInst()->getOpcode()); - std::vector > resources = rUsage.resourcesByCycle; - - //Loop over resources in each cycle and increments their usage count - for(unsigned i=0; i < resources.size(); ++i) { - for(unsigned j=0; j < resources[i].size(); ++j) { - int resourceNum = resources[i][j]; - - DEBUG(std::cerr << "Attempting to schedule Resource Num: " << resourceNum << " in cycle: " << currentCycle << "\n"); - + + //Get resource usage for this instruction + InstrRUsage rUsage = msi->getInstrRUsage(node->getInst()->getOpcode()); + std::vector > resources = rUsage.resourcesByCycle; + + //Loop over resources in each cycle and increments their usage count + for(unsigned i=0; i < resources.size(); ++i) { + for(unsigned j=0; j < resources[i].size(); ++j) { + + //Get Resource to check its availability + int resourceNum = resources[i][j]; + + DEBUG(std::cerr << "Attempting to schedule Resource Num: " << resourceNum << " in cycle: " << currentCycle << "\n"); + //Check if this resource is available for this cycle std::map >::iterator resourcesForCycle = resourceNumPerCycle.find(currentCycle); - //First check map of resources for this cycle + //First check if map exists for this cycle if(resourcesForCycle != resourceNumPerCycle.end()) { //A map exists for this cycle, so lets check for the resource std::map::iterator resourceUse = resourcesForCycle->second.find(resourceNum); if(resourceUse != resourcesForCycle->second.end()) { //Check if there are enough of this resource and if so, increase count and move on - if(resourceUse->second < CPUResource::getCPUResource(resourceNum)->maxNumUsers) { + if(resourceUse->second < CPUResource::getCPUResource(resourceNum)->maxNumUsers) ++resourceUse->second; - //Document that we increased the usage count for this resource at this cycle - } else { + DEBUG(std::cerr << "No resource num " << resourceNum << " available for cycle " << currentCycle << "\n"); success = false; } } @@ -96,50 +96,51 @@ std::map resourceMap; resourceMap[resourceNum] = 1; resourceNumPerCycle[currentCycle] = resourceMap; - } if(!success) break; } if(!success) break; - //Increase cycle - currentCycle++; - } - - if(!success) { - int oldCycle = cycle; - DEBUG(std::cerr << "Backtrack\n"); - //Get resource usage for this instruction - InstrRUsage rUsage = msi->getInstrRUsage(node->getInst()->getOpcode()); - std::vector > resources = rUsage.resourcesByCycle; + - //Loop over resources in each cycle and increments their usage count - for(unsigned i=0; i < resources.size(); ++i) { - if(oldCycle < currentCycle) { - - //Check if this resource is available for this cycle - std::map >::iterator resourcesForCycle = resourceNumPerCycle.find(oldCycle); - if(resourcesForCycle != resourceNumPerCycle.end()) { - for(unsigned j=0; j < resources[i].size(); ++j) { - int resourceNum = resources[i][j]; - //remove from map - std::map::iterator resourceUse = resourcesForCycle->second.find(resourceNum); - //assert if not in the map.. since it should be! - //assert(resourceUse != resourcesForCycle.end() && "Resource should be in map!"); - --resourceUse->second; - } + //Increase cycle + currentCycle++; + } + + if(!success) { + int oldCycle = cycle; + DEBUG(std::cerr << "Backtrack\n"); + //Get resource usage for this instruction + InstrRUsage rUsage = msi->getInstrRUsage(node->getInst()->getOpcode()); + std::vector > resources = rUsage.resourcesByCycle; + + //Loop over resources in each cycle and increments their usage count + for(unsigned i=0; i < resources.size(); ++i) { + if(oldCycle < currentCycle) { + + //Check if this resource is available for this cycle + std::map >::iterator resourcesForCycle = resourceNumPerCycle.find(oldCycle); + if(resourcesForCycle != resourceNumPerCycle.end()) { + for(unsigned j=0; j < resources[i].size(); ++j) { + int resourceNum = resources[i][j]; + //remove from map + std::map::iterator resourceUse = resourcesForCycle->second.find(resourceNum); + //assert if not in the map.. since it should be! + //assert(resourceUse != resourcesForCycle.end() && "Resource should be in map!"); + --resourceUse->second; } } - else - break; - oldCycle++; } - return false; - + else + break; + oldCycle++; } + return false; + + } - return true; + return true; } Index: llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp diff -u llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.35 llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.36 --- llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.35 Mon Nov 22 14:41:24 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp Tue Nov 23 19:49:10 2004 @@ -748,7 +748,11 @@ void ModuloSchedulingPass::computePartialOrder() { - + + //Only push BA branches onto the final node order, we put other branches after it + //FIXME: Should we really be pushing branches on it a specific order instead of relying + //on BA being there? + std::vector otherBranch; //Loop over all recurrences and add to our partial order //be sure to remove nodes that are already in the partial order in @@ -772,8 +776,15 @@ found = true; } if(!found) { - new_recurrence.insert(*N); - + if((*N)->isBranch()) { + if((*N)->getInst()->getOpcode() == V9::BA) + FinalNodeOrder.push_back(*N); + else + otherBranch.push_back(*N); + } + else + new_recurrence.insert(*N); + } if(partialOrder.size() == 0) //For each predecessors, add it to this recurrence ONLY if it is not already in it for(MSchedGraphNode::pred_iterator P = (*N)->pred_begin(), @@ -791,15 +802,21 @@ } if(!predFound) - if(!new_recurrence.count(*P)) - new_recurrence.insert(*P); - + if(!new_recurrence.count(*P)) { + if((*P)->isBranch()) { + if((*P)->getInst()->getOpcode() == V9::BA) + FinalNodeOrder.push_back(*P); + else + otherBranch.push_back(*P); + } + else + new_recurrence.insert(*P); + + } } } - } } - - + if(new_recurrence.size() > 0) partialOrder.push_back(new_recurrence); } @@ -814,8 +831,17 @@ if(PO->count(I->first)) found = true; } - if(!found) - lastNodes.insert(I->first); + if(!found) { + if(I->first->isBranch()) { + if(std::find(FinalNodeOrder.begin(), FinalNodeOrder.end(), I->first) == FinalNodeOrder.end()) + if((I->first)->getInst()->getOpcode() == V9::BA) + FinalNodeOrder.push_back(I->first); + else + otherBranch.push_back(I->first); + } + else + lastNodes.insert(I->first); + } } //Break up remaining nodes that are not in the partial order @@ -829,15 +855,22 @@ //if(lastNodes.size() > 0) //partialOrder.push_back(lastNodes); + //Clean up branches by putting them in final order + for(std::vector::iterator I = otherBranch.begin(), E = otherBranch.end(); I != E; ++I) + FinalNodeOrder.push_back(*I); + } void ModuloSchedulingPass::connectedComponentSet(MSchedGraphNode *node, std::set &ccSet, std::set &lastNodes) { - //Add to final set - if( !ccSet.count(node) && lastNodes.count(node)) { +//Add to final set +if( !ccSet.count(node) && lastNodes.count(node)) { lastNodes.erase(node); - ccSet.insert(node); +if(node->isBranch()) + FinalNodeOrder.push_back(node); + else + ccSet.insert(node); } else return; @@ -904,7 +937,7 @@ //Set default order int order = BOTTOM_UP; - + //Loop over all the sets and place them in the final node order for(std::vector >::iterator CurrentSet = partialOrder.begin(), E= partialOrder.end(); CurrentSet != E; ++CurrentSet) { @@ -1120,7 +1153,7 @@ int capII = 30; while(!success) { - + //Loop over the final node order and process each node for(std::vector::iterator I = FinalNodeOrder.begin(), E = FinalNodeOrder.end(); I != E; ++I) { @@ -1170,8 +1203,8 @@ LateStart = II-1; } else { - EarlyStart = II-1; - LateStart = II-1; + EarlyStart = II-2; + LateStart = 0; assert( (EarlyStart >= 0) && (LateStart >=0) && "EarlyStart and LateStart must be greater then 0"); } hasPred = 1; From lattner at cs.uiuc.edu Tue Nov 23 19:56:26 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 19:56:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200411240156.iAO1uQDk009393@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.21 -> 1.22 --- Log message: Get constant pools working. This fixes even more programs, allowing us to pass 24/42 in UnitTests (up from 20). --- Diffs of the changes: (+10 -10) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.21 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.22 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.21 Tue Nov 23 19:35:12 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Tue Nov 23 19:56:12 2004 @@ -199,6 +199,7 @@ } else { assert(0 && "Unknown instruction for relocation!"); } + assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), Reloc, MO.getGlobal(), -((intptr_t)MovePCtoLROffset+4))); @@ -208,27 +209,26 @@ BBRefs.push_back(std::make_pair(BB, CurrPC)); } else if (MO.isConstantPoolIndex()) { unsigned index = MO.getConstantPoolIndex(); - rv = MCE.getConstantPoolEntryAddress(index); - } else { - std::cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n"; - abort(); - } - - // Special treatment for global symbols: constants and vars - if ((MO.isConstantPoolIndex() || MO.isGlobalAddress()) && - MI.getOpcode() != PPC::CALLpcrel) { - unsigned Opcode = MI.getOpcode(); assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); + rv = MCE.getConstantPoolEntryAddress(index) - (intptr_t)MovePCtoLROffset-4; + unsigned Opcode = MI.getOpcode(); if (Opcode == PPC::LOADHiAddr) { // LoadHiAddr wants hi16(addr - &MovePCtoLR) + if ((short)rv < 0) rv += 1 << 16; rv >>= 16; } else if (Opcode == PPC::LWZ || Opcode == PPC::LA || Opcode == PPC::LFS || Opcode == PPC::LFD) { // These load opcodes want lo16(addr - &MovePCtoLR) rv &= 0xffff; + } else { + assert(0 && "Unknown constant pool using instruction!"); } + } else { + std::cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n"; + abort(); } + return rv; } From lattner at cs.uiuc.edu Tue Nov 23 20:00:20 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 20:00:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200411240200.iAO20Kfj009418@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.22 -> 1.23 --- Log message: Calls do not need a MovPCtoLR instruction --- Diffs of the changes: (+6 -3) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.22 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.23 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.22 Tue Nov 23 19:56:12 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Tue Nov 23 20:00:06 2004 @@ -190,19 +190,22 @@ rv = MO.getImmedValue(); } else if (MO.isGlobalAddress()) { unsigned Reloc = 0; + int Offset = 0; if (MI.getOpcode() == PPC::CALLpcrel) Reloc = PPC::reloc_pcrel_bx; else if (MI.getOpcode() == PPC::LOADHiAddr) { + assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); Reloc = PPC::reloc_absolute_loadhi; + Offset = -((intptr_t)MovePCtoLROffset+4); } else if (MI.getOpcode() == PPC::LA) { + assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); Reloc = PPC::reloc_absolute_la; + Offset = -((intptr_t)MovePCtoLROffset+4); } else { assert(0 && "Unknown instruction for relocation!"); } - assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), - Reloc, MO.getGlobal(), - -((intptr_t)MovePCtoLROffset+4))); + Reloc, MO.getGlobal(), Offset)); } else if (MO.isMachineBasicBlock()) { const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock(); unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); From lattner at cs.uiuc.edu Tue Nov 23 20:03:58 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 20:03:58 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200411240203.iAO23wBE009437@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.23 -> 1.24 --- Log message: Loads are relocatable too --- Diffs of the changes: (+2 -1) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.23 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.24 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.23 Tue Nov 23 20:00:06 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Tue Nov 23 20:03:44 2004 @@ -197,7 +197,8 @@ assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); Reloc = PPC::reloc_absolute_loadhi; Offset = -((intptr_t)MovePCtoLROffset+4); - } else if (MI.getOpcode() == PPC::LA) { + } else if (MI.getOpcode() == PPC::LA || MI.getOpcode() == PPC::LWZ || + MI.getOpcode() == PPC::LFS || MI.getOpcode() == PPC::LFD) { assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); Reloc = PPC::reloc_absolute_la; Offset = -((intptr_t)MovePCtoLROffset+4); From lattner at cs.uiuc.edu Tue Nov 23 20:15:56 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 20:15:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Message-ID: <200411240215.iAO2FuOj009465@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrFormats.td updated: 1.26 -> 1.27 --- Log message: Fix the encoding of ORi and other DForm4 instructions. This brings us to 36/42 SingleSource/UnitTests passing! --- Diffs of the changes: (+9 -1) Index: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.26 llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.27 --- llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.26 Tue Nov 23 19:15:19 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Tue Nov 23 20:15:41 2004 @@ -130,7 +130,15 @@ : DForm_1; class DForm_4 opcode, bit ppc64, bit vmx, dag OL, string asmstr> - : DForm_base; + : I { + bits<5> B; + bits<5> A; + bits<16> C; + + let Inst{6-10} = A; + let Inst{11-15} = B; + let Inst{16-31} = C; +} class DForm_4_zero opcode, bit ppc64, bit vmx, dag OL, string asmstr> : DForm_1 { From lattner at cs.uiuc.edu Tue Nov 23 21:52:17 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 23 Nov 2004 21:52:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Message-ID: <200411240352.iAO3qHFx009589@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrFormats.td updated: 1.27 -> 1.28 --- Log message: Fix a few more tests by encoding the extsb and other XForm11 instructions correctly. --- Diffs of the changes: (+19 -12) Index: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.27 llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.28 --- llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.27 Tue Nov 23 20:15:41 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Tue Nov 23 21:52:02 2004 @@ -214,6 +214,23 @@ let Inst{31} = rc; } +// This is the same as XForm_base_r3xo, but the first two operands are swapped +// when code is emitted. +class XForm_base_r3xo_swapped + opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, + dag OL, string asmstr> + : I { + bits<5> A; + bits<5> RST; + bits<5> B; + + let Inst{6-10} = RST; + let Inst{11-15} = A; + let Inst{16-20} = B; + let Inst{21-30} = xo; + let Inst{31} = rc; +} + class XForm_1 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> @@ -228,17 +245,7 @@ class XForm_6 opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> - : I { - bits<5> A; - bits<5> RST; - bits<5> B; - - let Inst{6-10} = RST; - let Inst{11-15} = A; - let Inst{16-20} = B; - let Inst{21-30} = xo; - let Inst{31} = rc; -} + : XForm_base_r3xo_swapped; class XForm_8 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> @@ -251,7 +258,7 @@ class XForm_11 opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> - : XForm_base_r3xo { + : XForm_base_r3xo_swapped { let B = 0; } From reid at x10sys.com Wed Nov 24 00:13:53 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 24 Nov 2004 00:13:53 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp Message-ID: <200411240613.AAA17196@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: CommandLine.cpp updated: 1.56 -> 1.57 --- Log message: Implement and document prefix options with arbitrary values including an = sign. This needed to support -DNAME=value options as pass-through in llvmc. --- Diffs of the changes: (+1 -1) Index: llvm/lib/Support/CommandLine.cpp diff -u llvm/lib/Support/CommandLine.cpp:1.56 llvm/lib/Support/CommandLine.cpp:1.57 --- llvm/lib/Support/CommandLine.cpp:1.56 Sat Nov 20 17:35:20 2004 +++ llvm/lib/Support/CommandLine.cpp Wed Nov 24 00:13:42 2004 @@ -397,7 +397,7 @@ Handler = LookupOption(ArgName, Value); // Check to see if this "option" is really a prefixed or grouped argument. - if (Handler == 0 && *Value == 0) { + if (Handler == 0) { std::string RealName(ArgName); if (RealName.size() > 1) { unsigned Length = 0; From reid at x10sys.com Wed Nov 24 00:13:52 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 24 Nov 2004 00:13:52 -0600 Subject: [llvm-commits] CVS: llvm/docs/CommandLine.html Message-ID: <200411240613.AAA17193@zion.cs.uiuc.edu> Changes in directory llvm/docs: CommandLine.html updated: 1.29 -> 1.30 --- Log message: Implement and document prefix options with arbitrary values including an = sign. This needed to support -DNAME=value options as pass-through in llvmc. --- Diffs of the changes: (+10 -8) Index: llvm/docs/CommandLine.html diff -u llvm/docs/CommandLine.html:1.29 llvm/docs/CommandLine.html:1.30 --- llvm/docs/CommandLine.html:1.29 Sun Nov 21 08:34:34 2004 +++ llvm/docs/CommandLine.html Wed Nov 24 00:13:42 2004 @@ -1276,13 +1276,15 @@ specifies that this option is used to capture "interpreter style" arguments. See this section for more information.
  • The cl::Prefix modifier specifies -that this option prefixes its value. With 'Prefix' options, there is no equal -sign that separates the value from the option name specified. This is useful -for processing odd arguments like '-lmalloc -L/usr/lib' in a linker -tool. Here, the 'l' and 'L' options are normal string (list) -options, that have the cl::Prefix modifier added to -allow the CommandLine library to recognize them. Note that cl::Prefix options must not have the -lmalloc and -L/usr/lib in a +linker tool or -DNAME=value in a compiler tool. Here, the +'l', 'D' and 'L' options are normal string (or list) +options, that have the cl::Prefix modifier added to +allow the CommandLine library to recognize them. Note that +cl::Prefix options must not have the cl::ValueDisallowed modifier specified.
  • The cl::Grouping modifier is used @@ -1806,7 +1808,7 @@ Chris Lattner
    LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/11/21 14:34:34 $ + Last modified: $Date: 2004/11/24 06:13:42 $ From alkis at cs.uiuc.edu Wed Nov 24 02:55:47 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 02:55:47 -0600 Subject: [llvm-commits] CVS: llvm-java/Makefile.rules Message-ID: <200411240855.CAA19033@zion.cs.uiuc.edu> Changes in directory llvm-java: Makefile.rules updated: 1.14 -> 1.15 --- Log message: Provide some tool variables. --- Diffs of the changes: (+5 -0) Index: llvm-java/Makefile.rules diff -u llvm-java/Makefile.rules:1.14 llvm-java/Makefile.rules:1.15 --- llvm-java/Makefile.rules:1.14 Wed Nov 17 12:57:38 2004 +++ llvm-java/Makefile.rules Wed Nov 24 02:55:33 2004 @@ -7,6 +7,11 @@ # ##===----------------------------------------------------------------------===## +LDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT) +LLI := $(LLVMToolDir)/lli$(EXEEXT) +LLINK := $(LLVMToolDir)/llvm-link$(EXEEXT) +LOPT := $(LLVMToolDir)/opt$(EXEEXT) + CLASS2LLVM := $(ToolDir)/class2llvm$(EXEEXT) CLASSDUMP := $(ToolDir)/classdump$(EXEEXT) From alkis at cs.uiuc.edu Wed Nov 24 02:56:25 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 02:56:25 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200411240856.CAA19105@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.148 -> 1.149 --- Log message: Correctly mangle function names for JNI invokation. --- Diffs of the changes: (+1 -1) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.148 llvm-java/lib/Compiler/Compiler.cpp:1.149 --- llvm-java/lib/Compiler/Compiler.cpp:1.148 Wed Nov 17 15:03:08 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Wed Nov 24 02:56:15 2004 @@ -1186,7 +1186,7 @@ const std::string& methodName = method->getName()->str(); for (unsigned i = 0, e = methodName.size(); i != e; ++i) { - if (funcName[i] == '_') + if (methodName[i] == '_') funcName += "_1"; else funcName += methodName[i]; From alkis at cs.uiuc.edu Wed Nov 24 02:59:29 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 02:59:29 -0600 Subject: [llvm-commits] CVS: llvm-java/runtime/runtime.c Makefile Message-ID: <200411240859.CAA19202@zion.cs.uiuc.edu> Changes in directory llvm-java/runtime: runtime.c updated: 1.9 -> 1.10 Makefile updated: 1.3 -> 1.4 --- Log message: Add the JNI interface stub. --- Diffs of the changes: (+241 -16) Index: llvm-java/runtime/runtime.c diff -u llvm-java/runtime/runtime.c:1.9 llvm-java/runtime/runtime.c:1.10 --- llvm-java/runtime/runtime.c:1.9 Mon Oct 18 00:48:02 2004 +++ llvm-java/runtime/runtime.c Wed Nov 24 02:59:19 2004 @@ -10,22 +10,7 @@ typedef unsigned jfieldID; typedef unsigned jmethodID; #define _JNI_VM_INTERNAL_TYPES_DEFINED - -/* Define some types*/ -/* FIXME: this should really be picked up from jni_md.h */ -typedef unsigned char jboolean; -typedef signed char jbyte; -typedef unsigned short jchar; -typedef short jshort; -typedef int jint; -typedef long long jlong; -typedef float jfloat; -typedef double jdouble; - -/* Used for jboolean type */ -/* FIXME: this should really be picked up from jni.h */ -#define JNI_TRUE 1 -#define JNI_FALSE 0 +#include struct llvm_java_object_header { /* gc info, hash info, locking */ @@ -90,6 +75,243 @@ abort(); } + +/* The JNI interface definition */ +const struct JNINativeInterface llvm_java_JNIEnv = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, +}; + extern void llvm_java_static_init(void); extern void llvm_java_main(int, char**); Index: llvm-java/runtime/Makefile diff -u llvm-java/runtime/Makefile:1.3 llvm-java/runtime/Makefile:1.4 --- llvm-java/runtime/Makefile:1.3 Mon Sep 13 14:54:11 2004 +++ llvm-java/runtime/Makefile Wed Nov 24 02:59:19 2004 @@ -7,6 +7,9 @@ # ##===----------------------------------------------------------------------===## LEVEL := .. +# FIXME: This needs to be handled by the configure script or alternatively +# import jni.h in the java-fe. +CPPFLAGS+=-I$(HOME)/projects/college/classpath-0.12/include BYTECODE_LIBRARY=1 LIBRARYNAME=jrt From alkis at cs.uiuc.edu Wed Nov 24 03:00:52 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 03:00:52 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/Test.java Message-ID: <200411240900.DAA19336@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: Test.java added (r1.1) --- Log message: Add test helper class that provides hooks for simple I/O. --- Diffs of the changes: (+12 -0) Index: llvm-java/test/Programs/SingleSource/UnitTests/Test.java diff -c /dev/null llvm-java/test/Programs/SingleSource/UnitTests/Test.java:1.1 *** /dev/null Wed Nov 24 03:00:52 2004 --- llvm-java/test/Programs/SingleSource/UnitTests/Test.java Wed Nov 24 03:00:42 2004 *************** *** 0 **** --- 1,12 ---- + public class Test + { + static { + System.loadLibrary("test"); + } + + public static native void print_boolean_ln(boolean b); + public static native void print_int_ln(int i); + public static native void print_long_ln(long l); + public static native void print_float_ln(float f); + public static native void print_double_ln(double d); + } From alkis at cs.uiuc.edu Wed Nov 24 03:01:52 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 03:01:52 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Makefile.test Message-ID: <200411240901.DAA19412@zion.cs.uiuc.edu> Changes in directory llvm-java/test: Makefile.test updated: 1.16 -> 1.17 --- Log message: Update rules to work with new tool names. --- Diffs of the changes: (+19 -11) Index: llvm-java/test/Makefile.test diff -u llvm-java/test/Makefile.test:1.16 llvm-java/test/Makefile.test:1.17 --- llvm-java/test/Makefile.test:1.16 Sat Oct 30 07:52:30 2004 +++ llvm-java/test/Makefile.test Wed Nov 24 03:01:42 2004 @@ -17,23 +17,31 @@ # we don't want these files to be deleted by make, even if they are # intermediate results -.PRECIOUS: Output/.dir Output/%.class %.bc %.ll %.llvm.bc %.llvm +.SECONDARY: Output/.dir %.linked.bc %.raw.bc %.ll %.llvm.bc #rule to link in runtime to raw bytecode -%.linked.bc: %.raw.bc $(DESTLIBBYTECODE)/libjrt.bc +%.linked.bc: %.raw.bc $(LibDir)/libjrt.bc $(EXTRA_OBJS) $(Echo) Linking $< with the Java runtime - $(Verb)$(LLVMTOOLCURRENT)/llvm-link$(EXEEXT) $^ -o - | \ - $(Verb)$(LOPT) -simplifycfg -mem2reg -instcombine > $@ + $(Verb)$(LLINK) $^ -o=$@ + +# rule to optimize the linked bytecode +%.llvm.bc: %.linked.bc $(LOPT) + $(Echo) Optimizing $< + $(Verb)$(LOPT) -simplifycfg -mem2reg -instcombine -f -o=$@ $< # rule to make assembly from bytecode %.dis-ll: %.bc - $(ECHO) Disassembling $< - $(Verb)$(LDIS) < $< > $@ + $(Echo) Disassembling $< + $(Verb)$(LDIS) -f -o=$@ $< -# rule to compile java source -Output/%.class: %.java Output/.dir - $(ECHO) Compiling $< - $(Verb)$(JAVAC) -d Output $< +# rule to compile java sources +ifdef JAVA_TESTS +Output/.compile-java: $(addsuffix .java,$(JAVA_TESTS)) + $(Echo) Compiling $? + $(Verb)mkdir -p Output + $(Verb)$(JAVAC) -d Output $? + $(Verb)touch $@ +endif # rule to run a .class file with the jvm %.out-nat: %.class @@ -41,4 +49,4 @@ # rule to run a .class file with the llvm jit %.out-jit: %.llvm.bc - $(Verb)$(LLI) $< > $*.out-nat || rm -f $*.out-nat + $(Verb)$(LLI) $< > $*.out-jit From alkis at cs.uiuc.edu Wed Nov 24 03:02:27 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 03:02:27 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/Makefile.singlesrc Message-ID: <200411240902.DAA19459@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource: Makefile.singlesrc updated: 1.8 -> 1.9 --- Log message: Update rule to use the -o option. --- Diffs of the changes: (+2 -2) Index: llvm-java/test/Programs/SingleSource/Makefile.singlesrc diff -u llvm-java/test/Programs/SingleSource/Makefile.singlesrc:1.8 llvm-java/test/Programs/SingleSource/Makefile.singlesrc:1.9 --- llvm-java/test/Programs/SingleSource/Makefile.singlesrc:1.8 Sat Oct 30 07:52:30 2004 +++ llvm-java/test/Programs/SingleSource/Makefile.singlesrc Wed Nov 24 03:02:17 2004 @@ -9,7 +9,7 @@ # rule to build raw bytecode from a classfile %.raw.bc: %.class $(CLASS2LLVM) - $(Echo) Compiling $< - $(Verb)$(CLASS2LLVM) -cp $(CLASSPATH):Output $(subst /,.,$(*F)) > $@ + $(Echo) Compiling $< to bytecode + $(Verb)$(CLASS2LLVM) -cp $(CLASSPATH):Output $(subst /,.,$(*F)) -o=$@ include $(LEVEL)/test/Makefile.test From alkis at cs.uiuc.edu Wed Nov 24 03:05:18 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 03:05:18 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/VTable.java TableSwitch.java StaticInitializers.java LookupSwitch.java LongCompare.java If.java ForLoop.java FloatCompare.java FieldAccess.java BigConstants.java Arithm.java Message-ID: <200411240905.DAA19791@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: VTable.java updated: 1.3 -> 1.4 TableSwitch.java updated: 1.3 -> 1.4 StaticInitializers.java updated: 1.1 -> 1.2 LookupSwitch.java updated: 1.3 -> 1.4 LongCompare.java updated: 1.2 -> 1.3 If.java updated: 1.3 -> 1.4 ForLoop.java updated: 1.2 -> 1.3 FloatCompare.java updated: 1.2 -> 1.3 FieldAccess.java updated: 1.2 -> 1.3 BigConstants.java updated: 1.2 -> 1.3 Arithm.java updated: 1.4 -> 1.5 --- Log message: Update tests to use the Test class for I/O. --- Diffs of the changes: (+41 -34) Index: llvm-java/test/Programs/SingleSource/UnitTests/VTable.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/VTable.java:1.3 llvm-java/test/Programs/SingleSource/UnitTests/VTable.java:1.4 --- llvm-java/test/Programs/SingleSource/UnitTests/VTable.java:1.3 Wed Sep 15 15:27:20 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/VTable.java Wed Nov 24 03:04:59 2004 @@ -1,7 +1,7 @@ class VTableBase { public int foo() { return 0; } - public int bar() { return 0; } + public int bar() { return 1; } } interface VTableInterface @@ -11,20 +11,20 @@ public class VTable extends VTableBase implements VTableInterface { - public int foo() { return 1; } - public int baz() { return 2; } + public int foo() { return 2; } + public int baz() { return 3; } public static void main(String[] args) { VTableBase a = new VTableBase(); - a.foo(); - a.bar(); + Test.print_int_ln(a.foo()); + Test.print_int_ln(a.bar()); a = new VTable(); - a.foo(); - a.bar(); - ((VTableInterface)a).baz(); + Test.print_int_ln(a.foo()); + Test.print_int_ln(a.bar()); + Test.print_int_ln(((VTableInterface)a).baz()); VTableInterface i = new VTable(); - i.baz(); + Test.print_int_ln(i.baz()); } } Index: llvm-java/test/Programs/SingleSource/UnitTests/TableSwitch.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/TableSwitch.java:1.3 llvm-java/test/Programs/SingleSource/UnitTests/TableSwitch.java:1.4 --- llvm-java/test/Programs/SingleSource/UnitTests/TableSwitch.java:1.3 Sat Jul 24 15:02:39 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/TableSwitch.java Wed Nov 24 03:04:59 2004 @@ -2,12 +2,12 @@ { public static void main(String[] args) { switch (4) { - case 0: System.out.println(4); - case 1: System.out.println(3); - case 2: System.out.println(2); - case 3: System.out.println(1); - case 4: System.out.println(0); - default: System.out.println(-1); + case 0: Test.print_int_ln(4); + case 1: Test.print_int_ln(3); + case 2: Test.print_int_ln(2); + case 3: Test.print_int_ln(1); + case 4: Test.print_int_ln(0); + default: Test.print_int_ln(-1); } } } Index: llvm-java/test/Programs/SingleSource/UnitTests/StaticInitializers.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/StaticInitializers.java:1.1 llvm-java/test/Programs/SingleSource/UnitTests/StaticInitializers.java:1.2 --- llvm-java/test/Programs/SingleSource/UnitTests/StaticInitializers.java:1.1 Sat Jul 24 15:55:43 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/StaticInitializers.java Wed Nov 24 03:04:59 2004 @@ -9,8 +9,8 @@ } public static void main(String[] args) { - System.out.println("foo = " + foo); - System.out.println("bar = " + bar); - System.out.println("baz = " + baz); + Test.print_int_ln(foo); + Test.print_int_ln(bar); + Test.print_int_ln(baz); } } Index: llvm-java/test/Programs/SingleSource/UnitTests/LookupSwitch.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/LookupSwitch.java:1.3 llvm-java/test/Programs/SingleSource/UnitTests/LookupSwitch.java:1.4 --- llvm-java/test/Programs/SingleSource/UnitTests/LookupSwitch.java:1.3 Sat Jul 24 15:02:39 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/LookupSwitch.java Wed Nov 24 03:04:59 2004 @@ -2,10 +2,10 @@ { public static void main(String[] args) { switch (128) { - case 0: System.out.println(255); - case 128: System.out.println(128); - case 255: System.out.println(0); - default: System.out.println(-1); + case 0: Test.print_int_ln(255); + case 128: Test.print_int_ln(128); + case 255: Test.print_int_ln(0); + default: Test.print_int_ln(-1); } } } Index: llvm-java/test/Programs/SingleSource/UnitTests/LongCompare.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/LongCompare.java:1.2 llvm-java/test/Programs/SingleSource/UnitTests/LongCompare.java:1.3 --- llvm-java/test/Programs/SingleSource/UnitTests/LongCompare.java:1.2 Sat Jul 24 15:02:39 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/LongCompare.java Wed Nov 24 03:04:59 2004 @@ -4,8 +4,8 @@ long l1 = 123456789123456789L; long l2 = 987654321987654321L; - System.out.println("l1 = " + l1); - System.out.println("l2 = " + l2); - System.out.println("l1 == l2 = " + (l1 == l2)); + Test.print_long_ln(l1); + Test.print_long_ln(l2); + Test.print_boolean_ln(l1 == l2); } } Index: llvm-java/test/Programs/SingleSource/UnitTests/If.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/If.java:1.3 llvm-java/test/Programs/SingleSource/UnitTests/If.java:1.4 --- llvm-java/test/Programs/SingleSource/UnitTests/If.java:1.3 Sat Jul 24 15:02:39 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/If.java Wed Nov 24 03:04:59 2004 @@ -3,8 +3,8 @@ public static void main(String[] args) { int i = 0; if (i == 0) - System.out.println("i == 0"); + Test.print_int_ln(0); else - System.out.println("i != 0"); + Test.print_int_ln(1); } } Index: llvm-java/test/Programs/SingleSource/UnitTests/ForLoop.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/ForLoop.java:1.2 llvm-java/test/Programs/SingleSource/UnitTests/ForLoop.java:1.3 --- llvm-java/test/Programs/SingleSource/UnitTests/ForLoop.java:1.2 Sat Jul 24 15:02:39 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/ForLoop.java Wed Nov 24 03:04:59 2004 @@ -5,6 +5,6 @@ for (int i = 0; i < 100; ++i) sum += i; - System.out.println(sum); + Test.print_int_ln(sum); } } Index: llvm-java/test/Programs/SingleSource/UnitTests/FloatCompare.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/FloatCompare.java:1.2 llvm-java/test/Programs/SingleSource/UnitTests/FloatCompare.java:1.3 --- llvm-java/test/Programs/SingleSource/UnitTests/FloatCompare.java:1.2 Sat Jul 24 15:02:39 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/FloatCompare.java Wed Nov 24 03:04:59 2004 @@ -9,6 +9,6 @@ for (double d = 100; d > 0; d -= 11) ++count; - System.out.println(count); + Test.print_int_ln(count); } } Index: llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java:1.2 llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java:1.3 --- llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java:1.2 Wed Sep 15 15:16:12 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java Wed Nov 24 03:04:59 2004 @@ -15,5 +15,11 @@ b.f = 2.0F; ((FieldAccessBase) b).i = 4; ((FieldAccessBase) b).f = 1.0F; + + Test.print_int_ln(((FieldAccessBase)b).i); + Test.print_int_ln(b.i); + Test.print_float_ln(((FieldAccessBase)b).f); + Test.print_float_ln(b.f); + Test.print_double_ln(b.d); } } Index: llvm-java/test/Programs/SingleSource/UnitTests/BigConstants.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/BigConstants.java:1.2 llvm-java/test/Programs/SingleSource/UnitTests/BigConstants.java:1.3 --- llvm-java/test/Programs/SingleSource/UnitTests/BigConstants.java:1.2 Sat Jul 24 15:02:39 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/BigConstants.java Wed Nov 24 03:04:59 2004 @@ -5,9 +5,10 @@ long l = 1234567890123456789L; float f = -1.23456789e10F; double d = 1.23456789e100; - System.out.println("i = " + i); - System.out.println("l = " + l); - System.out.println("f = " + f); - System.out.println("d = " + d); + + Test.print_int_ln(i); + Test.print_long_ln(l); + Test.print_float_ln(f); + Test.print_double_ln(d); } } Index: llvm-java/test/Programs/SingleSource/UnitTests/Arithm.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/Arithm.java:1.4 llvm-java/test/Programs/SingleSource/UnitTests/Arithm.java:1.5 --- llvm-java/test/Programs/SingleSource/UnitTests/Arithm.java:1.4 Sat Jul 24 15:02:39 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/Arithm.java Wed Nov 24 03:04:59 2004 @@ -4,6 +4,6 @@ int one = 1; int two = 2; - System.out.println((one + two) - (two * two) + (two / one) + (two % one) + (two << one) - (two >> 1) + (-two)); // = 2 + Test.print_int_ln((one + two) - (two * two) + (two / one) + (two % one) + (two << one) - (two >> 1) + (-two)); // = 2 } } From alkis at cs.uiuc.edu Wed Nov 24 03:06:56 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 03:06:56 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/Makefile Message-ID: <200411240906.DAA04935@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: Makefile updated: 1.4 -> 1.5 --- Log message: Update targets to use new rules for compiling java sources. --- Diffs of the changes: (+15 -2) Index: llvm-java/test/Programs/SingleSource/UnitTests/Makefile diff -u llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.4 llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.5 --- llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.4 Sat Jul 24 06:43:28 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/Makefile Wed Nov 24 03:06:46 2004 @@ -8,8 +8,21 @@ ##===----------------------------------------------------------------------===## LEVEL := ../../../.. -JAVAFILES := $(wildcard *.java) +JAVA_TESTS := Arithm \ + BigConstants \ + ForLoop \ + If \ + LookupSwitch \ + Return \ + StaticInitializers \ + TableSwitch \ +# ClassTest \ +# FieldAccess \ +# FloatCompare \ +# LongCompare \ +# InstanceOf \ +# VTable -all:: $(foreach ext,linked.dis-ll,$(JAVAFILES:%.java=Output/%.$(ext))) +all:: Output/.compile-java $(addprefix Output/, $(addsuffix .llvm.bc, $(JAVA_TESTS))) include ../Makefile.singlesrc From lattner at cs.uiuc.edu Wed Nov 24 11:43:11 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 24 Nov 2004 11:43:11 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Message-ID: <200411241743.iAOHhBUC010952@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.cpp updated: 1.6 -> 1.7 --- Log message: Force the intregs ptr into R2 and the FPregs ptr into R3. This fixes a really obscure problem where we were doing: lmw r3,0(r9) which is undefined on PPC. Now we do: lmw r3,0(r2) by force, not relying on the GCC register allocator for luck :) --- Diffs of the changes: (+8 -4) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.6 llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.7 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.6 Tue Nov 23 15:37:22 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Wed Nov 24 11:42:55 2004 @@ -62,6 +62,7 @@ "stfd f7, 48(%1)\n" "stfd f8, 56(%1)\n" "stfd f9, 64(%1)\n" "stfd f10, 72(%1)\n" "stfd f11, 80(%1)\n" "stfd f12, 88(%1)\n" "stfd f13, 96(%1)\n" :: "b" (IntRegs), "b" (FPRegs) ); + /// FIXME: Need to safe and restore the rest of the FP regs! #endif unsigned *CameFromStub = (unsigned*)__builtin_return_address(0); @@ -104,24 +105,27 @@ // Put the address of the stub and the LR value that originally came into the // stub in a place that is easy to get on the stack after we restore all regs. - CCStackPtr[2] = (intptr_t)CameFromStub; + CCStackPtr[2] = (intptr_t)Target; CCStackPtr[1] = (intptr_t)CameFromOrig; // Note, this is not a standard epilog! #if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) + register unsigned *IRR asm ("r2") = IntRegs; + register double *FRR asm ("r3") = FPRegs; __asm__ __volatile__ ( "lfd f1, 0(%0)\n" "lfd f2, 8(%0)\n" "lfd f3, 16(%0)\n" "lfd f4, 24(%0)\n" "lfd f5, 32(%0)\n" "lfd f6, 40(%0)\n" "lfd f7, 48(%0)\n" "lfd f8, 56(%0)\n" "lfd f9, 64(%0)\n" "lfd f10, 72(%0)\n" "lfd f11, 80(%0)\n" "lfd f12, 88(%0)\n" - "lfd f13, 96(%0)\n" "lmw r3, 0(%1)\n" + "lfd f13, 96(%0)\n" + "lmw r3, 0(%1)\n" // Load all integer regs "lwz r0,4(r1)\n" // Get CameFromOrig (LR into stub) "mtlr r0\n" // Put it in the LR register - "lwz r0,8(r1)\n" // Get "CameFromStub" + "lwz r0,8(r1)\n" // Get target function pointer "mtctr r0\n" // Put it into the CTR register "lwz r1,0(r1)\n" // Pop two frames off "bctr\n" :: // Return to stub! - "b" (FPRegs), "b" (IntRegs)); + "b" (FRR), "b" (IRR)); #endif } From lattner at cs.uiuc.edu Wed Nov 24 12:00:16 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 24 Nov 2004 12:00:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Message-ID: <200411241800.iAOI0GP5010990@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.cpp updated: 1.7 -> 1.8 --- Log message: When rewriting the original call instruction, make sure to rewrite it to call the right address. --- Diffs of the changes: (+5 -4) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.7 llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.8 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.7 Wed Nov 24 11:42:55 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Wed Nov 24 12:00:02 2004 @@ -81,12 +81,13 @@ // does not need to go through the stub anymore. unsigned CameFromOrigInst = CameFromOrig[-1]; if ((CameFromOrigInst >> 26) == 18) { // Direct call. - intptr_t Offset = ((intptr_t)Target-(intptr_t)CameFromOrig) >> 2; + intptr_t Offset = ((intptr_t)Target-(intptr_t)CameFromOrig+4) >> 2; if (Offset >= -(1 << 23) && Offset < (1 << 23)) { // In range? - // FIXME: hasn't been tested at all. - // Clear the original target out: + // Clear the original target out. CameFromOrigInst &= (63 << 26) | 3; - CameFromOrigInst |= Offset << 2; + // Fill in the new target. + CameFromOrigInst |= (Offset & ((1 << 24)-1)) << 2; + // Replace the call. CameFromOrig[-1] = CameFromOrigInst; } } From reid at x10sys.com Wed Nov 24 12:47:48 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 24 Nov 2004 12:47:48 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200411241847.MAA14631@zion.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.59 -> 1.60 --- Log message: If we're not supposed to generate debug stuff, then don't. --- Diffs of the changes: (+3 -0) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.59 llvm-gcc/gcc/llvm-expand.c:1.60 --- llvm-gcc/gcc/llvm-expand.c:1.59 Thu Nov 18 23:25:46 2004 +++ llvm-gcc/gcc/llvm-expand.c Wed Nov 24 12:47:37 2004 @@ -7617,6 +7617,9 @@ */ static void llvm_emit_dbg_stoppoint(llvm_function *Fn, unsigned lineNo, unsigned colNo) { + // If we're not emitting debug info, just bypass this. + if (debug_info_level <= DINFO_LEVEL_NONE) + return; llvm_instruction *stoppoint_inst; llvm_instruction *load_dbg_inst; llvm_instruction *store_dbg_inst; From reid at x10sys.com Wed Nov 24 12:54:04 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 24 Nov 2004 12:54:04 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200411241854.MAA20482@zion.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.60 -> 1.61 --- Log message: Make the last change compile with C compilers too. --- Diffs of the changes: (+7 -4) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.60 llvm-gcc/gcc/llvm-expand.c:1.61 --- llvm-gcc/gcc/llvm-expand.c:1.60 Wed Nov 24 12:47:37 2004 +++ llvm-gcc/gcc/llvm-expand.c Wed Nov 24 12:53:53 2004 @@ -7617,13 +7617,16 @@ */ static void llvm_emit_dbg_stoppoint(llvm_function *Fn, unsigned lineNo, unsigned colNo) { - // If we're not emitting debug info, just bypass this. - if (debug_info_level <= DINFO_LEVEL_NONE) - return; llvm_instruction *stoppoint_inst; llvm_instruction *load_dbg_inst; llvm_instruction *store_dbg_inst; - llvm_basicblock *CurBB = llvm_ilist_back(llvm_basicblock, Fn->BasicBlocks); + llvm_basicblock *CurBB = 0; + + // If we're not emitting debug info, just bypass this. + if (debug_info_level <= DINFO_LEVEL_NONE) + return; + + CurBB = llvm_ilist_back(llvm_basicblock, Fn->BasicBlocks); /* Do not emit two consequtive identical stoppoints. */ if (lineNo == Fn->ExpandInfo->LastDebugLine && From alkis at cs.uiuc.edu Wed Nov 24 13:43:30 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 13:43:30 -0600 Subject: [llvm-commits] CVS: llvm-java/include/llvm/Java/jni.h Message-ID: <200411241943.NAA25973@zion.cs.uiuc.edu> Changes in directory llvm-java/include/llvm/Java: jni.h added (r1.1) --- Log message: Import jni.h from classpath. --- Diffs of the changes: (+1425 -0) Index: llvm-java/include/llvm/Java/jni.h diff -c /dev/null llvm-java/include/llvm/Java/jni.h:1.1 *** /dev/null Wed Nov 24 13:43:29 2004 --- llvm-java/include/llvm/Java/jni.h Wed Nov 24 13:43:19 2004 *************** *** 0 **** --- 1,1425 ---- + /* jni.h + Copyright (C) 2001, 2004 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + /* This file is based on jni.h from libgcj */ + + #ifndef __CLASSPATH_JNI_H__ + #define __CLASSPATH_JNI_H__ + + #include + + #ifdef __cplusplus + extern "C" + { + #endif /* __cplusplus */ + + /* Define some defaults */ + #define JNICALL + #define JNIEXPORT + + typedef unsigned char jboolean; + typedef signed char jbyte; + typedef unsigned short jchar; + typedef short jshort; + typedef int jint; + typedef long long jlong; + typedef float jfloat; + typedef double jdouble; + + typedef jint jsize; + + #ifdef __cplusplus + } + #endif + + /* Define VM internal types */ + struct llvm_java_object_base; + typedef struct llvm_java_object_base* jobject; + typedef unsigned jfieldID; + typedef unsigned jmethodID; + + #ifdef __cplusplus + + class _jobject {}; + class _jclass : public _jobject {}; + class _jthrowable : public _jobject {}; + class _jstring : public _jobject {}; + class _jarray : public _jobject {}; + class _jbooleanArray : public _jarray {}; + class _jbyteArray : public _jarray {}; + class _jcharArray : public _jarray {}; + class _jshortArray : public _jarray {}; + class _jintArray : public _jarray {}; + class _jlongArray : public _jarray {}; + class _jfloatArray : public _jarray {}; + class _jdoubleArray : public _jarray {}; + class _jobjectArray : public _jarray {}; + + typedef _jobject *jobject; + typedef _jclass *jclass; + typedef _jthrowable *jthrowable; + typedef _jstring *jstring; + typedef _jarray *jarray; + typedef _jbooleanArray *jbooleanArray; + typedef _jbyteArray *jbyteArray; + typedef _jcharArray *jcharArray; + typedef _jshortArray *jshortArray; + typedef _jintArray *jintArray; + typedef _jlongArray *jlongArray; + typedef _jfloatArray *jfloatArray; + typedef _jdoubleArray *jdoubleArray; + typedef _jobjectArray *jobjectArray; + + typedef struct _Jv_JNIEnv JNIEnv; + typedef struct _Jv_JavaVM JavaVM; + + #else /* __cplusplus */ + + + typedef jobject jclass; + typedef jobject jstring; + typedef jobject jarray; + typedef jobject jthrowable; + typedef jobject jobjectArray; + typedef jobject jbyteArray; + typedef jobject jshortArray; + typedef jobject jintArray; + typedef jobject jlongArray; + typedef jobject jbooleanArray; + typedef jobject jcharArray; + typedef jobject jfloatArray; + typedef jobject jdoubleArray; + + /* Dummy defines. */ + typedef const struct JNINativeInterface *JNIEnv; + typedef const struct JNIInvokeInterface *JavaVM; + + #endif /* __cplusplus */ + + #define _Jv_va_list va_list + + #ifdef __cplusplus + extern "C" + { + #endif /* __cplusplus */ + + typedef union jvalue + { + jboolean z; + jbyte b; + jchar c; + jshort s; + jint i; + jlong j; + jfloat f; + jdouble d; + jobject l; + } jvalue; + + /* Used for jboolean type */ + #define JNI_TRUE 1 + #define JNI_FALSE 0 + + /* Used when releasing array elements. */ + #define JNI_COMMIT 1 + #define JNI_ABORT 2 + + /* FIXME: Could be wrong */ + typedef jobject jweak; + + /* Version numbers. */ + #define JNI_VERSION_1_1 0x00010001 /* JNI version 1.1 */ + #define JNI_VERSION_1_2 0x00010002 /* JNI version 1.2 */ + #define JNI_VERSION_1_4 0x00010004 /* JNI version 1.4 */ + + /* Error codes */ + #define JNI_OK 0 + #define JNI_ERR (-1) + #define JNI_EDETACHED (-2) + #define JNI_EVERSION (-3) + + /* These functions might be defined in libraries which we load; the + JNI implementation calls them at the appropriate times. */ + JNIEXPORT jint JNICALL JNI_OnLoad (JavaVM *, void *); + JNIEXPORT void JNICALL JNI_OnUnload (JavaVM *, void *); + + /* These functions are called by user code to start using the + invocation API. */ + JNIEXPORT jint JNICALL JNI_GetDefaultJavaVMInitArgs (void *); + JNIEXPORT jint JNICALL JNI_CreateJavaVM (JavaVM **, void **, void *); + JNIEXPORT jint JNICALL JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); + + + /* This structure is used when registering native methods. */ + typedef struct + { + char *name; + char *signature; + void *fnPtr; + } JNINativeMethod; + + struct JNINativeInterface + { + void *reserved0; /* 0 */ + void *reserved1; /* 1 */ + void *reserved2; /* 2 */ + void *reserved3; /* 3 */ + + jint (JNICALL *GetVersion) (JNIEnv *); /* 4 */ + jclass (JNICALL *DefineClass) (JNIEnv *, const char *, jobject, const jbyte *, jsize); /* 5 */ + jclass (JNICALL *FindClass) (JNIEnv *, const char *); /* 6 */ + + jmethodID (JNICALL *FromReflectedMethod) (JNIEnv *, jobject); /* 7 */ + jfieldID (JNICALL *FromReflectedField) (JNIEnv *, jobject); /* 8 */ + jobject (JNICALL *ToReflectedMethod) (JNIEnv *, jclass, jmethodID, jboolean); /* 9 */ + + jclass (JNICALL *GetSuperclass) (JNIEnv *, jclass); /* 10 */ + jboolean (JNICALL *IsAssignableFrom) (JNIEnv *, jclass, jclass); /* 11 */ + + jobject (JNICALL *ToReflectedField) (JNIEnv *, jclass, jfieldID, jboolean); /* 12 */ + + jint (JNICALL *Throw) (JNIEnv *, jthrowable); /* 13 */ + jint (JNICALL *ThrowNew) (JNIEnv *, jclass, const char *); /* 14 */ + jthrowable (JNICALL *ExceptionOccurred) (JNIEnv *); /* 15 */ + void (JNICALL *ExceptionDescribe) (JNIEnv *); /* 16 */ + void (JNICALL *ExceptionClear) (JNIEnv *); /* 17 */ + void (JNICALL *FatalError) (JNIEnv *, const char *); /* 18 */ + + jint (JNICALL *PushLocalFrame) (JNIEnv *, jint); /* 19 */ + jobject (JNICALL *PopLocalFrame) (JNIEnv *, jobject); /* 20 */ + + jobject (JNICALL *NewGlobalRef) (JNIEnv *, jobject); /* 21 */ + void (JNICALL *DeleteGlobalRef) (JNIEnv *, jobject); /* 22 */ + void (JNICALL *DeleteLocalRef) (JNIEnv *, jobject); /* 23 */ + jboolean (JNICALL *IsSameObject) (JNIEnv *, jobject, jobject); /* 24 */ + + jobject (JNICALL *NewLocalRef) (JNIEnv *, jobject); /* 25 */ + jint (JNICALL *EnsureLocalCapacity) (JNIEnv *, jint); /* 26 */ + + jobject (JNICALL *AllocObject) (JNIEnv *, jclass); /* 27 */ + jobject (JNICALL *NewObject) (JNIEnv *, jclass, jmethodID, ...); /* 28 */ + jobject (JNICALL *NewObjectV) (JNIEnv *, jclass, jmethodID, _Jv_va_list); /* 29 */ + jobject (JNICALL *NewObjectA) (JNIEnv *, jclass, jmethodID, jvalue *); /* 30 */ + + jclass (JNICALL *GetObjectClass) (JNIEnv *, jobject); /* 31 */ + jboolean (JNICALL *IsInstanceOf) (JNIEnv *, jobject, jclass); /* 32 */ + jmethodID (JNICALL *GetMethodID) (JNIEnv *, jclass, const char *, const char *); /* 33 */ + + jobject (JNICALL *CallObjectMethod) (JNIEnv *, jobject, jmethodID, ...); /* 34 */ + jobject (JNICALL *CallObjectMethodV) (JNIEnv *, jobject, jmethodID, _Jv_va_list); /* 35 */ + jobject (JNICALL *CallObjectMethodA) (JNIEnv *, jobject, jmethodID, jvalue *); /* 36 */ + jboolean (JNICALL *CallBooleanMethod) (JNIEnv *, jobject, jmethodID, ...); /* 37 */ + jboolean (JNICALL *CallBooleanMethodV) (JNIEnv *, jobject, jmethodID, _Jv_va_list); /* 38 */ + jboolean (JNICALL *CallBooleanMethodA) (JNIEnv *, jobject, jmethodID, jvalue *); /* 39 */ + jbyte (JNICALL *CallByteMethod) (JNIEnv *, jobject, jmethodID, ...); /* 40 */ + jbyte (JNICALL *CallByteMethodV) (JNIEnv *, jobject, jmethodID, _Jv_va_list); /* 41 */ + jbyte (JNICALL *CallByteMethodA) (JNIEnv *, jobject, jmethodID, jvalue *); /* 42 */ + jchar (JNICALL *CallCharMethod) (JNIEnv *, jobject, jmethodID, ...); /* 43 */ + jchar (JNICALL *CallCharMethodV) (JNIEnv *, jobject, jmethodID, _Jv_va_list); /* 44 */ + jchar (JNICALL *CallCharMethodA) (JNIEnv *, jobject, jmethodID, jvalue *); /* 45 */ + jshort (JNICALL *CallShortMethod) (JNIEnv *, jobject, jmethodID, ...); /* 46 */ + jshort (JNICALL *CallShortMethodV) (JNIEnv *, jobject, jmethodID, _Jv_va_list); /* 47 */ + jshort (JNICALL *CallShortMethodA) (JNIEnv *, jobject, jmethodID, jvalue *); /* 48 */ + jint (JNICALL *CallIntMethod) (JNIEnv *, jobject, jmethodID, ...); /* 49 */ + jint (JNICALL *CallIntMethodV) (JNIEnv *, jobject, jmethodID, _Jv_va_list); /* 50 */ + jint (JNICALL *CallIntMethodA) (JNIEnv *, jobject, jmethodID, jvalue *); /* 51 */ + jlong (JNICALL *CallLongMethod) (JNIEnv *, jobject, jmethodID, ...); /* 52 */ + jlong (JNICALL *CallLongMethodV) (JNIEnv *, jobject, jmethodID, _Jv_va_list); /* 53 */ + jlong (JNICALL *CallLongMethodA) (JNIEnv *, jobject, jmethodID, jvalue *); /* 54 */ + jfloat (JNICALL *CallFloatMethod) (JNIEnv *, jobject, jmethodID, ...); /* 55 */ + jfloat (JNICALL *CallFloatMethodV) (JNIEnv *, jobject, jmethodID, _Jv_va_list); /* 56 */ + jfloat (JNICALL *CallFloatMethodA) (JNIEnv *, jobject, jmethodID, jvalue *); /* 57 */ + jdouble (JNICALL *CallDoubleMethod) (JNIEnv *, jobject, jmethodID, ...); /* 58 */ + jdouble (JNICALL *CallDoubleMethodV) (JNIEnv *, jobject, jmethodID, _Jv_va_list); /* 59 */ + jdouble (JNICALL *CallDoubleMethodA) (JNIEnv *, jobject, jmethodID, jvalue *); /* 60 */ + void (JNICALL *CallVoidMethod) (JNIEnv *, jobject, jmethodID, ...); /* 61 */ + void (JNICALL *CallVoidMethodV) (JNIEnv *, jobject, jmethodID, _Jv_va_list); /* 62 */ + void (JNICALL *CallVoidMethodA) (JNIEnv *, jobject, jmethodID, jvalue *); /* 63 */ + + jobject (JNICALL *CallNonvirtualObjectMethod) (JNIEnv *, jobject, jclass, jmethodID, ...); /* 64 */ + jobject (JNICALL *CallNonvirtualObjectMethodV) (JNIEnv *, jobject, jclass, jmethodID, _Jv_va_list); /* 65 */ + jobject (JNICALL *CallNonvirtualObjectMethodA) (JNIEnv *, jobject, jclass, jmethodID, jvalue *); /* 66 */ + jboolean (JNICALL *CallNonvirtualBooleanMethod) (JNIEnv *, jobject, jclass, jmethodID, ...); /* 67 */ + jboolean (JNICALL *CallNonvirtualBooleanMethodV) (JNIEnv *, jobject, jclass, jmethodID, _Jv_va_list); /* 68 */ + jboolean (JNICALL *CallNonvirtualBooleanMethodA) (JNIEnv *, jobject, jclass, jmethodID, jvalue *); /* 69 */ + jbyte (JNICALL *CallNonvirtualByteMethod) (JNIEnv *, jobject, jclass, jmethodID, ...); /* 70 */ + jbyte (JNICALL *CallNonvirtualByteMethodV) (JNIEnv *, jobject, jclass, jmethodID, _Jv_va_list); /* 71 */ + jbyte (JNICALL *CallNonvirtualByteMethodA) (JNIEnv *, jobject, jclass, jmethodID, jvalue *); /* 72 */ + jchar (JNICALL *CallNonvirtualCharMethod) (JNIEnv *, jobject, jclass, jmethodID, ...); /* 73 */ + jchar (JNICALL *CallNonvirtualCharMethodV) (JNIEnv *, jobject, jclass, jmethodID, _Jv_va_list); /* 74 */ + jchar (JNICALL *CallNonvirtualCharMethodA) (JNIEnv *, jobject, jclass, jmethodID, jvalue *); /* 75 */ + jshort (JNICALL *CallNonvirtualShortMethod) (JNIEnv *, jobject, jclass, jmethodID, ...); /* 76 */ + jshort (JNICALL *CallNonvirtualShortMethodV) (JNIEnv *, jobject, jclass, jmethodID, _Jv_va_list); /* 77 */ + jshort (JNICALL *CallNonvirtualShortMethodA) (JNIEnv *, jobject, jclass, jmethodID, jvalue *); /* 78 */ + jint (JNICALL *CallNonvirtualIntMethod) (JNIEnv *, jobject, jclass, jmethodID, ...); /* 79 */ + jint (JNICALL *CallNonvirtualIntMethodV) (JNIEnv *, jobject, jclass, jmethodID, _Jv_va_list); /* 80 */ + jint (JNICALL *CallNonvirtualIntMethodA) (JNIEnv *, jobject, jclass, jmethodID, jvalue *); /* 81 */ + jlong (JNICALL *CallNonvirtualLongMethod) (JNIEnv *, jobject, jclass, jmethodID, ...); /* 82 */ + jlong (JNICALL *CallNonvirtualLongMethodV) (JNIEnv *, jobject, jclass, jmethodID, _Jv_va_list); /* 83 */ + jlong (JNICALL *CallNonvirtualLongMethodA) (JNIEnv *, jobject, jclass, jmethodID, jvalue *); /* 84 */ + jfloat (JNICALL *CallNonvirtualFloatMethod) (JNIEnv *, jobject, jclass, jmethodID, ...); /* 85 */ + jfloat (JNICALL *CallNonvirtualFloatMethodV) (JNIEnv *, jobject, jclass, jmethodID, _Jv_va_list); /* 86 */ + jfloat (JNICALL *CallNonvirtualFloatMethodA) (JNIEnv *, jobject, jclass, jmethodID, jvalue *); /* 87 */ + jdouble (JNICALL *CallNonvirtualDoubleMethod) (JNIEnv *, jobject, jclass, jmethodID, ...); /* 88 */ + jdouble (JNICALL *CallNonvirtualDoubleMethodV) (JNIEnv *, jobject, jclass, jmethodID, _Jv_va_list); /* 89 */ + jdouble (JNICALL *CallNonvirtualDoubleMethodA) (JNIEnv *, jobject, jclass, jmethodID, jvalue *); /* 90 */ + void (JNICALL *CallNonvirtualVoidMethod) (JNIEnv *, jobject, jclass, jmethodID, ...); /* 91 */ + void (JNICALL *CallNonvirtualVoidMethodV) (JNIEnv *, jobject, jclass, jmethodID, _Jv_va_list); /* 92 */ + void (JNICALL *CallNonvirtualVoidMethodA) (JNIEnv *, jobject, jclass, jmethodID, jvalue *); /* 93 */ + + jfieldID (JNICALL *GetFieldID) (JNIEnv *, jclass, const char *, const char *); /* 94 */ + + jobject (JNICALL *GetObjectField) (JNIEnv *, jobject, jfieldID); /* 95 */ + jboolean (JNICALL *GetBooleanField) (JNIEnv *, jobject, jfieldID); /* 96 */ + jbyte (JNICALL *GetByteField) (JNIEnv *, jobject, jfieldID); /* 97 */ + jchar (JNICALL *GetCharField) (JNIEnv *, jobject, jfieldID); /* 98 */ + jshort (JNICALL *GetShortField) (JNIEnv *, jobject, jfieldID); /* 99 */ + jint (JNICALL *GetIntField) (JNIEnv *, jobject, jfieldID); /* 100 */ + jlong (JNICALL *GetLongField) (JNIEnv *, jobject, jfieldID); /* 101 */ + jfloat (JNICALL *GetFloatField) (JNIEnv *, jobject, jfieldID); /* 102 */ + jdouble (JNICALL *GetDoubleField) (JNIEnv *, jobject, jfieldID); /* 103 */ + + void (JNICALL *SetObjectField) (JNIEnv *, jobject, jfieldID, jobject); /* 104 */ + void (JNICALL *SetBooleanField) (JNIEnv *, jobject, jfieldID, jboolean); /* 105 */ + void (JNICALL *SetByteField) (JNIEnv *, jobject, jfieldID, jbyte); /* 106 */ + void (JNICALL *SetCharField) (JNIEnv *, jobject, jfieldID, jchar); /* 107 */ + void (JNICALL *SetShortField) (JNIEnv *, jobject, jfieldID, jshort); /* 108 */ + void (JNICALL *SetIntField) (JNIEnv *, jobject, jfieldID, jint); /* 109 */ + void (JNICALL *SetLongField) (JNIEnv *, jobject, jfieldID, jlong); /* 110 */ + void (JNICALL *SetFloatField) (JNIEnv *, jobject, jfieldID, jfloat); /* 111 */ + void (JNICALL *SetDoubleField) (JNIEnv *, jobject, jfieldID, jdouble); /* 112 */ + + jmethodID (JNICALL *GetStaticMethodID) (JNIEnv *, jclass, const char *, const char *); /* 113 */ + + jobject (JNICALL *CallStaticObjectMethod) (JNIEnv *, jclass, jmethodID, ...); /* 114 */ + jobject (JNICALL *CallStaticObjectMethodV) (JNIEnv *, jclass, jmethodID, _Jv_va_list); /* 115 */ + jobject (JNICALL *CallStaticObjectMethodA) (JNIEnv *, jclass, jmethodID, jvalue *); /* 116 */ + jboolean (JNICALL *CallStaticBooleanMethod) (JNIEnv *, jclass, jmethodID, ...); /* 117 */ + jboolean (JNICALL *CallStaticBooleanMethodV) (JNIEnv *, jclass, jmethodID, _Jv_va_list); /* 118 */ + jboolean (JNICALL *CallStaticBooleanMethodA) (JNIEnv *, jclass, jmethodID, jvalue *); /* 119 */ + jbyte (JNICALL *CallStaticByteMethod) (JNIEnv *, jclass, jmethodID, ...); /* 120 */ + jbyte (JNICALL *CallStaticByteMethodV) (JNIEnv *, jclass, jmethodID, _Jv_va_list); /* 121 */ + jbyte (JNICALL *CallStaticByteMethodA) (JNIEnv *, jclass, jmethodID, jvalue *); /* 122 */ + jchar (JNICALL *CallStaticCharMethod) (JNIEnv *, jclass, jmethodID, ...); /* 123 */ + jchar (JNICALL *CallStaticCharMethodV) (JNIEnv *, jclass, jmethodID, _Jv_va_list); /* 124 */ + jchar (JNICALL *CallStaticCharMethodA) (JNIEnv *, jclass, jmethodID, jvalue *); /* 125 */ + jshort (JNICALL *CallStaticShortMethod) (JNIEnv *, jclass, jmethodID, ...); /* 126 */ + jshort (JNICALL *CallStaticShortMethodV) (JNIEnv *, jclass, jmethodID, _Jv_va_list); /* 127 */ + jshort (JNICALL *CallStaticShortMethodA) (JNIEnv *, jclass, jmethodID, jvalue *); /* 128 */ + jint (JNICALL *CallStaticIntMethod) (JNIEnv *, jclass, jmethodID, ...); /* 129 */ + jint (JNICALL *CallStaticIntMethodV) (JNIEnv *, jclass, jmethodID, _Jv_va_list); /* 130 */ + jint (JNICALL *CallStaticIntMethodA) (JNIEnv *, jclass, jmethodID, jvalue *); /* 131 */ + jlong (JNICALL *CallStaticLongMethod) (JNIEnv *, jclass, jmethodID, ...); /* 132 */ + jlong (JNICALL *CallStaticLongMethodV) (JNIEnv *, jclass, jmethodID, _Jv_va_list); /* 133 */ + jlong (JNICALL *CallStaticLongMethodA) (JNIEnv *, jclass, jmethodID, jvalue *); /* 134 */ + jfloat (JNICALL *CallStaticFloatMethod) (JNIEnv *, jclass, jmethodID, ...); /* 135 */ + jfloat (JNICALL *CallStaticFloatMethodV) (JNIEnv *, jclass, jmethodID, _Jv_va_list); /* 136 */ + jfloat (JNICALL *CallStaticFloatMethodA) (JNIEnv *, jclass, jmethodID, jvalue *); /* 137 */ + jdouble (JNICALL *CallStaticDoubleMethod) (JNIEnv *, jclass, jmethodID, ...); /* 138 */ + jdouble (JNICALL *CallStaticDoubleMethodV) (JNIEnv *, jclass, jmethodID, _Jv_va_list); /* 139 */ + jdouble (JNICALL *CallStaticDoubleMethodA) (JNIEnv *, jclass, jmethodID, jvalue *); /* 140 */ + void (JNICALL *CallStaticVoidMethod) (JNIEnv *, jclass, jmethodID, ...); /* 141 */ + void (JNICALL *CallStaticVoidMethodV) (JNIEnv *, jclass, jmethodID, _Jv_va_list); /* 142 */ + void (JNICALL *CallStaticVoidMethodA) (JNIEnv *, jclass, jmethodID, jvalue *); /* 143 */ + + jfieldID (JNICALL *GetStaticFieldID) (JNIEnv *, jclass, const char *, const char *); /* 144 */ + + jobject (JNICALL *GetStaticObjectField) (JNIEnv *, jclass, jfieldID); /* 145 */ + jboolean (JNICALL *GetStaticBooleanField) (JNIEnv *, jclass, jfieldID); /* 146 */ + jbyte (JNICALL *GetStaticByteField) (JNIEnv *, jclass, jfieldID); /* 147 */ + jchar (JNICALL *GetStaticCharField) (JNIEnv *, jclass, jfieldID); /* 148 */ + jshort (JNICALL *GetStaticShortField) (JNIEnv *, jclass, jfieldID); /* 149 */ + jint (JNICALL *GetStaticIntField) (JNIEnv *, jclass, jfieldID); /* 150 */ + jlong (JNICALL *GetStaticLongField) (JNIEnv *, jclass, jfieldID); /* 151 */ + jfloat (JNICALL *GetStaticFloatField) (JNIEnv *, jclass, jfieldID); /* 152 */ + jdouble (JNICALL *GetStaticDoubleField) (JNIEnv *, jclass, jfieldID); /* 153 */ + + void (JNICALL *SetStaticObjectField) (JNIEnv *, jclass, jfieldID, jobject); /* 154 */ + void (JNICALL *SetStaticBooleanField) (JNIEnv *, jclass, jfieldID, jboolean); /* 155 */ + void (JNICALL *SetStaticByteField) (JNIEnv *, jclass, jfieldID, jbyte); /* 156 */ + void (JNICALL *SetStaticCharField) (JNIEnv *, jclass, jfieldID, jchar); /* 157 */ + void (JNICALL *SetStaticShortField) (JNIEnv *, jclass, jfieldID, jshort); /* 158 */ + void (JNICALL *SetStaticIntField) (JNIEnv *, jclass, jfieldID, jint); /* 159 */ + void (JNICALL *SetStaticLongField) (JNIEnv *, jclass, jfieldID, jlong); /* 160 */ + void (JNICALL *SetStaticFloatField) (JNIEnv *, jclass, jfieldID, jfloat); /* 161 */ + void (JNICALL *SetStaticDoubleField) (JNIEnv *, jclass, jfieldID, jdouble); /* 162 */ + + jstring (JNICALL *NewString) (JNIEnv *, const jchar *, jsize); /* 163 */ + jsize (JNICALL *GetStringLength) (JNIEnv *, jstring); /* 164 */ + const jchar * (JNICALL *GetStringChars) (JNIEnv *, jstring, jboolean *); /* 165 */ + void (JNICALL *ReleaseStringChars) (JNIEnv *, jstring, const jchar *); /* 166 */ + jstring (JNICALL *NewStringUTF) (JNIEnv *, const char *); /* 167 */ + jsize (JNICALL *GetStringUTFLength) (JNIEnv *, jstring); /* 168 */ + const char * (JNICALL *GetStringUTFChars) (JNIEnv *, jstring, jboolean *); /* 169 */ + void (JNICALL *ReleaseStringUTFChars) (JNIEnv *, jstring, const char *); /* 170 */ + jsize (JNICALL *GetArrayLength) (JNIEnv *, jarray); /* 171 */ + jobjectArray (JNICALL *NewObjectArray) (JNIEnv *, jsize, jclass, jobject); /* 172 */ + jobject (JNICALL *GetObjectArrayElement) (JNIEnv *, jobjectArray, jsize); /* 173 */ + void (JNICALL *SetObjectArrayElement) (JNIEnv *, jobjectArray, jsize, jobject); /* 174 */ + + jbooleanArray (JNICALL *NewBooleanArray) (JNIEnv *, jsize); /* 175 */ + jbyteArray (JNICALL *NewByteArray) (JNIEnv *, jsize); /* 176 */ + jcharArray (JNICALL *NewCharArray) (JNIEnv *, jsize); /* 177 */ + jshortArray (JNICALL *NewShortArray) (JNIEnv *, jsize); /* 178 */ + jintArray (JNICALL *NewIntArray) (JNIEnv *, jsize); /* 179 */ + jlongArray (JNICALL *NewLongArray) (JNIEnv *, jsize); /* 180 */ + jfloatArray (JNICALL *NewFloatArray) (JNIEnv *, jsize); /* 181 */ + jdoubleArray (JNICALL *NewDoubleArray) (JNIEnv *, jsize); /* 182 */ + + jboolean * (JNICALL *GetBooleanArrayElements) (JNIEnv *, jbooleanArray, jboolean *); /* 183 */ + jbyte * (JNICALL *GetByteArrayElements) (JNIEnv *, jbyteArray, jboolean *); /* 184 */ + jchar * (JNICALL *GetCharArrayElements) (JNIEnv *, jcharArray, jboolean *); /* 185 */ + jshort * (JNICALL *GetShortArrayElements) (JNIEnv *, jshortArray, jboolean *); /* 186 */ + jint * (JNICALL *GetIntArrayElements) (JNIEnv *, jintArray, jboolean *); /* 187 */ + jlong * (JNICALL *GetLongArrayElements) (JNIEnv *, jlongArray, jboolean *); /* 188 */ + jfloat * (JNICALL *GetFloatArrayElements) (JNIEnv *, jfloatArray, jboolean *); /* 189 */ + jdouble * (JNICALL *GetDoubleArrayElements) (JNIEnv *, jdoubleArray, jboolean *); /* 190 */ + + void (JNICALL *ReleaseBooleanArrayElements) (JNIEnv *, jbooleanArray, jboolean *, jint); /* 191 */ + void (JNICALL *ReleaseByteArrayElements) (JNIEnv *, jbyteArray, jbyte *, jint); /* 192 */ + void (JNICALL *ReleaseCharArrayElements) (JNIEnv *, jcharArray, jchar *, jint); /* 193 */ + void (JNICALL *ReleaseShortArrayElements) (JNIEnv *, jshortArray, jshort *, jint); /* 194 */ + void (JNICALL *ReleaseIntArrayElements) (JNIEnv *, jintArray, jint *, jint); /* 195 */ + void (JNICALL *ReleaseLongArrayElements) (JNIEnv *, jlongArray, jlong *, jint); /* 196 */ + void (JNICALL *ReleaseFloatArrayElements) (JNIEnv *, jfloatArray, jfloat *, jint); /* 197 */ + void (JNICALL *ReleaseDoubleArrayElements) (JNIEnv *, jdoubleArray, jdouble *, jint); /* 198 */ + + void (JNICALL *GetBooleanArrayRegion) (JNIEnv *, jbooleanArray,jsize, jsize, jboolean *); /* 199 */ + void (JNICALL *GetByteArrayRegion) (JNIEnv *, jbyteArray, jsize, jsize, jbyte *); /* 200 */ + void (JNICALL *GetCharArrayRegion) (JNIEnv *, jcharArray, jsize, jsize, jchar *); /* 201 */ + void (JNICALL *GetShortArrayRegion) (JNIEnv *, jshortArray, jsize, jsize, jshort *); /* 202 */ + void (JNICALL *GetIntArrayRegion) (JNIEnv *, jintArray, jsize, jsize, jint *); /* 203 */ + void (JNICALL *GetLongArrayRegion) (JNIEnv *, jlongArray, jsize, jsize, jlong *); /* 204 */ + void (JNICALL *GetFloatArrayRegion) (JNIEnv *, jfloatArray, jsize, jsize, jfloat *); /* 205 */ + void (JNICALL *GetDoubleArrayRegion) (JNIEnv *, jdoubleArray, jsize, jsize, jdouble *); /* 206 */ + + void (JNICALL *SetBooleanArrayRegion) (JNIEnv *, jbooleanArray, jsize, jsize, jboolean *); /* 207 */ + void (JNICALL *SetByteArrayRegion) (JNIEnv *, jbyteArray, jsize, jsize, jbyte *); /* 208 */ + void (JNICALL *SetCharArrayRegion) (JNIEnv *, jcharArray, jsize, jsize, jchar *); /* 209 */ + void (JNICALL *SetShortArrayRegion) (JNIEnv *, jshortArray, jsize, jsize, jshort *); /* 210 */ + void (JNICALL *SetIntArrayRegion) (JNIEnv *, jintArray, jsize, jsize, jint *); /* 211 */ + void (JNICALL *SetLongArrayRegion) (JNIEnv *, jlongArray, jsize, jsize, jlong *); /* 212 */ + void (JNICALL *SetFloatArrayRegion) (JNIEnv *, jfloatArray, jsize, jsize, jfloat *); /* 213 */ + void (JNICALL *SetDoubleArrayRegion) (JNIEnv *, jdoubleArray, jsize, jsize, jdouble *); /* 214 */ + + jint (JNICALL *RegisterNatives) (JNIEnv *, jclass, const JNINativeMethod *, jint); /* 215 */ + jint (JNICALL *UnregisterNatives) (JNIEnv *, jclass); /* 216 */ + jint (JNICALL *MonitorEnter) (JNIEnv *, jobject); /* 217 */ + jint (JNICALL *MonitorExit) (JNIEnv *, jobject); /* 218 */ + jint (JNICALL *GetJavaVM) (JNIEnv *, JavaVM **); /* 219 */ + + /* ---- JNI 1.2 functions ---- */ + void (JNICALL *GetStringRegion) (JNIEnv *, jstring, jsize, jsize, jchar *); /* 220 */ + void (JNICALL *GetStringUTFRegion) (JNIEnv *, jstring, jsize, jsize, char *); /* 221 */ + + void * (JNICALL *GetPrimitiveArrayCritical) (JNIEnv *, jarray, jboolean *); /* 222 */ + void (JNICALL *ReleasePrimitiveArrayCritical) (JNIEnv *, jarray, void *, jint); /* 223 */ + + const jchar * (JNICALL *GetStringCritical) (JNIEnv *, jstring, jboolean *); /* 224 */ + void (JNICALL *ReleaseStringCritical) (JNIEnv *, jstring, const jchar *); /* 225 */ + + jweak (JNICALL *NewWeakGlobalRef) (JNIEnv *, jobject); /* 226 */ + void (JNICALL *DeleteWeakGlobalRef) (JNIEnv *, jweak); /* 227 */ + + jboolean (JNICALL *ExceptionCheck) (JNIEnv *); /* 228 */ + + /* ---- JNI 1.4 functions ---- */ + jobject (JNICALL *NewDirectByteBuffer) (JNIEnv *, void *, jlong); /* 229 */ + void * (JNICALL *GetDirectBufferAddress) (JNIEnv *, jobject); /* 230 */ + long (JNICALL *GetDirectBufferCapacity) (JNIEnv *, jobject); /* 231 */ + + }; + + #ifdef __cplusplus + } /* Extern "C" */ + + struct _Jv_JNIEnv + { + /* The method table. */ + const struct JNINativeInterface *p; + + jint GetVersion () + { return p->GetVersion (this); } + + jclass DefineClass (const char* char0, jobject obj0, const jbyte * val1, jsize val2) + { return p->DefineClass (this, char0, obj0, val1, val2); } + + jclass FindClass (const char * val0) + { return p->FindClass (this, val0); } + + jmethodID FromReflectedMethod (jobject obj0) + { return p->FromReflectedMethod (this, obj0); } + + jfieldID FromReflectedField (jobject obj0) + { return p->FromReflectedField (this, obj0); } + + jobject ToReflectedMethod (jclass cl0, jmethodID meth1, jboolean val2) + { return p->ToReflectedMethod (this, cl0, meth1, val2); } + + jclass GetSuperclass (jclass cl0) + { return p->GetSuperclass (this, cl0); } + + jboolean IsAssignableFrom (jclass cl0, jclass cl1) + { return p->IsAssignableFrom (this, cl0, cl1); } + + jobject ToReflectedField (jclass cl0, jfieldID fld1, jboolean val2) + { return p->ToReflectedField (this, cl0, fld1, val2); } + + jint Throw (jthrowable val0) + { return p->Throw (this, val0); } + + jint ThrowNew (jclass cl0, const char * val1) + { return p->ThrowNew (this, cl0, val1); } + + jthrowable ExceptionOccurred () + { return p->ExceptionOccurred (this); } + + void ExceptionDescribe () + { p->ExceptionDescribe (this); } + + void ExceptionClear () + { p->ExceptionClear (this); } + + void FatalError (const char * val0) + { p->FatalError (this, val0); } + + jint PushLocalFrame (jint val0) + { return p->PushLocalFrame (this, val0); } + + jobject PopLocalFrame (jobject obj0) + { return p->PopLocalFrame (this, obj0); } + + jobject NewGlobalRef (jobject obj0) + { return p->NewGlobalRef (this, obj0); } + + void DeleteGlobalRef (jobject obj0) + { p->DeleteGlobalRef (this, obj0); } + + void DeleteLocalRef (jobject obj0) + { p->DeleteLocalRef (this, obj0); } + + jboolean IsSameObject (jobject obj0, jobject obj1) + { return p->IsSameObject (this, obj0, obj1); } + + jobject NewLocalRef (jobject obj0) + { return p->NewLocalRef (this, obj0); } + + jint EnsureLocalCapacity (jint val0) + { return p->EnsureLocalCapacity (this, val0); } + + jobject AllocObject (jclass cl0) + { return p->AllocObject (this, cl0); } + + jobject NewObject (jclass cl0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jobject result = p->NewObjectV (this, cl0, meth1, args); + va_end (args); + return result; + } + + jobject NewObjectV (jclass cl0, jmethodID meth1, _Jv_va_list val2) + { return p->NewObjectV (this, cl0, meth1, val2); } + + jobject NewObjectA (jclass cl0, jmethodID meth1, jvalue * val2) + { return p->NewObjectA (this, cl0, meth1, val2); } + + jclass GetObjectClass (jobject obj0) + { return p->GetObjectClass (this, obj0); } + + jboolean IsInstanceOf (jobject obj0, jclass cl1) + { return p->IsInstanceOf (this, obj0, cl1); } + + jmethodID GetMethodID (jclass cl0, const char * val1, const char * val2) + { return p->GetMethodID (this, cl0, val1, val2); } + + jobject CallObjectMethod (jobject obj0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jobject result = p->CallObjectMethodV (this, obj0, meth1, args); + va_end (args); + return result; + } + + jobject CallObjectMethodV (jobject obj0, jmethodID meth1, _Jv_va_list val2) + { return p->CallObjectMethodV (this, obj0, meth1, val2); } + + jobject CallObjectMethodA (jobject obj0, jmethodID meth1, jvalue * val2) + { return p->CallObjectMethodA (this, obj0, meth1, val2); } + + jboolean CallBooleanMethod (jobject obj0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jboolean result = p->CallBooleanMethodV (this, obj0, meth1, args); + va_end (args); + return result; + } + + jboolean CallBooleanMethodV (jobject obj0, jmethodID meth1, _Jv_va_list val2) + { return p->CallBooleanMethodV (this, obj0, meth1, val2); } + + jboolean CallBooleanMethodA (jobject obj0, jmethodID meth1, jvalue * val2) + { return p->CallBooleanMethodA (this, obj0, meth1, val2); } + + jbyte CallByteMethod (jobject obj0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jbyte result = p->CallByteMethodV (this, obj0, meth1, args); + va_end (args); + return result; + } + + jbyte CallByteMethodV (jobject obj0, jmethodID meth1, _Jv_va_list val2) + { return p->CallByteMethodV (this, obj0, meth1, val2); } + + jbyte CallByteMethodA (jobject obj0, jmethodID meth1, jvalue * val2) + { return p->CallByteMethodA (this, obj0, meth1, val2); } + + jchar CallCharMethod (jobject obj0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jchar result = p->CallCharMethodV (this, obj0, meth1, args); + va_end (args); + return result; + } + + jchar CallCharMethodV (jobject obj0, jmethodID meth1, _Jv_va_list val2) + { return p->CallCharMethodV (this, obj0, meth1, val2); } + + jchar CallCharMethodA (jobject obj0, jmethodID meth1, jvalue * val2) + { return p->CallCharMethodA (this, obj0, meth1, val2); } + + jshort CallShortMethod (jobject obj0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jshort result = p->CallShortMethodV (this, obj0, meth1, args); + va_end (args); + return result; + } + + jshort CallShortMethodV (jobject obj0, jmethodID meth1, _Jv_va_list val2) + { return p->CallShortMethodV (this, obj0, meth1, val2); } + + jshort CallShortMethodA (jobject obj0, jmethodID meth1, jvalue * val2) + { return p->CallShortMethodA (this, obj0, meth1, val2); } + + jint CallIntMethod (jobject obj0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jint result = p->CallIntMethodV (this, obj0, meth1, args); + va_end (args); + return result; + } + + jint CallIntMethodV (jobject obj0, jmethodID meth1, _Jv_va_list val2) + { return p->CallIntMethodV (this, obj0, meth1, val2); } + + jint CallIntMethodA (jobject obj0, jmethodID meth1, jvalue * val2) + { return p->CallIntMethodA (this, obj0, meth1, val2); } + + jlong CallLongMethod (jobject obj0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jlong result = p->CallLongMethodV (this, obj0, meth1, args); + va_end (args); + return result; + } + + jlong CallLongMethodV (jobject obj0, jmethodID meth1, _Jv_va_list val2) + { return p->CallLongMethodV (this, obj0, meth1, val2); } + + jlong CallLongMethodA (jobject obj0, jmethodID meth1, jvalue * val2) + { return p->CallLongMethodA (this, obj0, meth1, val2); } + + jfloat CallFloatMethod (jobject obj0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jfloat result = p->CallFloatMethodV (this, obj0, meth1, args); + va_end (args); + return result; + } + + jfloat CallFloatMethodV (jobject obj0, jmethodID meth1, _Jv_va_list val2) + { return p->CallFloatMethodV (this, obj0, meth1, val2); } + + jfloat CallFloatMethodA (jobject obj0, jmethodID meth1, jvalue * val2) + { return p->CallFloatMethodA (this, obj0, meth1, val2); } + + jdouble CallDoubleMethod (jobject obj0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jdouble result = p->CallDoubleMethodV (this, obj0, meth1, args); + va_end (args); + return result; + } + + jdouble CallDoubleMethodV (jobject obj0, jmethodID meth1, _Jv_va_list val2) + { return p->CallDoubleMethodV (this, obj0, meth1, val2); } + + jdouble CallDoubleMethodA (jobject obj0, jmethodID meth1, jvalue * val2) + { return p->CallDoubleMethodA (this, obj0, meth1, val2); } + + void CallVoidMethod (jobject obj0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + p->CallVoidMethodV (this, obj0, meth1, args); + va_end (args); + } + + void CallVoidMethodV (jobject obj0, jmethodID meth1, _Jv_va_list val2) + { p->CallVoidMethodV (this, obj0, meth1, val2); } + + void CallVoidMethodA (jobject obj0, jmethodID meth1, jvalue * val2) + { p->CallVoidMethodA (this, obj0, meth1, val2); } + + jobject CallNonvirtualObjectMethod (jobject obj0, jclass cl1, jmethodID meth2, ...) + { + _Jv_va_list args; + va_start (args, meth2); + jobject result = p->CallNonvirtualObjectMethodV (this, obj0, cl1, meth2, args); + va_end (args); + return result; + } + + jobject CallNonvirtualObjectMethodV (jobject obj0, jclass cl1, jmethodID meth2, _Jv_va_list val3) + { return p->CallNonvirtualObjectMethodV (this, obj0, cl1, meth2, val3); } + + jobject CallNonvirtualObjectMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3) + { return p->CallNonvirtualObjectMethodA (this, obj0, cl1, meth2, val3); } + + jboolean CallNonvirtualBooleanMethod (jobject obj0, jclass cl1, jmethodID meth2, ...) + { + _Jv_va_list args; + va_start (args, meth2); + jboolean result = p->CallNonvirtualBooleanMethodV (this, obj0, cl1, meth2, args); + va_end (args); + return result; + } + + jboolean CallNonvirtualBooleanMethodV (jobject obj0, jclass cl1, jmethodID meth2, _Jv_va_list val3) + { return p->CallNonvirtualBooleanMethodV (this, obj0, cl1, meth2, val3); } + + jboolean CallNonvirtualBooleanMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3) + { return p->CallNonvirtualBooleanMethodA (this, obj0, cl1, meth2, val3); } + + jbyte CallNonvirtualByteMethod (jobject obj0, jclass cl1, jmethodID meth2, ...) + { + _Jv_va_list args; + va_start (args, meth2); + jbyte result = p->CallNonvirtualByteMethodV (this, obj0, cl1, meth2, args); + va_end (args); + return result; + } + + jbyte CallNonvirtualByteMethodV (jobject obj0, jclass cl1, jmethodID meth2, _Jv_va_list val3) + { return p->CallNonvirtualByteMethodV (this, obj0, cl1, meth2, val3); } + + jbyte CallNonvirtualByteMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3) + { return p->CallNonvirtualByteMethodA (this, obj0, cl1, meth2, val3); } + + jchar CallNonvirtualCharMethod (jobject obj0, jclass cl1, jmethodID meth2, ...) + { + _Jv_va_list args; + va_start (args, meth2); + jchar result = p->CallNonvirtualCharMethodV (this, obj0, cl1, meth2, args); + va_end (args); + return result; + } + + jchar CallNonvirtualCharMethodV (jobject obj0, jclass cl1, jmethodID meth2, _Jv_va_list val3) + { return p->CallNonvirtualCharMethodV (this, obj0, cl1, meth2, val3); } + + jchar CallNonvirtualCharMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3) + { return p->CallNonvirtualCharMethodA (this, obj0, cl1, meth2, val3); } + + jshort CallNonvirtualShortMethod (jobject obj0, jclass cl1, jmethodID meth2, ...) + { + _Jv_va_list args; + va_start (args, meth2); + jshort result = p->CallNonvirtualShortMethodV (this, obj0, cl1, meth2, args); + va_end (args); + return result; + } + + jshort CallNonvirtualShortMethodV (jobject obj0, jclass cl1, jmethodID meth2, _Jv_va_list val3) + { return p->CallNonvirtualShortMethodV (this, obj0, cl1, meth2, val3); } + + jshort CallNonvirtualShortMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3) + { return p->CallNonvirtualShortMethodA (this, obj0, cl1, meth2, val3); } + + jint CallNonvirtualIntMethod (jobject obj0, jclass cl1, jmethodID meth2, ...) + { + _Jv_va_list args; + va_start (args, meth2); + jint result = p->CallNonvirtualIntMethodV (this, obj0, cl1, meth2, args); + va_end (args); + return result; + } + + jint CallNonvirtualIntMethodV (jobject obj0, jclass cl1, jmethodID meth2, _Jv_va_list val3) + { return p->CallNonvirtualIntMethodV (this, obj0, cl1, meth2, val3); } + + jint CallNonvirtualIntMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3) + { return p->CallNonvirtualIntMethodA (this, obj0, cl1, meth2, val3); } + + jlong CallNonvirtualLongMethod (jobject obj0, jclass cl1, jmethodID meth2, ...) + { + _Jv_va_list args; + va_start (args, meth2); + jlong result = p->CallNonvirtualLongMethodV (this, obj0, cl1, meth2, args); + va_end (args); + return result; + } + + jlong CallNonvirtualLongMethodV (jobject obj0, jclass cl1, jmethodID meth2, _Jv_va_list val3) + { return p->CallNonvirtualLongMethodV (this, obj0, cl1, meth2, val3); } + + jlong CallNonvirtualLongMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3) + { return p->CallNonvirtualLongMethodA (this, obj0, cl1, meth2, val3); } + + jfloat CallNonvirtualFloatMethod (jobject obj0, jclass cl1, jmethodID meth2, ...) + { + _Jv_va_list args; + va_start (args, meth2); + jfloat result = p->CallNonvirtualFloatMethodV (this, obj0, cl1, meth2, args); + va_end (args); + return result; + } + + jfloat CallNonvirtualFloatMethodV (jobject obj0, jclass cl1, jmethodID meth2, _Jv_va_list val3) + { return p->CallNonvirtualFloatMethodV (this, obj0, cl1, meth2, val3); } + + jfloat CallNonvirtualFloatMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3) + { return p->CallNonvirtualFloatMethodA (this, obj0, cl1, meth2, val3); } + + jdouble CallNonvirtualDoubleMethod (jobject obj0, jclass cl1, jmethodID meth2, ...) + { + _Jv_va_list args; + va_start (args, meth2); + jdouble result = p->CallNonvirtualDoubleMethodV (this, obj0, cl1, meth2, args); + va_end (args); + return result; + } + + jdouble CallNonvirtualDoubleMethodV (jobject obj0, jclass cl1, jmethodID meth2, _Jv_va_list val3) + { return p->CallNonvirtualDoubleMethodV (this, obj0, cl1, meth2, val3); } + + jdouble CallNonvirtualDoubleMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3) + { return p->CallNonvirtualDoubleMethodA (this, obj0, cl1, meth2, val3); } + + void CallNonvirtualVoidMethod (jobject obj0, jclass cl1, jmethodID meth2, ...) + { + _Jv_va_list args; + va_start (args, meth2); + p->CallNonvirtualVoidMethodV (this, obj0, cl1, meth2, args); + va_end (args); + } + + void CallNonvirtualVoidMethodV (jobject obj0, jclass cl1, jmethodID meth2, _Jv_va_list val3) + { p->CallNonvirtualVoidMethodV (this, obj0, cl1, meth2, val3); } + + void CallNonvirtualVoidMethodA (jobject obj0, jclass cl1, jmethodID meth2, jvalue * val3) + { p->CallNonvirtualVoidMethodA (this, obj0, cl1, meth2, val3); } + + jfieldID GetFieldID (jclass cl0, const char * val1, const char * val2) + { return p->GetFieldID (this, cl0, val1, val2); } + + jobject GetObjectField (jobject obj0, jfieldID fld1) + { return p->GetObjectField (this, obj0, fld1); } + + jboolean GetBooleanField (jobject obj0, jfieldID fld1) + { return p->GetBooleanField (this, obj0, fld1); } + + jbyte GetByteField (jobject obj0, jfieldID fld1) + { return p->GetByteField (this, obj0, fld1); } + + jchar GetCharField (jobject obj0, jfieldID fld1) + { return p->GetCharField (this, obj0, fld1); } + + jshort GetShortField (jobject obj0, jfieldID fld1) + { return p->GetShortField (this, obj0, fld1); } + + jint GetIntField (jobject obj0, jfieldID fld1) + { return p->GetIntField (this, obj0, fld1); } + + jlong GetLongField (jobject obj0, jfieldID fld1) + { return p->GetLongField (this, obj0, fld1); } + + jfloat GetFloatField (jobject obj0, jfieldID fld1) + { return p->GetFloatField (this, obj0, fld1); } + + jdouble GetDoubleField (jobject obj0, jfieldID fld1) + { return p->GetDoubleField (this, obj0, fld1); } + + void SetObjectField (jobject obj0, jfieldID fld1, jobject obj2) + { p->SetObjectField (this, obj0, fld1, obj2); } + + void SetBooleanField (jobject obj0, jfieldID fld1, jboolean val2) + { p->SetBooleanField (this, obj0, fld1, val2); } + + void SetByteField (jobject obj0, jfieldID fld1, jbyte val2) + { p->SetByteField (this, obj0, fld1, val2); } + + void SetCharField (jobject obj0, jfieldID fld1, jchar val2) + { p->SetCharField (this, obj0, fld1, val2); } + + void SetShortField (jobject obj0, jfieldID fld1, jshort val2) + { p->SetShortField (this, obj0, fld1, val2); } + + void SetIntField (jobject obj0, jfieldID fld1, jint val2) + { p->SetIntField (this, obj0, fld1, val2); } + + void SetLongField (jobject obj0, jfieldID fld1, jlong val2) + { p->SetLongField (this, obj0, fld1, val2); } + + void SetFloatField (jobject obj0, jfieldID fld1, jfloat val2) + { p->SetFloatField (this, obj0, fld1, val2); } + + void SetDoubleField (jobject obj0, jfieldID fld1, jdouble val2) + { p->SetDoubleField (this, obj0, fld1, val2); } + + jmethodID GetStaticMethodID (jclass cl0, const char * val1, const char * val2) + { return p->GetStaticMethodID (this, cl0, val1, val2); } + + jobject CallStaticObjectMethod (jclass cl0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jobject result = p->CallStaticObjectMethodV (this, cl0, meth1, args); + va_end (args); + return result; + } + + jobject CallStaticObjectMethodV (jclass cl0, jmethodID meth1, _Jv_va_list val2) + { return p->CallStaticObjectMethodV (this, cl0, meth1, val2); } + + jobject CallStaticObjectMethodA (jclass cl0, jmethodID meth1, jvalue * val2) + { return p->CallStaticObjectMethodA (this, cl0, meth1, val2); } + + jboolean CallStaticBooleanMethod (jclass cl0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jboolean result = p->CallStaticBooleanMethodV (this, cl0, meth1, args); + va_end (args); + return result; + } + + jboolean CallStaticBooleanMethodV (jclass cl0, jmethodID meth1, _Jv_va_list val2) + { return p->CallStaticBooleanMethodV (this, cl0, meth1, val2); } + + jboolean CallStaticBooleanMethodA (jclass cl0, jmethodID meth1, jvalue * val2) + { return p->CallStaticBooleanMethodA (this, cl0, meth1, val2); } + + jbyte CallStaticByteMethod (jclass cl0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jbyte result = p->CallStaticByteMethodV (this, cl0, meth1, args); + va_end (args); + return result; + } + + jbyte CallStaticByteMethodV (jclass cl0, jmethodID meth1, _Jv_va_list val2) + { return p->CallStaticByteMethodV (this, cl0, meth1, val2); } + + jbyte CallStaticByteMethodA (jclass cl0, jmethodID meth1, jvalue * val2) + { return p->CallStaticByteMethodA (this, cl0, meth1, val2); } + + jchar CallStaticCharMethod (jclass cl0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jchar result = p->CallStaticCharMethodV (this, cl0, meth1, args); + va_end (args); + return result; + } + + jchar CallStaticCharMethodV (jclass cl0, jmethodID meth1, _Jv_va_list val2) + { return p->CallStaticCharMethodV (this, cl0, meth1, val2); } + + jchar CallStaticCharMethodA (jclass cl0, jmethodID meth1, jvalue * val2) + { return p->CallStaticCharMethodA (this, cl0, meth1, val2); } + + jshort CallStaticShortMethod (jclass cl0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jshort result = p->CallStaticShortMethodV (this, cl0, meth1, args); + va_end (args); + return result; + } + + jshort CallStaticShortMethodV (jclass cl0, jmethodID meth1, _Jv_va_list val2) + { return p->CallStaticShortMethodV (this, cl0, meth1, val2); } + + jshort CallStaticShortMethodA (jclass cl0, jmethodID meth1, jvalue * val2) + { return p->CallStaticShortMethodA (this, cl0, meth1, val2); } + + jint CallStaticIntMethod (jclass cl0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jint result = p->CallStaticIntMethodV (this, cl0, meth1, args); + va_end (args); + return result; + } + + jint CallStaticIntMethodV (jclass cl0, jmethodID meth1, _Jv_va_list val2) + { return p->CallStaticIntMethodV (this, cl0, meth1, val2); } + + jint CallStaticIntMethodA (jclass cl0, jmethodID meth1, jvalue * val2) + { return p->CallStaticIntMethodA (this, cl0, meth1, val2); } + + jlong CallStaticLongMethod (jclass cl0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jlong result = p->CallStaticLongMethodV (this, cl0, meth1, args); + va_end (args); + return result; + } + + jlong CallStaticLongMethodV (jclass cl0, jmethodID meth1, _Jv_va_list val2) + { return p->CallStaticLongMethodV (this, cl0, meth1, val2); } + + jlong CallStaticLongMethodA (jclass cl0, jmethodID meth1, jvalue * val2) + { return p->CallStaticLongMethodA (this, cl0, meth1, val2); } + + jfloat CallStaticFloatMethod (jclass cl0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jfloat result = p->CallStaticFloatMethodV (this, cl0, meth1, args); + va_end (args); + return result; + } + + jfloat CallStaticFloatMethodV (jclass cl0, jmethodID meth1, _Jv_va_list val2) + { return p->CallStaticFloatMethodV (this, cl0, meth1, val2); } + + jfloat CallStaticFloatMethodA (jclass cl0, jmethodID meth1, jvalue * val2) + { return p->CallStaticFloatMethodA (this, cl0, meth1, val2); } + + jdouble CallStaticDoubleMethod (jclass cl0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + jdouble result = p->CallStaticDoubleMethodV (this, cl0, meth1, args); + va_end (args); + return result; + } + + jdouble CallStaticDoubleMethodV (jclass cl0, jmethodID meth1, _Jv_va_list val2) + { return p->CallStaticDoubleMethodV (this, cl0, meth1, val2); } + + jdouble CallStaticDoubleMethodA (jclass cl0, jmethodID meth1, jvalue * val2) + { return p->CallStaticDoubleMethodA (this, cl0, meth1, val2); } + + void CallStaticVoidMethod (jclass cl0, jmethodID meth1, ...) + { + _Jv_va_list args; + va_start (args, meth1); + p->CallStaticVoidMethodV (this, cl0, meth1, args); + va_end (args); + } + + void CallStaticVoidMethodV (jclass cl0, jmethodID meth1, _Jv_va_list val2) + { p->CallStaticVoidMethodV (this, cl0, meth1, val2); } + + void CallStaticVoidMethodA (jclass cl0, jmethodID meth1, jvalue * val2) + { p->CallStaticVoidMethodA (this, cl0, meth1, val2); } + + jfieldID GetStaticFieldID (jclass cl0, const char * val1, const char * val2) + { return p->GetStaticFieldID (this, cl0, val1, val2); } + + jobject GetStaticObjectField (jclass cl0, jfieldID fld1) + { return p->GetStaticObjectField (this, cl0, fld1); } + + jboolean GetStaticBooleanField (jclass cl0, jfieldID fld1) + { return p->GetStaticBooleanField (this, cl0, fld1); } + + jbyte GetStaticByteField (jclass cl0, jfieldID fld1) + { return p->GetStaticByteField (this, cl0, fld1); } + + jchar GetStaticCharField (jclass cl0, jfieldID fld1) + { return p->GetStaticCharField (this, cl0, fld1); } + + jshort GetStaticShortField (jclass cl0, jfieldID fld1) + { return p->GetStaticShortField (this, cl0, fld1); } + + jint GetStaticIntField (jclass cl0, jfieldID fld1) + { return p->GetStaticIntField (this, cl0, fld1); } + + jlong GetStaticLongField (jclass cl0, jfieldID fld1) + { return p->GetStaticLongField (this, cl0, fld1); } + + jfloat GetStaticFloatField (jclass cl0, jfieldID fld1) + { return p->GetStaticFloatField (this, cl0, fld1); } + + jdouble GetStaticDoubleField (jclass cl0, jfieldID fld1) + { return p->GetStaticDoubleField (this, cl0, fld1); } + + void SetStaticObjectField (jclass cl0, jfieldID fld1, jobject obj2) + { p->SetStaticObjectField (this, cl0, fld1, obj2); } + + void SetStaticBooleanField (jclass cl0, jfieldID fld1, jboolean val2) + { p->SetStaticBooleanField (this, cl0, fld1, val2); } + + void SetStaticByteField (jclass cl0, jfieldID fld1, jbyte val2) + { p->SetStaticByteField (this, cl0, fld1, val2); } + + void SetStaticCharField (jclass cl0, jfieldID fld1, jchar val2) + { p->SetStaticCharField (this, cl0, fld1, val2); } + + void SetStaticShortField (jclass cl0, jfieldID fld1, jshort val2) + { p->SetStaticShortField (this, cl0, fld1, val2); } + + void SetStaticIntField (jclass cl0, jfieldID fld1, jint val2) + { p->SetStaticIntField (this, cl0, fld1, val2); } + + void SetStaticLongField (jclass cl0, jfieldID fld1, jlong val2) + { p->SetStaticLongField (this, cl0, fld1, val2); } + + void SetStaticFloatField (jclass cl0, jfieldID fld1, jfloat val2) + { p->SetStaticFloatField (this, cl0, fld1, val2); } + + void SetStaticDoubleField (jclass cl0, jfieldID fld1, jdouble val2) + { p->SetStaticDoubleField (this, cl0, fld1, val2); } + + jstring NewString (const jchar * val0, jsize val1) + { return p->NewString (this, val0, val1); } + + jsize GetStringLength (jstring val0) + { return p->GetStringLength (this, val0); } + + const jchar * GetStringChars (jstring val0, jboolean * val1) + { return p->GetStringChars (this, val0, val1); } + + void ReleaseStringChars (jstring val0, const jchar * val1) + { p->ReleaseStringChars (this, val0, val1); } + + jstring NewStringUTF (const char * val0) + { return p->NewStringUTF (this, val0); } + + jsize GetStringUTFLength (jstring val0) + { return p->GetStringUTFLength (this, val0); } + + const char * GetStringUTFChars (jstring val0, jboolean * val1) + { return p->GetStringUTFChars (this, val0, val1); } + + void ReleaseStringUTFChars (jstring val0, const char * val1) + { p->ReleaseStringUTFChars (this, val0, val1); } + + jsize GetArrayLength (jarray val0) + { return p->GetArrayLength (this, val0); } + + jobjectArray NewObjectArray (jsize val0, jclass cl1, jobject obj2) + { return p->NewObjectArray (this, val0, cl1, obj2); } + + jobject GetObjectArrayElement (jobjectArray val0, jsize val1) + { return p->GetObjectArrayElement (this, val0, val1); } + + void SetObjectArrayElement (jobjectArray val0, jsize val1, jobject obj2) + { p->SetObjectArrayElement (this, val0, val1, obj2); } + + jbooleanArray NewBooleanArray (jsize val0) + { return p->NewBooleanArray (this, val0); } + + jbyteArray NewByteArray (jsize val0) + { return p->NewByteArray (this, val0); } + + jcharArray NewCharArray (jsize val0) + { return p->NewCharArray (this, val0); } + + jshortArray NewShortArray (jsize val0) + { return p->NewShortArray (this, val0); } + + jintArray NewIntArray (jsize val0) + { return p->NewIntArray (this, val0); } + + jlongArray NewLongArray (jsize val0) + { return p->NewLongArray (this, val0); } + + jfloatArray NewFloatArray (jsize val0) + { return p->NewFloatArray (this, val0); } + + jdoubleArray NewDoubleArray (jsize val0) + { return p->NewDoubleArray (this, val0); } + + jboolean * GetBooleanArrayElements (jbooleanArray val0, jboolean * val1) + { return p->GetBooleanArrayElements (this, val0, val1); } + + jbyte * GetByteArrayElements (jbyteArray val0, jboolean * val1) + { return p->GetByteArrayElements (this, val0, val1); } + + jchar * GetCharArrayElements (jcharArray val0, jboolean * val1) + { return p->GetCharArrayElements (this, val0, val1); } + + jshort * GetShortArrayElements (jshortArray val0, jboolean * val1) + { return p->GetShortArrayElements (this, val0, val1); } + + jint * GetIntArrayElements (jintArray val0, jboolean * val1) + { return p->GetIntArrayElements (this, val0, val1); } + + jlong * GetLongArrayElements (jlongArray val0, jboolean * val1) + { return p->GetLongArrayElements (this, val0, val1); } + + jfloat * GetFloatArrayElements (jfloatArray val0, jboolean * val1) + { return p->GetFloatArrayElements (this, val0, val1); } + + jdouble * GetDoubleArrayElements (jdoubleArray val0, jboolean * val1) + { return p->GetDoubleArrayElements (this, val0, val1); } + + void ReleaseBooleanArrayElements (jbooleanArray val0, jboolean * val1, jint val2) + { p->ReleaseBooleanArrayElements (this, val0, val1, val2); } + + void ReleaseByteArrayElements (jbyteArray val0, jbyte * val1, jint val2) + { p->ReleaseByteArrayElements (this, val0, val1, val2); } + + void ReleaseCharArrayElements (jcharArray val0, jchar * val1, jint val2) + { p->ReleaseCharArrayElements (this, val0, val1, val2); } + + void ReleaseShortArrayElements (jshortArray val0, jshort * val1, jint val2) + { p->ReleaseShortArrayElements (this, val0, val1, val2); } + + void ReleaseIntArrayElements (jintArray val0, jint * val1, jint val2) + { p->ReleaseIntArrayElements (this, val0, val1, val2); } + + void ReleaseLongArrayElements (jlongArray val0, jlong * val1, jint val2) + { p->ReleaseLongArrayElements (this, val0, val1, val2); } + + void ReleaseFloatArrayElements (jfloatArray val0, jfloat * val1, jint val2) + { p->ReleaseFloatArrayElements (this, val0, val1, val2); } + + void ReleaseDoubleArrayElements (jdoubleArray val0, jdouble * val1, jint val2) + { p->ReleaseDoubleArrayElements (this, val0, val1, val2); } + + void GetBooleanArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3) + { p->GetBooleanArrayRegion (this, val0, val1, val2, val3); } + + void GetByteArrayRegion (jbyteArray val0, jsize val1, jsize val2, jbyte * val3) + { p->GetByteArrayRegion (this, val0, val1, val2, val3); } + + void GetCharArrayRegion (jcharArray val0, jsize val1, jsize val2, jchar * val3) + { p->GetCharArrayRegion (this, val0, val1, val2, val3); } + + void GetShortArrayRegion (jshortArray val0, jsize val1, jsize val2, jshort * val3) + { p->GetShortArrayRegion (this, val0, val1, val2, val3); } + + void GetIntArrayRegion (jintArray val0, jsize val1, jsize val2, jint * val3) + { p->GetIntArrayRegion (this, val0, val1, val2, val3); } + + void GetLongArrayRegion (jlongArray val0, jsize val1, jsize val2, jlong * val3) + { p->GetLongArrayRegion (this, val0, val1, val2, val3); } + + void GetFloatArrayRegion (jfloatArray val0, jsize val1, jsize val2, jfloat * val3) + { p->GetFloatArrayRegion (this, val0, val1, val2, val3); } + + void GetDoubleArrayRegion (jdoubleArray val0, jsize val1, jsize val2, jdouble * val3) + { p->GetDoubleArrayRegion (this, val0, val1, val2, val3); } + + void SetBooleanArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3) + { p->SetBooleanArrayRegion (this, val0, val1, val2, val3); } + + void SetByteArrayRegion (jbyteArray val0, jsize val1, jsize val2, jbyte * val3) + { p->SetByteArrayRegion (this, val0, val1, val2, val3); } + + void SetCharArrayRegion (jcharArray val0, jsize val1, jsize val2, jchar * val3) + { p->SetCharArrayRegion (this, val0, val1, val2, val3); } + + void SetShortArrayRegion (jshortArray val0, jsize val1, jsize val2, jshort * val3) + { p->SetShortArrayRegion (this, val0, val1, val2, val3); } + + void SetIntArrayRegion (jintArray val0, jsize val1, jsize val2, jint * val3) + { p->SetIntArrayRegion (this, val0, val1, val2, val3); } + + void SetLongArrayRegion (jlongArray val0, jsize val1, jsize val2, jlong * val3) + { p->SetLongArrayRegion (this, val0, val1, val2, val3); } + + void SetFloatArrayRegion (jfloatArray val0, jsize val1, jsize val2, jfloat * val3) + { p->SetFloatArrayRegion (this, val0, val1, val2, val3); } + + void SetDoubleArrayRegion (jdoubleArray val0, jsize val1, jsize val2, jdouble * val3) + { p->SetDoubleArrayRegion (this, val0, val1, val2, val3); } + + jint RegisterNatives (jclass cl0, const JNINativeMethod * val1, jint val2) + { return p->RegisterNatives (this, cl0, val1, val2); } + + jint UnregisterNatives (jclass cl0) + { return p->UnregisterNatives (this, cl0); } + + jint MonitorEnter (jobject obj0) + { return p->MonitorEnter (this, obj0); } + + jint MonitorExit (jobject obj0) + { return p->MonitorExit (this, obj0); } + + jint GetJavaVM (JavaVM ** val0) + { return p->GetJavaVM (this, val0); } + + void GetStringRegion (jstring val0, jsize val1, jsize val2, jchar * val3) + { p->GetStringRegion (this, val0, val1, val2, val3); } + + void GetStringUTFRegion (jstring val0, jsize val1, jsize val2, char * val3) + { p->GetStringUTFRegion (this, val0, val1, val2, val3); } + + void * GetPrimitiveArrayCritical (jarray val0, jboolean * val1) + { return p->GetPrimitiveArrayCritical (this, val0, val1); } + + void ReleasePrimitiveArrayCritical (jarray val0, void * val1, jint val2) + { p->ReleasePrimitiveArrayCritical (this, val0, val1, val2); } + + const jchar * GetStringCritical (jstring val0, jboolean * val1) + { return p->GetStringCritical (this, val0, val1); } + + void ReleaseStringCritical (jstring val0, const jchar * val1) + { p->ReleaseStringCritical (this, val0, val1); } + + jweak NewWeakGlobalRef (jobject obj0) + { return p->NewWeakGlobalRef (this, obj0); } + + void DeleteWeakGlobalRef (jweak val0) + { p->DeleteWeakGlobalRef (this, val0); } + + jboolean ExceptionCheck () + { return p->ExceptionCheck (this); } + + jobject NewDirectByteBuffer (void * val1, jlong val2) + { return p->NewDirectByteBuffer (this, val1, val2); } + + void * GetDirectBufferAddress (jobject val1) + { return p->GetDirectBufferAddress (this, val1); } + + long GetDirectBufferCapacity (jobject val1) + { return p->GetDirectBufferCapacity (this, val1); } + + }; + #endif /* __cplusplus */ + + /* + * Invocation API. + */ + + struct JNIInvokeInterface + { + void *reserved0; + void *reserved1; + void *reserved2; + + jint (JNICALL *DestroyJavaVM) (JavaVM *); + jint (JNICALL *AttachCurrentThread) (JavaVM *, void **, void *); + jint (JNICALL *DetachCurrentThread) (JavaVM *); + jint (JNICALL *GetEnv) (JavaVM *, void **, jint); + jint (JNICALL *AttachCurrentThreadAsDaemon) (JavaVM *, void **, void *); + + }; + + #ifdef __cplusplus + + struct _Jv_JavaVM + { + const struct JNIInvokeInterface *functions; + + jint DestroyJavaVM () + { return functions->DestroyJavaVM (this); } + + jint AttachCurrentThread (void **penv, void *args) + { return functions->AttachCurrentThread (this, penv, args); } + + jint DetachCurrentThread () + { return functions->DetachCurrentThread (this); } + + jint GetEnv (void **penv, jint version) + { return functions->GetEnv (this, penv, version); } + + jint AttachCurrentThreadAsDaemon (void **penv, void *args) + { return functions->AttachCurrentThreadAsDaemon (this, penv, args); } + }; + #endif /* __cplusplus */ + + typedef struct JavaVMAttachArgs + { + jint version; /* Must be JNI_VERSION_1_2. */ + char *name; /* The name of the thread (or NULL). */ + jobject group; /* Global ref of a ThreadGroup object + (or NULL). */ + } JavaVMAttachArgs; + + typedef struct JavaVMOption + { + char *optionString; + void *extraInfo; + } JavaVMOption; + + typedef struct JavaVMInitArgs + { + /* Must be JNI_VERSION_1_2. */ + jint version; + + /* Number of options. */ + jint nOptions; + + /* Options to the VM. */ + JavaVMOption *options; + + /* Whether we should ignore unrecognized options. */ + jboolean ignoreUnrecognized; + } JavaVMInitArgs; + + + /* Keep c-font-lock-extra-types in alphabetical order. */ + /* Local Variables: */ + /* c-font-lock-extra-types: ("\\sw+_t" + "JNIEnv" "JNINativeMethod" "JavaVM" "JavaVMOption" "jarray" + "jboolean" "jbooleanArray" "jbyte" "jbyteArray" "jchar" "jcharArray" + "jclass" "jdouble" "jdoubleArray" "jfieldID" "jfloat" "jfloatArray" + "jint" "jintArray" "jlong" "jlongArray" "jmethodID" "jobject" "jstring" "jthrowable" + "jvalue" "jweak") */ + /* End: */ + #endif /* __CLASSPATH_JNI_H__ */ From alkis at cs.uiuc.edu Wed Nov 24 13:44:00 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 13:44:00 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200411241944.NAA26210@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.149 -> 1.150 --- Log message: Use correct types for function signatures. --- Diffs of the changes: (+2 -2) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.149 llvm-java/lib/Compiler/Compiler.cpp:1.150 --- llvm-java/lib/Compiler/Compiler.cpp:1.149 Wed Nov 24 02:56:15 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Wed Nov 24 13:43:50 2004 @@ -1170,7 +1170,7 @@ DEBUG(std::cerr << "Adding stub for natively implemented method: " << classMethodDesc << '\n'); FunctionType* funcTy = cast( - getJNIType(method->getDescriptor(), Type::VoidTy)); + getJNIType(method->getDescriptor(), ClassInfo::ObjectBaseTy)); std::string funcName = "Java_"; const std::string& className = cf_->getThisClass()->getName()->str(); @@ -1202,7 +1202,7 @@ params.push_back(JNIEnvPtr_); if (method->isStatic()) params.push_back(llvm::Constant::getNullValue( - PointerType::get(Type::VoidTy))); + PointerType::get(ClassInfo::ObjectBaseTy))); for (Function::aiterator A = function->abegin(), E = function->aend(); A != E; ++A) { params.push_back(&*A); From alkis at cs.uiuc.edu Wed Nov 24 13:45:03 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 13:45:03 -0600 Subject: [llvm-commits] CVS: llvm-java/runtime/runtime.c Makefile Message-ID: <200411241945.NAA26463@zion.cs.uiuc.edu> Changes in directory llvm-java/runtime: runtime.c updated: 1.10 -> 1.11 Makefile updated: 1.4 -> 1.5 --- Log message: Make jni libraries link properly with java code. This allows us to run the tests in Programs/SingleSource/UnitTests. --- Diffs of the changes: (+6 -11) Index: llvm-java/runtime/runtime.c diff -u llvm-java/runtime/runtime.c:1.10 llvm-java/runtime/runtime.c:1.11 --- llvm-java/runtime/runtime.c:1.10 Wed Nov 24 02:59:19 2004 +++ llvm-java/runtime/runtime.c Wed Nov 24 13:44:53 2004 @@ -1,17 +1,11 @@ #include +#include struct llvm_java_object_base; struct llvm_java_object_header; struct llvm_java_object_vtable; struct llvm_java_object_typeinfo; -/* Define VM internal types */ -typedef struct llvm_java_object_base* jobject; -typedef unsigned jfieldID; -typedef unsigned jmethodID; -#define _JNI_VM_INTERNAL_TYPES_DEFINED -#include - struct llvm_java_object_header { /* gc info, hash info, locking */ }; @@ -77,7 +71,7 @@ /* The JNI interface definition */ -const struct JNINativeInterface llvm_java_JNIEnv = { +static const struct JNINativeInterface llvm_java_JNINativeInterface = { NULL, NULL, NULL, @@ -312,6 +306,8 @@ NULL, }; +const JNIEnv llvm_java_JNIEnv = &llvm_java_JNINativeInterface; + extern void llvm_java_static_init(void); extern void llvm_java_main(int, char**); Index: llvm-java/runtime/Makefile diff -u llvm-java/runtime/Makefile:1.4 llvm-java/runtime/Makefile:1.5 --- llvm-java/runtime/Makefile:1.4 Wed Nov 24 02:59:19 2004 +++ llvm-java/runtime/Makefile Wed Nov 24 13:44:53 2004 @@ -7,9 +7,8 @@ # ##===----------------------------------------------------------------------===## LEVEL := .. -# FIXME: This needs to be handled by the configure script or alternatively -# import jni.h in the java-fe. -CPPFLAGS+=-I$(HOME)/projects/college/classpath-0.12/include + +CPPFLAGS+=-I$(BUILD_SRC_ROOT)/include/llvm/Java BYTECODE_LIBRARY=1 LIBRARYNAME=jrt From alkis at cs.uiuc.edu Wed Nov 24 13:45:03 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 13:45:03 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/Makefile Message-ID: <200411241945.NAA26455@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: Makefile updated: 1.5 -> 1.6 --- Log message: Make jni libraries link properly with java code. This allows us to run the tests in Programs/SingleSource/UnitTests. --- Diffs of the changes: (+6 -0) Index: llvm-java/test/Programs/SingleSource/UnitTests/Makefile diff -u llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.5 llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.6 --- llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.5 Wed Nov 24 03:06:46 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/Makefile Wed Nov 24 13:44:53 2004 @@ -23,6 +23,12 @@ # InstanceOf \ # VTable +CPPFLAGS+=-I$(BUILD_SRC_ROOT)/include/llvm/Java +BYTECODE_LIBRARY=1 +LIBRARYNAME=test + +EXTRA_OBJS = $(LibDir)/libtest.bc + all:: Output/.compile-java $(addprefix Output/, $(addsuffix .llvm.bc, $(JAVA_TESTS))) include ../Makefile.singlesrc From alkis at cs.uiuc.edu Wed Nov 24 14:32:28 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 14:32:28 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/OperandStack.cpp Locals.cpp Message-ID: <200411242032.OAA01151@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: OperandStack.cpp updated: 1.3 -> 1.4 Locals.cpp updated: 1.2 -> 1.3 --- Log message: Emit all allocas in the entry block so that mem2reg can eliminate them. --- Diffs of the changes: (+35 -9) Index: llvm-java/lib/Compiler/OperandStack.cpp diff -u llvm-java/lib/Compiler/OperandStack.cpp:1.3 llvm-java/lib/Compiler/OperandStack.cpp:1.4 --- llvm-java/lib/Compiler/OperandStack.cpp:1.3 Sun Nov 7 03:42:46 2004 +++ llvm-java/lib/Compiler/OperandStack.cpp Wed Nov 24 14:32:18 2004 @@ -13,7 +13,9 @@ //===----------------------------------------------------------------------===// #include "OperandStack.h" +#include #include +#include #include #include @@ -30,10 +32,21 @@ valueTy == Type::ShortTy) value = new CastInst(value, Type::IntTy, "int-extend", insertAtEnd); - TheStack.push(new AllocaInst(value->getType(), - NULL, - "opStack" + utostr(TheStack.size()), - insertAtEnd)); + // Insert the alloca at the beginning of the entry block. + BasicBlock* entry = &insertAtEnd->getParent()->getEntryBlock(); + if (entry->empty()) + TheStack.push(new AllocaInst( + value->getType(), + NULL, + "opStack" + utostr(TheStack.size()), + entry)); + else + TheStack.push(new AllocaInst( + value->getType(), + NULL, + "opStack" + utostr(TheStack.size()), + &entry->front())); + new StoreInst(value, TheStack.top(), insertAtEnd); } Index: llvm-java/lib/Compiler/Locals.cpp diff -u llvm-java/lib/Compiler/Locals.cpp:1.2 llvm-java/lib/Compiler/Locals.cpp:1.3 --- llvm-java/lib/Compiler/Locals.cpp:1.2 Thu Oct 28 14:38:34 2004 +++ llvm-java/lib/Compiler/Locals.cpp Wed Nov 24 14:32:18 2004 @@ -13,7 +13,9 @@ //===----------------------------------------------------------------------===// #include "Locals.h" +#include #include +#include #include #include @@ -28,11 +30,22 @@ void Locals::store(unsigned i, Value* value, BasicBlock* insertAtEnd) { if (!TheLocals[i] || - TheLocals[i]->getType()->getElementType() != value->getType()) - TheLocals[i] = new AllocaInst(value->getType(), - NULL, - "local" + utostr(i), - insertAtEnd); + TheLocals[i]->getType()->getElementType() != value->getType()) { + // Insert the alloca at the beginning of the entry block. + BasicBlock* entry = &insertAtEnd->getParent()->getEntryBlock(); + if (entry->empty()) + TheLocals[i] = new AllocaInst( + value->getType(), + NULL, + "local" + utostr(i), + entry); + else + TheLocals[i] = new AllocaInst( + value->getType(), + NULL, + "local" + utostr(i), + &entry->front()); + } new StoreInst(value, TheLocals[i], insertAtEnd); } From alkis at cs.uiuc.edu Wed Nov 24 14:33:48 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 14:33:48 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Makefile.test Message-ID: <200411242033.OAA01595@zion.cs.uiuc.edu> Changes in directory llvm-java/test: Makefile.test updated: 1.17 -> 1.18 --- Log message: Use PRECIOUS instead of SECONDARY for files we want preserved. --- Diffs of the changes: (+1 -1) Index: llvm-java/test/Makefile.test diff -u llvm-java/test/Makefile.test:1.17 llvm-java/test/Makefile.test:1.18 --- llvm-java/test/Makefile.test:1.17 Wed Nov 24 03:01:42 2004 +++ llvm-java/test/Makefile.test Wed Nov 24 14:33:38 2004 @@ -17,7 +17,7 @@ # we don't want these files to be deleted by make, even if they are # intermediate results -.SECONDARY: Output/.dir %.linked.bc %.raw.bc %.ll %.llvm.bc +.PRECIOUS: Output/.dir %.linked.bc %.raw.bc %.ll %.llvm.bc #rule to link in runtime to raw bytecode %.linked.bc: %.raw.bc $(LibDir)/libjrt.bc $(EXTRA_OBJS) From alkis at cs.uiuc.edu Wed Nov 24 14:40:49 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 24 Nov 2004 14:40:49 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200411242040.OAA01990@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.150 -> 1.151 --- Log message: Fix codegen for iinc. --- Diffs of the changes: (+1 -1) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.150 llvm-java/lib/Compiler/Compiler.cpp:1.151 --- llvm-java/lib/Compiler/Compiler.cpp:1.150 Wed Nov 24 13:43:50 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Wed Nov 24 14:40:39 2004 @@ -1740,7 +1740,7 @@ void do_iinc(unsigned index, int amount) { Value* v = currentLocals_->load(index, currentBB_); Value* a = ConstantSInt::get(Type::IntTy, amount); - BinaryOperator::createAdd(v, a, TMP, currentBB_); + v = BinaryOperator::createAdd(v, a, TMP, currentBB_); currentLocals_->store(index, v, currentBB_); } From lattner at cs.uiuc.edu Wed Nov 24 15:02:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 24 Nov 2004 15:02:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Message-ID: <200411242102.iAOL207k011359@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.cpp updated: 1.8 -> 1.9 --- Log message: Write CompilationCallback as an explicit assembly stub to avoid getting GCC's prolog. --- Diffs of the changes: (+35 -20) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.8 llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.9 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.8 Wed Nov 24 12:00:02 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Wed Nov 24 15:01:46 2004 @@ -47,29 +47,44 @@ AtI[3] = BUILD_BCTR(isCall); // bctr/bctrl } -static void CompilationCallback() { - // Save R3-R31, since we want to restore arguments and nonvolatile regs used - // by the compiler. We also save and restore the FP regs, although this is - // probably just paranoia (gcc is unlikely to emit code that uses them for - // for this function. +extern "C" void PPC32CompilationCallback(); + #if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) - unsigned IntRegs[29]; - double FPRegs[13]; - __asm__ __volatile__ ( - "stmw r3, 0(%0)\n" - "stfd f1, 0(%1)\n" "stfd f2, 8(%1)\n" "stfd f3, 16(%1)\n" - "stfd f4, 24(%1)\n" "stfd f5, 32(%1)\n" "stfd f6, 40(%1)\n" - "stfd f7, 48(%1)\n" "stfd f8, 56(%1)\n" "stfd f9, 64(%1)\n" - "stfd f10, 72(%1)\n" "stfd f11, 80(%1)\n" "stfd f12, 88(%1)\n" - "stfd f13, 96(%1)\n" :: "b" (IntRegs), "b" (FPRegs) ); - /// FIXME: Need to safe and restore the rest of the FP regs! +// CompilationCallback stub - We can't use a C function with inline assembly in +// it, because we the prolog/epilog inserted by GCC won't work for us. Instead, +// write our own wrapper, which does things our way, so we have complete control +// over register saving and restoring. +asm( + ".text\n" + ".align 2\n" + ".globl _PPC32CompilationCallback\n" +"_PPC32CompilationCallback:\n" + // Make space for 29 ints r[3-31] and 14 doubles f[0-13] + "stwu r1, -272(r1)\n" + "mflr r11\n" + "stw r11, 280(r1)\n" // Set up a proper stack frame + "stmw r3, 156(r1)\n" // Save all of the integer registers + // Save all call-clobbered FP regs. + "stfd f1, 44(r1)\n" "stfd f2, 52(r1)\n" "stfd f3, 60(r1)\n" + "stfd f4, 68(r1)\n" "stfd f5, 76(r1)\n" "stfd f6, 84(r1)\n" + "stfd f7, 92(r1)\n" "stfd f8, 100(r1)\n" "stfd f9, 108(r1)\n" + "stfd f10, 116(r1)\n" "stfd f11, 124(r1)\n" "stfd f12, 132(r1)\n" + "stfd f13, 140(r1)\n" + + // Now that everything is saved, go to the C compilation callback function, + // passing the address of the intregs and fpregs. + "addi r3, r1, 156\n" // &IntRegs[0] + "addi r4, r1, 44\n" // &FPRegs[0] + "bl _PPC32CompilationCallbackC\n" + ); #endif - unsigned *CameFromStub = (unsigned*)__builtin_return_address(0); - unsigned *CameFromOrig = (unsigned*)__builtin_return_address(1); +extern "C" void PPC32CompilationCallbackC(unsigned *IntRegs, double *FPRegs) { + unsigned *CameFromStub = (unsigned*)__builtin_return_address(0+1); + unsigned *CameFromOrig = (unsigned*)__builtin_return_address(1+1); unsigned *CCStackPtr = (unsigned*)__builtin_frame_address(0); //unsigned *StubStackPtr = (unsigned*)__builtin_frame_address(1); - unsigned *OrigStackPtr = (unsigned*)__builtin_frame_address(2); + unsigned *OrigStackPtr = (unsigned*)__builtin_frame_address(2+1); // Adjust pointer to the branch, not the return address. --CameFromStub; @@ -135,13 +150,13 @@ TargetJITInfo::LazyResolverFn PPC32JITInfo::getLazyResolverFunction(JITCompilerFn Fn) { JITCompilerFunction = Fn; - return CompilationCallback; + return PPC32CompilationCallback; } void *PPC32JITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { // If this is just a call to an external function, emit a branch instead of a // call. The code is the same except for one bit of the last instruction. - if (Fn != CompilationCallback) { + if (Fn != PPC32CompilationCallback) { MCE.startFunctionStub(4*4); void *Addr = (void*)(intptr_t)MCE.getCurrentPCValue(); MCE.emitWord(0); From natebegeman at mac.com Wed Nov 24 15:53:25 2004 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 24 Nov 2004 15:53:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Message-ID: <200411242153.PAA09482@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32ISelSimple.cpp updated: 1.110 -> 1.111 --- Log message: Add the same optimization that we do loading from fixed alloca slots to storing to fixed alloca slots. --- Diffs of the changes: (+12 -0) Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.110 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.111 --- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.110 Tue Nov 23 00:05:44 2004 +++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Wed Nov 24 15:53:14 2004 @@ -2989,6 +2989,8 @@ if (Class == cShort && I.getType()->isSigned()) ImmOpcode = PPC::LHA; if (Class == cShort && I.getType()->isSigned()) IdxOpcode = PPC::LHAX; + // If this is a fixed size alloca, emit a load directly from the stack slot + // corresponding to it. if (AllocaInst *AI = dyn_castFixedAlloca(SourceAddr)) { unsigned FI = getFixedSizedAllocaFI(AI); if (Class == cLong) { @@ -3071,6 +3073,16 @@ unsigned IdxOpcode = IdxOpcodes[Class]; unsigned ValReg = getReg(I.getOperand(0)); + // If this is a fixed size alloca, emit a store directly to the stack slot + // corresponding to it. + if (AllocaInst *AI = dyn_castFixedAlloca(SourceAddr)) { + unsigned FI = getFixedSizedAllocaFI(AI); + addFrameReference(BuildMI(BB, ImmOpcode, 3).addReg(ValReg), FI); + if (Class == cLong) + addFrameReference(BuildMI(BB, ImmOpcode, 3).addReg(ValReg+1), FI, 4); + return; + } + // If the offset fits in 16 bits, we can emit a reg+imm store, otherwise, we // use the index from the FoldedGEP struct and use reg+reg addressing. if (GetElementPtrInst *GEPI = canFoldGEPIntoLoadOrStore(SourceAddr)) { From lattner at cs.uiuc.edu Wed Nov 24 16:30:23 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 24 Nov 2004 16:30:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp PPC32Relocations.h PPC32JITInfo.cpp Message-ID: <200411242230.iAOMUNac011596@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.24 -> 1.25 PPC32Relocations.h updated: 1.1 -> 1.2 PPC32JITInfo.cpp updated: 1.9 -> 1.10 --- Log message: * Rename existing relocations to be more specific * Add relocations for refernces to non-lazy darwin stubs and implement them correctly. With this change, we can correctly references external globals, and now all but two UnitTests and all but 1 Regression/C tests pass. More importantly, bugpoint-jit will start giving us useful testcases, instead of always telling us that references to external globals don't work :) --- Diffs of the changes: (+65 -18) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.24 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.25 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.24 Tue Nov 23 20:03:44 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Wed Nov 24 16:30:08 2004 @@ -189,21 +189,36 @@ } else if (MO.isImmediate()) { rv = MO.getImmedValue(); } else if (MO.isGlobalAddress()) { + GlobalValue *GV = MO.getGlobal(); unsigned Reloc = 0; int Offset = 0; if (MI.getOpcode() == PPC::CALLpcrel) Reloc = PPC::reloc_pcrel_bx; - else if (MI.getOpcode() == PPC::LOADHiAddr) { + else { assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); - Reloc = PPC::reloc_absolute_loadhi; Offset = -((intptr_t)MovePCtoLROffset+4); - } else if (MI.getOpcode() == PPC::LA || MI.getOpcode() == PPC::LWZ || - MI.getOpcode() == PPC::LFS || MI.getOpcode() == PPC::LFD) { - assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); - Reloc = PPC::reloc_absolute_la; - Offset = -((intptr_t)MovePCtoLROffset+4); - } else { - assert(0 && "Unknown instruction for relocation!"); + + if (MI.getOpcode() == PPC::LOADHiAddr) { + if (GV->hasWeakLinkage() || GV->isExternal() || isa(GV)) + Reloc = PPC::reloc_absolute_ptr_high; // Pointer to stub + else + Reloc = PPC::reloc_absolute_high; // Pointer to symbol + + } else if (MI.getOpcode() == PPC::LA) { + assert(!(GV->hasWeakLinkage() || GV->isExternal() || isa(GV)) + && "Something in the ISEL changed\n"); + + Reloc = PPC::reloc_absolute_low; + } else if (MI.getOpcode() == PPC::LWZ) { + Reloc = PPC::reloc_absolute_ptr_low; + + assert((GV->hasWeakLinkage() || GV->isExternal() || isa(GV))&& + "Something in the ISEL changed\n"); + } else { + // These don't show up for global value references AFAIK, only for + // constant pool refs: PPC::LFS, PPC::LFD + assert(0 && "Unknown instruction for relocation!"); + } } MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), Reloc, MO.getGlobal(), Offset)); Index: llvm/lib/Target/PowerPC/PPC32Relocations.h diff -u llvm/lib/Target/PowerPC/PPC32Relocations.h:1.1 llvm/lib/Target/PowerPC/PPC32Relocations.h:1.2 --- llvm/lib/Target/PowerPC/PPC32Relocations.h:1.1 Mon Nov 22 23:57:38 2004 +++ llvm/lib/Target/PowerPC/PPC32Relocations.h Wed Nov 24 16:30:08 2004 @@ -22,15 +22,29 @@ // reloc_pcrel_bx - PC relative relocation, for the b or bl instructions. reloc_pcrel_bx, - // reloc_absolute_loadhi - Absolute relocation, for the loadhi instruction + // reloc_absolute_high - Absolute relocation, for the loadhi instruction // (which is really addis). Add the high 16-bits of the specified global - // address into the immediate field of the addis. - reloc_absolute_loadhi, + // address into the low 16-bits of the instruction. + reloc_absolute_high, - // reloc_absolute_la - Absolute relocation, for the la instruction (which + // reloc_absolute_low - Absolute relocation, for the la instruction (which // is really an addi). Add the low 16-bits of teh specified global - // address into the immediate field of the addi. - reloc_absolute_la, + // address into the low 16-bits of the instruction. + reloc_absolute_low, + + // reloc_absolute_ptr_high - Absolute relocation for references to lazy + // pointer stubs. In this case, the relocated instruction should be + // relocated to point to a POINTER to the indicated global. The low-16 + // bits of the instruction are rewritten with the high 16-bits of the + // address of the pointer. + reloc_absolute_ptr_high, + + // reloc_absolute_ptr_low - Absolute relocation for references to lazy + // pointer stubs. In this case, the relocated instruction should be + // relocated to point to a POINTER to the indicated global. The low-16 + // bits of the instruction are rewritten with the low 16-bits of the + // address of the pointer. + reloc_absolute_ptr_low, }; } } Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.9 llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.10 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.9 Wed Nov 24 15:01:46 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Wed Nov 24 16:30:08 2004 @@ -16,6 +16,7 @@ #include "PPC32Relocations.h" #include "llvm/CodeGen/MachineCodeEmitter.h" #include "llvm/Config/alloca.h" +#include using namespace llvm; static TargetJITInfo::JITCompilerFn JITCompilerFunction; @@ -195,11 +196,28 @@ "Relocation out of range!"); *RelocPos |= (ResultPtr & ((1 << 24)-1)) << 2; break; - case PPC::reloc_absolute_loadhi: // Relocate high bits into addis - case PPC::reloc_absolute_la: // Relocate low bits into addi + + case PPC::reloc_absolute_ptr_high: // Pointer relocations. + case PPC::reloc_absolute_ptr_low: { + // Pointer relocations are used for the PPC external stubs and lazy + // resolver pointers that the Darwin ABI likes to use. Basically, the + // address of the global is actually stored in memory, and the address of + // the pointer is relocated into instructions instead of the pointer + // itself. Because we have to keep the mapping anyway, we just return + // pointers to the values in the map as our new location. + static std::map Pointers; + void *&Ptr = Pointers[(void*)ResultPtr]; + Ptr = (void*)ResultPtr; + ResultPtr = (intptr_t)&Ptr; + } + // FALL THROUGH + case PPC::reloc_absolute_high: // high bits of ref -> low 16 of instr + case PPC::reloc_absolute_low: // low bits of ref -> low 16 of instr ResultPtr += MR->getConstantVal(); - if (MR->getRelocationType() == PPC::reloc_absolute_loadhi) { + // If this is a high-part access, get the high-part. + if (MR->getRelocationType() == PPC::reloc_absolute_high || + MR->getRelocationType() == PPC::reloc_absolute_ptr_high) { // If the low part will have a carry (really a borrow) from the low // 16-bits into the high 16, add a bit to borrow from. if (((int)ResultPtr << 16) < 0) From lattner at cs.uiuc.edu Wed Nov 24 18:34:12 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 24 Nov 2004 18:34:12 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200411250034.iAP0YCge001966@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.25 -> 1.26 --- Log message: There is not a 1-1 mappign between llvm blocks and PPC blocks, do not use LLVM blocks as the keys for the branch rewriter. This fixes treeadd and many other programs with the JIT. --- Diffs of the changes: (+4 -5) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.25 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.26 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.25 Wed Nov 24 16:30:08 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Wed Nov 24 18:33:57 2004 @@ -33,9 +33,9 @@ void *MovePCtoLROffset; // Tracks which instruction references which BasicBlock - std::vector > BBRefs; + std::vector > BBRefs; // Tracks where each BasicBlock starts - std::map BBLocations; + std::map BBLocations; /// getMachineOpValue - evaluates the MachineOperand of a given MachineInstr /// @@ -120,7 +120,7 @@ } void PPC32CodeEmitter::emitBasicBlock(MachineBasicBlock &MBB) { - BBLocations[MBB.getBasicBlock()] = MCE.getCurrentPCValue(); + BBLocations[&MBB] = MCE.getCurrentPCValue(); for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I){ MachineInstr &MI = *I; unsigned Opcode = MI.getOpcode(); @@ -223,9 +223,8 @@ MCE.addRelocation(MachineRelocation(MCE.getCurrentPCOffset(), Reloc, MO.getGlobal(), Offset)); } else if (MO.isMachineBasicBlock()) { - const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock(); unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); - BBRefs.push_back(std::make_pair(BB, CurrPC)); + BBRefs.push_back(std::make_pair(MO.getMachineBasicBlock(), CurrPC)); } else if (MO.isConstantPoolIndex()) { unsigned index = MO.getConstantPoolIndex(); assert(MovePCtoLROffset && "MovePCtoLR not seen yet?"); From reid at x10sys.com Wed Nov 24 21:33:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 24 Nov 2004 21:33:14 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/m4/bison.m4 Message-ID: <200411250333.VAA14425@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: bison.m4 updated: 1.1 -> 1.2 --- Log message: Make the check print something, give the cache var an llvm specific name. --- Diffs of the changes: (+1 -2) Index: llvm/autoconf/m4/bison.m4 diff -u llvm/autoconf/m4/bison.m4:1.1 llvm/autoconf/m4/bison.m4:1.2 --- llvm/autoconf/m4/bison.m4:1.1 Tue Sep 7 01:56:14 2004 +++ llvm/autoconf/m4/bison.m4 Wed Nov 24 21:33:03 2004 @@ -6,8 +6,7 @@ # 2) BISON is set to bison # AC_DEFUN([AC_PROG_BISON], -[AC_CACHE_CHECK(, -ac_cv_has_bison, +[AC_CACHE_CHECK([if we have bison],[llvm_cv_has_bison], [AC_PROG_YACC() ]) if test "$YACC" != "bison -y"; then From lattner at cs.uiuc.edu Wed Nov 24 21:40:34 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 24 Nov 2004 21:40:34 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Message-ID: <200411250340.iAP3eYkZ003109@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrFormats.td updated: 1.28 -> 1.29 --- Log message: Fix encoding of swari, fixing several programs, including Olden/mst --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.28 llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.29 --- llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.28 Tue Nov 23 21:52:02 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Wed Nov 24 21:40:20 2004 @@ -253,7 +253,7 @@ class XForm_10 opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> - : XForm_base_r3xo { + : XForm_base_r3xo_swapped { } class XForm_11 opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, From lattner at cs.uiuc.edu Wed Nov 24 21:53:58 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 24 Nov 2004 21:53:58 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Message-ID: <200411250353.iAP3rw9o003143@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrInfo.td updated: 1.47 -> 1.48 --- Log message: Fix encoding of fneg instruction --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.47 llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.48 --- llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.47 Tue Nov 23 18:16:37 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Wed Nov 24 21:53:44 2004 @@ -306,7 +306,7 @@ "fctiwz $frD, $frB">; def FMR : XForm_26<63, 72, 0, 0, 0, (ops FPRC:$frD, FPRC:$frB), "fmr $frD, $frB">; -def FNEG : XForm_26<63, 80, 0, 0, 0, (ops FPRC:$frD, FPRC:$frB), +def FNEG : XForm_26<63, 40, 0, 0, 0, (ops FPRC:$frD, FPRC:$frB), "fneg $frD, $frB">; def FRSP : XForm_26<63, 12, 0, 0, 0, (ops FPRC:$frD, FPRC:$frB), "frsp $frD, $frB">; From lattner at cs.uiuc.edu Wed Nov 24 22:11:21 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 24 Nov 2004 22:11:21 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Message-ID: <200411250411.iAP4BLo9003456@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrFormats.td updated: 1.29 -> 1.30 --- Log message: Fix encoding of fsel, fixing olden/power, McCat/bisort and several others. All of Olden passes now! :) --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.29 llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.30 --- llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.29 Wed Nov 24 21:40:20 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Wed Nov 24 22:11:07 2004 @@ -419,8 +419,8 @@ dag OL, string asmstr> : I { bits<5> FRT; bits<5> FRA; - bits<5> FRB; bits<5> FRC; + bits<5> FRB; let Inst{6-10} = FRT; let Inst{11-15} = FRA; From lattner at cs.uiuc.edu Wed Nov 24 22:15:08 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 24 Nov 2004 22:15:08 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Message-ID: <200411250415.iAP4F8UH003478@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCTargetMachine.cpp updated: 1.41 -> 1.42 --- Log message: The JIT works enough --- Diffs of the changes: (+0 -1) Index: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.41 llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.42 --- llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.41 Tue Nov 23 12:47:42 2004 +++ llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Wed Nov 24 22:14:54 2004 @@ -57,7 +57,6 @@ {} unsigned PPC32TargetMachine::getJITMatchQuality() { - return 0; #if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) return 10; #else From reid at x10sys.com Wed Nov 24 22:42:35 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 24 Nov 2004 22:42:35 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/m4/bison.m4 Message-ID: <200411250442.WAA14963@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: bison.m4 updated: 1.2 -> 1.3 --- Log message: Eliminate duplicate "checking" message. --- Diffs of the changes: (+1 -1) Index: llvm/autoconf/m4/bison.m4 diff -u llvm/autoconf/m4/bison.m4:1.2 llvm/autoconf/m4/bison.m4:1.3 --- llvm/autoconf/m4/bison.m4:1.2 Wed Nov 24 21:33:03 2004 +++ llvm/autoconf/m4/bison.m4 Wed Nov 24 22:42:25 2004 @@ -6,7 +6,7 @@ # 2) BISON is set to bison # AC_DEFUN([AC_PROG_BISON], -[AC_CACHE_CHECK([if we have bison],[llvm_cv_has_bison], +[AC_CACHE_CHECK([],[llvm_cv_has_bison], [AC_PROG_YACC() ]) if test "$YACC" != "bison -y"; then From reid at x10sys.com Wed Nov 24 22:43:12 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 24 Nov 2004 22:43:12 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/m4/c_printf_a.m4 Message-ID: <200411250443.WAA14992@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: c_printf_a.m4 updated: 1.2 -> 1.3 --- Log message: Cache the value of this test. --- Diffs of the changes: (+7 -8) Index: llvm/autoconf/m4/c_printf_a.m4 diff -u llvm/autoconf/m4/c_printf_a.m4:1.2 llvm/autoconf/m4/c_printf_a.m4:1.3 --- llvm/autoconf/m4/c_printf_a.m4:1.2 Sun Sep 19 17:31:49 2004 +++ llvm/autoconf/m4/c_printf_a.m4 Wed Nov 24 22:43:01 2004 @@ -2,11 +2,11 @@ # Determine if the printf() functions have the %a format character. # This is modified from: # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html -AC_DEFUN([AC_C_PRINTF_A],[ - AC_MSG_CHECKING([for printf %a format specifier]) - AC_LANG_PUSH([C]) - AC_RUN_IFELSE([ - AC_LANG_PROGRAM([[ +AC_DEFUN([AC_C_PRINTF_A], +[AC_CACHE_CHECK([if printf has the %a format character],[ac_cv_printf_a], +[AC_LANG_PUSH([C]) + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[ #include #include ]],[[ @@ -24,9 +24,8 @@ ac_c_printf_a=yes, ac_c_printf_a=no, ac_c_printf_a=no) - AC_LANG_POP([C]) - AC_MSG_RESULT($ac_c_printf_a) - if test "$ac_c_printf_a" = "yes"; then + AC_LANG_POP([C])]) + if test "$ac_cv_printf_a" = "yes"; then AC_DEFINE([HAVE_PRINTF_A],[1],[Define to have the %a format string]) fi ]) From reid at x10sys.com Wed Nov 24 22:44:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 24 Nov 2004 22:44:05 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/m4/check_gnu_make.m4 Message-ID: <200411250444.WAA15019@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: check_gnu_make.m4 updated: 1.1 -> 1.2 --- Log message: Tidy up the indentation. Give the cache variable a proper name. --- Diffs of the changes: (+20 -19) Index: llvm/autoconf/m4/check_gnu_make.m4 diff -u llvm/autoconf/m4/check_gnu_make.m4:1.1 llvm/autoconf/m4/check_gnu_make.m4:1.2 --- llvm/autoconf/m4/check_gnu_make.m4:1.1 Tue Sep 7 01:56:14 2004 +++ llvm/autoconf/m4/check_gnu_make.m4 Wed Nov 24 22:43:54 2004 @@ -1,25 +1,26 @@ # -# Check for GNU Make. This is from +# Check for GNU Make. This is originally from # http://www.gnu.org/software/ac-archive/htmldoc/check_gnu_make.html # AC_DEFUN([AC_CHECK_GNU_MAKE], -[ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command, - _cv_gnu_make_command='' ; +[AC_CACHE_CHECK([for GNU make],[llvm_cv_gnu_make_command], dnl Search all the common names for GNU make - for a in "$MAKE" make gmake gnumake ; do - if test -z "$a" ; then continue ; fi ; - if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then - _cv_gnu_make_command=$a ; - break; - fi - done ; - ) ; -dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise - if test "x$_cv_gnu_make_command" != "x" ; then - ifGNUmake='' ; - else - ifGNUmake='#' ; - AC_MSG_RESULT("Not found"); - fi - AC_SUBST(ifGNUmake) +[llvm_cv_gnu_make_command='' + for a in "$MAKE" make gmake gnumake ; do + if test -z "$a" ; then continue ; fi ; + if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) + then + llvm_cv_gnu_make_command=$a ; + break; + fi + done]) +dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, +dnl '#' otherwise + if test "x$llvm_cv_gnu_make_command" != "x" ; then + ifGNUmake='' ; + else + ifGNUmake='#' ; + AC_MSG_RESULT("Not found"); + fi + AC_SUBST(ifGNUmake) ]) From reid at x10sys.com Wed Nov 24 22:44:57 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 24 Nov 2004 22:44:57 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/m4/link_use_r.m4 Message-ID: <200411250444.WAA15044@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: link_use_r.m4 updated: 1.3 -> 1.4 --- Log message: Cache the value of this test. --- Diffs of the changes: (+7 -8) Index: llvm/autoconf/m4/link_use_r.m4 diff -u llvm/autoconf/m4/link_use_r.m4:1.3 llvm/autoconf/m4/link_use_r.m4:1.4 --- llvm/autoconf/m4/link_use_r.m4:1.3 Sun Sep 19 23:08:22 2004 +++ llvm/autoconf/m4/link_use_r.m4 Wed Nov 24 22:44:46 2004 @@ -4,17 +4,16 @@ # This macro is specific to LLVM. # AC_DEFUN([AC_LINK_USE_R], -[ - AC_MSG_CHECKING([for compiler -Wl,-R option]) - AC_LANG_PUSH([C]) +[AC_CACHE_CHECK([for compiler -Wl,-R option],[llvm_cv_link_use_r], +[ AC_LANG_PUSH([C]) oldcflags="$CFLAGS" CFLAGS="$CFLAGS -Wl,-R." - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],[ac_cv_link_use_r=yes],[ac_cv_link_use_r=no]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])], + [llvm_cv_link_use_r=yes],[llvm_cv_link_use_r=no]) CFLAGS="$oldcflags" AC_LANG_POP([C]) - AC_MSG_RESULT($ac_cv_link_use_r) - if test "$ac_cv_link_use_r" = yes - then - AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.]) +]) +if test "$llvm_cv_link_use_r" = yes ; then + AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.]) fi ]) From reid at x10sys.com Wed Nov 24 22:51:15 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 24 Nov 2004 22:51:15 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200411250451.WAA15186@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.130 -> 1.131 --- Log message: For PR256: http://llvm.cs.uiuc.edu/PR256 : * cache more values * standardize cache value names * organize configure script per autoconf recommendations (10 sections) * Eliminate some redundancies and complexities in the script * Provide better documentation in the script. --- Diffs of the changes: (+398 -294) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.130 llvm/autoconf/configure.ac:1.131 --- llvm/autoconf/configure.ac:1.130 Tue Nov 23 17:48:45 2004 +++ llvm/autoconf/configure.ac Wed Nov 24 22:51:04 2004 @@ -1,23 +1,67 @@ -dnl Initialize autoconf +dnl === configure.ac --------------------------------------------------------=== +dnl The LLVM Compiler Infrastructure +dnl +dnl This file was developed by the LLVM research group and is distributed under +dnl the University of Illinois Open Source License. See LICENSE.TXT for details. +dnl +dnl===-----------------------------------------------------------------------=== +dnl This is the LLVM configuration script. It is processed by the autoconf +dnl program to produce a script named configure. This script contains the +dnl configuration checks that LLVM needs in order to support multiple platforms. +dnl This file is composed of 10 sections per the recommended organization of +dnl autoconf input defined in the autoconf documentation. As this file evolves, +dnl please keep the various types of checks within their sections. The sections +dnl are as follows: +dnl +dnl SECTION 1: Initialization & Setup +dnl SECTION 2: Architecture, target, and host checks +dnl SECTION 3: Command line arguments for the configure script. +dnl SECTION 4: Check for programs we need and that they are the right version +dnl SECTION 5: Check for libraries +dnl SECTION 6: Check for header files +dnl SECTION 7: Check for types and structures +dnl SECTION 8: Check for specific functions needed +dnl SECTION 9: Additional checks, variables, etc. +dnl SECTION 10: Specify the output files and generate it +dnl +dnl===-----------------------------------------------------------------------=== +dnl=== +dnl=== SECTION 1: Initialization & Setup +dnl=== +dnl===-----------------------------------------------------------------------=== +dnl Initialize autoconf and define the package name, version number and +dnl email address for reporting bugs. AC_INIT([[llvm]],[[1.4]],[llvmbugs at cs.uiuc.edu]) -dnl Place all of the extra autoconf files into the config subdirectory -dnl Tell various tools where the m4 autoconf macros are -dnl Have configure verify that the source directory is valid. +dnl Provide a copyright substitution and ensure the copyright notice is included +dnl in the output of --version option of the generated configure script. +AC_SUBST(LLVM_COPYRIGHT,["Copyright (c) 2003-2005 U University of Illinois at Urbana-Champaign."]) +AC_COPYRIGHT($LLVM_COPYRIGHT) + +dnl Indicate that we require autoconf 2.59 or later. Ths is needed because we +dnl use some autoconf macros only available in 2.59. +AC_PREREQ(2.59) + +dnl Verify that the source directory is valid. This makes sure that we are +dnl configuring LLVM and not some other package (it validates --srcdir argument) +AC_CONFIG_SRCDIR([lib/VMCore/Module.cpp]) + +dnl Place all of the extra autoconf files into the config subdirectory. Tell +dnl various tools where the m4 autoconf macros are. AC_CONFIG_AUX_DIR([autoconf]) -dnl AC_CONFIG_MACRO_DIR(autoconf/m4) -dnl Verify that the source directory is valid -AC_CONFIG_SRCDIR(["Makefile.config.in"]) dnl Quit if the source directory has already been configured. dnl NOTE: This relies upon undocumented autoconf behavior. if test ${srcdir} != "." ; then - if test -f ${srcdir}/include/llvm/Config/config.h ; then - AC_MSG_ERROR([Already configured in ${srcdir}]) - fi + if test -f ${srcdir}/include/llvm/Config/config.h ; then + AC_MSG_ERROR([Already configured in ${srcdir}]) + fi fi -dnl Configure all of the projects present in our source tree. +dnl Configure all of the projects present in our source tree. While we could +dnl just AC_CONFIG_SUBDIRS on the set of directories in projects that have a +dnl configure script, that usage of the AC_CONFIG_SUBDIRS macro is deprecated. +dnl Instead we match on the known projects. for i in `ls ${srcdir}/projects` do if test -d ${srcdir}/projects/${i} ; then @@ -39,178 +83,177 @@ fi done -dnl Configure header files -AC_CONFIG_HEADERS(include/llvm/Config/config.h) - -dnl Configure other output file -AC_CONFIG_FILES([Makefile.config tools/llvmc/st tools/llvmc/cpp tools/llvmc/ll - tools/llvmc/c]) -AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h]) -AC_CONFIG_HEADERS([include/llvm/ADT/hash_map]) -AC_CONFIG_HEADERS([include/llvm/ADT/hash_set]) -AC_CONFIG_HEADERS([include/llvm/Support/ThreadSupport.h]) -AC_CONFIG_HEADERS([include/llvm/ADT/iterator]) - -dnl Do special configuration of Makefiles -AC_CONFIG_MAKEFILE(Makefile) -AC_CONFIG_MAKEFILE(Makefile.common) -AC_CONFIG_MAKEFILE(examples/Makefile) -AC_CONFIG_MAKEFILE(lib/Makefile) -AC_CONFIG_MAKEFILE(runtime/Makefile) -AC_CONFIG_MAKEFILE(test/Makefile) -AC_CONFIG_MAKEFILE(test/Makefile.tests) -AC_CONFIG_MAKEFILE(test/QMTest/llvm.py) -AC_CONFIG_MAKEFILE(test/QMTest/llvmdb.py) -AC_CONFIG_MAKEFILE(tools/Makefile) -AC_CONFIG_MAKEFILE(tools/Makefile.JIT) -AC_CONFIG_MAKEFILE(utils/Makefile) -AC_CONFIG_MAKEFILE(projects/Makefile) - -dnl Find the install program (needs to be done before canonical stuff) -AC_PROG_INSTALL - -dnl Check which host for which we're compiling. This will tell us which LLVM -dnl compiler will be used for compiling SSA into object code. +dnl===-----------------------------------------------------------------------=== +dnl=== +dnl=== SECTION 2: Architecture, target, and host checks +dnl=== +dnl===-----------------------------------------------------------------------=== + +dnl Check the target for which we're compiling and the host that will do the +dnl compilations. This will tell us which LLVM compiler will be used for +dnl compiling SSA into object code. This needs to be done early because +dnl following tests depend on it. AC_CANONICAL_TARGET -dnl Set the "OS" Makefile variable based on the system we are building on. -dnl We will use the build machine information to set some variables. - -AC_MSG_CHECKING([support for generic build operating system]) -case $build in - *-*-aix*) - AC_SUBST(OS,[AIX]) - platform_type="AIX" - ;; - *-*-cygwin*) - AC_SUBST(OS,[Cygwin]) - platform_type="Cygwin" - ;; - *-*-darwin*) - AC_SUBST(OS,[Darwin]) - platform_type="Darwin" - ;; - *-*-freebsd*) - AC_SUBST(OS,[Linux]) - platform_type="FreeBSD" - ;; - *-*-interix*) - AC_SUBST(OS,[SunOS]) - platform_type="Interix" - ;; - *-*-linux*) - AC_SUBST(OS,[Linux]) - platform_type="Linux" - if test -d /home/vadve/lattner/local/x86/llvm-gcc - then - AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/]) - fi - ;; - *-*-solaris*) - AC_SUBST(OS,[SunOS]) - platform_type="SunOS" - if test -d /home/vadve/lattner/local/sparc/llvm-gcc - then - AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/]) - fi - ;; - *-*-win32*) - AC_SUBST(OS,[Win32]) - platform_type="Win32" - ;; - *-*-mingw*) - AC_SUBST(OS,[Win32]) - platform_type="Win32" - ;; - *) - AC_SUBST(OS,[Unknown]) - platform_type="Unknown" - ;; -esac +dnl Determine the platform type and cache its value. This helps us configure +dnl the System library to the correct build platform. +AC_CACHE_CHECK([support for generic build operating system], + [llvm_cv_platform_type], +[case $build in + *-*-aix*) llvm_cv_platform_type="AIX" ;; + *-*-cygwin*) llvm_cv_platform_type="Cygwin" ;; + *-*-darwin*) llvm_cv_platform_type="Darwin" ;; + *-*-freebsd*) llvm_cv_platform_type="FreeBSD" ;; + *-*-interix*) llvm_cv_platform_type="Interix" ;; + *-*-linux*) llvm_cv_platform_type="Linux" ;; + *-*-solaris*) llvm_cv_platform_type="SunOS" ;; + *-*-win32*) llvm_cv_platform_type="Win32" ;; + *-*-mingw*) llvm_cv_platform_type="Win32" ;; + *) llvm_cv_platform_type="Unknown" ;; +esac]) dnl Make sure we aren't attempting to configure for an unknown system -if test "$platform_type" = "Unknown" ; then - AC_MSG_ERROR([Platform is unknown, configure can't continue]) +if test "$llvm_cv_platform_type" = "Unknown" ; then + AC_MSG_ERROR([Operating system platform is unknown, configure can't continue]) fi +dnl Set the "OS" Makefile variable based on the platform type so the +dnl makefile can configure itself to specific build hosts +AC_SUBST(OS,$llvm_cv_platform_type) + dnl Make a link from lib/System/platform to lib/System/$platform_type dnl This helps the #inclusion of the system specific include files -dnl for the operating system abstraction library +dnl for the operating system abstraction library, lib/System. AC_CONFIG_LINKS(lib/System/platform:lib/System/$platform_type) - -AC_MSG_CHECKING(target architecture) dnl If we are targetting a Sparc machine running Solaris, pretend that it is dnl V9, since that is all that we support at the moment, and autoconf will only dnl tell us we're a sparc. case $target in - sparc*-*-solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]]) - ;; + sparc*-*-solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]]) + ;; esac dnl Determine what our target architecture is and configure accordingly. dnl This will allow Makefiles to make a distinction between the hardware and dnl the OS. -case $target in - i*86-*) - ARCH="x86" - AC_SUBST(ARCH,[x86]) - ;; - sparc*-*) - ARCH="Sparc" - AC_SUBST(ARCH,[Sparc]) - ;; - powerpc*-*) - ARCH="PowerPC" - AC_SUBST(ARCH,[PowerPC]) - ;; - *) - ARCH="Unknown" - AC_SUBST(ARCH,[Unknown]) - ;; -esac +AC_CACHE_CHECK([target architecture],[llvm_cv_target_arch], +[case $target in + i*86-*) llvm_cv_target_arch="x86" ;; + sparc*-*) llvm_cv_target_arch="Sparc" ;; + powerpc*-*) llvm_cv_target_arch="PowerPC" ;; + *) llvm_cv_target_arch="Unknown" ;; +esac]) -AC_MSG_RESULT($ARCH) - -dnl Check for compilation tools -AC_PROG_CXX -AC_PROG_CC(gcc) -dnl Ensure that compilation tools are GCC; we use GCC specific extensions -if test "$GCC" != "yes" -then - AC_MSG_ERROR([gcc required but not found]) -fi -AC_PROG_CPP -dnl Ensure that compilation tools are GCC; we use GCC specific extensions -if test "$GXX" != "yes" -then - AC_MSG_ERROR([g++ required but not found]) +if test "$llvm_cv_target_arch" = "Unknown" ; then + AC_MSG_WARN([Configuring LLVM for an unknown target archicture]) fi -dnl Verify that GCC is version 3.0 or higher -gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1` -if test "$gccmajor" -lt "3" -then - AC_MSG_ERROR([gcc 3.x required, but you have a lower version]) +dnl Define a substitution, ARCH, for the target architecture +AC_SUBST(ARCH,$llvm_cv_target_arch) + +dnl Check for the endianness of the target +AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little])) + +dnl===-----------------------------------------------------------------------=== +dnl=== +dnl=== SECTION 3: Command line arguments for the configure script. +dnl=== +dnl===-----------------------------------------------------------------------=== + +dnl --enable-optimized : check whether they want to do an optimized build: +AC_ARG_ENABLE(optimized, + AS_HELP_STRING([--enable-optimized,Compile with optimizations enabled (default is NO)]),,enableval=no) +if test ${enableval} = "no" ; then + AC_SUBST(ENABLE_OPTIMIZED,[[]]) +else + AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]]) fi -dnl Check for GNU Make. We use its extensions too, so don't build without it -AC_CHECK_GNU_MAKE -if test -z "$_cv_gnu_make_command" +dnl --enable-jit: check whether they want to enable the jit +AC_ARG_ENABLE(jit, + AS_HELP_STRING(--enable-jit, + [Enable Just In Time Compiling (default is YES)]),, + enableval=default) +if test ${enableval} = "no" then - AC_MSG_ERROR([GNU Make required but not found]) + AC_SUBST(JIT,[[]]) +else + case "$llvm_cv_target_architecture" in + x86) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;; + Sparc) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;; + PowerPC) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;; + *) AC_SUBST(JIT,[[]]) ;; + esac fi -dnl Checks for other tools +dnl Find the LLVM GCC-based C/C++ front end +AC_ARG_WITH(llvmgccdir, + AS_HELP_STRING(--with-llvmgccdir,[Location of LLVM GCC front-end]), + AC_SUBST(LLVMGCCDIR,[$withval])) + +dnl Provide some defaults for LLVMGCC for UIUC environments. +if test "x$LLVMGCCDIR" = x ; then + case "$llvm_cv_platform_type" in + Linux) + if test -d /home/vadve/lattner/local/x86/llvm-gcc ; then + AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/]) + fi + ;; + SunOS) + if test -d /home/vadve/lattner/local/sparc/llvm-gcc ; then + AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/]) + fi + ;; + esac +fi + +dnl===-----------------------------------------------------------------------=== +dnl=== +dnl=== SECTION 4: Check for programs we need and that they are the right version +dnl=== +dnl===-----------------------------------------------------------------------=== + +dnl Check for compilation tools +AC_PROG_CPP +AC_PROG_CC(gcc) +AC_PROG_CXX(g++) AC_PROG_FLEX AC_PROG_BISON + +dnl Check for libtool and the library that has dlopen function (which must come +dnl before the AC_PROG_LIBTOOL check in order to enable dlopening libraries with +dnl libtool). AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL -AC_PATH_PROG(TAR,[tar],[gtar]) + +dnl Check for the tools that the makefiles require +AC_CHECK_GNU_MAKE +AC_PROG_LN_S +AC_PATH_PROG(FIND, [find], [find]) +AC_PATH_PROG(GREP, [grep], [grep]) +AC_PATH_PROG(MKDIR,[mkdir],[mkdir]) +AC_PATH_PROG(MV, [mv], [mv]) +AC_PROG_RANLIB +AC_PATH_PROG(RM, [rm], [rm]) +AC_PATH_PROG(SED, [sed], [sed]) +AC_PATH_PROG(TAR, [tar],[gtar]) + +dnl Find the install program +AC_PROG_INSTALL dnl Checks for tools we can get away with not having: AC_PATH_PROG(DOT,[dot],[true dot]) AC_PATH_PROG(ETAGS,[etags],[true etags]) + +dnl Check for optional testing tools +AC_PATH_PROG(PYTHON,[python],[true python]) +AC_PATH_PROG(QMTEST,[qmtest],[true qmtest]) +AC_PATH_PROG(RUNTEST,[runtest],[true runtest]) + +dnl Determine if the linker supports the -R option. +AC_LINK_USE_R + dnl Check if we know how to tell etags we are using C++: etags_version=`$ETAGS --version 2>&1` case "$etags_version" in @@ -219,38 +262,67 @@ *) ETAGSFLAGS="" ;; esac AC_SUBST(ETAGSFLAGS,$ETAGSFLAGS) -AC_PATH_PROG(PYTHON,[python],[true python]) + +AC_MSG_CHECKING([tool compatibility]) + +dnl Ensure that compilation tools are GCC; we use GCC specific extensions +if test "$GCC" != "yes" +then + AC_MSG_ERROR([gcc required but not found]) +fi +dnl Ensure that compilation tools are GCC; we use GCC specific extensions +if test "$GXX" != "yes" +then + AC_MSG_ERROR([g++ required but not found]) +fi + +dnl Verify that GCC is version 3.0 or higher +gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1` +if test "$gccmajor" -lt "3" +then + AC_MSG_ERROR([gcc 3.x required, but you have a lower version]) +fi + +dnl Check for GNU Make. We use its extensions, so don't build without it +if test -z "$llvm_cv_gnu_make_command" +then + AC_MSG_ERROR([GNU Make required but not found]) +fi + +dnl Tool compatibility is okay if we make it here. +AC_MSG_RESULT([ok]) + +dnl Generate warnings for things not found but not strictly needed if test "$PYTHON" = "false" ; then - AC_MSG_WARN([Python is required for the test suite, but it was not found]) + AC_MSG_WARN([Python is required for the test suite, but it was not found]) fi -AC_PATH_PROG(QMTEST,[qmtest],[true qmtest]) if test "$QMTEST" = "false" ; then - AC_MSG_WARN([QMTest is required for the test suite, but it was not found]) + AC_MSG_WARN([QMTest is required for the test suite, but it was not found]) fi -AC_PATH_PROG(RUNTEST,[runtest],[true runtest]) if test "$RUNTEST" = "false" ; then AC_MSG_WARN([runtest (Deja-Gnu) is required for the test sute, but it was not found]) fi - -dnl Verify that the version of python available is high enough for qmtest pyversion=`$PYTHON -V 2>&1 | cut -d\ -f2` pymajor=`echo $pyversion | cut -d. -f1` pyminor=`echo $pyversion | cut -d. -f2` - -if test "$pymajor" -ge "2" -then - if test "$pymajor" -eq "2" - then - if test "$pyminor" -lt "2" - then - AC_MSG_WARN([QMTest requires Python 2.2 or later]) - fi - fi +if test "$pymajor" -ge "2" ; then + if test "$pymajor" -eq "2" ; then + if test "$pyminor" -lt "2" ; then + AC_MSG_WARN([QMTest requires Python 2.2 or later]) + fi + fi else - AC_MSG_WARN([QMTest requires Python 2.2 or later]) + AC_MSG_WARN([QMTest requires Python 2.2 or later]) fi -dnl Checks for libraries: +AC_MSG_RESULT([]) + +dnl===-----------------------------------------------------------------------=== +dnl=== +dnl=== SECTION 5: Check for libraries +dnl=== +dnl===-----------------------------------------------------------------------=== + dnl libelf is for sparc only; we can ignore it if we don't have it AC_CHECK_LIB(elf, elf_begin) @@ -264,7 +336,6 @@ else AC_SUBST([HAVE_ZLIB],[0]) fi - AC_CHECK_LIB(bz2,BZ2_bzCompressInit,[bzip2_found=1],[bzip2_found=0]) if test $bzip2_found -eq 1 ; then AC_DEFINE([HAVE_BZIP2],[1], @@ -281,145 +352,131 @@ not be available])) dnl dlopen() is required for plugin support. -AC_SEARCH_LIBS(dlopen,dl,AC_DEFINE([HAVE_DLOPEN],[1],[Define if dlopen() is available on this platform.]),AC_MSG_WARN([dlopen() not found - disabling plugin support])) +AC_SEARCH_LIBS(dlopen,dl,AC_DEFINE([HAVE_DLOPEN],[1], + [Define if dlopen() is available on this platform.]), + AC_MSG_WARN([dlopen() not found - disabling plugin support])) dnl mallinfo is optional; the code can compile (minus features) without it -AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo() is available on this platform.])) +AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1], + [Define if mallinfo() is available on this platform.])) dnl pthread locking functions are optional - but llvm will not be thread-safe dnl without locks. -AC_SEARCH_LIBS(pthread_mutex_lock,pthread,AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],[Have pthread_mutex_lock])) -dnl AC_SUBST(HAVE_PTHREAD_MUTEX_LOCK) +AC_SEARCH_LIBS(pthread_mutex_lock,pthread, + AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1], + [Have pthread_mutex_lock])) + +dnl===-----------------------------------------------------------------------=== +dnl=== +dnl=== SECTION 6: Check for header files +dnl=== +dnl===-----------------------------------------------------------------------=== -dnl Checks for header files. dnl We don't check for ancient stuff or things that are guaranteed to be there dnl by the C++ standard. We always use the versions of C headers. AC_HEADER_STDC -AC_HEADER_SYS_WAIT -dnl Checks for POSIX and other various system-specific header files -AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h unistd.h malloc.h sys/mman.h sys/resource.h dlfcn.h ltdl.h link.h execinfo.h windows.h bzlib.h zlib.h]) +dnl However, we do need some system specific header files. Generally we're +dnl looking for POSIX headers. +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS([sys/time.h sys/mman.h sys/resource.h sys/time.h sys/types.h]) +AC_CHECK_HEADERS([bzlib.h dlfcn.h execinfo.h fcntl.h limits.h link.h ltdl.h]) +AC_CHECK_HEADERS([malloc.h unistd.h windows.h zlib.h]) +AC_HEADER_TIME +AC_HEADER_MMAP_ANONYMOUS dnl Check for things that need to be included in public headers, and so dnl for which we may not have access to a HAVE_* preprocessor #define. dnl (primarily used in DataTypes.h) -AC_CHECK_HEADER([sys/types.h]) -AC_CHECK_HEADER([inttypes.h]) -AC_CHECK_HEADER([stdint.h]) +AC_CHECK_HEADERS([inttypes.h stdint.h]) + +dnl===-----------------------------------------------------------------------=== +dnl=== +dnl=== SECTION 7: Check for types and structures +dnl=== +dnl===-----------------------------------------------------------------------=== -dnl Check for types AC_TYPE_PID_T AC_TYPE_SIZE_T +AC_TYPE_SIGNAL +AC_STRUCT_TM AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found])) AC_CHECK_TYPES([uint64_t],, - AC_CHECK_TYPES([u_int64_t],, - AC_MSG_ERROR([Type uint64_t or u_int64_t required but not found]))) -AC_HEADER_TIME -AC_STRUCT_TM + AC_CHECK_TYPES([u_int64_t],, + AC_MSG_ERROR([Type uint64_t or u_int64_t required but not found]))) -dnl Check for various C features -AC_C_PRINTF_A +dnl===-----------------------------------------------------------------------=== +dnl=== +dnl=== SECTION 8: Check for specific functions needed +dnl=== +dnl===-----------------------------------------------------------------------=== -dnl Check for the endianness of the target -AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little])) +AC_CHECK_FUNCS([backtrace getcwd gettimeofday isatty getrusage mkstemp]) +AC_CHECK_FUNCS([strdup strtoq strtoll]) +AC_C_PRINTF_A +AC_FUNC_ALLOCA +AC_FUNC_RAND48 -dnl Check for C++ extensions +dnl Check for variations in the Standard C++ library and STL. These macros are +dnl provided by LLVM in the autoconf/m4 directory. AC_CXX_HAVE_HASH_MAP AC_CXX_HAVE_HASH_SET AC_CXX_HAVE_STD_ITERATOR AC_CXX_HAVE_BI_ITERATOR AC_CXX_HAVE_FWD_ITERATOR - AC_FUNC_ISNAN AC_FUNC_ISINF -AC_FUNC_RAND48 -dnl Checks for library functions. -AC_FUNC_ALLOCA +dnl Check for mmap and mprotect support. We need both to do the JIT and for +dnl bytecode loading, etc. AC_FUNC_MMAP +AC_FUNC_MMAP_FILE +AC_CHECK_FUNC(mprotect,, + AC_MSG_ERROR([Function mprotect() required but not found])) + if test "$ac_cv_func_mmap_fixed_mapped" = "no" then - AC_MSG_WARN([mmap() required but not found]) + AC_MSG_WARN([mmap() required but not found]) fi -AC_FUNC_MMAP_FILE if test "$ac_cv_func_mmap_file" = "no" then - AC_MSG_WARN([mmap() of files required but not found]) + AC_MSG_WARN([mmap() of files required but not found]) fi -AC_HEADER_MMAP_ANONYMOUS -AC_TYPE_SIGNAL -AC_CHECK_FUNCS(getcwd gettimeofday strdup strtoq strtoll backtrace isatty mkstemp getrusage) -AC_CHECK_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found])) -dnl Determine if the linker supports the -R option. -AC_LINK_USE_R - -dnl --enable/--with command-line options: -dnl Check whether they want to do an optimized build: -AC_ARG_ENABLE(optimized,AS_HELP_STRING(--enable-optimized,Compile with optimizations enabled (default is NO)),,enableval=no) -if test ${enableval} = "no" -then - AC_SUBST(ENABLE_OPTIMIZED,[[]]) -else - AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]]) -fi +dnl===-----------------------------------------------------------------------=== +dnl=== +dnl=== SECTION 9: Additional checks, variables, etc. +dnl=== +dnl===-----------------------------------------------------------------------=== + +dnl Figure out if there's an executable llvm-gcc in the llvmgccdir. +AC_CACHE_CHECK([for llvm-gcc],[llvm_cv_llvmgcc], +[llvm_cv_llvmgcc='llvmgcc_not_found' +if test -d "$LLVMGCCDIR" ; then + if test -x "$LLVMGCCDIR/bin/gcc" ; then + llvm_cv_llvmgcc="$LLVMGCCDIR/bin/gcc" + fi +fi]) -dnl JIT Option -AC_ARG_ENABLE(jit,AS_HELP_STRING(--enable-jit,Enable Just In Time Compiling (default is YES)),,enableval=default) -if test ${enableval} = "no" -then - AC_SUBST(JIT,[[]]) -else - case $target in - *i*86*) - AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) - ;; - *sparc*) - AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) - ;; - *) - AC_SUBST(JIT,[[]]) - ;; - esac -fi +dnl See if the llvmgcc executable can compile to LLVM assembly +AC_CACHE_CHECK([whether llvm-gcc is sane],[llvm_cv_llvmgcc_sanity], +[llvm_cv_llvmgcc_sanity="no" +if test -x "$llvm_cv_llvmgcc" ; then + cp /dev/null conftest.c + "$llvm_cv_llvmgcc" -S -o - conftest.c | grep implementation > /dev/null 2>&1 + if test $? -eq 0 ; then + llvm_cv_llvmgcc_sanity="yes" + fi + rm conftest.c +fi]) -dnl Find the LLVM GCC-based C/C++ front end -AC_ARG_WITH(llvmgccdir,AS_HELP_STRING(--with-llvmgccdir,Location of LLVM GCC front-end),AC_SUBST(LLVMGCCDIR,[$withval])) -AC_MSG_CHECKING([for llvm-gcc]) -LLVM_GCC_CHECK=no -if test -d "$LLVMGCCDIR" -then - if test -x "$LLVMGCCDIR/bin/gcc" - then - LLVM_GCC_CHECK="$LLVMGCCDIR/bin/gcc" - fi -fi -llvmgccwarn=no -AC_MSG_RESULT($LLVM_GCC_CHECK) -if test "$LLVM_GCC_CHECK" = "no" -then - llvmgccwarn=yes -fi -AC_MSG_CHECKING([whether llvm-gcc is sane]) -LLVM_GCC_SANE=no -if test -x "$LLVM_GCC_CHECK" -then - cp /dev/null conftest.c - "$LLVM_GCC_CHECK" -S -o - conftest.c | grep implementation > /dev/null 2>&1 - if test $? -eq 0 - then - LLVM_GCC_SANE=yes - fi - rm conftest.c - llvmcc1path=`"$LLVM_GCC_CHECK" --print-prog-name=cc1` - AC_SUBST(LLVMCC1,$llvmcc1path) - llvmcc1pluspath=`"$LLVM_GCC_CHECK" --print-prog-name=cc1plus` - AC_SUBST(LLVMCC1PLUS,$llvmcc1pluspath) -fi -AC_MSG_RESULT($LLVM_GCC_SANE) -if test "$LLVM_GCC_SANE" = "no" -then - llvmgccwarn=yes +dnl Since we have a sane llvmgcc, identify it and its sub-tools +if test "$llvm_cv_llvmgcc_sanity" = "yes" ; then + AC_SUBST(LLVMGCC,"$llvm_cv_llvmgcc") + llvmcc1path=`"$llvm_cv_llvmgcc" --print-prog-name=cc1` + AC_SUBST(LLVMCC1,$llvmcc1path) + llvmcc1pluspath=`"$llvm_cv_llvmgcc" --print-prog-name=cc1plus` + AC_SUBST(LLVMCC1PLUS,$llvmcc1pluspath) fi dnl Get libtool's idea of what the shared library suffix is. @@ -433,8 +490,8 @@ [Extension that shared libraries have, e.g., ".so".]) # Translate the various configuration directories and other basic -# information into substitutions that will end up in config.h.in so -# that these configured values can be hard-wired into a program. +# information into substitutions that will end up in Makefile.config.in +# that these configured values can be used by the makefiles eval LLVM_PREFIX="${prefix}"; eval LLVM_BINDIR="${prefix}/bin"; eval LLVM_LIBDIR="${prefix}/lib"; @@ -455,37 +512,84 @@ AC_SUBST(LLVM_INFODIR) AC_SUBST(LLVM_MANDIR) AC_SUBST(LLVM_CONFIGTIME) -AC_DEFINE_UNQUOTED(LLVM_PREFIX,"$LLVM_PREFIX", [Installation prefix directory]) -AC_DEFINE_UNQUOTED(LLVM_BINDIR, "$LLVM_BINDIR", [Installation directory for binary executables]) -AC_DEFINE_UNQUOTED(LLVM_LIBDIR, "$LLVM_LIBDIR", [Installation directory for libraries]) -AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DATADIR", [Installation directory for data files]) -AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DOCSDIR", [Installation directory for documentation]) -AC_DEFINE_UNQUOTED(LLVM_ETCDIR, "$LLVM_ETCDIR", [Installation directory for config files]) -AC_DEFINE_UNQUOTED(LLVM_INCLUDEDIR, "$LLVM_INCLUDEDIR", [Installation directory for include files]) -AC_DEFINE_UNQUOTED(LLVM_INFODIR, "$LLVM_INFODIR", [Installation directory for .info files]) -AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR", [Installation directory for man pages]) -AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME", [Time at which LLVM was configured]) -dnl Create the output files +# Place the various directores into the config.h file as #defines so that we +# can know about the installation paths within LLVM. +AC_DEFINE_UNQUOTED(LLVM_PREFIX,"$LLVM_PREFIX", + [Installation prefix directory]) +AC_DEFINE_UNQUOTED(LLVM_BINDIR, "$LLVM_BINDIR", + [Installation directory for binary executables]) +AC_DEFINE_UNQUOTED(LLVM_LIBDIR, "$LLVM_LIBDIR", + [Installation directory for libraries]) +AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DATADIR", + [Installation directory for data files]) +AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DOCSDIR", + [Installation directory for documentation]) +AC_DEFINE_UNQUOTED(LLVM_ETCDIR, "$LLVM_ETCDIR", + [Installation directory for config files]) +AC_DEFINE_UNQUOTED(LLVM_INCLUDEDIR, "$LLVM_INCLUDEDIR", + [Installation directory for include files]) +AC_DEFINE_UNQUOTED(LLVM_INFODIR, "$LLVM_INFODIR", + [Installation directory for .info files]) +AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR", + [Installation directory for man pages]) +AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME", + [Time at which LLVM was configured]) + +dnl===-----------------------------------------------------------------------=== +dnl=== +dnl=== SECTION 10: Specify the output files and generate it +dnl=== +dnl===-----------------------------------------------------------------------=== + +dnl Configure header files +AC_CONFIG_HEADERS(include/llvm/Config/config.h) + +AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h]) +AC_CONFIG_HEADERS([include/llvm/ADT/hash_map]) +AC_CONFIG_HEADERS([include/llvm/ADT/hash_set]) +AC_CONFIG_HEADERS([include/llvm/Support/ThreadSupport.h]) +AC_CONFIG_HEADERS([include/llvm/ADT/iterator]) + +dnl Configure the makefile's configuration data +AC_CONFIG_FILES([Makefile.config]) + +dnl Configure llvmc's configuration files +AC_CONFIG_FILES([tools/llvmc/st tools/llvmc/cpp tools/llvmc/ll tools/llvmc/c]) + +dnl Do special configuration of Makefiles +AC_CONFIG_MAKEFILE(Makefile) +AC_CONFIG_MAKEFILE(Makefile.common) +AC_CONFIG_MAKEFILE(examples/Makefile) +AC_CONFIG_MAKEFILE(lib/Makefile) +AC_CONFIG_MAKEFILE(runtime/Makefile) +AC_CONFIG_MAKEFILE(test/Makefile) +AC_CONFIG_MAKEFILE(test/Makefile.tests) +AC_CONFIG_MAKEFILE(test/QMTest/llvm.py) +AC_CONFIG_MAKEFILE(test/QMTest/llvmdb.py) +AC_CONFIG_MAKEFILE(tools/Makefile) +AC_CONFIG_MAKEFILE(tools/Makefile.JIT) +AC_CONFIG_MAKEFILE(utils/Makefile) +AC_CONFIG_MAKEFILE(projects/Makefile) + +dnl Finally, crank out the output AC_OUTPUT dnl Warn if we don't have a compression library if test $bzip2_found -ne 1 ; then - if test $zlib_found -ne 1 ; then - AC_MSG_WARN([*** Neither zlib nor bzip2 compression libraries were found.]) - AC_MSG_WARN([*** Bytecode archives will not support compression!]) - AC_MSG_WARN([*** To correct, install the libraries and and re-run configure.]) - fi + if test $zlib_found -ne 1 ; then + AC_MSG_WARN([*** Neither zlib nor bzip2 compression libraries were found.]) + AC_MSG_WARN([*** Bytecode archives will not support compression!]) + AC_MSG_WARN([*** To correct, install the libraries and and re-run configure.]) + fi fi dnl Warn loudly if llvm-gcc was not obviously working -if test $llvmgccwarn = yes -then - AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not]) - AC_MSG_WARN([***** appear to be working.]) - AC_MSG_WARN([***** ]) - AC_MSG_WARN([***** Please check configure's --with-llvmgccdir option.]) - AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,]) - AC_MSG_WARN([***** but you should be able to build the llvm tools.]) +if test "$llvm_cv_llvmgcc_sanity" = "no" ; then + AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not]) + AC_MSG_WARN([***** appear to be working.]) + AC_MSG_WARN([***** ]) + AC_MSG_WARN([***** Please check configure's --with-llvmgccdir option.]) + AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,]) + AC_MSG_WARN([***** but you should be able to build the llvm tools.]) fi - From reid at x10sys.com Wed Nov 24 22:51:15 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 24 Nov 2004 22:51:15 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200411250451.WAA15183@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.137 -> 1.138 --- Log message: For PR256: http://llvm.cs.uiuc.edu/PR256 : * cache more values * standardize cache value names * organize configure script per autoconf recommendations (10 sections) * Eliminate some redundancies and complexities in the script * Provide better documentation in the script. --- Diffs of the changes: (+4104 -2896) Index: llvm/configure diff -u llvm/configure:1.137 llvm/configure:1.138 --- llvm/configure:1.137 Tue Nov 23 17:48:45 2004 +++ llvm/configure Wed Nov 24 22:51:04 2004 @@ -7,6 +7,8 @@ # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +# +# $LLVM_COPYRIGHT ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -427,7 +429,7 @@ PACKAGE_STRING='llvm 1.4' PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu' -ac_unique_file=""Makefile.config.in"" +ac_unique_file="lib/VMCore/Module.cpp" ac_subdirs_all="$ac_subdirs_all projects/sample" ac_subdirs_all="$ac_subdirs_all projects/Stacker" ac_subdirs_all="$ac_subdirs_all projects/llvm-test" @@ -474,7 +476,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL TAR DOT ETAGS ETAGSFLAGS PYTHON QMTEST RUNTEST HAVE_ZLIB HAVE_BZIP2 ENDIAN ALLOCA MMAP_FILE ENABLE_OPTIMIZED JIT LLVMCC1 LLVMCC1PLUS SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUD! EDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT LLVMGCCDIR CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ifGNUmake FIND GREP MKDIR MV RM SED TAR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA DOT ETAGS PYTHON QMTEST RUNTEST ETAGSFLAGS HAVE_ZLIB HAVE_BZIP2 ALLOCA MMAP_FILE LLVMGCC LLVMCC1 LLVMCC1PLUS SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR ! LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -915,22 +917,6 @@ ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias -ac_env_CXX_set=${CXX+set} -ac_env_CXX_value=$CXX -ac_cv_env_CXX_set=${CXX+set} -ac_cv_env_CXX_value=$CXX -ac_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_env_CXXFLAGS_value=$CXXFLAGS -ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_cv_env_CXXFLAGS_value=$CXXFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} @@ -939,10 +925,26 @@ ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} @@ -1032,6 +1034,8 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-optimized + --enable-jit Enable Just In Time Compiling (default is YES) --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] @@ -1039,29 +1043,27 @@ --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) - --enable-optimized Compile with optimizations enabled (default is NO) - --enable-jit Enable Just In Time Compiling (default is YES) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-llvmgccdir Location of LLVM GCC front-end --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] - --with-llvmgccdir Location of LLVM GCC front-end Some influential environment variables: - CXX C++ compiler command - CXXFLAGS C++ compiler flags + CC C compiler command + CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - CC C compiler command - CFLAGS C compiler flags CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags @@ -1171,6 +1173,8 @@ Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. + +$LLVM_COPYRIGHT _ACEOF exit 0 fi @@ -1516,6 +1520,14 @@ +LLVM_COPYRIGHT="Copyright (c) 2003-2005 U University of Illinois at Urbana-Champaign." + + + + + + + ac_aux_dir= for ac_dir in autoconf $srcdir/autoconf; do if test -f $ac_dir/install-sh; then @@ -1542,13 +1554,12 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - if test ${srcdir} != "." ; then - if test -f ${srcdir}/include/llvm/Config/config.h ; then - { { echo "$as_me:$LINENO: error: Already configured in ${srcdir}" >&5 + if test -f ${srcdir}/include/llvm/Config/config.h ; then + { { echo "$as_me:$LINENO: error: Already configured in ${srcdir}" >&5 echo "$as_me: error: Already configured in ${srcdir}" >&2;} { (exit 1); exit 1; }; } - fi + fi fi for i in `ls ${srcdir}/projects` @@ -1600,141 +1611,6 @@ fi done - ac_config_headers="$ac_config_headers include/llvm/Config/config.h" - - - ac_config_files="$ac_config_files Makefile.config tools/llvmc/st tools/llvmc/cpp tools/llvmc/ll tools/llvmc/c" - - ac_config_headers="$ac_config_headers include/llvm/Support/DataTypes.h" - - ac_config_headers="$ac_config_headers include/llvm/ADT/hash_map" - - ac_config_headers="$ac_config_headers include/llvm/ADT/hash_set" - - ac_config_headers="$ac_config_headers include/llvm/Support/ThreadSupport.h" - - ac_config_headers="$ac_config_headers include/llvm/ADT/iterator" - - - ac_config_commands="$ac_config_commands Makefile" - - - ac_config_commands="$ac_config_commands Makefile.common" - - - ac_config_commands="$ac_config_commands examples/Makefile" - - - ac_config_commands="$ac_config_commands lib/Makefile" - - - ac_config_commands="$ac_config_commands runtime/Makefile" - - - ac_config_commands="$ac_config_commands test/Makefile" - - - ac_config_commands="$ac_config_commands test/Makefile.tests" - - - ac_config_commands="$ac_config_commands test/QMTest/llvm.py" - - - ac_config_commands="$ac_config_commands test/QMTest/llvmdb.py" - - - ac_config_commands="$ac_config_commands tools/Makefile" - - - ac_config_commands="$ac_config_commands tools/Makefile.JIT" - - - ac_config_commands="$ac_config_commands utils/Makefile" - - - ac_config_commands="$ac_config_commands projects/Makefile" - - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || @@ -1819,133 +1695,83 @@ NONENONEs,x,x, && program_prefix=${target_alias}- - echo "$as_me:$LINENO: checking support for generic build operating system" >&5 echo $ECHO_N "checking support for generic build operating system... $ECHO_C" >&6 -case $build in - *-*-aix*) - OS=AIX - - platform_type="AIX" - ;; - *-*-cygwin*) - OS=Cygwin - - platform_type="Cygwin" - ;; - *-*-darwin*) - OS=Darwin - - platform_type="Darwin" - ;; - *-*-freebsd*) - OS=Linux - - platform_type="FreeBSD" - ;; - *-*-interix*) - OS=SunOS - - platform_type="Interix" - ;; - *-*-linux*) - OS=Linux - - platform_type="Linux" - if test -d /home/vadve/lattner/local/x86/llvm-gcc - then - LLVMGCCDIR=/home/vadve/lattner/local/x86/llvm-gcc/ - - fi - ;; - *-*-solaris*) - OS=SunOS - - platform_type="SunOS" - if test -d /home/vadve/lattner/local/sparc/llvm-gcc - then - LLVMGCCDIR=/home/vadve/lattner/local/sparc/llvm-gcc/ - - fi - ;; - *-*-win32*) - OS=Win32 - - platform_type="Win32" - ;; - *-*-mingw*) - OS=Win32 - - platform_type="Win32" - ;; - *) - OS=Unknown - - platform_type="Unknown" - ;; +if test "${llvm_cv_platform_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $build in + *-*-aix*) llvm_cv_platform_type="AIX" ;; + *-*-cygwin*) llvm_cv_platform_type="Cygwin" ;; + *-*-darwin*) llvm_cv_platform_type="Darwin" ;; + *-*-freebsd*) llvm_cv_platform_type="FreeBSD" ;; + *-*-interix*) llvm_cv_platform_type="Interix" ;; + *-*-linux*) llvm_cv_platform_type="Linux" ;; + *-*-solaris*) llvm_cv_platform_type="SunOS" ;; + *-*-win32*) llvm_cv_platform_type="Win32" ;; + *-*-mingw*) llvm_cv_platform_type="Win32" ;; + *) llvm_cv_platform_type="Unknown" ;; esac +fi +echo "$as_me:$LINENO: result: $llvm_cv_platform_type" >&5 +echo "${ECHO_T}$llvm_cv_platform_type" >&6 -if test "$platform_type" = "Unknown" ; then - { { echo "$as_me:$LINENO: error: Platform is unknown, configure can't continue" >&5 -echo "$as_me: error: Platform is unknown, configure can't continue" >&2;} +if test "$llvm_cv_platform_type" = "Unknown" ; then + { { echo "$as_me:$LINENO: error: Operating system platform is unknown, configure can't continue" >&5 +echo "$as_me: error: Operating system platform is unknown, configure can't continue" >&2;} { (exit 1); exit 1; }; } fi - ac_config_links="$ac_config_links lib/System/platform:lib/System/$platform_type" - +OS=$llvm_cv_platform_type -echo "$as_me:$LINENO: checking target architecture" >&5 -echo $ECHO_N "checking target architecture... $ECHO_C" >&6 -case $target in - sparc*-*-solaris*) target=sparcv9-sun-solaris2.8 + ac_config_links="$ac_config_links lib/System/platform:lib/System/$platform_type" - ;; -esac case $target in - i*86-*) - ARCH="x86" - ARCH=x86 + sparc*-*-solaris*) target=sparcv9-sun-solaris2.8 - ;; - sparc*-*) - ARCH="Sparc" - ARCH=Sparc + ;; +esac - ;; - powerpc*-*) - ARCH="PowerPC" - ARCH=PowerPC +echo "$as_me:$LINENO: checking target architecture" >&5 +echo $ECHO_N "checking target architecture... $ECHO_C" >&6 +if test "${llvm_cv_target_arch+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $target in + i*86-*) llvm_cv_target_arch="x86" ;; + sparc*-*) llvm_cv_target_arch="Sparc" ;; + powerpc*-*) llvm_cv_target_arch="PowerPC" ;; + *) llvm_cv_target_arch="Unknown" ;; +esac +fi +echo "$as_me:$LINENO: result: $llvm_cv_target_arch" >&5 +echo "${ECHO_T}$llvm_cv_target_arch" >&6 - ;; - *) - ARCH="Unknown" - ARCH=Unknown +if test "$llvm_cv_target_arch" = "Unknown" ; then + { echo "$as_me:$LINENO: WARNING: Configuring LLVM for an unknown target archicture" >&5 +echo "$as_me: WARNING: Configuring LLVM for an unknown target archicture" >&2;} +fi - ;; -esac +ARCH=$llvm_cv_target_arch -echo "$as_me:$LINENO: result: $ARCH" >&5 -echo "${ECHO_T}$ARCH" >&6 -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CXX+set}" = set; then +if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -1954,7 +1780,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -1963,31 +1789,27 @@ fi fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6 +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi - test -n "$CXX" && break - done fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -1996,7 +1818,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" + ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2005,26 +1827,254 @@ fi fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6 +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_CXX" && break + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - CXX=$ac_ct_CXX fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 + "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 @@ -2062,8 +2112,8 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 -echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 @@ -2106,9 +2156,9 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C++ compiler cannot create executables +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C++ compiler cannot create executables +echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi @@ -2119,8 +2169,8 @@ # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 -echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2135,10 +2185,10 @@ if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs. + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C++ compiled programs. +echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } @@ -2243,9 +2293,9 @@ echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -2275,7 +2325,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 @@ -2296,18 +2346,18 @@ ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu +ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 -GXX=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -CXXFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cxx_g+set}" = set; then +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -2334,7 +2384,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 @@ -2347,33 +2397,179 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_prog_cxx_g=yes + ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cxx_g=no +ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" else - CXXFLAGS="-g" + CFLAGS="-g" fi else - if test "$GXX" = yes; then - CXXFLAGS="-O2" + if test "$GCC" = yes; then + CFLAGS="-O2" else - CXXFLAGS= + CFLAGS= fi fi -for ac_declaration in \ +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ @@ -2406,7 +2602,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 @@ -2451,7 +2647,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 @@ -2479,147 +2675,39 @@ echo '#endif' >>confdefs.h fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in gcc - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in gcc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include +#include int main () { -#ifndef __GNUC__ - choke me +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros #endif ; @@ -2648,38 +2736,22 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include +#include int main () { +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif ; return 0; @@ -2707,102 +2779,43 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes + ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no +ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + _ascii (); _ebcdic (); ; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext +rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? @@ -2824,185 +2837,152 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration -#include int main () { -exit (42); - ; - return 0; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - : + ac_cv_c_bigendian=no else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + ENDIAN=big + ;; + no) + ENDIAN=little + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + + + +# Check whether --enable-optimized or --disable-optimized was given. +if test "${enable_optimized+set}" = set; then + enableval="$enable_optimized" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + enableval=no +fi; +if test ${enableval} = "no" ; then + ENABLE_OPTIMIZED= + +else + ENABLE_OPTIMIZED=ENABLE_OPTIMIZED=1 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test "$GCC" != "yes" +# Check whether --enable-jit or --disable-jit was given. +if test "${enable_jit+set}" = set; then + enableval="$enable_jit" + +else + enableval=default +fi; +if test ${enableval} = "no" then - { { echo "$as_me:$LINENO: error: gcc required but not found" >&5 -echo "$as_me: error: gcc required but not found" >&2;} - { (exit 1); exit 1; }; } + JIT= + +else + case "$llvm_cv_target_architecture" in + x86) JIT=TARGET_HAS_JIT=1 + ;; + Sparc) JIT=TARGET_HAS_JIT=1 + ;; + PowerPC) JIT=TARGET_HAS_JIT=1 + ;; + *) JIT= + ;; + esac +fi + + +# Check whether --with-llvmgccdir or --without-llvmgccdir was given. +if test "${with_llvmgccdir+set}" = set; then + withval="$with_llvmgccdir" + LLVMGCCDIR=$withval + +fi; + +if test "x$LLVMGCCDIR" = x ; then + case "$llvm_cv_platform_type" in + Linux) + if test -d /home/vadve/lattner/local/x86/llvm-gcc ; then + LLVMGCCDIR=/home/vadve/lattner/local/x86/llvm-gcc/ + + fi + ;; + SunOS) + if test -d /home/vadve/lattner/local/sparc/llvm-gcc ; then + LLVMGCCDIR=/home/vadve/lattner/local/sparc/llvm-gcc/ + + fi + ;; + esac fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3237,71 +3217,65 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test "$GXX" != "yes" -then - { { echo "$as_me:$LINENO: error: g++ required but not found" >&5 -echo "$as_me: error: g++ required but not found" >&2;} - { (exit 1); exit 1; }; } -fi - -gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1` -if test "$gccmajor" -lt "3" -then - { { echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5 -echo "$as_me: error: gcc 3.x required, but you have a lower version" >&2;} - { (exit 1); exit 1; }; } -fi - - echo "$as_me:$LINENO: checking for GNU make" >&5 -echo $ECHO_N "checking for GNU make... $ECHO_C" >&6 -if test "${_cv_gnu_make_command+set}" = set; then +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in gcc + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - _cv_gnu_make_command='' ; - for a in "$MAKE" make gmake gnumake ; do - if test -z "$a" ; then continue ; fi ; - if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then - _cv_gnu_make_command=$a ; - break; - fi - done ; - -fi -echo "$as_me:$LINENO: result: $_cv_gnu_make_command" >&5 -echo "${ECHO_T}$_cv_gnu_make_command" >&6 ; - if test "x$_cv_gnu_make_command" != "x" ; then - ifGNUmake='' ; - else - ifGNUmake='#' ; - echo "$as_me:$LINENO: result: \"Not found\"" >&5 -echo "${ECHO_T}\"Not found\"" >&6; - fi - + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -if test -z "$_cv_gnu_make_command" -then - { { echo "$as_me:$LINENO: error: GNU Make required but not found" >&5 -echo "$as_me: error: GNU Make required but not found" >&2;} - { (exit 1); exit 1; }; } fi - - -echo "$as_me:$LINENO: checking " >&5 -echo $ECHO_N "checking ... $ECHO_C" >&6 -if test "${ac_cv_has_flex+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - for ac_prog in flex lex + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in gcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_LEX+set}" = set; then +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3310,7 +3284,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LEX="$ac_prog" + ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3319,53 +3293,74 @@ fi fi -LEX=$ac_cv_prog_LEX -if test -n "$LEX"; then - echo "$as_me:$LINENO: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6 +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi - test -n "$LEX" && break + test -n "$ac_ct_CC" && break done -test -n "$LEX" || LEX=":" -if test -z "$LEXLIB" -then - echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 -echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 -if test "${ac_cv_lib_fl_yywrap+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfl $LIBS" -cat >conftest.$ac_ext <<_ACEOF + CC=$ac_ct_CC +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); int main () { -yywrap (); +#ifndef __GNUC__ + choke me +#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3379,60 +3374,52 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_fl_yywrap=yes + ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_fl_yywrap=no +ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + fi -echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 -if test $ac_cv_lib_fl_yywrap = yes; then - LEXLIB="-lfl" -else - echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 -echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 -if test "${ac_cv_lib_l_yywrap+set}" = set; then +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ll $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); int main () { -yywrap (); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3446,83 +3433,110 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_l_yywrap=yes + ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_l_yywrap=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 -if test $ac_cv_lib_l_yywrap = yes; then - LEXLIB="-ll" -fi - +ac_cv_prog_cc_g=no fi - +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - -if test "x$LEX" != "x:"; then - echo "$as_me:$LINENO: checking lex output file root" >&5 -echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 -if test "${ac_cv_prog_lex_root+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # The minimal lex program is just a single line: %%. But some broken lexes -# (Solaris, I think it was) want two %% lines, so accommodate them. -cat >conftest.l <<_ACEOF -%% -%% -_ACEOF -{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 - (eval $LEX conftest.l) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -if test -f lex.yy.c; then - ac_cv_prog_lex_root=lex.yy -elif test -f lexyy.c; then - ac_cv_prog_lex_root=lexyy +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi else - { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 -echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} - { (exit 1); exit 1; }; } -fi + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 -rm -f conftest.l -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root - -echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 -echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 -if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # POSIX says lex can declare yytext either as a pointer or an array; the -# default is implementation-dependent. Figure out which it is, since -# not all implementations provide the %pointer and %array declarations. -ac_cv_prog_lex_yytext_pointer=no -echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c -ac_save_LIBS=$LIBS -LIBS="$LIBS $LEXLIB" + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -`cat $LEX_OUTPUT_ROOT.c` +/* confdefs.h. */ _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3536,13 +3550,797 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_prog_lex_yytext_pointer=yes + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +echo "$as_me:$LINENO: checking " >&5 +echo $ECHO_N "checking ... $ECHO_C" >&6 +if test "${ac_cv_has_flex+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + +if test -z "$LEXLIB" +then + echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 +echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 +if test "${ac_cv_lib_fl_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_fl_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_fl_yywrap=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 +if test $ac_cv_lib_fl_yywrap = yes; then + LEXLIB="-lfl" +else + echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 +echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 +if test "${ac_cv_lib_l_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ll $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_l_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_l_yywrap=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 +if test $ac_cv_lib_l_yywrap = yes; then + LEXLIB="-ll" +fi + +fi + +fi + +if test "x$LEX" != "x:"; then + echo "$as_me:$LINENO: checking lex output file root" >&5 +echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_root+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # The minimal lex program is just a single line: %%. But some broken lexes +# (Solaris, I think it was) want two %% lines, so accommodate them. +cat >conftest.l <<_ACEOF +%% +%% +_ACEOF +{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 + (eval $LEX conftest.l) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 +echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { (exit 1); exit 1; }; } +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 +rm -f conftest.l +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c +ac_save_LIBS=$LIBS +LIBS="$LIBS $LEXLIB" +cat >conftest.$ac_ext <<_ACEOF +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3580,7 +4378,7 @@ echo "$as_me:$LINENO: checking " >&5 echo $ECHO_N "checking ... $ECHO_C" >&6 -if test "${ac_cv_has_bison+set}" = set; then +if test "${llvm_cv_has_bison+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_prog in 'bison -y' byacc @@ -3626,8 +4424,8 @@ fi -echo "$as_me:$LINENO: result: $ac_cv_has_bison" >&5 -echo "${ECHO_T}$ac_cv_has_bison" >&6 +echo "$as_me:$LINENO: result: $llvm_cv_has_bison" >&5 +echo "${ECHO_T}$llvm_cv_has_bison" >&6 if test "$YACC" != "bison -y"; then { { echo "$as_me:$LINENO: error: bison not found but required" >&5 echo "$as_me: error: bison not found but required" >&2;} @@ -3639,6 +4437,7 @@ + # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -4190,7 +4989,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4193 "configure"' > conftest.$ac_ext + echo '#line 4992 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5064,7 +5863,7 @@ # Provide some information about the compiler. -echo "$as_me:5067:" \ +echo "$as_me:5866:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -6121,11 +6920,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6124: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6923: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6128: \$? = $ac_status" >&5 + echo "$as_me:6927: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6364,11 +7163,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6367: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7166: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6371: \$? = $ac_status" >&5 + echo "$as_me:7170: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6424,11 +7223,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6427: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7226: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6431: \$? = $ac_status" >&5 + echo "$as_me:7230: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8609,7 +9408,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:11702: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10907: \$? = $ac_status" >&5 + echo "$as_me:11706: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10960,11 +11759,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10963: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11762: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10967: \$? = $ac_status" >&5 + echo "$as_me:11766: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12321,7 +13120,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:14058: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13263: \$? = $ac_status" >&5 + echo "$as_me:14062: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13316,11 +14115,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13319: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14118: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13323: \$? = $ac_status" >&5 + echo "$as_me:14122: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15355,11 +16154,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15358: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16157: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15362: \$? = $ac_status" >&5 + echo "$as_me:16161: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15598,11 +16397,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15601: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16400: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15605: \$? = $ac_status" >&5 + echo "$as_me:16404: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15658,11 +16457,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15661: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16460: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15665: \$? = $ac_status" >&5 + echo "$as_me:16464: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17843,7 +18642,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 +echo $ECHO_N "checking for GNU make... $ECHO_C" >&6 +if test "${llvm_cv_gnu_make_command+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + llvm_cv_gnu_make_command='' + for a in "$MAKE" make gmake gnumake ; do + if test -z "$a" ; then continue ; fi ; + if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) + then + llvm_cv_gnu_make_command=$a ; + break; + fi + done +fi +echo "$as_me:$LINENO: result: $llvm_cv_gnu_make_command" >&5 +echo "${ECHO_T}$llvm_cv_gnu_make_command" >&6 + if test "x$llvm_cv_gnu_make_command" != "x" ; then + ifGNUmake='' ; + else + ifGNUmake='#' ; + echo "$as_me:$LINENO: result: \"Not found\"" >&5 +echo "${ECHO_T}\"Not found\"" >&6; + fi + + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +# Extract the first word of "find", so it can be a program name with args. +set dummy find; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_FIND+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $FIND in + [\\/]* | ?:[\\/]*) + ac_cv_path_FIND="$FIND" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_FIND" && ac_cv_path_FIND="find" + ;; +esac +fi +FIND=$ac_cv_path_FIND + +if test -n "$FIND"; then + echo "$as_me:$LINENO: result: $FIND" >&5 +echo "${ECHO_T}$FIND" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "grep", so it can be a program name with args. +set dummy grep; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_GREP="$GREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep" + ;; +esac +fi +GREP=$ac_cv_path_GREP + +if test -n "$GREP"; then + echo "$as_me:$LINENO: result: $GREP" >&5 +echo "${ECHO_T}$GREP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "mkdir", so it can be a program name with args. +set dummy mkdir; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MKDIR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MKDIR in + [\\/]* | ?:[\\/]*) + ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_MKDIR" && ac_cv_path_MKDIR="mkdir" + ;; +esac +fi +MKDIR=$ac_cv_path_MKDIR + +if test -n "$MKDIR"; then + echo "$as_me:$LINENO: result: $MKDIR" >&5 +echo "${ECHO_T}$MKDIR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "mv", so it can be a program name with args. +set dummy mv; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MV+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MV in + [\\/]* | ?:[\\/]*) + ac_cv_path_MV="$MV" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_MV" && ac_cv_path_MV="mv" + ;; +esac +fi +MV=$ac_cv_path_MV + +if test -n "$MV"; then + echo "$as_me:$LINENO: result: $MV" >&5 +echo "${ECHO_T}$MV" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +# Extract the first word of "rm", so it can be a program name with args. +set dummy rm; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_RM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $RM in + [\\/]* | ?:[\\/]*) + ac_cv_path_RM="$RM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_RM" && ac_cv_path_RM="rm" + ;; +esac +fi +RM=$ac_cv_path_RM + +if test -n "$RM"; then + echo "$as_me:$LINENO: result: $RM" >&5 +echo "${ECHO_T}$RM" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "sed", so it can be a program name with args. +set dummy sed; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $SED in + [\\/]* | ?:[\\/]*) + ac_cv_path_SED="$SED" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_SED" && ac_cv_path_SED="sed" + ;; +esac +fi +SED=$ac_cv_path_SED + +if test -n "$SED"; then + echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + # Extract the first word of "tar", so it can be a program name with args. set dummy tar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -19000,6 +20157,86 @@ fi +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + # Extract the first word of "dot", so it can be a program name with args. set dummy dot; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -19080,13 +20317,6 @@ echo "${ECHO_T}no" >&6 fi -etags_version=`$ETAGS --version 2>&1` -case "$etags_version" in - *Eexuberant*) ETAGSFLAGS="--language-force=c++" ;; - *GNU\ Emacs*) ETAGSFLAGS="-l c++" ;; - *) ETAGSFLAGS="" ;; -esac -ETAGSFLAGS=$ETAGSFLAGS # Extract the first word of "python", so it can be a program name with args. set dummy python; ac_word=$2 @@ -19128,10 +20358,6 @@ echo "${ECHO_T}no" >&6 fi -if test "$PYTHON" = "false" ; then - { echo "$as_me:$LINENO: WARNING: Python is required for the test suite, but it was not found" >&5 -echo "$as_me: WARNING: Python is required for the test suite, but it was not found" >&2;} -fi # Extract the first word of "qmtest", so it can be a program name with args. set dummy qmtest; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -19172,10 +20398,6 @@ echo "${ECHO_T}no" >&6 fi -if test "$QMTEST" = "false" ; then - { echo "$as_me:$LINENO: WARNING: QMTest is required for the test suite, but it was not found" >&5 -echo "$as_me: WARNING: QMTest is required for the test suite, but it was not found" >&2;} -fi # Extract the first word of "runtest", so it can be a program name with args. set dummy runtest; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -19216,30 +20438,160 @@ echo "${ECHO_T}no" >&6 fi + +echo "$as_me:$LINENO: checking for compiler -Wl,-R option" >&5 +echo $ECHO_N "checking for compiler -Wl,-R option... $ECHO_C" >&6 +if test "${llvm_cv_link_use_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + oldcflags="$CFLAGS" + CFLAGS="$CFLAGS -Wl,-R." + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int main() { return 0; } + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + llvm_cv_link_use_r=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +llvm_cv_link_use_r=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$oldcflags" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $llvm_cv_link_use_r" >&5 +echo "${ECHO_T}$llvm_cv_link_use_r" >&6 +if test "$llvm_cv_link_use_r" = yes ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LINK_R 1 +_ACEOF + + fi + + +etags_version=`$ETAGS --version 2>&1` +case "$etags_version" in + *Eexuberant*) ETAGSFLAGS="--language-force=c++" ;; + *GNU\ Emacs*) ETAGSFLAGS="-l c++" ;; + *) ETAGSFLAGS="" ;; +esac +ETAGSFLAGS=$ETAGSFLAGS + + +echo "$as_me:$LINENO: checking tool compatibility" >&5 +echo $ECHO_N "checking tool compatibility... $ECHO_C" >&6 + +if test "$GCC" != "yes" +then + { { echo "$as_me:$LINENO: error: gcc required but not found" >&5 +echo "$as_me: error: gcc required but not found" >&2;} + { (exit 1); exit 1; }; } +fi +if test "$GXX" != "yes" +then + { { echo "$as_me:$LINENO: error: g++ required but not found" >&5 +echo "$as_me: error: g++ required but not found" >&2;} + { (exit 1); exit 1; }; } +fi + +gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1` +if test "$gccmajor" -lt "3" +then + { { echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5 +echo "$as_me: error: gcc 3.x required, but you have a lower version" >&2;} + { (exit 1); exit 1; }; } +fi + +if test -z "$llvm_cv_gnu_make_command" +then + { { echo "$as_me:$LINENO: error: GNU Make required but not found" >&5 +echo "$as_me: error: GNU Make required but not found" >&2;} + { (exit 1); exit 1; }; } +fi + +echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 + +if test "$PYTHON" = "false" ; then + { echo "$as_me:$LINENO: WARNING: Python is required for the test suite, but it was not found" >&5 +echo "$as_me: WARNING: Python is required for the test suite, but it was not found" >&2;} +fi +if test "$QMTEST" = "false" ; then + { echo "$as_me:$LINENO: WARNING: QMTest is required for the test suite, but it was not found" >&5 +echo "$as_me: WARNING: QMTest is required for the test suite, but it was not found" >&2;} +fi if test "$RUNTEST" = "false" ; then { echo "$as_me:$LINENO: WARNING: runtest (Deja-Gnu) is required for the test sute, but it was not found" >&5 echo "$as_me: WARNING: runtest (Deja-Gnu) is required for the test sute, but it was not found" >&2;} fi - pyversion=`$PYTHON -V 2>&1 | cut -d\ -f2` pymajor=`echo $pyversion | cut -d. -f1` pyminor=`echo $pyversion | cut -d. -f2` - -if test "$pymajor" -ge "2" -then - if test "$pymajor" -eq "2" - then - if test "$pyminor" -lt "2" - then - { echo "$as_me:$LINENO: WARNING: QMTest requires Python 2.2 or later" >&5 +if test "$pymajor" -ge "2" ; then + if test "$pymajor" -eq "2" ; then + if test "$pyminor" -lt "2" ; then + { echo "$as_me:$LINENO: WARNING: QMTest requires Python 2.2 or later" >&5 echo "$as_me: WARNING: QMTest requires Python 2.2 or later" >&2;} - fi - fi + fi + fi else - { echo "$as_me:$LINENO: WARNING: QMTest requires Python 2.2 or later" >&5 + { echo "$as_me:$LINENO: WARNING: QMTest requires Python 2.2 or later" >&5 echo "$as_me: WARNING: QMTest requires Python 2.2 or later" >&2;} fi +echo "$as_me:$LINENO: result: " >&5 +echo "${ECHO_T}" >&6 + + echo "$as_me:$LINENO: checking for elf_begin in -lelf" >&5 echo $ECHO_N "checking for elf_begin in -lelf... $ECHO_C" >&6 @@ -19397,7 +20749,6 @@ HAVE_ZLIB=0 fi - echo "$as_me:$LINENO: checking for BZ2_bzCompressInit in -lbz2" >&5 echo $ECHO_N "checking for BZ2_bzCompressInit in -lbz2... $ECHO_C" >&6 if test "${ac_cv_lib_bz2_BZ2_bzCompressInit+set}" = set; then @@ -20013,6 +21364,7 @@ fi + echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then @@ -20179,6 +21531,7 @@ fi + echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then @@ -20255,17 +21608,7 @@ - - - - - - - - - - -for ac_header in fcntl.h limits.h sys/time.h unistd.h malloc.h sys/mman.h sys/resource.h dlfcn.h ltdl.h link.h execinfo.h windows.h bzlib.h zlib.h +for ac_header in sys/time.h sys/mman.h sys/resource.h sys/time.h sys/types.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -20415,18 +21758,27 @@ done -if test "${ac_cv_header_sys_types_h+set}" = set; then - echo "$as_me:$LINENO: checking for sys/types.h" >&5 -echo $ECHO_N "checking for sys/types.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_types_h+set}" = set; then + + + + + + +for ac_header in bzlib.h dlfcn.h execinfo.h fcntl.h limits.h link.h ltdl.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_types_h" >&6 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -echo "$as_me:$LINENO: checking sys/types.h usability" >&5 -echo $ECHO_N "checking sys/types.h usability... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20434,7 +21786,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -20470,15 +21822,15 @@ echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -echo "$as_me:$LINENO: checking sys/types.h presence" >&5 -echo $ECHO_N "checking sys/types.h presence... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -20512,25 +21864,25 @@ # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/types.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/types.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/types.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/types.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/types.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/types.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/types.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/types.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/types.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/types.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/types.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/types.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/types.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/types.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/types.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/types.h: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## @@ -20541,170 +21893,45 @@ sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for sys/types.h" >&5 -echo $ECHO_N "checking for sys/types.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_types_h+set}" = set; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_sys_types_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_types_h" >&6 - + eval "$as_ac_Header=\$ac_header_preproc" fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -if test "${ac_cv_header_inttypes_h+set}" = set; then - echo "$as_me:$LINENO: checking for inttypes.h" >&5 -echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 -if test "${ac_cv_header_inttypes_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_inttypes_h" >&5 -echo "${ECHO_T}$ac_cv_header_inttypes_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking inttypes.h usability" >&5 -echo $ECHO_N "checking inttypes.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking inttypes.h presence" >&5 -echo $ECHO_N "checking inttypes.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +done - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: inttypes.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: inttypes.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: inttypes.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: inttypes.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: inttypes.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: inttypes.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: inttypes.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: inttypes.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: inttypes.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: inttypes.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs at cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for inttypes.h" >&5 -echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 -if test "${ac_cv_header_inttypes_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_inttypes_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_inttypes_h" >&5 -echo "${ECHO_T}$ac_cv_header_inttypes_h" >&6 -fi -if test "${ac_cv_header_stdint_h+set}" = set; then - echo "$as_me:$LINENO: checking for stdint.h" >&5 -echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdint_h+set}" = set; then +for ac_header in malloc.h unistd.h windows.h zlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdint_h" >&6 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -echo "$as_me:$LINENO: checking stdint.h usability" >&5 -echo $ECHO_N "checking stdint.h usability... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20712,7 +21939,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -20748,15 +21975,15 @@ echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -echo "$as_me:$LINENO: checking stdint.h presence" >&5 -echo $ECHO_N "checking stdint.h presence... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -20790,118 +22017,58 @@ # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: stdint.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: stdint.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: stdint.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: stdint.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: stdint.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: stdint.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: stdint.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: stdint.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: stdint.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: stdint.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: stdint.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stdint.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: stdint.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: stdint.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs at cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for stdint.h" >&5 -echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdint_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_stdint_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdint_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdint_h" >&6 - -fi - - - -echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((pid_t *) 0) - return 0; -if (sizeof (pid_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_pid_t=yes + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------------- ## +## Report this to llvmbugs at cs.uiuc.edu ## +## ----------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_pid_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6 -if test $ac_cv_type_pid_t = yes; then - : -else +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -cat >>confdefs.h <<_ACEOF -#define pid_t int +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then +done + +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -20910,14 +22077,15 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#include +#include +#include + int main () { -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; +if ((struct tm *) 0) +return 0; ; return 0; } @@ -20944,46 +22112,49 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_size_t=yes + ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_size_t=no +ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then - : -else +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then -cat >>confdefs.h <<_ACEOF -#define size_t unsigned +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 _ACEOF fi -echo "$as_me:$LINENO: checking for int64_t" >&5 -echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 -if test "${ac_cv_type_int64_t+set}" = set; then +echo "$as_me:$LINENO: checking for MAP_ANONYMOUS vs. MAP_ANON" >&5 +echo $ECHO_N "checking for MAP_ANONYMOUS vs. MAP_ANON... $ECHO_C" >&6 +if test "${ac_cv_header_mmap_anon+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#include +#include +#include int main () { -if ((int64_t *) 0) - return 0; -if (sizeof (int64_t)) - return 0; +mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0); ; return 0; } @@ -21010,52 +22181,58 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_int64_t=yes + ac_cv_header_mmap_anon=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int64_t=no +ac_cv_header_mmap_anon=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + fi -echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_int64_t" >&6 -if test $ac_cv_type_int64_t = yes; then +echo "$as_me:$LINENO: result: $ac_cv_header_mmap_anon" >&5 +echo "${ECHO_T}$ac_cv_header_mmap_anon" >&6 +if test "$ac_cv_header_mmap_anon" = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_INT64_T 1 +cat >>confdefs.h <<\_ACEOF +#define HAVE_MMAP_ANONYMOUS _ACEOF - -else - { { echo "$as_me:$LINENO: error: Type int64_t required but not found" >&5 -echo "$as_me: error: Type int64_t required but not found" >&2;} - { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint64_t+set}" = set; then + + + +for ac_header in inttypes.h stdint.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -int -main () -{ -if ((uint64_t *) 0) - return 0; -if (sizeof (uint64_t)) - return 0; - ; - return 0; -} +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -21079,99 +22256,114 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_uint64_t=yes + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uint64_t=no +ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 -if test $ac_cv_type_uint64_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT64_T 1 -_ACEOF - +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 -else - echo "$as_me:$LINENO: checking for u_int64_t" >&5 -echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((u_int64_t *) 0) - return 0; -if (sizeof (u_int64_t)) - return 0; - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_u_int64_t=yes + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------------- ## +## Report this to llvmbugs at cs.uiuc.edu ## +## ----------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_u_int64_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 -if test $ac_cv_type_u_int64_t = yes; then +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -cat >>confdefs.h <<_ACEOF -#define HAVE_U_INT64_T 1 +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - -else - { { echo "$as_me:$LINENO: error: Type uint64_t or u_int64_t required but not found" >&5 -echo "$as_me: error: Type uint64_t or u_int64_t required but not found" >&2;} - { (exit 1); exit 1; }; } fi -fi +done -echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 -if test "${ac_cv_header_time+set}" = set; then + + +echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21180,15 +22372,14 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include - +$ac_includes_default int main () { -if ((struct tm *) 0) -return 0; +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; ; return 0; } @@ -21215,28 +22406,30 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_header_time=yes + ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_time=no +ac_cv_type_pid_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 -if test $ac_cv_header_time = yes; then +echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +if test $ac_cv_type_pid_t = yes; then + : +else -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 +cat >>confdefs.h <<_ACEOF +#define pid_t int _ACEOF fi -echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 -if test "${ac_cv_struct_tm+set}" = set; then +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21245,13 +22438,14 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include - +$ac_includes_default int main () { -struct tm *tp; tp->tm_sec; +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; ; return 0; } @@ -21278,172 +22472,53 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_struct_tm=time.h + ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_struct_tm=sys/time.h +ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6 -if test $ac_cv_struct_tm = sys/time.h; then - -cat >>confdefs.h <<\_ACEOF -#define TM_IN_SYS_TIME 1 -_ACEOF - -fi - - - - echo "$as_me:$LINENO: checking for printf %a format specifier" >&5 -echo $ECHO_N "checking for printf %a format specifier... $ECHO_C" >&6 - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - if test "$cross_compiling" = yes; then - ac_c_printf_a=no +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : else - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#include - -int -main () -{ -volatile double A, B; -char Buffer[100]; -A = 1; -A /= 10.0; -sprintf(Buffer, "%a", A); -B = atof(Buffer); -if (A != B) - return (1); -if (A != 0x1.999999999999ap-4) - return (1); -return (0); - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define size_t unsigned _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_c_printf_a=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_c_printf_a=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - echo "$as_me:$LINENO: result: $ac_c_printf_a" >&5 -echo "${ECHO_T}$ac_c_printf_a" >&6 - if test "$ac_c_printf_a" = "yes"; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_PRINTF_A 1 -_ACEOF - - fi - - -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then +echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include - -int -main () -{ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros +#include +#ifdef signal +# undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include int main () { -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - +int i; ; return 0; } @@ -21470,38 +22545,41 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_c_bigendian=yes + ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_bigendian=no +ac_cv_type_signal=int fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +#include +#include + int main () { - _ascii (); _ebcdic (); +struct tm *tp; tp->tm_sec; ; return 0; } @@ -21528,108 +22606,44 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi + ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_struct_tm=sys/time.h fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -} +fi +echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6 +if test $ac_cv_struct_tm = sys/time.h; then + +cat >>confdefs.h <<\_ACEOF +#define TM_IN_SYS_TIME 1 _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) - ENDIAN=big - ;; - no) - ENDIAN=little - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -echo "$as_me:$LINENO: checking whether the compiler implements namespaces" >&5 -echo $ECHO_N "checking whether the compiler implements namespaces... $ECHO_C" >&6 -if test "${ac_cv_cxx_namespaces+set}" = set; then +echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -namespace Outer { namespace Inner { int i = 0; }} +$ac_includes_default int main () { -using namespace Outer::Inner; return i; +if ((int64_t *) 0) + return 0; +if (sizeof (int64_t)) + return 0; ; return 0; } @@ -21643,7 +22657,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 @@ -21656,58 +22670,49 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cxx_namespaces=yes + ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cxx_namespaces=no +ac_cv_type_int64_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_namespaces" >&5 -echo "${ECHO_T}$ac_cv_cxx_namespaces" >&6 -if test "$ac_cv_cxx_namespaces" = yes; then +echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6 +if test $ac_cv_type_int64_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_NAMESPACES +cat >>confdefs.h <<_ACEOF +#define HAVE_INT64_T 1 _ACEOF + +else + { { echo "$as_me:$LINENO: error: Type int64_t required but not found" >&5 +echo "$as_me: error: Type int64_t required but not found" >&2;} + { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking whether the compiler has defining template class std::hash_map" >&5 -echo $ECHO_N "checking whether the compiler has defining template class std::hash_map... $ECHO_C" >&6 -if test "${ac_cv_cxx_have_std_ext_hash_map+set}" = set; then +echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_NAMESPACES -using namespace std; -#endif +$ac_includes_default int main () { -hash_map t; +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; ; return 0; } @@ -21721,7 +22726,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 @@ -21734,64 +22739,44 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cxx_have_std_ext_hash_map=yes + ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cxx_have_std_ext_hash_map=no +ac_cv_type_uint64_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_have_std_ext_hash_map" >&5 -echo "${ECHO_T}$ac_cv_cxx_have_std_ext_hash_map" >&6 - if test "$ac_cv_cxx_have_std_ext_hash_map" = yes - then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STD_EXT_HASH_MAP 1 -_ACEOF - - else +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STD_EXT_HASH_MAP 0 +cat >>confdefs.h <<_ACEOF +#define HAVE_UINT64_T 1 _ACEOF - fi - echo "$as_me:$LINENO: checking whether the compiler has defining template class __gnu_cxx::hash_map" >&5 -echo $ECHO_N "checking whether the compiler has defining template class __gnu_cxx::hash_map... $ECHO_C" >&6 -if test "${ac_cv_cxx_have_gnu_ext_hash_map+set}" = set; then +else + echo "$as_me:$LINENO: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_NAMESPACES -using namespace __gnu_cxx; -#endif +$ac_includes_default int main () { -hash_map t; +if ((u_int64_t *) 0) + return 0; +if (sizeof (u_int64_t)) + return 0; ; return 0; } @@ -21805,7 +22790,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 @@ -21818,628 +22803,691 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cxx_have_gnu_ext_hash_map=yes + ac_cv_type_u_int64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cxx_have_gnu_ext_hash_map=no +ac_cv_type_u_int64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 +if test $ac_cv_type_u_int64_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_U_INT64_T 1 +_ACEOF + + +else + { { echo "$as_me:$LINENO: error: Type uint64_t or u_int64_t required but not found" >&5 +echo "$as_me: error: Type uint64_t or u_int64_t required but not found" >&2;} + { (exit 1); exit 1; }; } fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_have_gnu_ext_hash_map" >&5 -echo "${ECHO_T}$ac_cv_cxx_have_gnu_ext_hash_map" >&6 - if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes - then -cat >>confdefs.h <<\_ACEOF -#define HAVE_GNU_EXT_HASH_MAP 1 -_ACEOF - else -cat >>confdefs.h <<\_ACEOF -#define HAVE_GNU_EXT_HASH_MAP 0 -_ACEOF - fi - echo "$as_me:$LINENO: checking whether the compiler has defining template class ::hash_map" >&5 -echo $ECHO_N "checking whether the compiler has defining template class ::hash_map... $ECHO_C" >&6 -if test "${ac_cv_cxx_have_global_hash_map+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +for ac_func in backtrace getcwd gettimeofday isatty getrusage mkstemp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + int main () { -hash_map t; +return f != $ac_func; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cxx_have_global_hash_map=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cxx_have_global_hash_map=no +eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_have_global_hash_map" >&5 -echo "${ECHO_T}$ac_cv_cxx_have_global_hash_map" >&6 - if test "$ac_cv_cxx_have_global_hash_map" = yes - then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GLOBAL_HASH_MAP 1 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - else +fi +done -cat >>confdefs.h <<\_ACEOF -#define HAVE_GLOBAL_HASH_MAP 0 -_ACEOF - fi -echo "$as_me:$LINENO: checking whether the compiler has defining template class std::hash_set" >&5 -echo $ECHO_N "checking whether the compiler has defining template class std::hash_set... $ECHO_C" >&6 -if test "${ac_cv_cxx_have_std_ext_hash_set+set}" = set; then + +for ac_func in strdup strtoq strtoll +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_NAMESPACES -using namespace std; +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; #endif +#ifdef __cplusplus +} +#endif + int main () { -hash_set t; +return f != $ac_func; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cxx_have_std_ext_hash_set=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cxx_have_std_ext_hash_set=no +eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_have_std_ext_hash_set" >&5 -echo "${ECHO_T}$ac_cv_cxx_have_std_ext_hash_set" >&6 - if test "$ac_cv_cxx_have_std_ext_hash_set" = yes - then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STD_EXT_HASH_SET 1 -_ACEOF - - else - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STD_EXT_HASH_SET 0 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - fi +fi +done - echo "$as_me:$LINENO: checking whether the compiler has defining template class __gnu_cxx::hash_set" >&5 -echo $ECHO_N "checking whether the compiler has defining template class __gnu_cxx::hash_set... $ECHO_C" >&6 -if test "${ac_cv_cxx_have_gnu_ext_hash_set+set}" = set; then +echo "$as_me:$LINENO: checking if printf has the %a format character" >&5 +echo $ECHO_N "checking if printf has the %a format character... $ECHO_C" >&6 +if test "${ac_cv_printf_a+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - + if test "$cross_compiling" = yes; then + ac_c_printf_a=no +else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_NAMESPACES -using namespace __gnu_cxx; -#endif + +#include +#include + int main () { -hash_set t; + +volatile double A, B; +char Buffer[100]; +A = 1; +A /= 10.0; +sprintf(Buffer, "%a", A); +B = atof(Buffer); +if (A != B) + return (1); +if (A != 0x1.999999999999ap-4) + return (1); +return (0); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cxx_have_gnu_ext_hash_set=yes + ac_c_printf_a=yes else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cxx_have_gnu_ext_hash_set=no +( exit $ac_status ) +ac_c_printf_a=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_have_gnu_ext_hash_set" >&5 -echo "${ECHO_T}$ac_cv_cxx_have_gnu_ext_hash_set" >&6 - if test "$ac_cv_cxx_have_gnu_ext_hash_set" = yes - then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GNU_EXT_HASH_SET 1 -_ACEOF - - else +echo "$as_me:$LINENO: result: $ac_cv_printf_a" >&5 +echo "${ECHO_T}$ac_cv_printf_a" >&6 + if test "$ac_cv_printf_a" = "yes"; then cat >>confdefs.h <<\_ACEOF -#define HAVE_GNU_EXT_HASH_SET 0 +#define HAVE_PRINTF_A 1 _ACEOF fi - echo "$as_me:$LINENO: checking whether the compiler has defining template class ::hash_set" >&5 -echo $ECHO_N "checking whether the compiler has defining template class ::hash_set... $ECHO_C" >&6 -if test "${ac_cv_cxx_have_global_hash_set+set}" = set; then +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +echo "$as_me:$LINENO: checking for working alloca.h" >&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -hash_set t; return 0; +char *p = (char *) alloca (2 * sizeof (int)); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cxx_have_global_hash_set=yes + ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cxx_have_global_hash_set=no +ac_cv_working_alloca_h=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_have_global_hash_set" >&5 -echo "${ECHO_T}$ac_cv_cxx_have_global_hash_set" >&6 - if test "$ac_cv_cxx_have_global_hash_set" = yes - then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GLOBAL_HASH_SET 1 -_ACEOF - - else +echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_GLOBAL_HASH_SET 0 +#define HAVE_ALLOCA_H 1 _ACEOF - fi +fi -echo "$as_me:$LINENO: checking whether the compiler has the standard iterator" >&5 -echo $ECHO_N "checking whether the compiler has the standard iterator... $ECHO_C" >&6 -if test "${ac_cv_cxx_have_std_iterator+set}" = set; then +echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_NAMESPACES -using namespace std; +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif #endif + int main () { -iterator t; return 0; +char *p = (char *) alloca (1); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cxx_have_std_iterator=yes + ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cxx_have_std_iterator=no +ac_cv_func_alloca_works=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_have_std_iterator" >&5 -echo "${ECHO_T}$ac_cv_cxx_have_std_iterator" >&6 -if test "$ac_cv_cxx_have_std_iterator" = yes -then +echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 + +if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_STD_ITERATOR 1 +#define HAVE_ALLOCA 1 _ACEOF else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF -#define HAVE_STD_ITERATOR 0 +#define C_ALLOCA 1 _ACEOF -fi -echo "$as_me:$LINENO: checking whether the compiler has the bidirectional iterator" >&5 -echo $ECHO_N "checking whether the compiler has the bidirectional iterator... $ECHO_C" >&6 -if test "${ac_cv_cxx_have_bi_iterator+set}" = set; then +echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined(CRAY) && ! defined(CRAY2) +webecray +#else +wenotbecray +#endif - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* +fi +echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&6 +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_NAMESPACES -using namespace std; +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif + int main () { -bidirectional_iterator t; return 0; +return f != $ac_func; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cxx_have_bi_iterator=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cxx_have_bi_iterator=no +eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_have_bi_iterator" >&5 -echo "${ECHO_T}$ac_cv_cxx_have_bi_iterator" >&6 -if test "$ac_cv_cxx_have_bi_iterator" = yes -then +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_BI_ITERATOR 1 +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func _ACEOF -else - -cat >>confdefs.h <<\_ACEOF -#define HAVE_BI_ITERATOR 0 -_ACEOF + break +fi + done fi -echo "$as_me:$LINENO: checking whether the compiler has forward iterators" >&5 -echo $ECHO_N "checking whether the compiler has forward iterators... $ECHO_C" >&6 -if test "${ac_cv_cxx_have_fwd_iterator+set}" = set; then +echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - + if test "$cross_compiling" = yes; then + ac_cv_c_stack_direction=0 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_NAMESPACES -using namespace std; -#endif +int +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} + int main () { -forward_iterator t; return 0; - ; - return 0; + exit (find_stack_direction () < 0); } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cxx_have_fwd_iterator=yes + ac_cv_c_stack_direction=1 else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cxx_have_fwd_iterator=no +( exit $ac_status ) +ac_cv_c_stack_direction=-1 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_have_fwd_iterator" >&5 -echo "${ECHO_T}$ac_cv_cxx_have_fwd_iterator" >&6 -if test "$ac_cv_cxx_have_fwd_iterator" = yes -then +fi +echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 -cat >>confdefs.h <<\_ACEOF -#define HAVE_FWD_ITERATOR 1 +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF -else - -cat >>confdefs.h <<\_ACEOF -#define HAVE_FWD_ITERATOR 0 -_ACEOF fi - -echo "$as_me:$LINENO: checking for isnan in " >&5 -echo $ECHO_N "checking for isnan in ... $ECHO_C" >&6 -if test "${ac_cv_func_isnan_in_math_h+set}" = set; then +echo "$as_me:$LINENO: checking for srand48/lrand48/drand48 in " >&5 +echo $ECHO_N "checking for srand48/lrand48/drand48 in ... $ECHO_C" >&6 +if test "${ac_cv_func_rand48+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=cc @@ -22454,11 +23502,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -float f; isnan(f); +srand48(0);lrand48();drand48(); ; return 0; } @@ -22485,12 +23533,12 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_isnan_in_math_h=yes + ac_cv_func_rand48=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_isnan_in_math_h=no +ac_cv_func_rand48=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -22500,21 +23548,21 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_func_isnan_in_math_h" >&5 -echo "${ECHO_T}$ac_cv_func_isnan_in_math_h" >&6 - +echo "$as_me:$LINENO: result: $ac_cv_func_rand48" >&5 +echo "${ECHO_T}$ac_cv_func_rand48" >&6 -if test "$ac_cv_func_isnan_in_math_h" = "yes" ; then +if test "$ac_cv_func_rand48" = "yes" ; then cat >>confdefs.h <<\_ACEOF -#define HAVE_ISNAN_IN_MATH_H 1 +#define HAVE_RAND48 1 _ACEOF fi -echo "$as_me:$LINENO: checking for isnan in " >&5 -echo $ECHO_N "checking for isnan in ... $ECHO_C" >&6 -if test "${ac_cv_func_isnan_in_cmath+set}" = set; then + +echo "$as_me:$LINENO: checking whether the compiler implements namespaces" >&5 +echo $ECHO_N "checking whether the compiler implements namespaces... $ECHO_C" >&6 +if test "${ac_cv_cxx_namespaces+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=cc @@ -22523,17 +23571,17 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +namespace Outer { namespace Inner { int i = 0; }} int main () { -float f; isnan(f); +using namespace Outer::Inner; return i; ; return 0; } @@ -22560,54 +23608,58 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_isnan_in_cmath=yes + ac_cv_cxx_namespaces=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_isnan_in_cmath=no +ac_cv_cxx_namespaces=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -fi -echo "$as_me:$LINENO: result: $ac_cv_func_isnan_in_cmath" >&5 -echo "${ECHO_T}$ac_cv_func_isnan_in_cmath" >&6 -if test "$ac_cv_func_isnan_in_cmath" = "yes" ; then +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_namespaces" >&5 +echo "${ECHO_T}$ac_cv_cxx_namespaces" >&6 +if test "$ac_cv_cxx_namespaces" = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_ISNAN_IN_CMATH 1 +#define HAVE_NAMESPACES _ACEOF fi -echo "$as_me:$LINENO: checking for std::isnan in " >&5 -echo $ECHO_N "checking for std::isnan in ... $ECHO_C" >&6 -if test "${ac_cv_func_std_isnan_in_cmath+set}" = set; then +echo "$as_me:$LINENO: checking whether the compiler has defining template class std::hash_map" >&5 +echo $ECHO_N "checking whether the compiler has defining template class std::hash_map... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_std_ext_hash_map+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif int main () { -float f; std::isnan(f); +hash_map t; ; return 0; } @@ -22634,12 +23686,12 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_std_isnan_in_cmath=yes + ac_cv_cxx_have_std_ext_hash_map=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_std_isnan_in_cmath=no +ac_cv_cxx_have_std_ext_hash_map=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -22649,40 +23701,49 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_func_std_isnan_in_cmath" >&5 -echo "${ECHO_T}$ac_cv_func_std_isnan_in_cmath" >&6 - -if test "$ac_cv_func_std_isnan_in_cmath" = "yes" ; then +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_std_ext_hash_map" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_std_ext_hash_map" >&6 + if test "$ac_cv_cxx_have_std_ext_hash_map" = yes + then cat >>confdefs.h <<\_ACEOF -#define HAVE_STD_ISNAN_IN_CMATH 1 +#define HAVE_STD_EXT_HASH_MAP 1 _ACEOF -fi + else + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STD_EXT_HASH_MAP 0 +_ACEOF + fi -echo "$as_me:$LINENO: checking for isinf in " >&5 -echo $ECHO_N "checking for isinf in ... $ECHO_C" >&6 -if test "${ac_cv_func_isinf_in_math_h+set}" = set; then + echo "$as_me:$LINENO: checking whether the compiler has defining template class __gnu_cxx::hash_map" >&5 +echo $ECHO_N "checking whether the compiler has defining template class __gnu_cxx::hash_map... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_gnu_ext_hash_map+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include +#ifdef HAVE_NAMESPACES +using namespace __gnu_cxx; +#endif int main () { -float f; isinf(f); +hash_map t; ; return 0; } @@ -22709,12 +23770,12 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_isinf_in_math_h=yes + ac_cv_cxx_have_gnu_ext_hash_map=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_isinf_in_math_h=no +ac_cv_cxx_have_gnu_ext_hash_map=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -22724,39 +23785,46 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_func_isinf_in_math_h" >&5 -echo "${ECHO_T}$ac_cv_func_isinf_in_math_h" >&6 +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_gnu_ext_hash_map" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_gnu_ext_hash_map" >&6 + if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes + then -if test "$ac_cv_func_isinf_in_math_h" = "yes" ; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_GNU_EXT_HASH_MAP 1 +_ACEOF + + else cat >>confdefs.h <<\_ACEOF -#define HAVE_ISINF_IN_MATH_H 1 +#define HAVE_GNU_EXT_HASH_MAP 0 _ACEOF -fi + fi -echo "$as_me:$LINENO: checking for isinf in " >&5 -echo $ECHO_N "checking for isinf in ... $ECHO_C" >&6 -if test "${ac_cv_func_isinf_in_cmath+set}" = set; then + echo "$as_me:$LINENO: checking whether the compiler has defining template class ::hash_map" >&5 +echo $ECHO_N "checking whether the compiler has defining template class ::hash_map... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_global_hash_map+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -float f; isinf(f); +hash_map t; ; return 0; } @@ -22783,12 +23851,12 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_isinf_in_cmath=yes + ac_cv_cxx_have_global_hash_map=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_isinf_in_cmath=no +ac_cv_cxx_have_global_hash_map=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -22798,39 +23866,49 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_func_isinf_in_cmath" >&5 -echo "${ECHO_T}$ac_cv_func_isinf_in_cmath" >&6 +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_global_hash_map" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_global_hash_map" >&6 + if test "$ac_cv_cxx_have_global_hash_map" = yes + then -if test "$ac_cv_func_isinf_in_cmath" = "yes" ; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_GLOBAL_HASH_MAP 1 +_ACEOF + + else cat >>confdefs.h <<\_ACEOF -#define HAVE_ISINF_IN_CMATH 1 +#define HAVE_GLOBAL_HASH_MAP 0 _ACEOF -fi + fi -echo "$as_me:$LINENO: checking for std::isinf in " >&5 -echo $ECHO_N "checking for std::isinf in ... $ECHO_C" >&6 -if test "${ac_cv_func_std_isinf_in_cmath+set}" = set; then +echo "$as_me:$LINENO: checking whether the compiler has defining template class std::hash_set" >&5 +echo $ECHO_N "checking whether the compiler has defining template class std::hash_set... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_std_ext_hash_set+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif int main () { -float f; std::isinf(f)} +hash_set t; ; return 0; } @@ -22857,12 +23935,12 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_std_isinf_in_cmath=yes + ac_cv_cxx_have_std_ext_hash_set=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_std_isinf_in_cmath=no +ac_cv_cxx_have_std_ext_hash_set=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -22872,39 +23950,49 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_func_std_isinf_in_cmath" >&5 -echo "${ECHO_T}$ac_cv_func_std_isinf_in_cmath" >&6 +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_std_ext_hash_set" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_std_ext_hash_set" >&6 + if test "$ac_cv_cxx_have_std_ext_hash_set" = yes + then -if test "$ac_cv_func_std_isinf_in_cmath" = "yes" ; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_STD_EXT_HASH_SET 1 +_ACEOF + + else cat >>confdefs.h <<\_ACEOF -#define HAVE_STD_ISINF_IN_CMATH 1 +#define HAVE_STD_EXT_HASH_SET 0 _ACEOF -fi + fi -echo "$as_me:$LINENO: checking for finite in " >&5 -echo $ECHO_N "checking for finite in ... $ECHO_C" >&6 -if test "${ac_cv_func_finite_in_ieeefp_h+set}" = set; then + echo "$as_me:$LINENO: checking whether the compiler has defining template class __gnu_cxx::hash_set" >&5 +echo $ECHO_N "checking whether the compiler has defining template class __gnu_cxx::hash_set... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_gnu_ext_hash_set+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include +#ifdef HAVE_NAMESPACES +using namespace __gnu_cxx; +#endif int main () { -float f; finite(f); +hash_set t; ; return 0; } @@ -22931,12 +24019,12 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_finite_in_ieeefp_h=yes + ac_cv_cxx_have_gnu_ext_hash_set=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_finite_in_ieeefp_h=no +ac_cv_cxx_have_gnu_ext_hash_set=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -22946,41 +24034,46 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_func_finite_in_ieeefp_h" >&5 -echo "${ECHO_T}$ac_cv_func_finite_in_ieeefp_h" >&6 - -if test "$ac_cv_func_finite_in_ieeefp_h" = "yes" ; then +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_gnu_ext_hash_set" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_gnu_ext_hash_set" >&6 + if test "$ac_cv_cxx_have_gnu_ext_hash_set" = yes + then cat >>confdefs.h <<\_ACEOF -#define HAVE_FINITE_IN_IEEEFP_H 1 +#define HAVE_GNU_EXT_HASH_SET 1 _ACEOF -fi + else +cat >>confdefs.h <<\_ACEOF +#define HAVE_GNU_EXT_HASH_SET 0 +_ACEOF + fi -echo "$as_me:$LINENO: checking for srand48/lrand48/drand48 in " >&5 -echo $ECHO_N "checking for srand48/lrand48/drand48 in ... $ECHO_C" >&6 -if test "${ac_cv_func_rand48+set}" = set; then + echo "$as_me:$LINENO: checking whether the compiler has defining template class ::hash_set" >&5 +echo $ECHO_N "checking whether the compiler has defining template class ::hash_set... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_global_hash_set+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -srand48(0);lrand48();drand48(); +hash_set t; return 0; ; return 0; } @@ -23007,12 +24100,12 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_rand48=yes + ac_cv_cxx_have_global_hash_set=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_rand48=no +ac_cv_cxx_have_global_hash_set=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -23022,402 +24115,379 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_func_rand48" >&5 -echo "${ECHO_T}$ac_cv_func_rand48" >&6 - -if test "$ac_cv_func_rand48" = "yes" ; then +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_global_hash_set" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_global_hash_set" >&6 + if test "$ac_cv_cxx_have_global_hash_set" = yes + then cat >>confdefs.h <<\_ACEOF -#define HAVE_RAND48 1 +#define HAVE_GLOBAL_HASH_SET 1 _ACEOF -fi + else +cat >>confdefs.h <<\_ACEOF +#define HAVE_GLOBAL_HASH_SET 0 +_ACEOF -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 -if test "${ac_cv_working_alloca_h+set}" = set; then + fi + +echo "$as_me:$LINENO: checking whether the compiler has the standard iterator" >&5 +echo $ECHO_N "checking whether the compiler has the standard iterator... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_std_iterator+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif int main () { -char *p = (char *) alloca (2 * sizeof (int)); +iterator t; return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_working_alloca_h=yes + ac_cv_cxx_have_std_iterator=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_working_alloca_h=no +ac_cv_cxx_have_std_iterator=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + fi -echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 -if test $ac_cv_working_alloca_h = yes; then +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_std_iterator" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_std_iterator" >&6 +if test "$ac_cv_cxx_have_std_iterator" = yes +then cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 +#define HAVE_STD_ITERATOR 1 _ACEOF -fi - -echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6 -if test "${ac_cv_func_alloca_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STD_ITERATOR 0 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif +fi + +echo "$as_me:$LINENO: checking whether the compiler has the bidirectional iterator" >&5 +echo $ECHO_N "checking whether the compiler has the bidirectional iterator... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_bi_iterator+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif int main () { -char *p = (char *) alloca (1); +bidirectional_iterator t; return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_alloca_works=yes + ac_cv_cxx_have_bi_iterator=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_alloca_works=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +ac_cv_cxx_have_bi_iterator=no fi -echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test $ac_cv_func_alloca_works = yes; then + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_bi_iterator" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_bi_iterator" >&6 +if test "$ac_cv_cxx_have_bi_iterator" = yes +then cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 +#define HAVE_BI_ITERATOR 1 _ACEOF else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. - -ALLOCA=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 +#define HAVE_BI_ITERATOR 0 _ACEOF +fi -echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 -if test "${ac_cv_os_cray+set}" = set; then +echo "$as_me:$LINENO: checking whether the compiler has forward iterators" >&5 +echo $ECHO_N "checking whether the compiler has forward iterators... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_fwd_iterator+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined(CRAY) && ! defined(CRAY2) -webecray -#else -wenotbecray -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -fi -echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6 -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} +#include +#ifdef HAVE_NAMESPACES +using namespace std; #endif - int main () { -return f != $ac_func; +forward_iterator t; return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + ac_cv_cxx_have_fwd_iterator=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" +ac_cv_cxx_have_fwd_iterator=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_fwd_iterator" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_fwd_iterator" >&6 +if test "$ac_cv_cxx_have_fwd_iterator" = yes +then -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func +cat >>confdefs.h <<\_ACEOF +#define HAVE_FWD_ITERATOR 1 _ACEOF - break -fi +else + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FWD_ITERATOR 0 +_ACEOF - done fi -echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 -if test "${ac_cv_c_stack_direction+set}" = set; then + +echo "$as_me:$LINENO: checking for isnan in " >&5 +echo $ECHO_N "checking for isnan in ... $ECHO_C" >&6 +if test "${ac_cv_func_isnan_in_math_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else - cat >conftest.$ac_ext <<_ACEOF + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} - +#include int main () { - exit (find_stack_direction () < 0); +float f; isnan(f); + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_c_stack_direction=1 -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + ac_cv_func_isnan_in_math_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_isnan_in_math_h=no fi -echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF +fi +echo "$as_me:$LINENO: result: $ac_cv_func_isnan_in_math_h" >&5 +echo "${ECHO_T}$ac_cv_func_isnan_in_math_h" >&6 -fi +if test "$ac_cv_func_isnan_in_math_h" = "yes" ; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_ISNAN_IN_MATH_H 1 +_ACEOF +fi -for ac_header in stdlib.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +echo "$as_me:$LINENO: checking for isnan in " >&5 +echo $ECHO_N "checking for isnan in ... $ECHO_C" >&6 +if test "${ac_cv_func_isnan_in_cmath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +#include +int +main () +{ +float f; isnan(f); + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -23428,7 +24498,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 @@ -23441,501 +24511,351 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_func_isnan_in_cmath=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no +ac_cv_func_isnan_in_cmath=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF +fi +echo "$as_me:$LINENO: result: $ac_cv_func_isnan_in_cmath" >&5 +echo "${ECHO_T}$ac_cv_func_isnan_in_cmath" >&6 + +if test "$ac_cv_func_isnan_in_cmath" = "yes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ISNAN_IN_CMATH 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for std::isnan in " >&5 +echo $ECHO_N "checking for std::isnan in ... $ECHO_C" >&6 +if test "${ac_cv_func_std_isnan_in_cmath+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +#include +int +main () +{ +float f; std::isnan(f); + ; + return 0; +} _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_std_isnan_in_cmath=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs at cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - +ac_cv_func_std_isnan_in_cmath=no fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi +echo "$as_me:$LINENO: result: $ac_cv_func_std_isnan_in_cmath" >&5 +echo "${ECHO_T}$ac_cv_func_std_isnan_in_cmath" >&6 -done - +if test "$ac_cv_func_std_isnan_in_cmath" = "yes" ; then -for ac_func in getpagesize -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<\_ACEOF +#define HAVE_STD_ISNAN_IN_CMATH 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif +fi + +echo "$as_me:$LINENO: checking for isinf in " >&5 +echo $ECHO_N "checking for isinf in ... $ECHO_C" >&6 +if test "${ac_cv_func_isinf_in_math_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include int main () { -return f != $ac_func; +float f; isinf(f); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + ac_cv_func_isinf_in_math_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" +ac_cv_func_isinf_in_math_h=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +echo "$as_me:$LINENO: result: $ac_cv_func_isinf_in_math_h" >&5 +echo "${ECHO_T}$ac_cv_func_isinf_in_math_h" >&6 + +if test "$ac_cv_func_isinf_in_math_h" = "yes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ISINF_IN_MATH_H 1 _ACEOF fi -done -echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then +echo "$as_me:$LINENO: checking for isinf in " >&5 +echo $ECHO_N "checking for isinf in ... $ECHO_C" >&6 +if test "${ac_cv_func_isinf_in_cmath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no -else - cat >conftest.$ac_ext <<_ACEOF + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -/* malloc might have been renamed as rpl_malloc. */ -#undef malloc - -/* Thanks to Mike Haertel and Jim Avera for this test. - Here is a matrix of mmap possibilities: - mmap private not fixed - mmap private fixed at somewhere currently unmapped - mmap private fixed at somewhere already mapped - mmap shared not fixed - mmap shared fixed at somewhere currently unmapped - mmap shared fixed at somewhere already mapped - For private mappings, we should verify that changes cannot be read() - back from the file, nor mmap's back from the file at a different - address. (There have been systems where private was not correctly - implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the file system buffer cache - like early versions of FreeBSD and possibly contemporary NetBSD.) - For shared mappings, we should conversely verify that changes get - propagated back to all the places they're supposed to be. - - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ - -#include -#include - -#if !STDC_HEADERS && !HAVE_STDLIB_H -char *malloc (); -#endif - -/* This mess was copied from the GNU getpagesize.h. */ -#if !HAVE_GETPAGESIZE -/* Assume that all systems that can run configure have sys/param.h. */ -# if !HAVE_SYS_PARAM_H -# define HAVE_SYS_PARAM_H 1 -# endif - -# ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ -# if HAVE_SYS_PARAM_H -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* no CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ -# ifdef PAGESIZE -# define getpagesize() PAGESIZE -# endif /* PAGESIZE */ -# endif /* no NBPC */ -# endif /* no NBPG */ -# endif /* no EXEC_PAGESIZE */ -# else /* no HAVE_SYS_PARAM_H */ -# define getpagesize() 8192 /* punt totally */ -# endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ - +#include int main () { - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize (); - - /* First, make a file with some known garbage in it. */ - data = (char *) malloc (pagesize); - if (!data) - exit (1); - for (i = 0; i < pagesize; ++i) - *(data + i) = rand (); - umask (0); - fd = creat ("conftest.mmap", 0600); - if (fd < 0) - exit (1); - if (write (fd, data, pagesize) != pagesize) - exit (1); - close (fd); - - /* Next, try to mmap the file at a fixed address which already has - something else allocated at it. If we can, also make sure that - we see the same garbage. */ - fd = open ("conftest.mmap", O_RDWR); - if (fd < 0) - exit (1); - data2 = (char *) malloc (2 * pagesize); - if (!data2) - exit (1); - data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - exit (1); - - /* Finally, make sure that changes to the mapped area do not - percolate back to the file as seen by read(). (This is a bug on - some variants of i386 svr4.0.) */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = (char *) malloc (pagesize); - if (!data3) - exit (1); - if (read (fd, data3, pagesize) != pagesize) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - exit (1); - close (fd); - exit (0); +float f; isinf(f); + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_mmap_fixed_mapped=yes + ac_cv_func_isinf_in_cmath=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_func_mmap_fixed_mapped=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 -if test $ac_cv_func_mmap_fixed_mapped = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP 1 -_ACEOF - -fi -rm -f conftest.mmap - -if test "$ac_cv_func_mmap_fixed_mapped" = "no" -then - { echo "$as_me:$LINENO: WARNING: mmap() required but not found" >&5 -echo "$as_me: WARNING: mmap() required but not found" >&2;} +ac_cv_func_isinf_in_cmath=no fi -echo "$as_me:$LINENO: checking for mmap of files" >&5 -echo $ECHO_N "checking for mmap of files... $ECHO_C" >&6 -if test "${ac_cv_func_mmap_file+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_file=no +fi +echo "$as_me:$LINENO: result: $ac_cv_func_isinf_in_cmath" >&5 +echo "${ECHO_T}$ac_cv_func_isinf_in_cmath" >&6 + +if test "$ac_cv_func_isinf_in_cmath" = "yes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ISINF_IN_CMATH 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for std::isinf in " >&5 +echo $ECHO_N "checking for std::isinf in ... $ECHO_C" >&6 +if test "${ac_cv_func_std_isinf_in_cmath+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - /* confdefs.h. */ + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#include -#include -#include - +#include int main () { - - int fd; - fd = creat ("foo",0777); - fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0); - unlink ("foo"); - return (fd != (int) MAP_FAILED); +float f; std::isinf(f)} ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_mmap_file=yes + ac_cv_func_std_isinf_in_cmath=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_func_mmap_file=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +ac_cv_func_std_isinf_in_cmath=no fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap_file" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_file" >&6 -if test "$ac_cv_func_mmap_file" = yes; then +echo "$as_me:$LINENO: result: $ac_cv_func_std_isinf_in_cmath" >&5 +echo "${ECHO_T}$ac_cv_func_std_isinf_in_cmath" >&6 + +if test "$ac_cv_func_std_isinf_in_cmath" = "yes" ; then cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP_FILE +#define HAVE_STD_ISINF_IN_CMATH 1 _ACEOF - MMAP_FILE=yes - fi -if test "$ac_cv_func_mmap_file" = "no" -then - { echo "$as_me:$LINENO: WARNING: mmap() of files required but not found" >&5 -echo "$as_me: WARNING: mmap() of files required but not found" >&2;} -fi -echo "$as_me:$LINENO: checking for MAP_ANONYMOUS vs. MAP_ANON" >&5 -echo $ECHO_N "checking for MAP_ANONYMOUS vs. MAP_ANON... $ECHO_C" >&6 -if test "${ac_cv_header_mmap_anon+set}" = set; then +echo "$as_me:$LINENO: checking for finite in " >&5 +echo $ECHO_N "checking for finite in ... $ECHO_C" >&6 +if test "${ac_cv_func_finite_in_ieeefp_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include +#include int main () { -mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0); +float f; finite(f); ; return 0; } @@ -23949,7 +24869,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 @@ -23962,12 +24882,12 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_header_mmap_anon=yes + ac_cv_func_finite_in_ieeefp_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_mmap_anon=no +ac_cv_func_finite_in_ieeefp_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -23976,47 +24896,45 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - fi -echo "$as_me:$LINENO: result: $ac_cv_header_mmap_anon" >&5 -echo "${ECHO_T}$ac_cv_header_mmap_anon" >&6 -if test "$ac_cv_header_mmap_anon" = yes; then +echo "$as_me:$LINENO: result: $ac_cv_func_finite_in_ieeefp_h" >&5 +echo "${ECHO_T}$ac_cv_func_finite_in_ieeefp_h" >&6 + +if test "$ac_cv_func_finite_in_ieeefp_h" = "yes" ; then cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP_ANONYMOUS +#define HAVE_FINITE_IN_IEEEFP_H 1 _ACEOF fi -echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 -if test "${ac_cv_type_signal+set}" = set; then + + + + +for ac_header in stdlib.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#ifdef signal -# undef signal -#endif -#ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); -#else -void (*signal ()) (); -#endif - -int -main () -{ -int i; - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -24040,33 +24958,111 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_signal=void + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_signal=int +ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6 +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------------- ## +## Report this to llvmbugs at cs.uiuc.edu ## +## ----------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF +fi +done - - - - -for ac_func in getcwd gettimeofday strdup strtoq strtoll backtrace isatty mkstemp getrusage +for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -24140,32 +25136,288 @@ (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +echo "$as_me:$LINENO: checking for working mmap" >&5 +echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 +if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_mmap_fixed_mapped=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include +#include + +#if !STDC_HEADERS && !HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#if !HAVE_GETPAGESIZE +/* Assume that all systems that can run configure have sys/param.h. */ +# if !HAVE_SYS_PARAM_H +# define HAVE_SYS_PARAM_H 1 +# endif + +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# if HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +int +main () +{ + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + exit (1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + exit (1); + if (write (fd, data, pagesize) != pagesize) + exit (1); + close (fd); + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + exit (1); + data2 = (char *) malloc (2 * pagesize); + if (!data2) + exit (1); + data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + exit (1); + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + exit (1); + if (read (fd, data3, pagesize) != pagesize) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + exit (1); + close (fd); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mmap_fixed_mapped=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_mmap_fixed_mapped=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MMAP 1 +_ACEOF + +fi +rm -f conftest.mmap + +echo "$as_me:$LINENO: checking for mmap of files" >&5 +echo $ECHO_N "checking for mmap of files... $ECHO_C" >&6 +if test "${ac_cv_func_mmap_file+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + if test "$cross_compiling" = yes; then + ac_cv_func_mmap_file=no +else + cat >conftest.$ac_ext <<_ACEOF + + /* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + + int fd; + fd = creat ("foo",0777); + fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0); + unlink ("foo"); + return (fd != (int) MAP_FAILED); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + ac_cv_func_mmap_file=yes else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" +( exit $ac_status ) +ac_cv_func_mmap_file=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $ac_cv_func_mmap_file" >&5 +echo "${ECHO_T}$ac_cv_func_mmap_file" >&6 +if test "$ac_cv_func_mmap_file" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MMAP_FILE _ACEOF + MMAP_FILE=yes + fi -done echo "$as_me:$LINENO: checking for mprotect" >&5 echo $ECHO_N "checking for mprotect... $ECHO_C" >&6 @@ -24266,174 +25518,60 @@ fi - - echo "$as_me:$LINENO: checking for compiler -Wl,-R option" >&5 -echo $ECHO_N "checking for compiler -Wl,-R option... $ECHO_C" >&6 - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - oldcflags="$CFLAGS" - CFLAGS="$CFLAGS -Wl,-R." - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int main() { return 0; } - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_link_use_r=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_link_use_r=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$oldcflags" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - echo "$as_me:$LINENO: result: $ac_cv_link_use_r" >&5 -echo "${ECHO_T}$ac_cv_link_use_r" >&6 - if test "$ac_cv_link_use_r" = yes - then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LINK_R 1 -_ACEOF - - fi - - -# Check whether --enable-optimized or --disable-optimized was given. -if test "${enable_optimized+set}" = set; then - enableval="$enable_optimized" - -else - enableval=no -fi; -if test ${enableval} = "no" +if test "$ac_cv_func_mmap_fixed_mapped" = "no" then - ENABLE_OPTIMIZED= - -else - ENABLE_OPTIMIZED=ENABLE_OPTIMIZED=1 - + { echo "$as_me:$LINENO: WARNING: mmap() required but not found" >&5 +echo "$as_me: WARNING: mmap() required but not found" >&2;} fi - -# Check whether --enable-jit or --disable-jit was given. -if test "${enable_jit+set}" = set; then - enableval="$enable_jit" - -else - enableval=default -fi; -if test ${enableval} = "no" +if test "$ac_cv_func_mmap_file" = "no" then - JIT= - -else - case $target in - *i*86*) - JIT=TARGET_HAS_JIT=1 - - ;; - *sparc*) - JIT=TARGET_HAS_JIT=1 - - ;; - *) - JIT= - - ;; - esac + { echo "$as_me:$LINENO: WARNING: mmap() of files required but not found" >&5 +echo "$as_me: WARNING: mmap() of files required but not found" >&2;} fi -# Check whether --with-llvmgccdir or --without-llvmgccdir was given. -if test "${with_llvmgccdir+set}" = set; then - withval="$with_llvmgccdir" - LLVMGCCDIR=$withval - -fi; echo "$as_me:$LINENO: checking for llvm-gcc" >&5 echo $ECHO_N "checking for llvm-gcc... $ECHO_C" >&6 -LLVM_GCC_CHECK=no -if test -d "$LLVMGCCDIR" -then - if test -x "$LLVMGCCDIR/bin/gcc" - then - LLVM_GCC_CHECK="$LLVMGCCDIR/bin/gcc" - fi +if test "${llvm_cv_llvmgcc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + llvm_cv_llvmgcc='llvmgcc_not_found' +if test -d "$LLVMGCCDIR" ; then + if test -x "$LLVMGCCDIR/bin/gcc" ; then + llvm_cv_llvmgcc="$LLVMGCCDIR/bin/gcc" + fi fi -llvmgccwarn=no -echo "$as_me:$LINENO: result: $LLVM_GCC_CHECK" >&5 -echo "${ECHO_T}$LLVM_GCC_CHECK" >&6 -if test "$LLVM_GCC_CHECK" = "no" -then - llvmgccwarn=yes fi +echo "$as_me:$LINENO: result: $llvm_cv_llvmgcc" >&5 +echo "${ECHO_T}$llvm_cv_llvmgcc" >&6 + echo "$as_me:$LINENO: checking whether llvm-gcc is sane" >&5 echo $ECHO_N "checking whether llvm-gcc is sane... $ECHO_C" >&6 -LLVM_GCC_SANE=no -if test -x "$LLVM_GCC_CHECK" -then - cp /dev/null conftest.c - "$LLVM_GCC_CHECK" -S -o - conftest.c | grep implementation > /dev/null 2>&1 - if test $? -eq 0 - then - LLVM_GCC_SANE=yes - fi - rm conftest.c - llvmcc1path=`"$LLVM_GCC_CHECK" --print-prog-name=cc1` - LLVMCC1=$llvmcc1path +if test "${llvm_cv_llvmgcc_sanity+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + llvm_cv_llvmgcc_sanity="no" +if test -x "$llvm_cv_llvmgcc" ; then + cp /dev/null conftest.c + "$llvm_cv_llvmgcc" -S -o - conftest.c | grep implementation > /dev/null 2>&1 + if test $? -eq 0 ; then + llvm_cv_llvmgcc_sanity="yes" + fi + rm conftest.c +fi +fi +echo "$as_me:$LINENO: result: $llvm_cv_llvmgcc_sanity" >&5 +echo "${ECHO_T}$llvm_cv_llvmgcc_sanity" >&6 - llvmcc1pluspath=`"$LLVM_GCC_CHECK" --print-prog-name=cc1plus` - LLVMCC1PLUS=$llvmcc1pluspath +if test "$llvm_cv_llvmgcc_sanity" = "yes" ; then + LLVMGCC="$llvm_cv_llvmgcc" + + llvmcc1path=`"$llvm_cv_llvmgcc" --print-prog-name=cc1` + LLVMCC1=$llvmcc1path + + llvmcc1pluspath=`"$llvm_cv_llvmgcc" --print-prog-name=cc1plus` + LLVMCC1PLUS=$llvmcc1pluspath -fi -echo "$as_me:$LINENO: result: $LLVM_GCC_SANE" >&5 -echo "${ECHO_T}$LLVM_GCC_SANE" >&6 -if test "$LLVM_GCC_SANE" = "no" -then - llvmgccwarn=yes fi echo "$as_me:$LINENO: checking for shared library suffix" >&5 @@ -24450,8 +25588,8 @@ # Translate the various configuration directories and other basic -# information into substitutions that will end up in config.h.in so -# that these configured values can be hard-wired into a program. +# information into substitutions that will end up in Makefile.config.in +# that these configured values can be used by the makefiles eval LLVM_PREFIX="${prefix}"; eval LLVM_BINDIR="${prefix}/bin"; eval LLVM_LIBDIR="${prefix}/lib"; @@ -24473,6 +25611,9 @@ +# Place the various directores into the config.h file as #defines so that we +# can know about the installation paths within LLVM. + cat >>confdefs.h <<_ACEOF #define LLVM_PREFIX "$LLVM_PREFIX" _ACEOF @@ -24523,6 +25664,67 @@ _ACEOF + + ac_config_headers="$ac_config_headers include/llvm/Config/config.h" + + + ac_config_headers="$ac_config_headers include/llvm/Support/DataTypes.h" + + ac_config_headers="$ac_config_headers include/llvm/ADT/hash_map" + + ac_config_headers="$ac_config_headers include/llvm/ADT/hash_set" + + ac_config_headers="$ac_config_headers include/llvm/Support/ThreadSupport.h" + + ac_config_headers="$ac_config_headers include/llvm/ADT/iterator" + + + ac_config_files="$ac_config_files Makefile.config" + + + ac_config_files="$ac_config_files tools/llvmc/st tools/llvmc/cpp tools/llvmc/ll tools/llvmc/c" + + + ac_config_commands="$ac_config_commands Makefile" + + + ac_config_commands="$ac_config_commands Makefile.common" + + + ac_config_commands="$ac_config_commands examples/Makefile" + + + ac_config_commands="$ac_config_commands lib/Makefile" + + + ac_config_commands="$ac_config_commands runtime/Makefile" + + + ac_config_commands="$ac_config_commands test/Makefile" + + + ac_config_commands="$ac_config_commands test/Makefile.tests" + + + ac_config_commands="$ac_config_commands test/QMTest/llvm.py" + + + ac_config_commands="$ac_config_commands test/QMTest/llvmdb.py" + + + ac_config_commands="$ac_config_commands tools/Makefile" + + + ac_config_commands="$ac_config_commands tools/Makefile.JIT" + + + ac_config_commands="$ac_config_commands utils/Makefile" + + + ac_config_commands="$ac_config_commands projects/Makefile" + + + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -25184,10 +26386,8 @@ s, at ECHO_N@,$ECHO_N,;t t s, at ECHO_T@,$ECHO_T,;t t s, at LIBS@,$LIBS,;t t +s, at LLVM_COPYRIGHT@,$LLVM_COPYRIGHT,;t t s, at subdirs@,$subdirs,;t t -s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s, at INSTALL_DATA@,$INSTALL_DATA,;t t s, at build@,$build,;t t s, at build_cpu@,$build_cpu,;t t s, at build_vendor@,$build_vendor,;t t @@ -25201,20 +26401,22 @@ s, at target_vendor@,$target_vendor,;t t s, at target_os@,$target_os,;t t s, at OS@,$OS,;t t -s, at LLVMGCCDIR@,$LLVMGCCDIR,;t t s, at ARCH@,$ARCH,;t t -s, at CXX@,$CXX,;t t -s, at CXXFLAGS@,$CXXFLAGS,;t t +s, at ENDIAN@,$ENDIAN,;t t +s, at CC@,$CC,;t t +s, at CFLAGS@,$CFLAGS,;t t s, at LDFLAGS@,$LDFLAGS,;t t s, at CPPFLAGS@,$CPPFLAGS,;t t -s, at ac_ct_CXX@,$ac_ct_CXX,;t t +s, at ac_ct_CC@,$ac_ct_CC,;t t s, at EXEEXT@,$EXEEXT,;t t s, at OBJEXT@,$OBJEXT,;t t -s, at CC@,$CC,;t t -s, at CFLAGS@,$CFLAGS,;t t -s, at ac_ct_CC@,$ac_ct_CC,;t t +s, at ENABLE_OPTIMIZED@,$ENABLE_OPTIMIZED,;t t +s, at JIT@,$JIT,;t t +s, at LLVMGCCDIR@,$LLVMGCCDIR,;t t s, at CPP@,$CPP,;t t -s, at ifGNUmake@,$ifGNUmake,;t t +s, at CXX@,$CXX,;t t +s, at CXXFLAGS@,$CXXFLAGS,;t t +s, at ac_ct_CXX@,$ac_ct_CXX,;t t s, at LEX@,$LEX,;t t s, at LEXLIB@,$LEXLIB,;t t s, at LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t @@ -25235,20 +26437,28 @@ s, at FFLAGS@,$FFLAGS,;t t s, at ac_ct_F77@,$ac_ct_F77,;t t s, at LIBTOOL@,$LIBTOOL,;t t +s, at ifGNUmake@,$ifGNUmake,;t t +s, at FIND@,$FIND,;t t +s, at GREP@,$GREP,;t t +s, at MKDIR@,$MKDIR,;t t +s, at MV@,$MV,;t t +s, at RM@,$RM,;t t +s, at SED@,$SED,;t t s, at TAR@,$TAR,;t t +s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s, at INSTALL_DATA@,$INSTALL_DATA,;t t s, at DOT@,$DOT,;t t s, at ETAGS@,$ETAGS,;t t -s, at ETAGSFLAGS@,$ETAGSFLAGS,;t t s, at PYTHON@,$PYTHON,;t t s, at QMTEST@,$QMTEST,;t t s, at RUNTEST@,$RUNTEST,;t t +s, at ETAGSFLAGS@,$ETAGSFLAGS,;t t s, at HAVE_ZLIB@,$HAVE_ZLIB,;t t s, at HAVE_BZIP2@,$HAVE_BZIP2,;t t -s, at ENDIAN@,$ENDIAN,;t t s, at ALLOCA@,$ALLOCA,;t t s, at MMAP_FILE@,$MMAP_FILE,;t t -s, at ENABLE_OPTIMIZED@,$ENABLE_OPTIMIZED,;t t -s, at JIT@,$JIT,;t t +s, at LLVMGCC@,$LLVMGCC,;t t s, at LLVMCC1@,$LLVMCC1,;t t s, at LLVMCC1PLUS@,$LLVMCC1PLUS,;t t s, at SHLIBEXT@,$SHLIBEXT,;t t @@ -26202,29 +27412,27 @@ if test $bzip2_found -ne 1 ; then - if test $zlib_found -ne 1 ; then - { echo "$as_me:$LINENO: WARNING: *** Neither zlib nor bzip2 compression libraries were found." >&5 + if test $zlib_found -ne 1 ; then + { echo "$as_me:$LINENO: WARNING: *** Neither zlib nor bzip2 compression libraries were found." >&5 echo "$as_me: WARNING: *** Neither zlib nor bzip2 compression libraries were found." >&2;} - { echo "$as_me:$LINENO: WARNING: *** Bytecode archives will not support compression!" >&5 + { echo "$as_me:$LINENO: WARNING: *** Bytecode archives will not support compression!" >&5 echo "$as_me: WARNING: *** Bytecode archives will not support compression!" >&2;} - { echo "$as_me:$LINENO: WARNING: *** To correct, install the libraries and and re-run configure." >&5 + { echo "$as_me:$LINENO: WARNING: *** To correct, install the libraries and and re-run configure." >&5 echo "$as_me: WARNING: *** To correct, install the libraries and and re-run configure." >&2;} - fi + fi fi -if test $llvmgccwarn = yes -then - { echo "$as_me:$LINENO: WARNING: ***** llvm C/C++ front end was not found, or does not" >&5 +if test "$llvm_cv_llvmgcc_sanity" = "no" ; then + { echo "$as_me:$LINENO: WARNING: ***** llvm C/C++ front end was not found, or does not" >&5 echo "$as_me: WARNING: ***** llvm C/C++ front end was not found, or does not" >&2;} - { echo "$as_me:$LINENO: WARNING: ***** appear to be working." >&5 + { echo "$as_me:$LINENO: WARNING: ***** appear to be working." >&5 echo "$as_me: WARNING: ***** appear to be working." >&2;} - { echo "$as_me:$LINENO: WARNING: ***** " >&5 + { echo "$as_me:$LINENO: WARNING: ***** " >&5 echo "$as_me: WARNING: ***** " >&2;} - { echo "$as_me:$LINENO: WARNING: ***** Please check configure's --with-llvmgccdir option." >&5 + { echo "$as_me:$LINENO: WARNING: ***** Please check configure's --with-llvmgccdir option." >&5 echo "$as_me: WARNING: ***** Please check configure's --with-llvmgccdir option." >&2;} - { echo "$as_me:$LINENO: WARNING: ***** Runtime libraries (in llvm/runtime) will not be built," >&5 + { echo "$as_me:$LINENO: WARNING: ***** Runtime libraries (in llvm/runtime) will not be built," >&5 echo "$as_me: WARNING: ***** Runtime libraries (in llvm/runtime) will not be built," >&2;} - { echo "$as_me:$LINENO: WARNING: ***** but you should be able to build the llvm tools." >&5 + { echo "$as_me:$LINENO: WARNING: ***** but you should be able to build the llvm tools." >&5 echo "$as_me: WARNING: ***** but you should be able to build the llvm tools." >&2;} fi - From reid at x10sys.com Thu Nov 25 00:03:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 00:03:24 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200411250603.AAA16053@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.138 -> 1.139 --- Log message: Fix the lib/System/platform link by using proper cached variable name. --- Diffs of the changes: (+2 -2) Index: llvm/configure diff -u llvm/configure:1.138 llvm/configure:1.139 --- llvm/configure:1.138 Wed Nov 24 22:51:04 2004 +++ llvm/configure Thu Nov 25 00:03:14 2004 @@ -1725,7 +1725,7 @@ OS=$llvm_cv_platform_type - ac_config_links="$ac_config_links lib/System/platform:lib/System/$platform_type" + ac_config_links="$ac_config_links lib/System/platform:lib/System/$llvm_cv_platform_type" case $target in @@ -26280,7 +26280,7 @@ "tools/llvmc/cpp" ) CONFIG_FILES="$CONFIG_FILES tools/llvmc/cpp" ;; "tools/llvmc/ll" ) CONFIG_FILES="$CONFIG_FILES tools/llvmc/ll" ;; "tools/llvmc/c" ) CONFIG_FILES="$CONFIG_FILES tools/llvmc/c" ;; - "lib/System/platform" ) CONFIG_LINKS="$CONFIG_LINKS lib/System/platform:lib/System/$platform_type" ;; + "lib/System/platform" ) CONFIG_LINKS="$CONFIG_LINKS lib/System/platform:lib/System/$llvm_cv_platform_type" ;; "Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; "Makefile.common" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.common" ;; "examples/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS examples/Makefile" ;; From reid at x10sys.com Thu Nov 25 00:03:25 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 00:03:25 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200411250603.AAA16056@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.131 -> 1.132 --- Log message: Fix the lib/System/platform link by using proper cached variable name. --- Diffs of the changes: (+2 -2) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.131 llvm/autoconf/configure.ac:1.132 --- llvm/autoconf/configure.ac:1.131 Wed Nov 24 22:51:04 2004 +++ llvm/autoconf/configure.ac Thu Nov 25 00:03:14 2004 @@ -121,10 +121,10 @@ dnl makefile can configure itself to specific build hosts AC_SUBST(OS,$llvm_cv_platform_type) -dnl Make a link from lib/System/platform to lib/System/$platform_type +dnl Make a link from lib/System/platform to lib/System/$llvm_cv_platform_type dnl This helps the #inclusion of the system specific include files dnl for the operating system abstraction library, lib/System. -AC_CONFIG_LINKS(lib/System/platform:lib/System/$platform_type) +AC_CONFIG_LINKS(lib/System/platform:lib/System/$llvm_cv_platform_type) dnl If we are targetting a Sparc machine running Solaris, pretend that it is dnl V9, since that is all that we support at the moment, and autoconf will only From reid at x10sys.com Thu Nov 25 00:07:53 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 00:07:53 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411250607.AAA16177@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.253 -> 1.254 --- Log message: PR256: http://llvm.cs.uiuc.edu/PR256 fixed. --- Diffs of the changes: (+4 -2) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.253 llvm/docs/ReleaseNotes.html:1.254 --- llvm/docs/ReleaseNotes.html:1.253 Mon Nov 22 16:09:58 2004 +++ llvm/docs/ReleaseNotes.html Thu Nov 25 00:07:42 2004 @@ -168,7 +168,9 @@
      -
    1. +
    2. [autoconf] further standardizing + autoconf usage. Various improvements in the configure.ac script were + made as well as the makefile system.
    @@ -669,7 +671,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/11/22 22:09:58 $ + Last modified: $Date: 2004/11/25 06:07:42 $ From lattner at cs.uiuc.edu Thu Nov 25 00:14:59 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 25 Nov 2004 00:14:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Message-ID: <200411250614.iAP6ExjG025668@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.cpp updated: 1.10 -> 1.11 --- Log message: Fix the build on non ppc machines --- Diffs of the changes: (+5 -0) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.10 llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.11 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.10 Wed Nov 24 16:30:08 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Thu Nov 25 00:14:45 2004 @@ -78,6 +78,11 @@ "addi r4, r1, 44\n" // &FPRegs[0] "bl _PPC32CompilationCallbackC\n" ); +#else +void PPC32CompilationCallback() { + assert(0 && "This is not a power pc, you can't execute this!"); + abort(); +} #endif extern "C" void PPC32CompilationCallbackC(unsigned *IntRegs, double *FPRegs) { From lattner at cs.uiuc.edu Thu Nov 25 00:25:28 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 25 Nov 2004 00:25:28 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2004-11-25-UnnamedBitfieldPadding.c Message-ID: <200411250625.iAP6PSDj031417@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2004-11-25-UnnamedBitfieldPadding.c added (r1.1) --- Log message: New testcase for PR451: http://llvm.cs.uiuc.edu/PR451 --- Diffs of the changes: (+8 -0) Index: llvm/test/Regression/CFrontend/2004-11-25-UnnamedBitfieldPadding.c diff -c /dev/null llvm/test/Regression/CFrontend/2004-11-25-UnnamedBitfieldPadding.c:1.1 *** /dev/null Thu Nov 25 00:25:23 2004 --- llvm/test/Regression/CFrontend/2004-11-25-UnnamedBitfieldPadding.c Thu Nov 25 00:25:13 2004 *************** *** 0 **** --- 1,8 ---- + // RUN: %llvmgcc -S %s -o /dev/null + // This is a testcase for PR461 + typedef struct { + unsigned min_align: 1; + unsigned : 1; + } addr_diff_vec_flags; + + addr_diff_vec_flags X; From lattner at cs.uiuc.edu Thu Nov 25 00:25:57 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 25 Nov 2004 00:25:57 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-types.c Message-ID: <200411250625.iAP6Pv6j031427@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-types.c updated: 1.15 -> 1.16 --- Log message: Fix PR461: http://llvm.cs.uiuc.edu/PR461 and Regression/CFrontend/2004-11-25-UnnamedBitfieldPadding.c --- Diffs of the changes: (+9 -4) Index: llvm-gcc/gcc/llvm-types.c diff -u llvm-gcc/gcc/llvm-types.c:1.15 llvm-gcc/gcc/llvm-types.c:1.16 --- llvm-gcc/gcc/llvm-types.c:1.15 Fri Aug 6 13:07:34 2004 +++ llvm-gcc/gcc/llvm-types.c Thu Nov 25 00:25:45 2004 @@ -718,8 +718,9 @@ } else if (DECL_NAME(field) == 0 && /* Is this an anonymous bitfield? */ DECL_BIT_FIELD(field)) { unsigned NumPads; + unsigned DeclSize = GetDeclSize(field); /* Is it attempting to align the current offset to some value? */ - if (GetDeclSize(field) == 0) { + if (DeclSize == 0) { NumPads = ByteAlignment - (*Size % ByteAlignment); if (NumPads == ByteAlignment) NumPads = 0; assert((*Size+NumPads) % ByteAlignment == 0 &&"Incorrect padding calc?"); @@ -732,10 +733,14 @@ /* Otherwise we are just padding out for an unnamed bitfield. This does * not affect alignment, so we just insert the appropriate number of * ubytes. EndByte is the byte that the last bit of the unnamed bitfield - * falls into. + * falls into. If we already padded out for this due to alignment, this + * is a noop. */ - unsigned EndByte = (StartOffset+GetDeclSize(field)+7)/8; - NumPads = EndByte - *Size; + unsigned EndByte = (StartOffset+DeclSize+7)/8; + if (EndByte <= *Size) + NumPads = 0; /* This padding already exists! */ + else + NumPads = EndByte - *Size; } /* Add "NumPads" ubyte elements to the structure. */ From lattner at cs.uiuc.edu Thu Nov 25 00:31:56 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 25 Nov 2004 00:31:56 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411250631.iAP6VuPj031466@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.254 -> 1.255 --- Log message: Bug fixed --- Diffs of the changes: (+3 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.254 llvm/docs/ReleaseNotes.html:1.255 --- llvm/docs/ReleaseNotes.html:1.254 Thu Nov 25 00:07:42 2004 +++ llvm/docs/ReleaseNotes.html Thu Nov 25 00:31:42 2004 @@ -216,6 +216,8 @@
  • [llvmg++] not enough templates are instantiated
  • [llvmg++] Extern const globals cannot be marked 'constant' if they have nontrivial ctors or dtors
  • +
  • [llvmgcc] Crash compiling unnamed + bitfield which does not increase struct size
  • Bugs fixed in the Sparc V9 back-end:

    @@ -671,7 +673,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/11/25 06:07:42 $ + Last modified: $Date: 2004/11/25 06:31:42 $ From lattner at cs.uiuc.edu Thu Nov 25 00:32:32 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 25 Nov 2004 00:32:32 -0600 Subject: [llvm-commits] CVS: llvm-www/releases/1.3/docs/ReleaseNotes.html Message-ID: <200411250632.iAP6WWpT031487@apoc.cs.uiuc.edu> Changes in directory llvm-www/releases/1.3/docs: ReleaseNotes.html updated: 1.9 -> 1.10 --- Log message: Bug found --- Diffs of the changes: (+3 -2) Index: llvm-www/releases/1.3/docs/ReleaseNotes.html diff -u llvm-www/releases/1.3/docs/ReleaseNotes.html:1.9 llvm-www/releases/1.3/docs/ReleaseNotes.html:1.10 --- llvm-www/releases/1.3/docs/ReleaseNotes.html:1.9 Mon Oct 25 17:14:29 2004 +++ llvm-www/releases/1.3/docs/ReleaseNotes.html Thu Nov 25 00:32:22 2004 @@ -485,7 +485,8 @@
  • [llvmg++] not enough templates are instantiated
  • [llvmg++] Extern const globals cannot be marked 'constant' if they have nontrivial ctors or dtors
  • - +
  • [llvmgcc] Crash compiling unnamed + bitfield which does not increase struct size
  • @@ -791,7 +792,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/10/25 22:14:29 $ + Last modified: $Date: 2004/11/25 06:32:22 $ From lattner at cs.uiuc.edu Thu Nov 25 00:33:22 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 25 Nov 2004 00:33:22 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411250633.iAP6XMlH031510@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.255 -> 1.256 --- Log message: The PPC backend is basically stable, and has a JIT now. --- Diffs of the changes: (+2 -7) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.255 llvm/docs/ReleaseNotes.html:1.256 --- llvm/docs/ReleaseNotes.html:1.255 Thu Nov 25 00:31:42 2004 +++ llvm/docs/ReleaseNotes.html Thu Nov 25 00:33:10 2004 @@ -244,9 +244,7 @@ other unix-like systems).
  • Sun UltraSPARC workstations running Solaris 8.
  • Intel and AMD machines running on Win32 with the Cygwin libraries.
  • -
  • PowerPC-based Mac OS X boxes, running 10.2 and above. Note that no JIT -support is available yet, and LLC support is beta. The C backend can be used -to produce stable code for this platform.
  • +
  • PowerPC-based Mac OS X boxes, running 10.2 and above.
  • The core LLVM infrastructure uses @@ -296,9 +294,6 @@ components, please contact us on the llvmdev list.

      -
    • The PowerPC backend is incomplete and is known to miscompile several SPEC -benchmarks. The file llvm/lib/Target/PowerPC/README.txt has -details.
    • The following passes are incomplete or buggy: -pgmdep, -memdep, -ipmodref, -cee, -branch-combine, -instloops, -paths
    • The -pre pass is incomplete (there are cases it doesn't handle that @@ -673,7 +668,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/25 06:31:42 $ + Last modified: $Date: 2004/11/25 06:33:10 $ From natebegeman at mac.com Thu Nov 25 01:09:17 2004 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 25 Nov 2004 01:09:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp PPC32ISelSimple.cpp PowerPCAsmPrinter.cpp Message-ID: <200411250709.BAA18071@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.26 -> 1.27 PPC32ISelSimple.cpp updated: 1.111 -> 1.112 PowerPCAsmPrinter.cpp updated: 1.67 -> 1.68 --- Log message: Enable optimization suggested by Chris Lattner to not emit reloc stubs for static global variables whose addresses are taken. This allows us to convert the following code for taking the address of a static function foo addis r2, r30, ha16(Ll1__2E_foo_2$non_lazy_ptr-"L00001$pb") lwz r3, lo16(Ll1__2E_foo_2$non_lazy_ptr-"L00001$pb")(r2) which also includes linker stub code emitted at the end of the .s file not shown here, and replace it with this: addis r2, r30, ha16(l1__2E_foo_2-"L00001$pb") la r3, lo16(l1__2E_foo_2-"L00001$pb")(r2) which in addition to not needing linker help, also has no load instruction. For those not up on PowerPC mnemonics, la is shorthand for add immediate. --- Diffs of the changes: (+18 -21) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.26 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.27 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.26 Wed Nov 24 18:33:57 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Thu Nov 25 01:09:01 2004 @@ -199,20 +199,20 @@ Offset = -((intptr_t)MovePCtoLROffset+4); if (MI.getOpcode() == PPC::LOADHiAddr) { - if (GV->hasWeakLinkage() || GV->isExternal() || isa(GV)) + if (GV->hasWeakLinkage() || GV->isExternal()) Reloc = PPC::reloc_absolute_ptr_high; // Pointer to stub else Reloc = PPC::reloc_absolute_high; // Pointer to symbol } else if (MI.getOpcode() == PPC::LA) { - assert(!(GV->hasWeakLinkage() || GV->isExternal() || isa(GV)) + assert(!(GV->hasWeakLinkage() || GV->isExternal()) && "Something in the ISEL changed\n"); Reloc = PPC::reloc_absolute_low; } else if (MI.getOpcode() == PPC::LWZ) { Reloc = PPC::reloc_absolute_ptr_low; - assert((GV->hasWeakLinkage() || GV->isExternal() || isa(GV))&& + assert((GV->hasWeakLinkage() || GV->isExternal()) && "Something in the ISEL changed\n"); } else { // These don't show up for global value references AFAIK, only for Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.111 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.112 --- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.111 Wed Nov 24 15:53:14 2004 +++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Thu Nov 25 01:09:01 2004 @@ -703,7 +703,7 @@ BuildMI(*MBB, IP, PPC::LOADHiAddr, 2, TmpReg) .addReg(getGlobalBaseReg(MBB, IP)).addGlobalAddress(GV); - if (GV->hasWeakLinkage() || GV->isExternal() || isa(GV)) { + if (GV->hasWeakLinkage() || GV->isExternal()) { BuildMI(*MBB, IP, PPC::LWZ, 2, R).addGlobalAddress(GV).addReg(TmpReg); } else { BuildMI(*MBB, IP, PPC::LA, 2, R).addReg(TmpReg).addGlobalAddress(GV); Index: llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.67 llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.68 --- llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.67 Sun Nov 14 15:03:30 2004 +++ llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp Thu Nov 25 01:09:01 2004 @@ -33,6 +33,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Target/MRegisterInfo.h" +#include "llvm/Target/TargetInstrInfo.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" #include @@ -67,7 +68,7 @@ bool printInstruction(const MachineInstr *MI); void printMachineInstruction(const MachineInstr *MI); - void printOp(const MachineOperand &MO, bool LoadAddrOp = false); + void printOp(const MachineOperand &MO, bool IsCallOp = false); void printOperand(const MachineInstr *MI, unsigned OpNo, MVT::ValueType VT){ const MachineOperand &MO = MI->getOperand(OpNo); @@ -108,7 +109,8 @@ if (MI->getOperand(OpNo).isImmediate()) { O << "$+" << MI->getOperand(OpNo).getImmedValue() << '\n'; } else { - printOp(MI->getOperand(OpNo)); + printOp(MI->getOperand(OpNo), + TM.getInstrInfo()->isCall(MI->getOpcode())); } } void printPICLabel(const MachineInstr *MI, unsigned OpNo, @@ -120,7 +122,7 @@ void printSymbolHi(const MachineInstr *MI, unsigned OpNo, MVT::ValueType VT) { O << "ha16("; - printOp(MI->getOperand(OpNo), true /* LoadAddrOp */); + printOp(MI->getOperand(OpNo)); O << "-\"L0000" << LabelNumber << "$pb\")"; } void printSymbolLo(const MachineInstr *MI, unsigned OpNo, @@ -132,7 +134,7 @@ O << (short)MI->getOperand(OpNo).getImmedValue(); } else { O << "lo16("; - printOp(MI->getOperand(OpNo), true /* LoadAddrOp */); + printOp(MI->getOperand(OpNo)); O << "-\"L0000" << LabelNumber << "$pb\")"; } } @@ -307,8 +309,7 @@ // Include the auto-generated portion of the assembly writer #include "PowerPCGenAsmWriter.inc" -void PowerPCAsmPrinter::printOp(const MachineOperand &MO, - bool LoadAddrOp /* = false */) { +void PowerPCAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) { const MRegisterInfo &RI = *TM.getRegisterInfo(); int new_symbol; @@ -359,27 +360,23 @@ // wary however not to output $stub for external functions whose addresses // are taken. Those should be emitted as $non_lazy_ptr below. Function *F = dyn_cast(GV); - if (F && F->isExternal() && !LoadAddrOp && - getTM().CalledFunctions.count(F)) { + if (F && F->isExternal() && IsCallOp && getTM().CalledFunctions.count(F)) { FnStubs.insert(Name); O << "L" << Name << "$stub"; return; } // External or weakly linked global variables need non-lazily-resolved stubs - if ((GV->isExternal() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()) + if ((GV->isExternal() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()) && getTM().AddressTaken.count(GV)) { - GVStubs.insert(Name); + if (GV->hasLinkOnceLinkage()) + LinkOnceStubs.insert(Name); + else + GVStubs.insert(Name); O << "L" << Name << "$non_lazy_ptr"; return; } - - if (F && LoadAddrOp && getTM().AddressTaken.count(GV)) { - LinkOnceStubs.insert(Name); - O << "L" << Name << "$non_lazy_ptr"; - return; - } - + O << Mang->getValueName(GV); return; } From reid at x10sys.com Thu Nov 25 01:28:30 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 01:28:30 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200411250728.BAA18263@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.132 -> 1.133 --- Log message: Gack. Actually use the correct variable name in setting the JIT support. --- Diffs of the changes: (+1 -1) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.132 llvm/autoconf/configure.ac:1.133 --- llvm/autoconf/configure.ac:1.132 Thu Nov 25 00:03:14 2004 +++ llvm/autoconf/configure.ac Thu Nov 25 01:28:19 2004 @@ -179,7 +179,7 @@ then AC_SUBST(JIT,[[]]) else - case "$llvm_cv_target_architecture" in + case "$llvm_cv_target_arch" in x86) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;; Sparc) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;; PowerPC) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;; From reid at x10sys.com Thu Nov 25 01:28:30 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 01:28:30 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200411250728.BAA18265@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.139 -> 1.140 --- Log message: Gack. Actually use the correct variable name in setting the JIT support. --- Diffs of the changes: (+1 -1) Index: llvm/configure diff -u llvm/configure:1.139 llvm/configure:1.140 --- llvm/configure:1.139 Thu Nov 25 00:03:14 2004 +++ llvm/configure Thu Nov 25 01:28:19 2004 @@ -2945,7 +2945,7 @@ JIT= else - case "$llvm_cv_target_architecture" in + case "$llvm_cv_target_arch" in x86) JIT=TARGET_HAS_JIT=1 ;; Sparc) JIT=TARGET_HAS_JIT=1 From reid at x10sys.com Thu Nov 25 03:09:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 03:09:05 -0600 Subject: [llvm-commits] CVS: llvm/Makefile Message-ID: <200411250909.DAA05454@zion.cs.uiuc.edu> Changes in directory llvm: Makefile updated: 1.41 -> 1.42 --- Log message: Add a convenience target to build all three modes: Debug, Release, Profile --- Diffs of the changes: (+13 -1) Index: llvm/Makefile diff -u llvm/Makefile:1.41 llvm/Makefile:1.42 --- llvm/Makefile:1.41 Sun Nov 7 23:44:05 2004 +++ llvm/Makefile Thu Nov 25 03:08:54 2004 @@ -9,7 +9,6 @@ LEVEL = . DIRS = lib/System lib/Support utils lib tools - ifneq ($(MAKECMDGOALS),tools-only) DIRS += runtime OPTIONAL_DIRS = examples projects @@ -19,6 +18,19 @@ include $(LEVEL)/Makefile.common +.PHONY: debug-opt-prof +debug-opt-prof: + $(Echo) Building Debug Version + $(Verb) $(MAKE) + $(Echo) + $(Echo) Building Optimized Version + $(Echo) + $(Verb) $(MAKE) ENABLE_OPTIMIZED=1 + $(Echo) + $(Echo) Building Profiling Version + $(Echo) + $(Verb) $(MAKE) ENABLE_PROFILING=1 + dist-hook:: $(Echo) Eliminating CVS directories from distribution $(Verb) $(RM) -rf `find $(TopDistDir) -type d -name CVS -print` From reid at x10sys.com Thu Nov 25 03:29:55 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 03:29:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp Message-ID: <200411250929.DAA09243@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.94 -> 1.95 --- Log message: Remove blank comment lines for uniformity. Make sure lines don't exceed 80 cols. --- Diffs of the changes: (+2 -25) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.94 llvm/lib/Linker/LinkModules.cpp:1.95 --- llvm/lib/Linker/LinkModules.cpp:1.94 Tue Nov 16 13:04:40 2004 +++ llvm/lib/Linker/LinkModules.cpp Thu Nov 25 03:29:44 2004 @@ -30,12 +30,12 @@ // Error - Simple wrapper function to conditionally assign to E and return true. // This just makes error return conditions a little bit simpler... -// static inline bool Error(std::string *E, const std::string &Message) { if (E) *E = Message; return true; } +// ToStr - Simple wrapper function to convert a type to a string. static std::string ToStr(const Type *Ty, const Module *M) { std::ostringstream OS; WriteTypeSymbolic(OS, Ty, M); @@ -91,7 +91,6 @@ // RecursiveResolveTypes - This is just like ResolveTypes, except that it // recurses down into derived types, merging the used types if the parent types // are compatible. -// static bool RecursiveResolveTypesI(const PATypeHolder &DestTy, const PATypeHolder &SrcTy, SymbolTable *DestST, const std::string &Name, @@ -145,7 +144,6 @@ // so, we are in a recursive branch. Cut off the search now. We cannot use // an associative container for this search, because the type pointers (keys // in the container) change whenever types get resolved... - // for (unsigned i = 0, e = Pointers.size(); i != e; ++i) if (Pointers[i].first == DestTy) return Pointers[i].second != SrcTy; @@ -175,7 +173,6 @@ // LinkTypes - Go through the symbol table of the Src module and see if any // types are named in the src module that are not named in the Dst module. // Make sure there are no type name conflicts. -// static bool LinkTypes(Module *Dest, const Module *Src, std::string *Err) { SymbolTable *DestST = &Dest->getSymbolTable(); const SymbolTable *SrcST = &Src->getSymbolTable(); @@ -278,7 +275,6 @@ // RemapOperand - Use ValueMap to convert references from one module to another. // This is somewhat sophisticated in that it can automatically handle constant // references correctly as well... -// static Value *RemapOperand(const Value *In, std::map &ValueMap) { std::map::const_iterator I = ValueMap.find(In); @@ -381,7 +377,6 @@ // LinkGlobals - Loop through the global variables in the src module and merge // them into the dest module. -// static bool LinkGlobals(Module *Dest, const Module *Src, std::map &ValueMap, std::multimap &AppendingVars, @@ -392,7 +387,6 @@ SymbolTable *ST = (SymbolTable*)&Dest->getSymbolTable(); // Loop over all of the globals in the src module, mapping them over as we go - // for (Module::const_giterator I = Src->gbegin(), E = Src->gend(); I != E; ++I){ const GlobalVariable *SGV = I; GlobalVariable *DGV = 0; @@ -418,7 +412,6 @@ // No linking to be performed, simply create an identical version of the // symbol over in the dest module... the initializer will be filled in // later by LinkGlobalInits... - // GlobalVariable *NewDGV = new GlobalVariable(SGV->getType()->getElementType(), SGV->isConstant(), SGV->getLinkage(), /*init*/0, @@ -534,13 +527,11 @@ // LinkGlobalInits - Update the initializers in the Dest module now that all // globals that may be referenced are in Dest. -// static bool LinkGlobalInits(Module *Dest, const Module *Src, std::map &ValueMap, std::string *Err) { // Loop over all of the globals in the src module, mapping them over as we go - // for (Module::const_giterator I = Src->gbegin(), E = Src->gend(); I != E; ++I){ const GlobalVariable *SGV = I; @@ -588,7 +579,6 @@ // Loop over all of the functions in the src module, mapping them over as we // go - // for (Module::const_iterator I = Src->begin(), E = Src->end(); I != E; ++I) { const Function *SF = I; // SrcFunction Function *DF = 0; @@ -659,7 +649,6 @@ // LinkFunctionBody - Copy the source function over into the dest function and // fix up references to values. At this point we know that Dest is an external // function, and that Src is not. -// static bool LinkFunctionBody(Function *Dest, Function *Src, std::map &GlobalMap, std::string *Err) { @@ -701,14 +690,12 @@ // LinkFunctionBodies - Link in the function bodies that are defined in the // source module into the DestModule. This consists basically of copying the // function over and fixing up references to values. -// static bool LinkFunctionBodies(Module *Dest, Module *Src, std::map &ValueMap, std::string *Err) { // Loop over all of the functions in the src module, mapping them over as we // go - // for (Module::iterator SF = Src->begin(), E = Src->end(); SF != E; ++SF) { if (!SF->isExternal()) { // No body if function is external Function *DF = cast(ValueMap[SF]); // Destination function @@ -726,7 +713,6 @@ // LinkAppendingVars - If there were any appending global variables, link them // together now. Return true on error. -// static bool LinkAppendingVars(Module *M, std::multimap &AppendingVars, std::string *ErrorMsg) { @@ -736,7 +722,6 @@ // same name, forming a new appending global variable with both of the // initializers merged together, then rewrite references to the old variables // and delete them. - // std::vector Inits; while (AppendingVars.size() > 1) { // Get the first two elements in the map... @@ -833,7 +818,7 @@ Dest->getPointerSize() != Src->getPointerSize()) std::cerr << "WARNING: Linking two modules of different pointer size!\n"; - // Update the destination module's dependent libraries list with the libraries + // Update the destination module's dependent libraries list with the libraries // from the source module. There's no opportunity for duplicates here as the // Module ensures that duplicate insertions are discarded. Module::lib_iterator SI = Src->lib_begin(); @@ -846,18 +831,15 @@ // LinkTypes - Go through the symbol table of the Src module and see if any // types are named in the src module that are not named in the Dst module. // Make sure there are no type name conflicts. - // if (LinkTypes(Dest, Src, ErrorMsg)) return true; // ValueMap - Mapping of values from what they used to be in Src, to what they // are now in Dest. - // std::map ValueMap; // AppendingVars - Keep track of global variables in the destination module // with appending linkage. After the module is linked together, they are // appended and the module is rewritten. - // std::multimap AppendingVars; // GlobalsByName - The LLVM SymbolTable class fights our best efforts at @@ -883,7 +865,6 @@ // Insert all of the globals in src into the Dest module... without linking // initializers (which could refer to functions not yet mapped over). - // if (LinkGlobals(Dest, Src, ValueMap, AppendingVars, GlobalsByName, ErrorMsg)) return true; @@ -892,23 +873,19 @@ // function... We do this so that when we begin processing function bodies, // all of the global values that may be referenced are available in our // ValueMap. - // if (LinkFunctionProtos(Dest, Src, ValueMap, GlobalsByName, ErrorMsg)) return true; // Update the initializers in the Dest module now that all globals that may // be referenced are in Dest. - // if (LinkGlobalInits(Dest, Src, ValueMap, ErrorMsg)) return true; // Link in the function bodies that are defined in the source module into the // DestModule. This consists basically of copying the function over and // fixing up references to values. - // if (LinkFunctionBodies(Dest, Src, ValueMap, ErrorMsg)) return true; // If there were any appending global variables, link them together now. - // if (LinkAppendingVars(Dest, AppendingVars, ErrorMsg)) return true; // If the source library's module id is in the dependent library list of the From reid at x10sys.com Thu Nov 25 03:32:19 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 03:32:19 -0600 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkArchives.cpp Message-ID: <200411250932.DAA09645@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkArchives.cpp updated: 1.38 -> 1.39 --- Log message: Implement dependent library linking. It is no longer required that -lstdc++ -lstdsup++ no -lc be passed on the command line to llvm linkers if the progam being linked was compiled with the C/C++ Front End or Stacker. --- Diffs of the changes: (+8 -1) Index: llvm/lib/Linker/LinkArchives.cpp diff -u llvm/lib/Linker/LinkArchives.cpp:1.38 llvm/lib/Linker/LinkArchives.cpp:1.39 --- llvm/lib/Linker/LinkArchives.cpp:1.38 Thu Nov 18 21:27:05 2004 +++ llvm/lib/Linker/LinkArchives.cpp Thu Nov 25 03:32:08 2004 @@ -371,12 +371,19 @@ /// TRUE - Error. /// void llvm::LinkLibraries(const char *progname, Module *HeadModule, - const std::vector &Libraries, + const std::vector &Libs, const std::vector &LibPaths, bool Verbose, bool Native) { // String in which to receive error messages. std::string ErrorMessage; + // Build a set of library names that we should try, including the + // HeadModule's dependent libraries. We use a set here to eliminate + // duplicates between the module's libraries and the argument Libs. + Module::LibraryListType Libraries(HeadModule->getLibraries()); + Libraries.insert(Libs.begin(),Libs.end()); + + // For each library for (unsigned i = 0; i < Libraries.size(); ++i) { // Determine where this library lives. std::string Pathname = FindLib(Libraries[i], LibPaths); From reid at x10sys.com Thu Nov 25 03:36:39 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 03:36:39 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/st.in Message-ID: <200411250936.DAA15092@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: st.in updated: 1.1 -> 1.2 --- Log message: Correct the configuration variable used to find the bin directory. --- Diffs of the changes: (+3 -3) Index: llvm/tools/llvmc/st.in diff -u llvm/tools/llvmc/st.in:1.1 llvm/tools/llvmc/st.in:1.2 --- llvm/tools/llvmc/st.in:1.1 Tue Nov 23 17:33:08 2004 +++ llvm/tools/llvmc/st.in Thu Nov 25 03:36:28 2004 @@ -25,7 +25,7 @@ # To compile stacker source, we just run the stacker # compiler with a default stack size of 2048 entries. - translator.command=@bindir@/stkrc -s 2048 %in% -f -o %out% %opt% \ + translator.command=@LLVM_BINDIR@/stkrc -s 2048 %in% -f -o %out% %opt% \ %time% %stats% %args% # stkrc doesn't preprocess but we set this to true so @@ -43,7 +43,7 @@ ########################################################## # For optimization, we use the LLVM "opt" program - optimizer.command=@bindir@/stkrc -s 2048 %in% -f -o %out% %opt% \ + optimizer.command=@LLVM_BINDIR@/stkrc -s 2048 %in% -f -o %out% %opt% \ %time% %stats% %args% optimizer.required = yes @@ -60,4 +60,4 @@ ########################################################## # Assembler definitions ########################################################## - assembler.command=llc %in% -o %out% %target% %time% %stats% + assembler.command=@LLVM_BINDIR@/llc %in% -o %out% %target% %time% %stats% From llvm at cs.uiuc.edu Thu Nov 25 10:10:01 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Thu, 25 Nov 2004 10:10:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/bzip2/ Message-ID: <200411251610.KAA24622@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support/bzip2: --- Log message: Directory /var/cvs/llvm/llvm/lib/Support/bzip2 added to the repository --- Diffs of the changes: (+0 -0) From reid at x10sys.com Thu Nov 25 10:11:47 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 10:11:47 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/bzip2/CHANGES LICENSE Makefile README README.COMPILATION.PROBLEMS Y2K_INFO blocksort.c bzlib.c bzlib.h bzlib_private.h compress.c crctable.c decompress.c huffman.c randtable.c Message-ID: <200411251611.KAA24677@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support/bzip2: CHANGES added (r1.1) LICENSE added (r1.1) Makefile added (r1.1) README added (r1.1) README.COMPILATION.PROBLEMS added (r1.1) Y2K_INFO added (r1.1) blocksort.c added (r1.1) bzlib.c added (r1.1) bzlib.h added (r1.1) bzlib_private.h added (r1.1) compress.c added (r1.1) crctable.c added (r1.1) decompress.c added (r1.1) huffman.c added (r1.1) randtable.c added (r1.1) --- Log message: Initial Version from bzip2 Release 1.0.2. --- Diffs of the changes: (+6297 -0) Index: llvm/lib/Support/bzip2/CHANGES diff -c /dev/null llvm/lib/Support/bzip2/CHANGES:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/CHANGES Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,259 ---- + ############################################################################### + # LLVM CHANGES: + # LLVM incorporated version 1.0.2 of bzip2 and removed several files that + # were deemed unnecessary. All the programs (bzip2 bzip2recover), test suites + # and documentaton were removed. These items are available elsewhere and + # LLVM does not use them. + ############################################################################### + + 0.9.0 + ~~~~~ + First version. + + + 0.9.0a + ~~~~~~ + Removed 'ranlib' from Makefile, since most modern Unix-es + don't need it, or even know about it. + + + 0.9.0b + ~~~~~~ + Fixed a problem with error reporting in bzip2.c. This does not effect + the library in any way. Problem is: versions 0.9.0 and 0.9.0a (of the + program proper) compress and decompress correctly, but give misleading + error messages (internal panics) when an I/O error occurs, instead of + reporting the problem correctly. This shouldn't give any data loss + (as far as I can see), but is confusing. + + Made the inline declarations disappear for non-GCC compilers. + + + 0.9.0c + ~~~~~~ + Fixed some problems in the library pertaining to some boundary cases. + This makes the library behave more correctly in those situations. The + fixes apply only to features (calls and parameters) not used by + bzip2.c, so the non-fixedness of them in previous versions has no + effect on reliability of bzip2.c. + + In bzlib.c: + * made zero-length BZ_FLUSH work correctly in bzCompress(). + * fixed bzWrite/bzRead to ignore zero-length requests. + * fixed bzread to correctly handle read requests after EOF. + * wrong parameter order in call to bzDecompressInit in + bzBuffToBuffDecompress. Fixed. + + In compress.c: + * changed setting of nGroups in sendMTFValues() so as to + do a bit better on small files. This _does_ effect + bzip2.c. + + + 0.9.5a + ~~~~~~ + Major change: add a fallback sorting algorithm (blocksort.c) + to give reasonable behaviour even for very repetitive inputs. + Nuked --repetitive-best and --repetitive-fast since they are + no longer useful. + + Minor changes: mostly a whole bunch of small changes/ + bugfixes in the driver (bzip2.c). Changes pertaining to the + user interface are: + + allow decompression of symlink'd files to stdout + decompress/test files even without .bz2 extension + give more accurate error messages for I/O errors + when compressing/decompressing to stdout, don't catch control-C + read flags from BZIP2 and BZIP environment variables + decline to break hard links to a file unless forced with -f + allow -c flag even with no filenames + preserve file ownerships as far as possible + make -s -1 give the expected block size (100k) + add a flag -q --quiet to suppress nonessential warnings + stop decoding flags after --, so files beginning in - can be handled + resolved inconsistent naming: bzcat or bz2cat ? + bzip2 --help now returns 0 + + Programming-level changes are: + + fixed syntax error in GET_LL4 for Borland C++ 5.02 + let bzBuffToBuffDecompress return BZ_DATA_ERROR{_MAGIC} + fix overshoot of mode-string end in bzopen_or_bzdopen + wrapped bzlib.h in #ifdef __cplusplus ... extern "C" { ... } + close file handles under all error conditions + added minor mods so it compiles with DJGPP out of the box + fixed Makefile so it doesn't give problems with BSD make + fix uninitialised memory reads in dlltest.c + + 0.9.5b + ~~~~~~ + Open stdin/stdout in binary mode for DJGPP. + + 0.9.5c + ~~~~~~ + Changed BZ_N_OVERSHOOT to be ... + 2 instead of ... + 1. The + 1 + version could cause the sorted order to be wrong in some extremely + obscure cases. Also changed setting of quadrant in blocksort.c. + + 0.9.5d + ~~~~~~ + The only functional change is to make bzlibVersion() in the library + return the correct string. This has no effect whatsoever on the + functioning of the bzip2 program or library. Added a couple of casts + so the library compiles without warnings at level 3 in MS Visual + Studio 6.0. Included a Y2K statement in the file Y2K_INFO. All other + changes are minor documentation changes. + + 1.0 + ~~~ + Several minor bugfixes and enhancements: + + * Large file support. The library uses 64-bit counters to + count the volume of data passing through it. bzip2.c + is now compiled with -D_FILE_OFFSET_BITS=64 to get large + file support from the C library. -v correctly prints out + file sizes greater than 4 gigabytes. All these changes have + been made without assuming a 64-bit platform or a C compiler + which supports 64-bit ints, so, except for the C library + aspect, they are fully portable. + + * Decompression robustness. The library/program should be + robust to any corruption of compressed data, detecting and + handling _all_ corruption, instead of merely relying on + the CRCs. What this means is that the program should + never crash, given corrupted data, and the library should + always return BZ_DATA_ERROR. + + * Fixed an obscure race-condition bug only ever observed on + Solaris, in which, if you were very unlucky and issued + control-C at exactly the wrong time, both input and output + files would be deleted. + + * Don't run out of file handles on test/decompression when + large numbers of files have invalid magic numbers. + + * Avoid library namespace pollution. Prefix all exported + symbols with BZ2_. + + * Minor sorting enhancements from my DCC2000 paper. + + * Advance the version number to 1.0, so as to counteract the + (false-in-this-case) impression some people have that programs + with version numbers less than 1.0 are in some way, experimental, + pre-release versions. + + * Create an initial Makefile-libbz2_so to build a shared library. + Yes, I know I should really use libtool et al ... + + * Make the program exit with 2 instead of 0 when decompression + fails due to a bad magic number (ie, an invalid bzip2 header). + Also exit with 1 (as the manual claims :-) whenever a diagnostic + message would have been printed AND the corresponding operation + is aborted, for example + bzip2: Output file xx already exists. + When a diagnostic message is printed but the operation is not + aborted, for example + bzip2: Can't guess original name for wurble -- using wurble.out + then the exit value 0 is returned, unless some other problem is + also detected. + + I think it corresponds more closely to what the manual claims now. + + + 1.0.1 + ~~~~~ + * Modified dlltest.c so it uses the new BZ2_ naming scheme. + * Modified makefile-msc to fix minor build probs on Win2k. + * Updated README.COMPILATION.PROBLEMS. + + There are no functionality changes or bug fixes relative to version + 1.0.0. This is just a documentation update + a fix for minor Win32 + build problems. For almost everyone, upgrading from 1.0.0 to 1.0.1 is + utterly pointless. Don't bother. + + + 1.0.2 + ~~~~~ + A bug fix release, addressing various minor issues which have appeared + in the 18 or so months since 1.0.1 was released. Most of the fixes + are to do with file-handling or documentation bugs. To the best of my + knowledge, there have been no data-loss-causing bugs reported in the + compression/decompression engine of 1.0.0 or 1.0.1. + + Note that this release does not improve the rather crude build system + for Unix platforms. The general plan here is to autoconfiscate/ + libtoolise 1.0.2 soon after release, and release the result as 1.1.0 + or perhaps 1.2.0. That, however, is still just a plan at this point. + + Here are the changes in 1.0.2. Bug-reporters and/or patch-senders in + parentheses. + + * Fix an infinite segfault loop in 1.0.1 when a directory is + encountered in -f (force) mode. + (Trond Eivind Glomsrod, Nicholas Nethercote, Volker Schmidt) + + * Avoid double fclose() of output file on certain I/O error paths. + (Solar Designer) + + * Don't fail with internal error 1007 when fed a long stream (> 48MB) + of byte 251. Also print useful message suggesting that 1007s may be + caused by bad memory. + (noticed by Juan Pedro Vallejo, fixed by me) + + * Fix uninitialised variable silly bug in demo prog dlltest.c. + (Jorj Bauer) + + * Remove 512-MB limitation on recovered file size for bzip2recover + on selected platforms which support 64-bit ints. At the moment + all GCC supported platforms, and Win32. + (me, Alson van der Meulen) + + * Hard-code header byte values, to give correct operation on platforms + using EBCDIC as their native character set (IBM's OS/390). + (Leland Lucius) + + * Copy file access times correctly. + (Marty Leisner) + + * Add distclean and check targets to Makefile. + (Michael Carmack) + + * Parameterise use of ar and ranlib in Makefile. Also add $(LDFLAGS). + (Rich Ireland, Bo Thorsen) + + * Pass -p (create parent dirs as needed) to mkdir during make install. + (Jeremy Fusco) + + * Dereference symlinks when copying file permissions in -f mode. + (Volker Schmidt) + + * Majorly simplify implementation of uInt64_qrm10. + (Bo Lindbergh) + + * Check the input file still exists before deleting the output one, + when aborting in cleanUpAndFail(). + (Joerg Prante, Robert Linden, Matthias Krings) + + Also a bunch of patches courtesy of Philippe Troin, the Debian maintainer + of bzip2: + + * Wrapper scripts (with manpages): bzdiff, bzgrep, bzmore. + + * Spelling changes and minor enhancements in bzip2.1. + + * Avoid race condition between creating the output file and setting its + interim permissions safely, by using fopen_output_safely(). + No changes to bzip2recover since there is no issue with file + permissions there. + + * do not print senseless report with -v when compressing an empty + file. + + * bzcat -f works on non-bzip2 files. + + * do not try to escape shell meta-characters on unix (the shell takes + care of these). + + * added --fast and --best aliases for -1 -9 for gzip compatibility. + Index: llvm/lib/Support/bzip2/LICENSE diff -c /dev/null llvm/lib/Support/bzip2/LICENSE:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/LICENSE Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,39 ---- + + This program, "bzip2" and associated library "libbzip2", are + copyright (C) 1996-2002 Julian R Seward. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Julian Seward, Cambridge, UK. + jseward at acm.org + bzip2/libbzip2 version 1.0.2 of 30 December 2001 + Index: llvm/lib/Support/bzip2/Makefile diff -c /dev/null llvm/lib/Support/bzip2/Makefile:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/Makefile Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,192 ---- + + SHELL=/bin/sh + + # To assist in cross-compiling + CC=gcc + AR=ar + RANLIB=ranlib + LDFLAGS= + + # Suitably paranoid flags to avoid bugs in gcc-2.7 + BIGFILES=-D_FILE_OFFSET_BITS=64 + CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES) + + # Where you want it installed when you do 'make install' + PREFIX=/usr + + + OBJS= blocksort.o \ + huffman.o \ + crctable.o \ + randtable.o \ + compress.o \ + decompress.o \ + bzlib.o + + all: libbz2.a bzip2 bzip2recover test + + bzip2: libbz2.a bzip2.o + $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2 + + bzip2recover: bzip2recover.o + $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o + + libbz2.a: $(OBJS) + rm -f libbz2.a + $(AR) cq libbz2.a $(OBJS) + @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \ + -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \ + echo $(RANLIB) libbz2.a ; \ + $(RANLIB) libbz2.a ; \ + fi + + check: test + test: bzip2 + @cat words1 + ./bzip2 -1 < sample1.ref > sample1.rb2 + ./bzip2 -2 < sample2.ref > sample2.rb2 + ./bzip2 -3 < sample3.ref > sample3.rb2 + ./bzip2 -d < sample1.bz2 > sample1.tst + ./bzip2 -d < sample2.bz2 > sample2.tst + ./bzip2 -ds < sample3.bz2 > sample3.tst + cmp sample1.bz2 sample1.rb2 + cmp sample2.bz2 sample2.rb2 + cmp sample3.bz2 sample3.rb2 + cmp sample1.tst sample1.ref + cmp sample2.tst sample2.ref + cmp sample3.tst sample3.ref + @cat words3 + + install: bzip2 bzip2recover + if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi + if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi + if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi + if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi + if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi + cp -f bzip2 $(PREFIX)/bin/bzip2 + cp -f bzip2 $(PREFIX)/bin/bunzip2 + cp -f bzip2 $(PREFIX)/bin/bzcat + cp -f bzip2recover $(PREFIX)/bin/bzip2recover + chmod a+x $(PREFIX)/bin/bzip2 + chmod a+x $(PREFIX)/bin/bunzip2 + chmod a+x $(PREFIX)/bin/bzcat + chmod a+x $(PREFIX)/bin/bzip2recover + cp -f bzip2.1 $(PREFIX)/man/man1 + chmod a+r $(PREFIX)/man/man1/bzip2.1 + cp -f bzlib.h $(PREFIX)/include + chmod a+r $(PREFIX)/include/bzlib.h + cp -f libbz2.a $(PREFIX)/lib + chmod a+r $(PREFIX)/lib/libbz2.a + cp -f bzgrep $(PREFIX)/bin/bzgrep + ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep + ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep + chmod a+x $(PREFIX)/bin/bzgrep + cp -f bzmore $(PREFIX)/bin/bzmore + ln $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless + chmod a+x $(PREFIX)/bin/bzmore + cp -f bzdiff $(PREFIX)/bin/bzdiff + ln $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp + chmod a+x $(PREFIX)/bin/bzdiff + cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1 + chmod a+r $(PREFIX)/man/man1/bzgrep.1 + chmod a+r $(PREFIX)/man/man1/bzmore.1 + chmod a+r $(PREFIX)/man/man1/bzdiff.1 + echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1 + echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1 + echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1 + echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1 + + distclean: clean + clean: + rm -f *.o libbz2.a bzip2 bzip2recover \ + sample1.rb2 sample2.rb2 sample3.rb2 \ + sample1.tst sample2.tst sample3.tst + + blocksort.o: blocksort.c + @cat words0 + $(CC) $(CFLAGS) -c blocksort.c + huffman.o: huffman.c + $(CC) $(CFLAGS) -c huffman.c + crctable.o: crctable.c + $(CC) $(CFLAGS) -c crctable.c + randtable.o: randtable.c + $(CC) $(CFLAGS) -c randtable.c + compress.o: compress.c + $(CC) $(CFLAGS) -c compress.c + decompress.o: decompress.c + $(CC) $(CFLAGS) -c decompress.c + bzlib.o: bzlib.c + $(CC) $(CFLAGS) -c bzlib.c + bzip2.o: bzip2.c + $(CC) $(CFLAGS) -c bzip2.c + bzip2recover.o: bzip2recover.c + $(CC) $(CFLAGS) -c bzip2recover.c + + DISTNAME=bzip2-1.0.2 + tarfile: + rm -f $(DISTNAME) + ln -sf . $(DISTNAME) + tar cvf $(DISTNAME).tar \ + $(DISTNAME)/blocksort.c \ + $(DISTNAME)/huffman.c \ + $(DISTNAME)/crctable.c \ + $(DISTNAME)/randtable.c \ + $(DISTNAME)/compress.c \ + $(DISTNAME)/decompress.c \ + $(DISTNAME)/bzlib.c \ + $(DISTNAME)/bzip2.c \ + $(DISTNAME)/bzip2recover.c \ + $(DISTNAME)/bzlib.h \ + $(DISTNAME)/bzlib_private.h \ + $(DISTNAME)/Makefile \ + $(DISTNAME)/manual.texi \ + $(DISTNAME)/manual.ps \ + $(DISTNAME)/manual.pdf \ + $(DISTNAME)/LICENSE \ + $(DISTNAME)/bzip2.1 \ + $(DISTNAME)/bzip2.1.preformatted \ + $(DISTNAME)/bzip2.txt \ + $(DISTNAME)/words0 \ + $(DISTNAME)/words1 \ + $(DISTNAME)/words2 \ + $(DISTNAME)/words3 \ + $(DISTNAME)/sample1.ref \ + $(DISTNAME)/sample2.ref \ + $(DISTNAME)/sample3.ref \ + $(DISTNAME)/sample1.bz2 \ + $(DISTNAME)/sample2.bz2 \ + $(DISTNAME)/sample3.bz2 \ + $(DISTNAME)/dlltest.c \ + $(DISTNAME)/*.html \ + $(DISTNAME)/README \ + $(DISTNAME)/README.COMPILATION.PROBLEMS \ + $(DISTNAME)/CHANGES \ + $(DISTNAME)/libbz2.def \ + $(DISTNAME)/libbz2.dsp \ + $(DISTNAME)/dlltest.dsp \ + $(DISTNAME)/makefile.msc \ + $(DISTNAME)/Y2K_INFO \ + $(DISTNAME)/unzcrash.c \ + $(DISTNAME)/spewG.c \ + $(DISTNAME)/mk251.c \ + $(DISTNAME)/bzdiff \ + $(DISTNAME)/bzdiff.1 \ + $(DISTNAME)/bzmore \ + $(DISTNAME)/bzmore.1 \ + $(DISTNAME)/bzgrep \ + $(DISTNAME)/bzgrep.1 \ + $(DISTNAME)/Makefile-libbz2_so + gzip -v $(DISTNAME).tar + + # For rebuilding the manual from sources on my RedHat 7.2 box + manual: manual.ps manual.pdf manual.html + + manual.ps: manual.texi + tex manual.texi + dvips -o manual.ps manual.dvi + + manual.pdf: manual.ps + ps2pdf manual.ps + + manual.html: manual.texi + texi2html -split_chapter manual.texi Index: llvm/lib/Support/bzip2/README diff -c /dev/null llvm/lib/Support/bzip2/README:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/README Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,181 ---- + + This is the README for bzip2, a block-sorting file compressor, version + 1.0.2. This version is fully compatible with the previous public + releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1. + + bzip2-1.0.2 is distributed under a BSD-style license. For details, + see the file LICENSE. + + Complete documentation is available in Postscript form (manual.ps), + PDF (manual.pdf, amazingly enough) or html (manual_toc.html). A + plain-text version of the manual page is available as bzip2.txt. + A statement about Y2K issues is now included in the file Y2K_INFO. + + + HOW TO BUILD -- UNIX + + Type `make'. This builds the library libbz2.a and then the + programs bzip2 and bzip2recover. Six self-tests are run. + If the self-tests complete ok, carry on to installation: + + To install in /usr/bin, /usr/lib, /usr/man and /usr/include, type + make install + To install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type + make install PREFIX=/xxx/yyy + If you are (justifiably) paranoid and want to see what 'make install' + is going to do, you can first do + make -n install or + make -n install PREFIX=/xxx/yyy respectively. + The -n instructs make to show the commands it would execute, but + not actually execute them. + + + HOW TO BUILD -- UNIX, shared library libbz2.so. + + Do 'make -f Makefile-libbz2_so'. This Makefile seems to work for + Linux-ELF (RedHat 7.2 on an x86 box), with gcc. I make no claims + that it works for any other platform, though I suspect it probably + will work for most platforms employing both ELF and gcc. + + bzip2-shared, a client of the shared library, is also built, but not + self-tested. So I suggest you also build using the normal Makefile, + since that conducts a self-test. A second reason to prefer the + version statically linked to the library is that, on x86 platforms, + building shared objects makes a valuable register (%ebx) unavailable + to gcc, resulting in a slowdown of 10%-20%, at least for bzip2. + + Important note for people upgrading .so's from 0.9.0/0.9.5 to version + 1.0.X. All the functions in the library have been renamed, from (eg) + bzCompress to BZ2_bzCompress, to avoid namespace pollution. + Unfortunately this means that the libbz2.so created by + Makefile-libbz2_so will not work with any program which used an older + version of the library. Sorry. I do encourage library clients to + make the effort to upgrade to use version 1.0, since it is both faster + and more robust than previous versions. + + + HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc. + + It's difficult for me to support compilation on all these platforms. + My approach is to collect binaries for these platforms, and put them + on the master web page (http://sources.redhat.com/bzip2). Look there. + However (FWIW), bzip2-1.0.X is very standard ANSI C and should compile + unmodified with MS Visual C. If you have difficulties building, you + might want to read README.COMPILATION.PROBLEMS. + + At least using MS Visual C++ 6, you can build from the unmodified + sources by issuing, in a command shell: + nmake -f makefile.msc + (you may need to first run the MSVC-provided script VCVARS32.BAT + so as to set up paths to the MSVC tools correctly). + + + VALIDATION + + Correct operation, in the sense that a compressed file can always be + decompressed to reproduce the original, is obviously of paramount + importance. To validate bzip2, I used a modified version of Mark + Nelson's churn program. Churn is an automated test driver which + recursively traverses a directory structure, using bzip2 to compress + and then decompress each file it encounters, and checking that the + decompressed data is the same as the original. There are more details + in Section 4 of the user guide. + + + + Please read and be aware of the following: + + WARNING: + + This program (attempts to) compress data by performing several + non-trivial transformations on it. Unless you are 100% familiar + with *all* the algorithms contained herein, and with the + consequences of modifying them, you should NOT meddle with the + compression or decompression machinery. Incorrect changes can and + very likely *will* lead to disastrous loss of data. + + + DISCLAIMER: + + I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE + USE OF THIS PROGRAM, HOWSOEVER CAUSED. + + Every compression of a file implies an assumption that the + compressed file can be decompressed to reproduce the original. + Great efforts in design, coding and testing have been made to + ensure that this program works correctly. However, the complexity + of the algorithms, and, in particular, the presence of various + special cases in the code which occur with very low but non-zero + probability make it impossible to rule out the possibility of bugs + remaining in the program. DO NOT COMPRESS ANY DATA WITH THIS + PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER + SMALL, THAT THE DATA WILL NOT BE RECOVERABLE. + + That is not to say this program is inherently unreliable. Indeed, + I very much hope the opposite is true. bzip2 has been carefully + constructed and extensively tested. + + + PATENTS: + + To the best of my knowledge, bzip2 does not use any patented + algorithms. However, I do not have the resources available to + carry out a full patent search. Therefore I cannot give any + guarantee of the above statement. + + End of legalities. + + + WHAT'S NEW IN 0.9.0 (as compared to 0.1pl2) ? + + * Approx 10% faster compression, 30% faster decompression + * -t (test mode) is a lot quicker + * Can decompress concatenated compressed files + * Programming interface, so programs can directly read/write .bz2 files + * Less restrictive (BSD-style) licensing + * Flag handling more compatible with GNU gzip + * Much more documentation, i.e., a proper user manual + * Hopefully, improved portability (at least of the library) + + WHAT'S NEW IN 0.9.5 ? + + * Compression speed is much less sensitive to the input + data than in previous versions. Specifically, the very + slow performance caused by repetitive data is fixed. + * Many small improvements in file and flag handling. + * A Y2K statement. + + WHAT'S NEW IN 1.0.0 ? + + See the CHANGES file. + + WHAT'S NEW IN 1.0.2 ? + + See the CHANGES file. + + + I hope you find bzip2 useful. Feel free to contact me at + jseward at acm.org + if you have any suggestions or queries. Many people mailed me with + comments, suggestions and patches after the releases of bzip-0.15, + bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1, + and the changes in bzip2 are largely a result of this feedback. + I thank you for your comments. + + At least for the time being, bzip2's "home" is (or can be reached via) + http://sources.redhat.com/bzip2. + + Julian Seward + jseward at acm.org + + Cambridge, UK (and what a great town this is!) + + 18 July 1996 (version 0.15) + 25 August 1996 (version 0.21) + 7 August 1997 (bzip2, version 0.1) + 29 August 1997 (bzip2, version 0.1pl2) + 23 August 1998 (bzip2, version 0.9.0) + 8 June 1999 (bzip2, version 0.9.5) + 4 Sept 1999 (bzip2, version 0.9.5d) + 5 May 2000 (bzip2, version 1.0pre8) + 30 December 2001 (bzip2, version 1.0.2pre1) \ No newline at end of file Index: llvm/lib/Support/bzip2/README.COMPILATION.PROBLEMS diff -c /dev/null llvm/lib/Support/bzip2/README.COMPILATION.PROBLEMS:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/README.COMPILATION.PROBLEMS Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,130 ---- + + bzip2-1.0 should compile without problems on the vast majority of + platforms. Using the supplied Makefile, I've built and tested it + myself for x86-linux, sparc-solaris, alpha-linux, x86-cygwin32 and + alpha-tru64unix. With makefile.msc, Visual C++ 6.0 and nmake, you can + build a native Win32 version too. Large file support seems to work + correctly on at least alpha-tru64unix and x86-cygwin32 (on Windows + 2000). + + When I say "large file" I mean a file of size 2,147,483,648 (2^31) + bytes or above. Many older OSs can't handle files above this size, + but many newer ones can. Large files are pretty huge -- most files + you'll encounter are not Large Files. + + Earlier versions of bzip2 (0.1, 0.9.0, 0.9.5) compiled on a wide + variety of platforms without difficulty, and I hope this version will + continue in that tradition. However, in order to support large files, + I've had to include the define -D_FILE_OFFSET_BITS=64 in the Makefile. + This can cause problems. + + The technique of adding -D_FILE_OFFSET_BITS=64 to get large file + support is, as far as I know, the Recommended Way to get correct large + file support. For more details, see the Large File Support + Specification, published by the Large File Summit, at + http://www.sas.com/standard/large.file/ + + As a general comment, if you get compilation errors which you think + are related to large file support, try removing the above define from + the Makefile, ie, delete the line + BIGFILES=-D_FILE_OFFSET_BITS=64 + from the Makefile, and do 'make clean ; make'. This will give you a + version of bzip2 without large file support, which, for most + applications, is probably not a problem. + + Alternatively, try some of the platform-specific hints listed below. + + You can use the spewG.c program to generate huge files to test bzip2's + large file support, if you are feeling paranoid. Be aware though that + any compilation problems which affect bzip2 will also affect spewG.c, + alas. + + + Known problems as of 1.0pre8: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + * HP/UX 10.20 and 11.00, using gcc (2.7.2.3 and 2.95.2): A large + number of warnings appear, including the following: + + /usr/include/sys/resource.h: In function `getrlimit': + /usr/include/sys/resource.h:168: + warning: implicit declaration of function `__getrlimit64' + /usr/include/sys/resource.h: In function `setrlimit': + /usr/include/sys/resource.h:170: + warning: implicit declaration of function `__setrlimit64' + + This would appear to be a problem with large file support, header + files and gcc. gcc may or may not give up at this point. If it + fails, you might be able to improve matters by adding + -D__STDC_EXT__=1 + to the BIGFILES variable in the Makefile (ie, change its definition + to + BIGFILES=-D_FILE_OFFSET_BITS=64 -D__STDC_EXT__=1 + + Even if gcc does produce a binary which appears to work (ie passes + its self-tests), you might want to test it to see if it works properly + on large files. + + + * HP/UX 10.20 and 11.00, using HP's cc compiler. + + No specific problems for this combination, except that you'll need to + specify the -Ae flag, and zap the gcc-specific stuff + -Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce. + You should retain -D_FILE_OFFSET_BITS=64 in order to get large + file support -- which is reported to work ok for this HP/UX + cc + combination. + + + * SunOS 4.1.X. + + Amazingly, there are still people out there using this venerable old + banger. I shouldn't be too rude -- I started life on SunOS, and + it was a pretty darn good OS, way back then. Anyway: + + SunOS doesn't seem to have strerror(), so you'll have to use + perror(), perhaps by doing adding this (warning: UNTESTED CODE): + + char* strerror ( int errnum ) + { + if (errnum < 0 || errnum >= sys_nerr) + return "Unknown error"; + else + return sys_errlist[errnum]; + } + + Or you could comment out the relevant calls to strerror; they're + not mission-critical. Or you could upgrade to Solaris. Ha ha ha! + (what?? you think I've got Bad Attitude?) + + + * Making a shared library on Solaris. (Not really a compilation + problem, but many people ask ...) + + Firstly, if you have Solaris 8, either you have libbz2.so already + on your system, or you can install it from the Solaris CD. + + Secondly, be aware that there are potential naming conflicts + between the .so file supplied with Solaris 8, and the .so file + which Makefile-libbz2_so will make. Makefile-libbz2_so creates + a .so which has the names which I intend to be "official" as + of version 1.0.0 and onwards. Unfortunately, the .so in + Solaris 8 appeared before I decided on the final names, so + the two libraries are incompatible. We have since communicated + and I hope that the problems will have been solved in the next + version of Solaris, whenever that might appear. + + All that said: you might be able to get somewhere + by finding the line in Makefile-libbz2_so which says + + $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.2 $(OBJS) + + and replacing with + + $(CC) -G -shared -o libbz2.so.1.0.2 -h libbz2.so.1.0 $(OBJS) + + If gcc objects to the combination -fpic -fPIC, get rid of + the second one, leaving just "-fpic". + + + That's the end of the currently known compilation problems. Index: llvm/lib/Support/bzip2/Y2K_INFO diff -c /dev/null llvm/lib/Support/bzip2/Y2K_INFO:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/Y2K_INFO Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,34 ---- + + Y2K status of bzip2 and libbzip2, versions 0.1, 0.9.0 and 0.9.5 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Informally speaking: + bzip2 is a compression program built on top of libbzip2, + a library which does the real work of compression and + decompression. As far as I am aware, libbzip2 does not have + any date-related code at all. + + bzip2 itself copies dates from source to destination files + when compressing or decompressing, using the 'stat' and 'utime' + UNIX system calls. It doesn't examine, manipulate or store the + dates in any way. So as far as I can see, there shouldn't be any + problem with bzip2 providing 'stat' and 'utime' work correctly + on your system. + + On non-unix platforms (those for which BZ_UNIX in bzip2.c is + not set to 1), bzip2 doesn't even do the date copying. + + Overall, informally speaking, I don't think bzip2 or libbzip2 + have a Y2K problem. + + Formally speaking: + I am not prepared to offer you any assurance whatsoever + regarding Y2K issues in my software. You alone assume the + entire risk of using the software. The disclaimer of liability + in the LICENSE file in the bzip2 source distribution continues + to apply on this issue as with every other issue pertaining + to the software. + + Julian Seward + Cambridge, UK + 25 August 1999 Index: llvm/lib/Support/bzip2/blocksort.c diff -c /dev/null llvm/lib/Support/bzip2/blocksort.c:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/blocksort.c Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,1141 ---- + + /*-------------------------------------------------------------*/ + /*--- Block sorting machinery ---*/ + /*--- blocksort.c ---*/ + /*-------------------------------------------------------------*/ + + /*-- + This file is a part of bzip2 and/or libbzip2, a program and + library for lossless, block-sorting data compression. + + Copyright (C) 1996-2002 Julian R Seward. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Julian Seward, Cambridge, UK. + jseward at acm.org + bzip2/libbzip2 version 1.0 of 21 March 2000 + + This program is based on (at least) the work of: + Mike Burrows + David Wheeler + Peter Fenwick + Alistair Moffat + Radford Neal + Ian H. Witten + Robert Sedgewick + Jon L. Bentley + + For more information on these sources, see the manual. + + To get some idea how the block sorting algorithms in this file + work, read my paper + On the Performance of BWT Sorting Algorithms + in Proceedings of the IEEE Data Compression Conference 2000, + Snowbird, Utah, USA, 27-30 March 2000. The main sort in this + file implements the algorithm called cache in the paper. + --*/ + + + #include "bzlib_private.h" + + /*---------------------------------------------*/ + /*--- Fallback O(N log(N)^2) sorting ---*/ + /*--- algorithm, for repetitive blocks ---*/ + /*---------------------------------------------*/ + + /*---------------------------------------------*/ + static + __inline__ + void fallbackSimpleSort ( UInt32* fmap, + UInt32* eclass, + Int32 lo, + Int32 hi ) + { + Int32 i, j, tmp; + UInt32 ec_tmp; + + if (lo == hi) return; + + if (hi - lo > 3) { + for ( i = hi-4; i >= lo; i-- ) { + tmp = fmap[i]; + ec_tmp = eclass[tmp]; + for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 ) + fmap[j-4] = fmap[j]; + fmap[j-4] = tmp; + } + } + + for ( i = hi-1; i >= lo; i-- ) { + tmp = fmap[i]; + ec_tmp = eclass[tmp]; + for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ ) + fmap[j-1] = fmap[j]; + fmap[j-1] = tmp; + } + } + + + /*---------------------------------------------*/ + #define fswap(zz1, zz2) \ + { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; } + + #define fvswap(zzp1, zzp2, zzn) \ + { \ + Int32 yyp1 = (zzp1); \ + Int32 yyp2 = (zzp2); \ + Int32 yyn = (zzn); \ + while (yyn > 0) { \ + fswap(fmap[yyp1], fmap[yyp2]); \ + yyp1++; yyp2++; yyn--; \ + } \ + } + + + #define fmin(a,b) ((a) < (b)) ? (a) : (b) + + #define fpush(lz,hz) { stackLo[sp] = lz; \ + stackHi[sp] = hz; \ + sp++; } + + #define fpop(lz,hz) { sp--; \ + lz = stackLo[sp]; \ + hz = stackHi[sp]; } + + #define FALLBACK_QSORT_SMALL_THRESH 10 + #define FALLBACK_QSORT_STACK_SIZE 100 + + + static + void fallbackQSort3 ( UInt32* fmap, + UInt32* eclass, + Int32 loSt, + Int32 hiSt ) + { + Int32 unLo, unHi, ltLo, gtHi, n, m; + Int32 sp, lo, hi; + UInt32 med, r, r3; + Int32 stackLo[FALLBACK_QSORT_STACK_SIZE]; + Int32 stackHi[FALLBACK_QSORT_STACK_SIZE]; + + r = 0; + + sp = 0; + fpush ( loSt, hiSt ); + + while (sp > 0) { + + AssertH ( sp < FALLBACK_QSORT_STACK_SIZE, 1004 ); + + fpop ( lo, hi ); + if (hi - lo < FALLBACK_QSORT_SMALL_THRESH) { + fallbackSimpleSort ( fmap, eclass, lo, hi ); + continue; + } + + /* Random partitioning. Median of 3 sometimes fails to + avoid bad cases. Median of 9 seems to help but + looks rather expensive. This too seems to work but + is cheaper. Guidance for the magic constants + 7621 and 32768 is taken from Sedgewick's algorithms + book, chapter 35. + */ + r = ((r * 7621) + 1) % 32768; + r3 = r % 3; + if (r3 == 0) med = eclass[fmap[lo]]; else + if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else + med = eclass[fmap[hi]]; + + unLo = ltLo = lo; + unHi = gtHi = hi; + + while (1) { + while (1) { + if (unLo > unHi) break; + n = (Int32)eclass[fmap[unLo]] - (Int32)med; + if (n == 0) { + fswap(fmap[unLo], fmap[ltLo]); + ltLo++; unLo++; + continue; + }; + if (n > 0) break; + unLo++; + } + while (1) { + if (unLo > unHi) break; + n = (Int32)eclass[fmap[unHi]] - (Int32)med; + if (n == 0) { + fswap(fmap[unHi], fmap[gtHi]); + gtHi--; unHi--; + continue; + }; + if (n < 0) break; + unHi--; + } + if (unLo > unHi) break; + fswap(fmap[unLo], fmap[unHi]); unLo++; unHi--; + } + + AssertD ( unHi == unLo-1, "fallbackQSort3(2)" ); + + if (gtHi < ltLo) continue; + + n = fmin(ltLo-lo, unLo-ltLo); fvswap(lo, unLo-n, n); + m = fmin(hi-gtHi, gtHi-unHi); fvswap(unLo, hi-m+1, m); + + n = lo + unLo - ltLo - 1; + m = hi - (gtHi - unHi) + 1; + + if (n - lo > hi - m) { + fpush ( lo, n ); + fpush ( m, hi ); + } else { + fpush ( m, hi ); + fpush ( lo, n ); + } + } + } + + #undef fmin + #undef fpush + #undef fpop + #undef fswap + #undef fvswap + #undef FALLBACK_QSORT_SMALL_THRESH + #undef FALLBACK_QSORT_STACK_SIZE + + + /*---------------------------------------------*/ + /* Pre: + nblock > 0 + eclass exists for [0 .. nblock-1] + ((UChar*)eclass) [0 .. nblock-1] holds block + ptr exists for [0 .. nblock-1] + + Post: + ((UChar*)eclass) [0 .. nblock-1] holds block + All other areas of eclass destroyed + fmap [0 .. nblock-1] holds sorted order + bhtab [ 0 .. 2+(nblock/32) ] destroyed + */ + + #define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31)) + #define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31)) + #define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31))) + #define WORD_BH(zz) bhtab[(zz) >> 5] + #define UNALIGNED_BH(zz) ((zz) & 0x01f) + + static + void fallbackSort ( UInt32* fmap, + UInt32* eclass, + UInt32* bhtab, + Int32 nblock, + Int32 verb ) + { + Int32 ftab[257]; + Int32 ftabCopy[256]; + Int32 H, i, j, k, l, r, cc, cc1; + Int32 nNotDone; + Int32 nBhtab; + UChar* eclass8 = (UChar*)eclass; + + /*-- + Initial 1-char radix sort to generate + initial fmap and initial BH bits. + --*/ + if (verb >= 4) + VPrintf0 ( " bucket sorting ...\n" ); + for (i = 0; i < 257; i++) ftab[i] = 0; + for (i = 0; i < nblock; i++) ftab[eclass8[i]]++; + for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i]; + for (i = 1; i < 257; i++) ftab[i] += ftab[i-1]; + + for (i = 0; i < nblock; i++) { + j = eclass8[i]; + k = ftab[j] - 1; + ftab[j] = k; + fmap[k] = i; + } + + nBhtab = 2 + (nblock / 32); + for (i = 0; i < nBhtab; i++) bhtab[i] = 0; + for (i = 0; i < 256; i++) SET_BH(ftab[i]); + + /*-- + Inductively refine the buckets. Kind-of an + "exponential radix sort" (!), inspired by the + Manber-Myers suffix array construction algorithm. + --*/ + + /*-- set sentinel bits for block-end detection --*/ + for (i = 0; i < 32; i++) { + SET_BH(nblock + 2*i); + CLEAR_BH(nblock + 2*i + 1); + } + + /*-- the log(N) loop --*/ + H = 1; + while (1) { + + if (verb >= 4) + VPrintf1 ( " depth %6d has ", H ); + + j = 0; + for (i = 0; i < nblock; i++) { + if (ISSET_BH(i)) j = i; + k = fmap[i] - H; if (k < 0) k += nblock; + eclass[k] = j; + } + + nNotDone = 0; + r = -1; + while (1) { + + /*-- find the next non-singleton bucket --*/ + k = r + 1; + while (ISSET_BH(k) && UNALIGNED_BH(k)) k++; + if (ISSET_BH(k)) { + while (WORD_BH(k) == 0xffffffff) k += 32; + while (ISSET_BH(k)) k++; + } + l = k - 1; + if (l >= nblock) break; + while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++; + if (!ISSET_BH(k)) { + while (WORD_BH(k) == 0x00000000) k += 32; + while (!ISSET_BH(k)) k++; + } + r = k - 1; + if (r >= nblock) break; + + /*-- now [l, r] bracket current bucket --*/ + if (r > l) { + nNotDone += (r - l + 1); + fallbackQSort3 ( fmap, eclass, l, r ); + + /*-- scan bucket and generate header bits-- */ + cc = -1; + for (i = l; i <= r; i++) { + cc1 = eclass[fmap[i]]; + if (cc != cc1) { SET_BH(i); cc = cc1; }; + } + } + } + + if (verb >= 4) + VPrintf1 ( "%6d unresolved strings\n", nNotDone ); + + H *= 2; + if (H > nblock || nNotDone == 0) break; + } + + /*-- + Reconstruct the original block in + eclass8 [0 .. nblock-1], since the + previous phase destroyed it. + --*/ + if (verb >= 4) + VPrintf0 ( " reconstructing block ...\n" ); + j = 0; + for (i = 0; i < nblock; i++) { + while (ftabCopy[j] == 0) j++; + ftabCopy[j]--; + eclass8[fmap[i]] = (UChar)j; + } + AssertH ( j < 256, 1005 ); + } + + #undef SET_BH + #undef CLEAR_BH + #undef ISSET_BH + #undef WORD_BH + #undef UNALIGNED_BH + + + /*---------------------------------------------*/ + /*--- The main, O(N^2 log(N)) sorting ---*/ + /*--- algorithm. Faster for "normal" ---*/ + /*--- non-repetitive blocks. ---*/ + /*---------------------------------------------*/ + + /*---------------------------------------------*/ + static + __inline__ + Bool mainGtU ( UInt32 i1, + UInt32 i2, + UChar* block, + UInt16* quadrant, + UInt32 nblock, + Int32* budget ) + { + Int32 k; + UChar c1, c2; + UInt16 s1, s2; + + AssertD ( i1 != i2, "mainGtU" ); + /* 1 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 2 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 3 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 4 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 5 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 6 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 7 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 8 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 9 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 10 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 11 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 12 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + + k = nblock + 8; + + do { + /* 1 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 2 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 3 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 4 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 5 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 6 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 7 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 8 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + + if (i1 >= nblock) i1 -= nblock; + if (i2 >= nblock) i2 -= nblock; + + k -= 8; + (*budget)--; + } + while (k >= 0); + + return False; + } + + + /*---------------------------------------------*/ + /*-- + Knuth's increments seem to work better + than Incerpi-Sedgewick here. Possibly + because the number of elems to sort is + usually small, typically <= 20. + --*/ + static + Int32 incs[14] = { 1, 4, 13, 40, 121, 364, 1093, 3280, + 9841, 29524, 88573, 265720, + 797161, 2391484 }; + + static + void mainSimpleSort ( UInt32* ptr, + UChar* block, + UInt16* quadrant, + Int32 nblock, + Int32 lo, + Int32 hi, + Int32 d, + Int32* budget ) + { + Int32 i, j, h, bigN, hp; + UInt32 v; + + bigN = hi - lo + 1; + if (bigN < 2) return; + + hp = 0; + while (incs[hp] < bigN) hp++; + hp--; + + for (; hp >= 0; hp--) { + h = incs[hp]; + + i = lo + h; + while (True) { + + /*-- copy 1 --*/ + if (i > hi) break; + v = ptr[i]; + j = i; + while ( mainGtU ( + ptr[j-h]+d, v+d, block, quadrant, nblock, budget + ) ) { + ptr[j] = ptr[j-h]; + j = j - h; + if (j <= (lo + h - 1)) break; + } + ptr[j] = v; + i++; + + /*-- copy 2 --*/ + if (i > hi) break; + v = ptr[i]; + j = i; + while ( mainGtU ( + ptr[j-h]+d, v+d, block, quadrant, nblock, budget + ) ) { + ptr[j] = ptr[j-h]; + j = j - h; + if (j <= (lo + h - 1)) break; + } + ptr[j] = v; + i++; + + /*-- copy 3 --*/ + if (i > hi) break; + v = ptr[i]; + j = i; + while ( mainGtU ( + ptr[j-h]+d, v+d, block, quadrant, nblock, budget + ) ) { + ptr[j] = ptr[j-h]; + j = j - h; + if (j <= (lo + h - 1)) break; + } + ptr[j] = v; + i++; + + if (*budget < 0) return; + } + } + } + + + /*---------------------------------------------*/ + /*-- + The following is an implementation of + an elegant 3-way quicksort for strings, + described in a paper "Fast Algorithms for + Sorting and Searching Strings", by Robert + Sedgewick and Jon L. Bentley. + --*/ + + #define mswap(zz1, zz2) \ + { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; } + + #define mvswap(zzp1, zzp2, zzn) \ + { \ + Int32 yyp1 = (zzp1); \ + Int32 yyp2 = (zzp2); \ + Int32 yyn = (zzn); \ + while (yyn > 0) { \ + mswap(ptr[yyp1], ptr[yyp2]); \ + yyp1++; yyp2++; yyn--; \ + } \ + } + + static + __inline__ + UChar mmed3 ( UChar a, UChar b, UChar c ) + { + UChar t; + if (a > b) { t = a; a = b; b = t; }; + if (b > c) { + b = c; + if (a > b) b = a; + } + return b; + } + + #define mmin(a,b) ((a) < (b)) ? (a) : (b) + + #define mpush(lz,hz,dz) { stackLo[sp] = lz; \ + stackHi[sp] = hz; \ + stackD [sp] = dz; \ + sp++; } + + #define mpop(lz,hz,dz) { sp--; \ + lz = stackLo[sp]; \ + hz = stackHi[sp]; \ + dz = stackD [sp]; } + + + #define mnextsize(az) (nextHi[az]-nextLo[az]) + + #define mnextswap(az,bz) \ + { Int32 tz; \ + tz = nextLo[az]; nextLo[az] = nextLo[bz]; nextLo[bz] = tz; \ + tz = nextHi[az]; nextHi[az] = nextHi[bz]; nextHi[bz] = tz; \ + tz = nextD [az]; nextD [az] = nextD [bz]; nextD [bz] = tz; } + + + #define MAIN_QSORT_SMALL_THRESH 20 + #define MAIN_QSORT_DEPTH_THRESH (BZ_N_RADIX + BZ_N_QSORT) + #define MAIN_QSORT_STACK_SIZE 100 + + static + void mainQSort3 ( UInt32* ptr, + UChar* block, + UInt16* quadrant, + Int32 nblock, + Int32 loSt, + Int32 hiSt, + Int32 dSt, + Int32* budget ) + { + Int32 unLo, unHi, ltLo, gtHi, n, m, med; + Int32 sp, lo, hi, d; + + Int32 stackLo[MAIN_QSORT_STACK_SIZE]; + Int32 stackHi[MAIN_QSORT_STACK_SIZE]; + Int32 stackD [MAIN_QSORT_STACK_SIZE]; + + Int32 nextLo[3]; + Int32 nextHi[3]; + Int32 nextD [3]; + + sp = 0; + mpush ( loSt, hiSt, dSt ); + + while (sp > 0) { + + AssertH ( sp < MAIN_QSORT_STACK_SIZE, 1001 ); + + mpop ( lo, hi, d ); + if (hi - lo < MAIN_QSORT_SMALL_THRESH || + d > MAIN_QSORT_DEPTH_THRESH) { + mainSimpleSort ( ptr, block, quadrant, nblock, lo, hi, d, budget ); + if (*budget < 0) return; + continue; + } + + med = (Int32) + mmed3 ( block[ptr[ lo ]+d], + block[ptr[ hi ]+d], + block[ptr[ (lo+hi)>>1 ]+d] ); + + unLo = ltLo = lo; + unHi = gtHi = hi; + + while (True) { + while (True) { + if (unLo > unHi) break; + n = ((Int32)block[ptr[unLo]+d]) - med; + if (n == 0) { + mswap(ptr[unLo], ptr[ltLo]); + ltLo++; unLo++; continue; + }; + if (n > 0) break; + unLo++; + } + while (True) { + if (unLo > unHi) break; + n = ((Int32)block[ptr[unHi]+d]) - med; + if (n == 0) { + mswap(ptr[unHi], ptr[gtHi]); + gtHi--; unHi--; continue; + }; + if (n < 0) break; + unHi--; + } + if (unLo > unHi) break; + mswap(ptr[unLo], ptr[unHi]); unLo++; unHi--; + } + + AssertD ( unHi == unLo-1, "mainQSort3(2)" ); + + if (gtHi < ltLo) { + mpush(lo, hi, d+1 ); + continue; + } + + n = mmin(ltLo-lo, unLo-ltLo); mvswap(lo, unLo-n, n); + m = mmin(hi-gtHi, gtHi-unHi); mvswap(unLo, hi-m+1, m); + + n = lo + unLo - ltLo - 1; + m = hi - (gtHi - unHi) + 1; + + nextLo[0] = lo; nextHi[0] = n; nextD[0] = d; + nextLo[1] = m; nextHi[1] = hi; nextD[1] = d; + nextLo[2] = n+1; nextHi[2] = m-1; nextD[2] = d+1; + + if (mnextsize(0) < mnextsize(1)) mnextswap(0,1); + if (mnextsize(1) < mnextsize(2)) mnextswap(1,2); + if (mnextsize(0) < mnextsize(1)) mnextswap(0,1); + + AssertD (mnextsize(0) >= mnextsize(1), "mainQSort3(8)" ); + AssertD (mnextsize(1) >= mnextsize(2), "mainQSort3(9)" ); + + mpush (nextLo[0], nextHi[0], nextD[0]); + mpush (nextLo[1], nextHi[1], nextD[1]); + mpush (nextLo[2], nextHi[2], nextD[2]); + } + } + + #undef mswap + #undef mvswap + #undef mpush + #undef mpop + #undef mmin + #undef mnextsize + #undef mnextswap + #undef MAIN_QSORT_SMALL_THRESH + #undef MAIN_QSORT_DEPTH_THRESH + #undef MAIN_QSORT_STACK_SIZE + + + /*---------------------------------------------*/ + /* Pre: + nblock > N_OVERSHOOT + block32 exists for [0 .. nblock-1 +N_OVERSHOOT] + ((UChar*)block32) [0 .. nblock-1] holds block + ptr exists for [0 .. nblock-1] + + Post: + ((UChar*)block32) [0 .. nblock-1] holds block + All other areas of block32 destroyed + ftab [0 .. 65536 ] destroyed + ptr [0 .. nblock-1] holds sorted order + if (*budget < 0), sorting was abandoned + */ + + #define BIGFREQ(b) (ftab[((b)+1) << 8] - ftab[(b) << 8]) + #define SETMASK (1 << 21) + #define CLEARMASK (~(SETMASK)) + + static + void mainSort ( UInt32* ptr, + UChar* block, + UInt16* quadrant, + UInt32* ftab, + Int32 nblock, + Int32 verb, + Int32* budget ) + { + Int32 i, j, k, ss, sb; + Int32 runningOrder[256]; + Bool bigDone[256]; + Int32 copyStart[256]; + Int32 copyEnd [256]; + UChar c1; + Int32 numQSorted; + UInt16 s; + if (verb >= 4) VPrintf0 ( " main sort initialise ...\n" ); + + /*-- set up the 2-byte frequency table --*/ + for (i = 65536; i >= 0; i--) ftab[i] = 0; + + j = block[0] << 8; + i = nblock-1; + for (; i >= 3; i -= 4) { + quadrant[i] = 0; + j = (j >> 8) | ( ((UInt16)block[i]) << 8); + ftab[j]++; + quadrant[i-1] = 0; + j = (j >> 8) | ( ((UInt16)block[i-1]) << 8); + ftab[j]++; + quadrant[i-2] = 0; + j = (j >> 8) | ( ((UInt16)block[i-2]) << 8); + ftab[j]++; + quadrant[i-3] = 0; + j = (j >> 8) | ( ((UInt16)block[i-3]) << 8); + ftab[j]++; + } + for (; i >= 0; i--) { + quadrant[i] = 0; + j = (j >> 8) | ( ((UInt16)block[i]) << 8); + ftab[j]++; + } + + /*-- (emphasises close relationship of block & quadrant) --*/ + for (i = 0; i < BZ_N_OVERSHOOT; i++) { + block [nblock+i] = block[i]; + quadrant[nblock+i] = 0; + } + + if (verb >= 4) VPrintf0 ( " bucket sorting ...\n" ); + + /*-- Complete the initial radix sort --*/ + for (i = 1; i <= 65536; i++) ftab[i] += ftab[i-1]; + + s = block[0] << 8; + i = nblock-1; + for (; i >= 3; i -= 4) { + s = (s >> 8) | (block[i] << 8); + j = ftab[s] -1; + ftab[s] = j; + ptr[j] = i; + s = (s >> 8) | (block[i-1] << 8); + j = ftab[s] -1; + ftab[s] = j; + ptr[j] = i-1; + s = (s >> 8) | (block[i-2] << 8); + j = ftab[s] -1; + ftab[s] = j; + ptr[j] = i-2; + s = (s >> 8) | (block[i-3] << 8); + j = ftab[s] -1; + ftab[s] = j; + ptr[j] = i-3; + } + for (; i >= 0; i--) { + s = (s >> 8) | (block[i] << 8); + j = ftab[s] -1; + ftab[s] = j; + ptr[j] = i; + } + + /*-- + Now ftab contains the first loc of every small bucket. + Calculate the running order, from smallest to largest + big bucket. + --*/ + for (i = 0; i <= 255; i++) { + bigDone [i] = False; + runningOrder[i] = i; + } + + { + Int32 vv; + Int32 h = 1; + do h = 3 * h + 1; while (h <= 256); + do { + h = h / 3; + for (i = h; i <= 255; i++) { + vv = runningOrder[i]; + j = i; + while ( BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv) ) { + runningOrder[j] = runningOrder[j-h]; + j = j - h; + if (j <= (h - 1)) goto zero; + } + zero: + runningOrder[j] = vv; + } + } while (h != 1); + } + + /*-- + The main sorting loop. + --*/ + + numQSorted = 0; + + for (i = 0; i <= 255; i++) { + + /*-- + Process big buckets, starting with the least full. + Basically this is a 3-step process in which we call + mainQSort3 to sort the small buckets [ss, j], but + also make a big effort to avoid the calls if we can. + --*/ + ss = runningOrder[i]; + + /*-- + Step 1: + Complete the big bucket [ss] by quicksorting + any unsorted small buckets [ss, j], for j != ss. + Hopefully previous pointer-scanning phases have already + completed many of the small buckets [ss, j], so + we don't have to sort them at all. + --*/ + for (j = 0; j <= 255; j++) { + if (j != ss) { + sb = (ss << 8) + j; + if ( ! (ftab[sb] & SETMASK) ) { + Int32 lo = ftab[sb] & CLEARMASK; + Int32 hi = (ftab[sb+1] & CLEARMASK) - 1; + if (hi > lo) { + if (verb >= 4) + VPrintf4 ( " qsort [0x%x, 0x%x] " + "done %d this %d\n", + ss, j, numQSorted, hi - lo + 1 ); + mainQSort3 ( + ptr, block, quadrant, nblock, + lo, hi, BZ_N_RADIX, budget + ); + numQSorted += (hi - lo + 1); + if (*budget < 0) return; + } + } + ftab[sb] |= SETMASK; + } + } + + AssertH ( !bigDone[ss], 1006 ); + + /*-- + Step 2: + Now scan this big bucket [ss] so as to synthesise the + sorted order for small buckets [t, ss] for all t, + including, magically, the bucket [ss,ss] too. + This will avoid doing Real Work in subsequent Step 1's. + --*/ + { + for (j = 0; j <= 255; j++) { + copyStart[j] = ftab[(j << 8) + ss] & CLEARMASK; + copyEnd [j] = (ftab[(j << 8) + ss + 1] & CLEARMASK) - 1; + } + for (j = ftab[ss << 8] & CLEARMASK; j < copyStart[ss]; j++) { + k = ptr[j]-1; if (k < 0) k += nblock; + c1 = block[k]; + if (!bigDone[c1]) + ptr[ copyStart[c1]++ ] = k; + } + for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) { + k = ptr[j]-1; if (k < 0) k += nblock; + c1 = block[k]; + if (!bigDone[c1]) + ptr[ copyEnd[c1]-- ] = k; + } + } + + AssertH ( (copyStart[ss]-1 == copyEnd[ss]) + || + /* Extremely rare case missing in bzip2-1.0.0 and 1.0.1. + Necessity for this case is demonstrated by compressing + a sequence of approximately 48.5 million of character + 251; 1.0.0/1.0.1 will then die here. */ + (copyStart[ss] == 0 && copyEnd[ss] == nblock-1), + 1007 ) + + for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= SETMASK; + + /*-- + Step 3: + The [ss] big bucket is now done. Record this fact, + and update the quadrant descriptors. Remember to + update quadrants in the overshoot area too, if + necessary. The "if (i < 255)" test merely skips + this updating for the last bucket processed, since + updating for the last bucket is pointless. + + The quadrant array provides a way to incrementally + cache sort orderings, as they appear, so as to + make subsequent comparisons in fullGtU() complete + faster. For repetitive blocks this makes a big + difference (but not big enough to be able to avoid + the fallback sorting mechanism, exponential radix sort). + + The precise meaning is: at all times: + + for 0 <= i < nblock and 0 <= j <= nblock + + if block[i] != block[j], + + then the relative values of quadrant[i] and + quadrant[j] are meaningless. + + else { + if quadrant[i] < quadrant[j] + then the string starting at i lexicographically + precedes the string starting at j + + else if quadrant[i] > quadrant[j] + then the string starting at j lexicographically + precedes the string starting at i + + else + the relative ordering of the strings starting + at i and j has not yet been determined. + } + --*/ + bigDone[ss] = True; + + if (i < 255) { + Int32 bbStart = ftab[ss << 8] & CLEARMASK; + Int32 bbSize = (ftab[(ss+1) << 8] & CLEARMASK) - bbStart; + Int32 shifts = 0; + + while ((bbSize >> shifts) > 65534) shifts++; + + for (j = bbSize-1; j >= 0; j--) { + Int32 a2update = ptr[bbStart + j]; + UInt16 qVal = (UInt16)(j >> shifts); + quadrant[a2update] = qVal; + if (a2update < BZ_N_OVERSHOOT) + quadrant[a2update + nblock] = qVal; + } + AssertH ( ((bbSize-1) >> shifts) <= 65535, 1002 ); + } + + } + + if (verb >= 4) + VPrintf3 ( " %d pointers, %d sorted, %d scanned\n", + nblock, numQSorted, nblock - numQSorted ); + } + + #undef BIGFREQ + #undef SETMASK + #undef CLEARMASK + + + /*---------------------------------------------*/ + /* Pre: + nblock > 0 + arr2 exists for [0 .. nblock-1 +N_OVERSHOOT] + ((UChar*)arr2) [0 .. nblock-1] holds block + arr1 exists for [0 .. nblock-1] + + Post: + ((UChar*)arr2) [0 .. nblock-1] holds block + All other areas of block destroyed + ftab [ 0 .. 65536 ] destroyed + arr1 [0 .. nblock-1] holds sorted order + */ + void BZ2_blockSort ( EState* s ) + { + UInt32* ptr = s->ptr; + UChar* block = s->block; + UInt32* ftab = s->ftab; + Int32 nblock = s->nblock; + Int32 verb = s->verbosity; + Int32 wfact = s->workFactor; + UInt16* quadrant; + Int32 budget; + Int32 budgetInit; + Int32 i; + + if (nblock < 10000) { + fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb ); + } else { + /* Calculate the location for quadrant, remembering to get + the alignment right. Assumes that &(block[0]) is at least + 2-byte aligned -- this should be ok since block is really + the first section of arr2. + */ + i = nblock+BZ_N_OVERSHOOT; + if (i & 1) i++; + quadrant = (UInt16*)(&(block[i])); + + /* (wfact-1) / 3 puts the default-factor-30 + transition point at very roughly the same place as + with v0.1 and v0.9.0. + Not that it particularly matters any more, since the + resulting compressed stream is now the same regardless + of whether or not we use the main sort or fallback sort. + */ + if (wfact < 1 ) wfact = 1; + if (wfact > 100) wfact = 100; + budgetInit = nblock * ((wfact-1) / 3); + budget = budgetInit; + + mainSort ( ptr, block, quadrant, ftab, nblock, verb, &budget ); + if (verb >= 3) + VPrintf3 ( " %d work, %d block, ratio %5.2f\n", + budgetInit - budget, + nblock, + (float)(budgetInit - budget) / + (float)(nblock==0 ? 1 : nblock) ); + if (budget < 0) { + if (verb >= 2) + VPrintf0 ( " too repetitive; using fallback" + " sorting algorithm\n" ); + fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb ); + } + } + + s->origPtr = -1; + for (i = 0; i < s->nblock; i++) + if (ptr[i] == 0) + { s->origPtr = i; break; }; + + AssertH( s->origPtr != -1, 1003 ); + } + + + /*-------------------------------------------------------------*/ + /*--- end blocksort.c ---*/ + /*-------------------------------------------------------------*/ Index: llvm/lib/Support/bzip2/bzlib.c diff -c /dev/null llvm/lib/Support/bzip2/bzlib.c:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/bzlib.c Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,1593 ---- + + /*-------------------------------------------------------------*/ + /*--- Library top-level functions. ---*/ + /*--- bzlib.c ---*/ + /*-------------------------------------------------------------*/ + + /*-- + This file is a part of bzip2 and/or libbzip2, a program and + library for lossless, block-sorting data compression. + + Copyright (C) 1996-2002 Julian R Seward. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Julian Seward, Cambridge, UK. + jseward at acm.org + bzip2/libbzip2 version 1.0 of 21 March 2000 + + This program is based on (at least) the work of: + Mike Burrows + David Wheeler + Peter Fenwick + Alistair Moffat + Radford Neal + Ian H. Witten + Robert Sedgewick + Jon L. Bentley + + For more information on these sources, see the manual. + --*/ + + /*-- + CHANGES + ~~~~~~~ + 0.9.0 -- original version. + + 0.9.0a/b -- no changes in this file. + + 0.9.0c + * made zero-length BZ_FLUSH work correctly in bzCompress(). + * fixed bzWrite/bzRead to ignore zero-length requests. + * fixed bzread to correctly handle read requests after EOF. + * wrong parameter order in call to bzDecompressInit in + bzBuffToBuffDecompress. Fixed. + --*/ + + #include "bzlib_private.h" + + + /*---------------------------------------------------*/ + /*--- Compression stuff ---*/ + /*---------------------------------------------------*/ + + + /*---------------------------------------------------*/ + #ifndef BZ_NO_STDIO + void BZ2_bz__AssertH__fail ( int errcode ) + { + fprintf(stderr, + "\n\nbzip2/libbzip2: internal error number %d.\n" + "This is a bug in bzip2/libbzip2, %s.\n" + "Please report it to me at: jseward at acm.org. If this happened\n" + "when you were using some program which uses libbzip2 as a\n" + "component, you should also report this bug to the author(s)\n" + "of that program. Please make an effort to report this bug;\n" + "timely and accurate bug reports eventually lead to higher\n" + "quality software. Thanks. Julian Seward, 30 December 2001.\n\n", + errcode, + BZ2_bzlibVersion() + ); + + if (errcode == 1007) { + fprintf(stderr, + "\n*** A special note about internal error number 1007 ***\n" + "\n" + "Experience suggests that a common cause of i.e. 1007\n" + "is unreliable memory or other hardware. The 1007 assertion\n" + "just happens to cross-check the results of huge numbers of\n" + "memory reads/writes, and so acts (unintendedly) as a stress\n" + "test of your memory system.\n" + "\n" + "I suggest the following: try compressing the file again,\n" + "possibly monitoring progress in detail with the -vv flag.\n" + "\n" + "* If the error cannot be reproduced, and/or happens at different\n" + " points in compression, you may have a flaky memory system.\n" + " Try a memory-test program. I have used Memtest86\n" + " (www.memtest86.com). At the time of writing it is free (GPLd).\n" + " Memtest86 tests memory much more thorougly than your BIOSs\n" + " power-on test, and may find failures that the BIOS doesn't.\n" + "\n" + "* If the error can be repeatably reproduced, this is a bug in\n" + " bzip2, and I would very much like to hear about it. Please\n" + " let me know, and, ideally, save a copy of the file causing the\n" + " problem -- without which I will be unable to investigate it.\n" + "\n" + ); + } + + exit(3); + } + #endif + + + /*---------------------------------------------------*/ + static + int bz_config_ok ( void ) + { + if (sizeof(int) != 4) return 0; + if (sizeof(short) != 2) return 0; + if (sizeof(char) != 1) return 0; + return 1; + } + + + /*---------------------------------------------------*/ + static + void* default_bzalloc ( void* opaque, Int32 items, Int32 size ) + { + void* v = malloc ( items * size ); + return v; + } + + static + void default_bzfree ( void* opaque, void* addr ) + { + if (addr != NULL) free ( addr ); + } + + + /*---------------------------------------------------*/ + static + void prepare_new_block ( EState* s ) + { + Int32 i; + s->nblock = 0; + s->numZ = 0; + s->state_out_pos = 0; + BZ_INITIALISE_CRC ( s->blockCRC ); + for (i = 0; i < 256; i++) s->inUse[i] = False; + s->blockNo++; + } + + + /*---------------------------------------------------*/ + static + void init_RL ( EState* s ) + { + s->state_in_ch = 256; + s->state_in_len = 0; + } + + + static + Bool isempty_RL ( EState* s ) + { + if (s->state_in_ch < 256 && s->state_in_len > 0) + return False; else + return True; + } + + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzCompressInit) + ( bz_stream* strm, + int blockSize100k, + int verbosity, + int workFactor ) + { + Int32 n; + EState* s; + + if (!bz_config_ok()) return BZ_CONFIG_ERROR; + + if (strm == NULL || + blockSize100k < 1 || blockSize100k > 9 || + workFactor < 0 || workFactor > 250) + return BZ_PARAM_ERROR; + + if (workFactor == 0) workFactor = 30; + if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; + if (strm->bzfree == NULL) strm->bzfree = default_bzfree; + + s = BZALLOC( sizeof(EState) ); + if (s == NULL) return BZ_MEM_ERROR; + s->strm = strm; + + s->arr1 = NULL; + s->arr2 = NULL; + s->ftab = NULL; + + n = 100000 * blockSize100k; + s->arr1 = BZALLOC( n * sizeof(UInt32) ); + s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) ); + s->ftab = BZALLOC( 65537 * sizeof(UInt32) ); + + if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) { + if (s->arr1 != NULL) BZFREE(s->arr1); + if (s->arr2 != NULL) BZFREE(s->arr2); + if (s->ftab != NULL) BZFREE(s->ftab); + if (s != NULL) BZFREE(s); + return BZ_MEM_ERROR; + } + + s->blockNo = 0; + s->state = BZ_S_INPUT; + s->mode = BZ_M_RUNNING; + s->combinedCRC = 0; + s->blockSize100k = blockSize100k; + s->nblockMAX = 100000 * blockSize100k - 19; + s->verbosity = verbosity; + s->workFactor = workFactor; + + s->block = (UChar*)s->arr2; + s->mtfv = (UInt16*)s->arr1; + s->zbits = NULL; + s->ptr = (UInt32*)s->arr1; + + strm->state = s; + strm->total_in_lo32 = 0; + strm->total_in_hi32 = 0; + strm->total_out_lo32 = 0; + strm->total_out_hi32 = 0; + init_RL ( s ); + prepare_new_block ( s ); + return BZ_OK; + } + + + /*---------------------------------------------------*/ + static + void add_pair_to_block ( EState* s ) + { + Int32 i; + UChar ch = (UChar)(s->state_in_ch); + for (i = 0; i < s->state_in_len; i++) { + BZ_UPDATE_CRC( s->blockCRC, ch ); + } + s->inUse[s->state_in_ch] = True; + switch (s->state_in_len) { + case 1: + s->block[s->nblock] = (UChar)ch; s->nblock++; + break; + case 2: + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + break; + case 3: + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + break; + default: + s->inUse[s->state_in_len-4] = True; + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = ((UChar)(s->state_in_len-4)); + s->nblock++; + break; + } + } + + + /*---------------------------------------------------*/ + static + void flush_RL ( EState* s ) + { + if (s->state_in_ch < 256) add_pair_to_block ( s ); + init_RL ( s ); + } + + + /*---------------------------------------------------*/ + #define ADD_CHAR_TO_BLOCK(zs,zchh0) \ + { \ + UInt32 zchh = (UInt32)(zchh0); \ + /*-- fast track the common case --*/ \ + if (zchh != zs->state_in_ch && \ + zs->state_in_len == 1) { \ + UChar ch = (UChar)(zs->state_in_ch); \ + BZ_UPDATE_CRC( zs->blockCRC, ch ); \ + zs->inUse[zs->state_in_ch] = True; \ + zs->block[zs->nblock] = (UChar)ch; \ + zs->nblock++; \ + zs->state_in_ch = zchh; \ + } \ + else \ + /*-- general, uncommon cases --*/ \ + if (zchh != zs->state_in_ch || \ + zs->state_in_len == 255) { \ + if (zs->state_in_ch < 256) \ + add_pair_to_block ( zs ); \ + zs->state_in_ch = zchh; \ + zs->state_in_len = 1; \ + } else { \ + zs->state_in_len++; \ + } \ + } + + + /*---------------------------------------------------*/ + static + Bool copy_input_until_stop ( EState* s ) + { + Bool progress_in = False; + + if (s->mode == BZ_M_RUNNING) { + + /*-- fast track the common case --*/ + while (True) { + /*-- block full? --*/ + if (s->nblock >= s->nblockMAX) break; + /*-- no input? --*/ + if (s->strm->avail_in == 0) break; + progress_in = True; + ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); + s->strm->next_in++; + s->strm->avail_in--; + s->strm->total_in_lo32++; + if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++; + } + + } else { + + /*-- general, uncommon case --*/ + while (True) { + /*-- block full? --*/ + if (s->nblock >= s->nblockMAX) break; + /*-- no input? --*/ + if (s->strm->avail_in == 0) break; + /*-- flush/finish end? --*/ + if (s->avail_in_expect == 0) break; + progress_in = True; + ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); + s->strm->next_in++; + s->strm->avail_in--; + s->strm->total_in_lo32++; + if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++; + s->avail_in_expect--; + } + } + return progress_in; + } + + + /*---------------------------------------------------*/ + static + Bool copy_output_until_stop ( EState* s ) + { + Bool progress_out = False; + + while (True) { + + /*-- no output space? --*/ + if (s->strm->avail_out == 0) break; + + /*-- block done? --*/ + if (s->state_out_pos >= s->numZ) break; + + progress_out = True; + *(s->strm->next_out) = s->zbits[s->state_out_pos]; + s->state_out_pos++; + s->strm->avail_out--; + s->strm->next_out++; + s->strm->total_out_lo32++; + if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; + } + + return progress_out; + } + + + /*---------------------------------------------------*/ + static + Bool handle_compress ( bz_stream* strm ) + { + Bool progress_in = False; + Bool progress_out = False; + EState* s = strm->state; + + while (True) { + + if (s->state == BZ_S_OUTPUT) { + progress_out |= copy_output_until_stop ( s ); + if (s->state_out_pos < s->numZ) break; + if (s->mode == BZ_M_FINISHING && + s->avail_in_expect == 0 && + isempty_RL(s)) break; + prepare_new_block ( s ); + s->state = BZ_S_INPUT; + if (s->mode == BZ_M_FLUSHING && + s->avail_in_expect == 0 && + isempty_RL(s)) break; + } + + if (s->state == BZ_S_INPUT) { + progress_in |= copy_input_until_stop ( s ); + if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) { + flush_RL ( s ); + BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) ); + s->state = BZ_S_OUTPUT; + } + else + if (s->nblock >= s->nblockMAX) { + BZ2_compressBlock ( s, False ); + s->state = BZ_S_OUTPUT; + } + else + if (s->strm->avail_in == 0) { + break; + } + } + + } + + return progress_in || progress_out; + } + + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action ) + { + Bool progress; + EState* s; + if (strm == NULL) return BZ_PARAM_ERROR; + s = strm->state; + if (s == NULL) return BZ_PARAM_ERROR; + if (s->strm != strm) return BZ_PARAM_ERROR; + + preswitch: + switch (s->mode) { + + case BZ_M_IDLE: + return BZ_SEQUENCE_ERROR; + + case BZ_M_RUNNING: + if (action == BZ_RUN) { + progress = handle_compress ( strm ); + return progress ? BZ_RUN_OK : BZ_PARAM_ERROR; + } + else + if (action == BZ_FLUSH) { + s->avail_in_expect = strm->avail_in; + s->mode = BZ_M_FLUSHING; + goto preswitch; + } + else + if (action == BZ_FINISH) { + s->avail_in_expect = strm->avail_in; + s->mode = BZ_M_FINISHING; + goto preswitch; + } + else + return BZ_PARAM_ERROR; + + case BZ_M_FLUSHING: + if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR; + if (s->avail_in_expect != s->strm->avail_in) + return BZ_SEQUENCE_ERROR; + progress = handle_compress ( strm ); + if (s->avail_in_expect > 0 || !isempty_RL(s) || + s->state_out_pos < s->numZ) return BZ_FLUSH_OK; + s->mode = BZ_M_RUNNING; + return BZ_RUN_OK; + + case BZ_M_FINISHING: + if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR; + if (s->avail_in_expect != s->strm->avail_in) + return BZ_SEQUENCE_ERROR; + progress = handle_compress ( strm ); + if (!progress) return BZ_SEQUENCE_ERROR; + if (s->avail_in_expect > 0 || !isempty_RL(s) || + s->state_out_pos < s->numZ) return BZ_FINISH_OK; + s->mode = BZ_M_IDLE; + return BZ_STREAM_END; + } + return BZ_OK; /*--not reached--*/ + } + + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm ) + { + EState* s; + if (strm == NULL) return BZ_PARAM_ERROR; + s = strm->state; + if (s == NULL) return BZ_PARAM_ERROR; + if (s->strm != strm) return BZ_PARAM_ERROR; + + if (s->arr1 != NULL) BZFREE(s->arr1); + if (s->arr2 != NULL) BZFREE(s->arr2); + if (s->ftab != NULL) BZFREE(s->ftab); + BZFREE(strm->state); + + strm->state = NULL; + + return BZ_OK; + } + + + /*---------------------------------------------------*/ + /*--- Decompression stuff ---*/ + /*---------------------------------------------------*/ + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzDecompressInit) + ( bz_stream* strm, + int verbosity, + int small ) + { + DState* s; + + if (!bz_config_ok()) return BZ_CONFIG_ERROR; + + if (strm == NULL) return BZ_PARAM_ERROR; + if (small != 0 && small != 1) return BZ_PARAM_ERROR; + if (verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR; + + if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; + if (strm->bzfree == NULL) strm->bzfree = default_bzfree; + + s = BZALLOC( sizeof(DState) ); + if (s == NULL) return BZ_MEM_ERROR; + s->strm = strm; + strm->state = s; + s->state = BZ_X_MAGIC_1; + s->bsLive = 0; + s->bsBuff = 0; + s->calculatedCombinedCRC = 0; + strm->total_in_lo32 = 0; + strm->total_in_hi32 = 0; + strm->total_out_lo32 = 0; + strm->total_out_hi32 = 0; + s->smallDecompress = (Bool)small; + s->ll4 = NULL; + s->ll16 = NULL; + s->tt = NULL; + s->currBlockNo = 0; + s->verbosity = verbosity; + + return BZ_OK; + } + + + /*---------------------------------------------------*/ + static + void unRLE_obuf_to_output_FAST ( DState* s ) + { + UChar k1; + + if (s->blockRandomised) { + + while (True) { + /* try to finish existing run */ + while (True) { + if (s->strm->avail_out == 0) return; + if (s->state_out_len == 0) break; + *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; + BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); + s->state_out_len--; + s->strm->next_out++; + s->strm->avail_out--; + s->strm->total_out_lo32++; + if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; + } + + /* can a new run be started? */ + if (s->nblock_used == s->save_nblock+1) return; + + + s->state_out_len = 1; + s->state_out_ch = s->k0; + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 2; + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 3; + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + s->state_out_len = ((Int32)k1) + 4; + BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK; + s->k0 ^= BZ_RAND_MASK; s->nblock_used++; + } + + } else { + + /* restore */ + UInt32 c_calculatedBlockCRC = s->calculatedBlockCRC; + UChar c_state_out_ch = s->state_out_ch; + Int32 c_state_out_len = s->state_out_len; + Int32 c_nblock_used = s->nblock_used; + Int32 c_k0 = s->k0; + UInt32* c_tt = s->tt; + UInt32 c_tPos = s->tPos; + char* cs_next_out = s->strm->next_out; + unsigned int cs_avail_out = s->strm->avail_out; + /* end restore */ + + UInt32 avail_out_INIT = cs_avail_out; + Int32 s_save_nblockPP = s->save_nblock+1; + unsigned int total_out_lo32_old; + + while (True) { + + /* try to finish existing run */ + if (c_state_out_len > 0) { + while (True) { + if (cs_avail_out == 0) goto return_notr; + if (c_state_out_len == 1) break; + *( (UChar*)(cs_next_out) ) = c_state_out_ch; + BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); + c_state_out_len--; + cs_next_out++; + cs_avail_out--; + } + s_state_out_len_eq_one: + { + if (cs_avail_out == 0) { + c_state_out_len = 1; goto return_notr; + }; + *( (UChar*)(cs_next_out) ) = c_state_out_ch; + BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); + cs_next_out++; + cs_avail_out--; + } + } + /* can a new run be started? */ + if (c_nblock_used == s_save_nblockPP) { + c_state_out_len = 0; goto return_notr; + }; + c_state_out_ch = c_k0; + BZ_GET_FAST_C(k1); c_nblock_used++; + if (k1 != c_k0) { + c_k0 = k1; goto s_state_out_len_eq_one; + }; + if (c_nblock_used == s_save_nblockPP) + goto s_state_out_len_eq_one; + + c_state_out_len = 2; + BZ_GET_FAST_C(k1); c_nblock_used++; + if (c_nblock_used == s_save_nblockPP) continue; + if (k1 != c_k0) { c_k0 = k1; continue; }; + + c_state_out_len = 3; + BZ_GET_FAST_C(k1); c_nblock_used++; + if (c_nblock_used == s_save_nblockPP) continue; + if (k1 != c_k0) { c_k0 = k1; continue; }; + + BZ_GET_FAST_C(k1); c_nblock_used++; + c_state_out_len = ((Int32)k1) + 4; + BZ_GET_FAST_C(c_k0); c_nblock_used++; + } + + return_notr: + total_out_lo32_old = s->strm->total_out_lo32; + s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out); + if (s->strm->total_out_lo32 < total_out_lo32_old) + s->strm->total_out_hi32++; + + /* save */ + s->calculatedBlockCRC = c_calculatedBlockCRC; + s->state_out_ch = c_state_out_ch; + s->state_out_len = c_state_out_len; + s->nblock_used = c_nblock_used; + s->k0 = c_k0; + s->tt = c_tt; + s->tPos = c_tPos; + s->strm->next_out = cs_next_out; + s->strm->avail_out = cs_avail_out; + /* end save */ + } + } + + + + /*---------------------------------------------------*/ + __inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab ) + { + Int32 nb, na, mid; + nb = 0; + na = 256; + do { + mid = (nb + na) >> 1; + if (indx >= cftab[mid]) nb = mid; else na = mid; + } + while (na - nb != 1); + return nb; + } + + + /*---------------------------------------------------*/ + static + void unRLE_obuf_to_output_SMALL ( DState* s ) + { + UChar k1; + + if (s->blockRandomised) { + + while (True) { + /* try to finish existing run */ + while (True) { + if (s->strm->avail_out == 0) return; + if (s->state_out_len == 0) break; + *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; + BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); + s->state_out_len--; + s->strm->next_out++; + s->strm->avail_out--; + s->strm->total_out_lo32++; + if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; + } + + /* can a new run be started? */ + if (s->nblock_used == s->save_nblock+1) return; + + + s->state_out_len = 1; + s->state_out_ch = s->k0; + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 2; + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 3; + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + s->state_out_len = ((Int32)k1) + 4; + BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK; + s->k0 ^= BZ_RAND_MASK; s->nblock_used++; + } + + } else { + + while (True) { + /* try to finish existing run */ + while (True) { + if (s->strm->avail_out == 0) return; + if (s->state_out_len == 0) break; + *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; + BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); + s->state_out_len--; + s->strm->next_out++; + s->strm->avail_out--; + s->strm->total_out_lo32++; + if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; + } + + /* can a new run be started? */ + if (s->nblock_used == s->save_nblock+1) return; + + s->state_out_len = 1; + s->state_out_ch = s->k0; + BZ_GET_SMALL(k1); s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 2; + BZ_GET_SMALL(k1); s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 3; + BZ_GET_SMALL(k1); s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + BZ_GET_SMALL(k1); s->nblock_used++; + s->state_out_len = ((Int32)k1) + 4; + BZ_GET_SMALL(s->k0); s->nblock_used++; + } + + } + } + + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzDecompress) ( bz_stream *strm ) + { + DState* s; + if (strm == NULL) return BZ_PARAM_ERROR; + s = strm->state; + if (s == NULL) return BZ_PARAM_ERROR; + if (s->strm != strm) return BZ_PARAM_ERROR; + + while (True) { + if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR; + if (s->state == BZ_X_OUTPUT) { + if (s->smallDecompress) + unRLE_obuf_to_output_SMALL ( s ); else + unRLE_obuf_to_output_FAST ( s ); + if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) { + BZ_FINALISE_CRC ( s->calculatedBlockCRC ); + if (s->verbosity >= 3) + VPrintf2 ( " {0x%x, 0x%x}", s->storedBlockCRC, + s->calculatedBlockCRC ); + if (s->verbosity >= 2) VPrintf0 ( "]" ); + if (s->calculatedBlockCRC != s->storedBlockCRC) + return BZ_DATA_ERROR; + s->calculatedCombinedCRC + = (s->calculatedCombinedCRC << 1) | + (s->calculatedCombinedCRC >> 31); + s->calculatedCombinedCRC ^= s->calculatedBlockCRC; + s->state = BZ_X_BLKHDR_1; + } else { + return BZ_OK; + } + } + if (s->state >= BZ_X_MAGIC_1) { + Int32 r = BZ2_decompress ( s ); + if (r == BZ_STREAM_END) { + if (s->verbosity >= 3) + VPrintf2 ( "\n combined CRCs: stored = 0x%x, computed = 0x%x", + s->storedCombinedCRC, s->calculatedCombinedCRC ); + if (s->calculatedCombinedCRC != s->storedCombinedCRC) + return BZ_DATA_ERROR; + return r; + } + if (s->state != BZ_X_OUTPUT) return r; + } + } + + AssertH ( 0, 6001 ); + + return 0; /*NOTREACHED*/ + } + + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ) + { + DState* s; + if (strm == NULL) return BZ_PARAM_ERROR; + s = strm->state; + if (s == NULL) return BZ_PARAM_ERROR; + if (s->strm != strm) return BZ_PARAM_ERROR; + + if (s->tt != NULL) BZFREE(s->tt); + if (s->ll16 != NULL) BZFREE(s->ll16); + if (s->ll4 != NULL) BZFREE(s->ll4); + + BZFREE(strm->state); + strm->state = NULL; + + return BZ_OK; + } + + + #ifndef BZ_NO_STDIO + /*---------------------------------------------------*/ + /*--- File I/O stuff ---*/ + /*---------------------------------------------------*/ + + #define BZ_SETERR(eee) \ + { \ + if (bzerror != NULL) *bzerror = eee; \ + if (bzf != NULL) bzf->lastErr = eee; \ + } + + typedef + struct { + FILE* handle; + Char buf[BZ_MAX_UNUSED]; + Int32 bufN; + Bool writing; + bz_stream strm; + Int32 lastErr; + Bool initialisedOk; + } + bzFile; + + + /*---------------------------------------------*/ + static Bool myfeof ( FILE* f ) + { + Int32 c = fgetc ( f ); + if (c == EOF) return True; + ungetc ( c, f ); + return False; + } + + + /*---------------------------------------------------*/ + BZFILE* BZ_API(BZ2_bzWriteOpen) + ( int* bzerror, + FILE* f, + int blockSize100k, + int verbosity, + int workFactor ) + { + Int32 ret; + bzFile* bzf = NULL; + + BZ_SETERR(BZ_OK); + + if (f == NULL || + (blockSize100k < 1 || blockSize100k > 9) || + (workFactor < 0 || workFactor > 250) || + (verbosity < 0 || verbosity > 4)) + { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; + + if (ferror(f)) + { BZ_SETERR(BZ_IO_ERROR); return NULL; }; + + bzf = malloc ( sizeof(bzFile) ); + if (bzf == NULL) + { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; + + BZ_SETERR(BZ_OK); + bzf->initialisedOk = False; + bzf->bufN = 0; + bzf->handle = f; + bzf->writing = True; + bzf->strm.bzalloc = NULL; + bzf->strm.bzfree = NULL; + bzf->strm.opaque = NULL; + + if (workFactor == 0) workFactor = 30; + ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, + verbosity, workFactor ); + if (ret != BZ_OK) + { BZ_SETERR(ret); free(bzf); return NULL; }; + + bzf->strm.avail_in = 0; + bzf->initialisedOk = True; + return bzf; + } + + + + /*---------------------------------------------------*/ + void BZ_API(BZ2_bzWrite) + ( int* bzerror, + BZFILE* b, + void* buf, + int len ) + { + Int32 n, n2, ret; + bzFile* bzf = (bzFile*)b; + + BZ_SETERR(BZ_OK); + if (bzf == NULL || buf == NULL || len < 0) + { BZ_SETERR(BZ_PARAM_ERROR); return; }; + if (!(bzf->writing)) + { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; + if (ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return; }; + + if (len == 0) + { BZ_SETERR(BZ_OK); return; }; + + bzf->strm.avail_in = len; + bzf->strm.next_in = buf; + + while (True) { + bzf->strm.avail_out = BZ_MAX_UNUSED; + bzf->strm.next_out = bzf->buf; + ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN ); + if (ret != BZ_RUN_OK) + { BZ_SETERR(ret); return; }; + + if (bzf->strm.avail_out < BZ_MAX_UNUSED) { + n = BZ_MAX_UNUSED - bzf->strm.avail_out; + n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), + n, bzf->handle ); + if (n != n2 || ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return; }; + } + + if (bzf->strm.avail_in == 0) + { BZ_SETERR(BZ_OK); return; }; + } + } + + + /*---------------------------------------------------*/ + void BZ_API(BZ2_bzWriteClose) + ( int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in, + unsigned int* nbytes_out ) + { + BZ2_bzWriteClose64 ( bzerror, b, abandon, + nbytes_in, NULL, nbytes_out, NULL ); + } + + + void BZ_API(BZ2_bzWriteClose64) + ( int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in_lo32, + unsigned int* nbytes_in_hi32, + unsigned int* nbytes_out_lo32, + unsigned int* nbytes_out_hi32 ) + { + Int32 n, n2, ret; + bzFile* bzf = (bzFile*)b; + + if (bzf == NULL) + { BZ_SETERR(BZ_OK); return; }; + if (!(bzf->writing)) + { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; + if (ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return; }; + + if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = 0; + if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = 0; + if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = 0; + if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = 0; + + if ((!abandon) && bzf->lastErr == BZ_OK) { + while (True) { + bzf->strm.avail_out = BZ_MAX_UNUSED; + bzf->strm.next_out = bzf->buf; + ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH ); + if (ret != BZ_FINISH_OK && ret != BZ_STREAM_END) + { BZ_SETERR(ret); return; }; + + if (bzf->strm.avail_out < BZ_MAX_UNUSED) { + n = BZ_MAX_UNUSED - bzf->strm.avail_out; + n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), + n, bzf->handle ); + if (n != n2 || ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return; }; + } + + if (ret == BZ_STREAM_END) break; + } + } + + if ( !abandon && !ferror ( bzf->handle ) ) { + fflush ( bzf->handle ); + if (ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return; }; + } + + if (nbytes_in_lo32 != NULL) + *nbytes_in_lo32 = bzf->strm.total_in_lo32; + if (nbytes_in_hi32 != NULL) + *nbytes_in_hi32 = bzf->strm.total_in_hi32; + if (nbytes_out_lo32 != NULL) + *nbytes_out_lo32 = bzf->strm.total_out_lo32; + if (nbytes_out_hi32 != NULL) + *nbytes_out_hi32 = bzf->strm.total_out_hi32; + + BZ_SETERR(BZ_OK); + BZ2_bzCompressEnd ( &(bzf->strm) ); + free ( bzf ); + } + + + /*---------------------------------------------------*/ + BZFILE* BZ_API(BZ2_bzReadOpen) + ( int* bzerror, + FILE* f, + int verbosity, + int small, + void* unused, + int nUnused ) + { + bzFile* bzf = NULL; + int ret; + + BZ_SETERR(BZ_OK); + + if (f == NULL || + (small != 0 && small != 1) || + (verbosity < 0 || verbosity > 4) || + (unused == NULL && nUnused != 0) || + (unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED))) + { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; + + if (ferror(f)) + { BZ_SETERR(BZ_IO_ERROR); return NULL; }; + + bzf = malloc ( sizeof(bzFile) ); + if (bzf == NULL) + { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; + + BZ_SETERR(BZ_OK); + + bzf->initialisedOk = False; + bzf->handle = f; + bzf->bufN = 0; + bzf->writing = False; + bzf->strm.bzalloc = NULL; + bzf->strm.bzfree = NULL; + bzf->strm.opaque = NULL; + + while (nUnused > 0) { + bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; + unused = ((void*)( 1 + ((UChar*)(unused)) )); + nUnused--; + } + + ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small ); + if (ret != BZ_OK) + { BZ_SETERR(ret); free(bzf); return NULL; }; + + bzf->strm.avail_in = bzf->bufN; + bzf->strm.next_in = bzf->buf; + + bzf->initialisedOk = True; + return bzf; + } + + + /*---------------------------------------------------*/ + void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b ) + { + bzFile* bzf = (bzFile*)b; + + BZ_SETERR(BZ_OK); + if (bzf == NULL) + { BZ_SETERR(BZ_OK); return; }; + + if (bzf->writing) + { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; + + if (bzf->initialisedOk) + (void)BZ2_bzDecompressEnd ( &(bzf->strm) ); + free ( bzf ); + } + + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzRead) + ( int* bzerror, + BZFILE* b, + void* buf, + int len ) + { + Int32 n, ret; + bzFile* bzf = (bzFile*)b; + + BZ_SETERR(BZ_OK); + + if (bzf == NULL || buf == NULL || len < 0) + { BZ_SETERR(BZ_PARAM_ERROR); return 0; }; + + if (bzf->writing) + { BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; }; + + if (len == 0) + { BZ_SETERR(BZ_OK); return 0; }; + + bzf->strm.avail_out = len; + bzf->strm.next_out = buf; + + while (True) { + + if (ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return 0; }; + + if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { + n = fread ( bzf->buf, sizeof(UChar), + BZ_MAX_UNUSED, bzf->handle ); + if (ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return 0; }; + bzf->bufN = n; + bzf->strm.avail_in = bzf->bufN; + bzf->strm.next_in = bzf->buf; + } + + ret = BZ2_bzDecompress ( &(bzf->strm) ); + + if (ret != BZ_OK && ret != BZ_STREAM_END) + { BZ_SETERR(ret); return 0; }; + + if (ret == BZ_OK && myfeof(bzf->handle) && + bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) + { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; }; + + if (ret == BZ_STREAM_END) + { BZ_SETERR(BZ_STREAM_END); + return len - bzf->strm.avail_out; }; + if (bzf->strm.avail_out == 0) + { BZ_SETERR(BZ_OK); return len; }; + + } + + return 0; /*not reached*/ + } + + + /*---------------------------------------------------*/ + void BZ_API(BZ2_bzReadGetUnused) + ( int* bzerror, + BZFILE* b, + void** unused, + int* nUnused ) + { + bzFile* bzf = (bzFile*)b; + if (bzf == NULL) + { BZ_SETERR(BZ_PARAM_ERROR); return; }; + if (bzf->lastErr != BZ_STREAM_END) + { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; + if (unused == NULL || nUnused == NULL) + { BZ_SETERR(BZ_PARAM_ERROR); return; }; + + BZ_SETERR(BZ_OK); + *nUnused = bzf->strm.avail_in; + *unused = bzf->strm.next_in; + } + #endif + + + /*---------------------------------------------------*/ + /*--- Misc convenience stuff ---*/ + /*---------------------------------------------------*/ + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzBuffToBuffCompress) + ( char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int blockSize100k, + int verbosity, + int workFactor ) + { + bz_stream strm; + int ret; + + if (dest == NULL || destLen == NULL || + source == NULL || + blockSize100k < 1 || blockSize100k > 9 || + verbosity < 0 || verbosity > 4 || + workFactor < 0 || workFactor > 250) + return BZ_PARAM_ERROR; + + if (workFactor == 0) workFactor = 30; + strm.bzalloc = NULL; + strm.bzfree = NULL; + strm.opaque = NULL; + ret = BZ2_bzCompressInit ( &strm, blockSize100k, + verbosity, workFactor ); + if (ret != BZ_OK) return ret; + + strm.next_in = source; + strm.next_out = dest; + strm.avail_in = sourceLen; + strm.avail_out = *destLen; + + ret = BZ2_bzCompress ( &strm, BZ_FINISH ); + if (ret == BZ_FINISH_OK) goto output_overflow; + if (ret != BZ_STREAM_END) goto errhandler; + + /* normal termination */ + *destLen -= strm.avail_out; + BZ2_bzCompressEnd ( &strm ); + return BZ_OK; + + output_overflow: + BZ2_bzCompressEnd ( &strm ); + return BZ_OUTBUFF_FULL; + + errhandler: + BZ2_bzCompressEnd ( &strm ); + return ret; + } + + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzBuffToBuffDecompress) + ( char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int small, + int verbosity ) + { + bz_stream strm; + int ret; + + if (dest == NULL || destLen == NULL || + source == NULL || + (small != 0 && small != 1) || + verbosity < 0 || verbosity > 4) + return BZ_PARAM_ERROR; + + strm.bzalloc = NULL; + strm.bzfree = NULL; + strm.opaque = NULL; + ret = BZ2_bzDecompressInit ( &strm, verbosity, small ); + if (ret != BZ_OK) return ret; + + strm.next_in = source; + strm.next_out = dest; + strm.avail_in = sourceLen; + strm.avail_out = *destLen; + + ret = BZ2_bzDecompress ( &strm ); + if (ret == BZ_OK) goto output_overflow_or_eof; + if (ret != BZ_STREAM_END) goto errhandler; + + /* normal termination */ + *destLen -= strm.avail_out; + BZ2_bzDecompressEnd ( &strm ); + return BZ_OK; + + output_overflow_or_eof: + if (strm.avail_out > 0) { + BZ2_bzDecompressEnd ( &strm ); + return BZ_UNEXPECTED_EOF; + } else { + BZ2_bzDecompressEnd ( &strm ); + return BZ_OUTBUFF_FULL; + }; + + errhandler: + BZ2_bzDecompressEnd ( &strm ); + return ret; + } + + + /*---------------------------------------------------*/ + /*-- + Code contributed by Yoshioka Tsuneo + (QWF00133 at niftyserve.or.jp/tsuneo-y at is.aist-nara.ac.jp), + to support better zlib compatibility. + This code is not _officially_ part of libbzip2 (yet); + I haven't tested it, documented it, or considered the + threading-safeness of it. + If this code breaks, please contact both Yoshioka and me. + --*/ + /*---------------------------------------------------*/ + + /*---------------------------------------------------*/ + /*-- + return version like "0.9.0c". + --*/ + const char * BZ_API(BZ2_bzlibVersion)(void) + { + return BZ_VERSION; + } + + + #ifndef BZ_NO_STDIO + /*---------------------------------------------------*/ + + #if defined(_WIN32) || defined(OS2) || defined(MSDOS) + # include + # include + # define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY) + #else + # define SET_BINARY_MODE(file) + #endif + static + BZFILE * bzopen_or_bzdopen + ( const char *path, /* no use when bzdopen */ + int fd, /* no use when bzdopen */ + const char *mode, + int open_mode) /* bzopen: 0, bzdopen:1 */ + { + int bzerr; + char unused[BZ_MAX_UNUSED]; + int blockSize100k = 9; + int writing = 0; + char mode2[10] = ""; + FILE *fp = NULL; + BZFILE *bzfp = NULL; + int verbosity = 0; + int workFactor = 30; + int smallMode = 0; + int nUnused = 0; + + if (mode == NULL) return NULL; + while (*mode) { + switch (*mode) { + case 'r': + writing = 0; break; + case 'w': + writing = 1; break; + case 's': + smallMode = 1; break; + default: + if (isdigit((int)(*mode))) { + blockSize100k = *mode-BZ_HDR_0; + } + } + mode++; + } + strcat(mode2, writing ? "w" : "r" ); + strcat(mode2,"b"); /* binary mode */ + + if (open_mode==0) { + if (path==NULL || strcmp(path,"")==0) { + fp = (writing ? stdout : stdin); + SET_BINARY_MODE(fp); + } else { + fp = fopen(path,mode2); + } + } else { + #ifdef BZ_STRICT_ANSI + fp = NULL; + #else + fp = fdopen(fd,mode2); + #endif + } + if (fp == NULL) return NULL; + + if (writing) { + /* Guard against total chaos and anarchy -- JRS */ + if (blockSize100k < 1) blockSize100k = 1; + if (blockSize100k > 9) blockSize100k = 9; + bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k, + verbosity,workFactor); + } else { + bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode, + unused,nUnused); + } + if (bzfp == NULL) { + if (fp != stdin && fp != stdout) fclose(fp); + return NULL; + } + return bzfp; + } + + + /*---------------------------------------------------*/ + /*-- + open file for read or write. + ex) bzopen("file","w9") + case path="" or NULL => use stdin or stdout. + --*/ + BZFILE * BZ_API(BZ2_bzopen) + ( const char *path, + const char *mode ) + { + return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0); + } + + + /*---------------------------------------------------*/ + BZFILE * BZ_API(BZ2_bzdopen) + ( int fd, + const char *mode ) + { + return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1); + } + + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len ) + { + int bzerr, nread; + if (((bzFile*)b)->lastErr == BZ_STREAM_END) return 0; + nread = BZ2_bzRead(&bzerr,b,buf,len); + if (bzerr == BZ_OK || bzerr == BZ_STREAM_END) { + return nread; + } else { + return -1; + } + } + + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len ) + { + int bzerr; + + BZ2_bzWrite(&bzerr,b,buf,len); + if(bzerr == BZ_OK){ + return len; + }else{ + return -1; + } + } + + + /*---------------------------------------------------*/ + int BZ_API(BZ2_bzflush) (BZFILE *b) + { + /* do nothing now... */ + return 0; + } + + + /*---------------------------------------------------*/ + void BZ_API(BZ2_bzclose) (BZFILE* b) + { + int bzerr; + FILE *fp = ((bzFile *)b)->handle; + + if (b==NULL) {return;} + if(((bzFile*)b)->writing){ + BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL); + if(bzerr != BZ_OK){ + BZ2_bzWriteClose(NULL,b,1,NULL,NULL); + } + }else{ + BZ2_bzReadClose(&bzerr,b); + } + if(fp!=stdin && fp!=stdout){ + fclose(fp); + } + } + + + /*---------------------------------------------------*/ + /*-- + return last error code + --*/ + static const char *bzerrorstrings[] = { + "OK" + ,"SEQUENCE_ERROR" + ,"PARAM_ERROR" + ,"MEM_ERROR" + ,"DATA_ERROR" + ,"DATA_ERROR_MAGIC" + ,"IO_ERROR" + ,"UNEXPECTED_EOF" + ,"OUTBUFF_FULL" + ,"CONFIG_ERROR" + ,"???" /* for future */ + ,"???" /* for future */ + ,"???" /* for future */ + ,"???" /* for future */ + ,"???" /* for future */ + ,"???" /* for future */ + }; + + + const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum) + { + int err = ((bzFile *)b)->lastErr; + + if(err>0) err = 0; + *errnum = err; + return bzerrorstrings[err*-1]; + } + #endif + + + /*-------------------------------------------------------------*/ + /*--- end bzlib.c ---*/ + /*-------------------------------------------------------------*/ Index: llvm/lib/Support/bzip2/bzlib.h diff -c /dev/null llvm/lib/Support/bzip2/bzlib.h:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/bzlib.h Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,321 ---- + + /*-------------------------------------------------------------*/ + /*--- Public header file for the library. ---*/ + /*--- bzlib.h ---*/ + /*-------------------------------------------------------------*/ + + /*-- + This file is a part of bzip2 and/or libbzip2, a program and + library for lossless, block-sorting data compression. + + Copyright (C) 1996-2002 Julian R Seward. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Julian Seward, Cambridge, UK. + jseward at acm.org + bzip2/libbzip2 version 1.0 of 21 March 2000 + + This program is based on (at least) the work of: + Mike Burrows + David Wheeler + Peter Fenwick + Alistair Moffat + Radford Neal + Ian H. Witten + Robert Sedgewick + Jon L. Bentley + + For more information on these sources, see the manual. + --*/ + + + #ifndef _BZLIB_H + #define _BZLIB_H + + #ifdef __cplusplus + extern "C" { + #endif + + #define BZ_RUN 0 + #define BZ_FLUSH 1 + #define BZ_FINISH 2 + + #define BZ_OK 0 + #define BZ_RUN_OK 1 + #define BZ_FLUSH_OK 2 + #define BZ_FINISH_OK 3 + #define BZ_STREAM_END 4 + #define BZ_SEQUENCE_ERROR (-1) + #define BZ_PARAM_ERROR (-2) + #define BZ_MEM_ERROR (-3) + #define BZ_DATA_ERROR (-4) + #define BZ_DATA_ERROR_MAGIC (-5) + #define BZ_IO_ERROR (-6) + #define BZ_UNEXPECTED_EOF (-7) + #define BZ_OUTBUFF_FULL (-8) + #define BZ_CONFIG_ERROR (-9) + + typedef + struct { + char *next_in; + unsigned int avail_in; + unsigned int total_in_lo32; + unsigned int total_in_hi32; + + char *next_out; + unsigned int avail_out; + unsigned int total_out_lo32; + unsigned int total_out_hi32; + + void *state; + + void *(*bzalloc)(void *,int,int); + void (*bzfree)(void *,void *); + void *opaque; + } + bz_stream; + + + #ifndef BZ_IMPORT + #define BZ_EXPORT + #endif + + /* Need a definitition for FILE */ + #include + + #ifdef _WIN32 + # include + # ifdef small + /* windows.h define small to char */ + # undef small + # endif + # ifdef BZ_EXPORT + # define BZ_API(func) WINAPI func + # define BZ_EXTERN extern + # else + /* import windows dll dynamically */ + # define BZ_API(func) (WINAPI * func) + # define BZ_EXTERN + # endif + #else + # define BZ_API(func) func + # define BZ_EXTERN extern + #endif + + + /*-- Core (low-level) library functions --*/ + + BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( + bz_stream* strm, + int blockSize100k, + int verbosity, + int workFactor + ); + + BZ_EXTERN int BZ_API(BZ2_bzCompress) ( + bz_stream* strm, + int action + ); + + BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( + bz_stream* strm + ); + + BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( + bz_stream *strm, + int verbosity, + int small + ); + + BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( + bz_stream* strm + ); + + BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( + bz_stream *strm + ); + + + + /*-- High(er) level library functions --*/ + + #ifndef BZ_NO_STDIO + #define BZ_MAX_UNUSED 5000 + + typedef void BZFILE; + + BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( + int* bzerror, + FILE* f, + int verbosity, + int small, + void* unused, + int nUnused + ); + + BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( + int* bzerror, + BZFILE* b + ); + + BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( + int* bzerror, + BZFILE* b, + void** unused, + int* nUnused + ); + + BZ_EXTERN int BZ_API(BZ2_bzRead) ( + int* bzerror, + BZFILE* b, + void* buf, + int len + ); + + BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( + int* bzerror, + FILE* f, + int blockSize100k, + int verbosity, + int workFactor + ); + + BZ_EXTERN void BZ_API(BZ2_bzWrite) ( + int* bzerror, + BZFILE* b, + void* buf, + int len + ); + + BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( + int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in, + unsigned int* nbytes_out + ); + + BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( + int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in_lo32, + unsigned int* nbytes_in_hi32, + unsigned int* nbytes_out_lo32, + unsigned int* nbytes_out_hi32 + ); + #endif + + + /*-- Utility functions --*/ + + BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( + char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int blockSize100k, + int verbosity, + int workFactor + ); + + BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( + char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int small, + int verbosity + ); + + + /*-- + Code contributed by Yoshioka Tsuneo + (QWF00133 at niftyserve.or.jp/tsuneo-y at is.aist-nara.ac.jp), + to support better zlib compatibility. + This code is not _officially_ part of libbzip2 (yet); + I haven't tested it, documented it, or considered the + threading-safeness of it. + If this code breaks, please contact both Yoshioka and me. + --*/ + + BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( + void + ); + + #ifndef BZ_NO_STDIO + BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( + const char *path, + const char *mode + ); + + BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( + int fd, + const char *mode + ); + + BZ_EXTERN int BZ_API(BZ2_bzread) ( + BZFILE* b, + void* buf, + int len + ); + + BZ_EXTERN int BZ_API(BZ2_bzwrite) ( + BZFILE* b, + void* buf, + int len + ); + + BZ_EXTERN int BZ_API(BZ2_bzflush) ( + BZFILE* b + ); + + BZ_EXTERN void BZ_API(BZ2_bzclose) ( + BZFILE* b + ); + + BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( + BZFILE *b, + int *errnum + ); + #endif + + #ifdef __cplusplus + } + #endif + + #endif + + /*-------------------------------------------------------------*/ + /*--- end bzlib.h ---*/ + /*-------------------------------------------------------------*/ Index: llvm/lib/Support/bzip2/bzlib_private.h diff -c /dev/null llvm/lib/Support/bzip2/bzlib_private.h:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/bzlib_private.h Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,537 ---- + + /*-------------------------------------------------------------*/ + /*--- Private header file for the library. ---*/ + /*--- bzlib_private.h ---*/ + /*-------------------------------------------------------------*/ + + /*-- + This file is a part of bzip2 and/or libbzip2, a program and + library for lossless, block-sorting data compression. + + Copyright (C) 1996-2002 Julian R Seward. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Julian Seward, Cambridge, UK. + jseward at acm.org + bzip2/libbzip2 version 1.0 of 21 March 2000 + + This program is based on (at least) the work of: + Mike Burrows + David Wheeler + Peter Fenwick + Alistair Moffat + Radford Neal + Ian H. Witten + Robert Sedgewick + Jon L. Bentley + + For more information on these sources, see the manual. + --*/ + + + #ifndef _BZLIB_PRIVATE_H + #define _BZLIB_PRIVATE_H + + #include + + #ifndef BZ_NO_STDIO + #include + #include + #include + #endif + + #include "bzlib.h" + + + + /*-- General stuff. --*/ + + #define BZ_VERSION "1.0.2, 30-Dec-2001" + + typedef char Char; + typedef unsigned char Bool; + typedef unsigned char UChar; + typedef int Int32; + typedef unsigned int UInt32; + typedef short Int16; + typedef unsigned short UInt16; + + #define True ((Bool)1) + #define False ((Bool)0) + + #ifndef __GNUC__ + #define __inline__ /* */ + #endif + + #ifndef BZ_NO_STDIO + extern void BZ2_bz__AssertH__fail ( int errcode ); + #define AssertH(cond,errcode) \ + { if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); } + #if BZ_DEBUG + #define AssertD(cond,msg) \ + { if (!(cond)) { \ + fprintf ( stderr, \ + "\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\ + exit(1); \ + }} + #else + #define AssertD(cond,msg) /* */ + #endif + #define VPrintf0(zf) \ + fprintf(stderr,zf) + #define VPrintf1(zf,za1) \ + fprintf(stderr,zf,za1) + #define VPrintf2(zf,za1,za2) \ + fprintf(stderr,zf,za1,za2) + #define VPrintf3(zf,za1,za2,za3) \ + fprintf(stderr,zf,za1,za2,za3) + #define VPrintf4(zf,za1,za2,za3,za4) \ + fprintf(stderr,zf,za1,za2,za3,za4) + #define VPrintf5(zf,za1,za2,za3,za4,za5) \ + fprintf(stderr,zf,za1,za2,za3,za4,za5) + #else + extern void bz_internal_error ( int errcode ); + #define AssertH(cond,errcode) \ + { if (!(cond)) bz_internal_error ( errcode ); } + #define AssertD(cond,msg) /* */ + #define VPrintf0(zf) /* */ + #define VPrintf1(zf,za1) /* */ + #define VPrintf2(zf,za1,za2) /* */ + #define VPrintf3(zf,za1,za2,za3) /* */ + #define VPrintf4(zf,za1,za2,za3,za4) /* */ + #define VPrintf5(zf,za1,za2,za3,za4,za5) /* */ + #endif + + + #define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1) + #define BZFREE(ppp) (strm->bzfree)(strm->opaque,(ppp)) + + + /*-- Header bytes. --*/ + + #define BZ_HDR_B 0x42 /* 'B' */ + #define BZ_HDR_Z 0x5a /* 'Z' */ + #define BZ_HDR_h 0x68 /* 'h' */ + #define BZ_HDR_0 0x30 /* '0' */ + + /*-- Constants for the back end. --*/ + + #define BZ_MAX_ALPHA_SIZE 258 + #define BZ_MAX_CODE_LEN 23 + + #define BZ_RUNA 0 + #define BZ_RUNB 1 + + #define BZ_N_GROUPS 6 + #define BZ_G_SIZE 50 + #define BZ_N_ITERS 4 + + #define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE)) + + + + /*-- Stuff for randomising repetitive blocks. --*/ + + extern Int32 BZ2_rNums[512]; + + #define BZ_RAND_DECLS \ + Int32 rNToGo; \ + Int32 rTPos \ + + #define BZ_RAND_INIT_MASK \ + s->rNToGo = 0; \ + s->rTPos = 0 \ + + #define BZ_RAND_MASK ((s->rNToGo == 1) ? 1 : 0) + + #define BZ_RAND_UPD_MASK \ + if (s->rNToGo == 0) { \ + s->rNToGo = BZ2_rNums[s->rTPos]; \ + s->rTPos++; \ + if (s->rTPos == 512) s->rTPos = 0; \ + } \ + s->rNToGo--; + + + + /*-- Stuff for doing CRCs. --*/ + + extern UInt32 BZ2_crc32Table[256]; + + #define BZ_INITIALISE_CRC(crcVar) \ + { \ + crcVar = 0xffffffffL; \ + } + + #define BZ_FINALISE_CRC(crcVar) \ + { \ + crcVar = ~(crcVar); \ + } + + #define BZ_UPDATE_CRC(crcVar,cha) \ + { \ + crcVar = (crcVar << 8) ^ \ + BZ2_crc32Table[(crcVar >> 24) ^ \ + ((UChar)cha)]; \ + } + + + + /*-- States and modes for compression. --*/ + + #define BZ_M_IDLE 1 + #define BZ_M_RUNNING 2 + #define BZ_M_FLUSHING 3 + #define BZ_M_FINISHING 4 + + #define BZ_S_OUTPUT 1 + #define BZ_S_INPUT 2 + + #define BZ_N_RADIX 2 + #define BZ_N_QSORT 12 + #define BZ_N_SHELL 18 + #define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2) + + + + + /*-- Structure holding all the compression-side stuff. --*/ + + typedef + struct { + /* pointer back to the struct bz_stream */ + bz_stream* strm; + + /* mode this stream is in, and whether inputting */ + /* or outputting data */ + Int32 mode; + Int32 state; + + /* remembers avail_in when flush/finish requested */ + UInt32 avail_in_expect; + + /* for doing the block sorting */ + UInt32* arr1; + UInt32* arr2; + UInt32* ftab; + Int32 origPtr; + + /* aliases for arr1 and arr2 */ + UInt32* ptr; + UChar* block; + UInt16* mtfv; + UChar* zbits; + + /* for deciding when to use the fallback sorting algorithm */ + Int32 workFactor; + + /* run-length-encoding of the input */ + UInt32 state_in_ch; + Int32 state_in_len; + BZ_RAND_DECLS; + + /* input and output limits and current posns */ + Int32 nblock; + Int32 nblockMAX; + Int32 numZ; + Int32 state_out_pos; + + /* map of bytes used in block */ + Int32 nInUse; + Bool inUse[256]; + UChar unseqToSeq[256]; + + /* the buffer for bit stream creation */ + UInt32 bsBuff; + Int32 bsLive; + + /* block and combined CRCs */ + UInt32 blockCRC; + UInt32 combinedCRC; + + /* misc administratium */ + Int32 verbosity; + Int32 blockNo; + Int32 blockSize100k; + + /* stuff for coding the MTF values */ + Int32 nMTF; + Int32 mtfFreq [BZ_MAX_ALPHA_SIZE]; + UChar selector [BZ_MAX_SELECTORS]; + UChar selectorMtf[BZ_MAX_SELECTORS]; + + UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 rfreq [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + /* second dimension: only 3 needed; 4 makes index calculations faster */ + UInt32 len_pack[BZ_MAX_ALPHA_SIZE][4]; + + } + EState; + + + + /*-- externs for compression. --*/ + + extern void + BZ2_blockSort ( EState* ); + + extern void + BZ2_compressBlock ( EState*, Bool ); + + extern void + BZ2_bsInitWrite ( EState* ); + + extern void + BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 ); + + extern void + BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 ); + + + + /*-- states for decompression. --*/ + + #define BZ_X_IDLE 1 + #define BZ_X_OUTPUT 2 + + #define BZ_X_MAGIC_1 10 + #define BZ_X_MAGIC_2 11 + #define BZ_X_MAGIC_3 12 + #define BZ_X_MAGIC_4 13 + #define BZ_X_BLKHDR_1 14 + #define BZ_X_BLKHDR_2 15 + #define BZ_X_BLKHDR_3 16 + #define BZ_X_BLKHDR_4 17 + #define BZ_X_BLKHDR_5 18 + #define BZ_X_BLKHDR_6 19 + #define BZ_X_BCRC_1 20 + #define BZ_X_BCRC_2 21 + #define BZ_X_BCRC_3 22 + #define BZ_X_BCRC_4 23 + #define BZ_X_RANDBIT 24 + #define BZ_X_ORIGPTR_1 25 + #define BZ_X_ORIGPTR_2 26 + #define BZ_X_ORIGPTR_3 27 + #define BZ_X_MAPPING_1 28 + #define BZ_X_MAPPING_2 29 + #define BZ_X_SELECTOR_1 30 + #define BZ_X_SELECTOR_2 31 + #define BZ_X_SELECTOR_3 32 + #define BZ_X_CODING_1 33 + #define BZ_X_CODING_2 34 + #define BZ_X_CODING_3 35 + #define BZ_X_MTF_1 36 + #define BZ_X_MTF_2 37 + #define BZ_X_MTF_3 38 + #define BZ_X_MTF_4 39 + #define BZ_X_MTF_5 40 + #define BZ_X_MTF_6 41 + #define BZ_X_ENDHDR_2 42 + #define BZ_X_ENDHDR_3 43 + #define BZ_X_ENDHDR_4 44 + #define BZ_X_ENDHDR_5 45 + #define BZ_X_ENDHDR_6 46 + #define BZ_X_CCRC_1 47 + #define BZ_X_CCRC_2 48 + #define BZ_X_CCRC_3 49 + #define BZ_X_CCRC_4 50 + + + + /*-- Constants for the fast MTF decoder. --*/ + + #define MTFA_SIZE 4096 + #define MTFL_SIZE 16 + + + + /*-- Structure holding all the decompression-side stuff. --*/ + + typedef + struct { + /* pointer back to the struct bz_stream */ + bz_stream* strm; + + /* state indicator for this stream */ + Int32 state; + + /* for doing the final run-length decoding */ + UChar state_out_ch; + Int32 state_out_len; + Bool blockRandomised; + BZ_RAND_DECLS; + + /* the buffer for bit stream reading */ + UInt32 bsBuff; + Int32 bsLive; + + /* misc administratium */ + Int32 blockSize100k; + Bool smallDecompress; + Int32 currBlockNo; + Int32 verbosity; + + /* for undoing the Burrows-Wheeler transform */ + Int32 origPtr; + UInt32 tPos; + Int32 k0; + Int32 unzftab[256]; + Int32 nblock_used; + Int32 cftab[257]; + Int32 cftabCopy[257]; + + /* for undoing the Burrows-Wheeler transform (FAST) */ + UInt32 *tt; + + /* for undoing the Burrows-Wheeler transform (SMALL) */ + UInt16 *ll16; + UChar *ll4; + + /* stored and calculated CRCs */ + UInt32 storedBlockCRC; + UInt32 storedCombinedCRC; + UInt32 calculatedBlockCRC; + UInt32 calculatedCombinedCRC; + + /* map of bytes used in block */ + Int32 nInUse; + Bool inUse[256]; + Bool inUse16[16]; + UChar seqToUnseq[256]; + + /* for decoding the MTF values */ + UChar mtfa [MTFA_SIZE]; + Int32 mtfbase[256 / MTFL_SIZE]; + UChar selector [BZ_MAX_SELECTORS]; + UChar selectorMtf[BZ_MAX_SELECTORS]; + UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + + Int32 limit [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 base [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 perm [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 minLens[BZ_N_GROUPS]; + + /* save area for scalars in the main decompress code */ + Int32 save_i; + Int32 save_j; + Int32 save_t; + Int32 save_alphaSize; + Int32 save_nGroups; + Int32 save_nSelectors; + Int32 save_EOB; + Int32 save_groupNo; + Int32 save_groupPos; + Int32 save_nextSym; + Int32 save_nblockMAX; + Int32 save_nblock; + Int32 save_es; + Int32 save_N; + Int32 save_curr; + Int32 save_zt; + Int32 save_zn; + Int32 save_zvec; + Int32 save_zj; + Int32 save_gSel; + Int32 save_gMinlen; + Int32* save_gLimit; + Int32* save_gBase; + Int32* save_gPerm; + + } + DState; + + + + /*-- Macros for decompression. --*/ + + #define BZ_GET_FAST(cccc) \ + s->tPos = s->tt[s->tPos]; \ + cccc = (UChar)(s->tPos & 0xff); \ + s->tPos >>= 8; + + #define BZ_GET_FAST_C(cccc) \ + c_tPos = c_tt[c_tPos]; \ + cccc = (UChar)(c_tPos & 0xff); \ + c_tPos >>= 8; + + #define SET_LL4(i,n) \ + { if (((i) & 0x1) == 0) \ + s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0xf0) | (n); else \ + s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0x0f) | ((n) << 4); \ + } + + #define GET_LL4(i) \ + ((((UInt32)(s->ll4[(i) >> 1])) >> (((i) << 2) & 0x4)) & 0xF) + + #define SET_LL(i,n) \ + { s->ll16[i] = (UInt16)(n & 0x0000ffff); \ + SET_LL4(i, n >> 16); \ + } + + #define GET_LL(i) \ + (((UInt32)s->ll16[i]) | (GET_LL4(i) << 16)) + + #define BZ_GET_SMALL(cccc) \ + cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \ + s->tPos = GET_LL(s->tPos); + + + /*-- externs for decompression. --*/ + + extern Int32 + BZ2_indexIntoF ( Int32, Int32* ); + + extern Int32 + BZ2_decompress ( DState* ); + + extern void + BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*, + Int32, Int32, Int32 ); + + + #endif + + + /*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/ + + #ifdef BZ_NO_STDIO + #ifndef NULL + #define NULL 0 + #endif + #endif + + + /*-------------------------------------------------------------*/ + /*--- end bzlib_private.h ---*/ + /*-------------------------------------------------------------*/ Index: llvm/lib/Support/bzip2/compress.c diff -c /dev/null llvm/lib/Support/bzip2/compress.c:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/compress.c Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,714 ---- + + /*-------------------------------------------------------------*/ + /*--- Compression machinery (not incl block sorting) ---*/ + /*--- compress.c ---*/ + /*-------------------------------------------------------------*/ + + /*-- + This file is a part of bzip2 and/or libbzip2, a program and + library for lossless, block-sorting data compression. + + Copyright (C) 1996-2002 Julian R Seward. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Julian Seward, Cambridge, UK. + jseward at acm.org + bzip2/libbzip2 version 1.0 of 21 March 2000 + + This program is based on (at least) the work of: + Mike Burrows + David Wheeler + Peter Fenwick + Alistair Moffat + Radford Neal + Ian H. Witten + Robert Sedgewick + Jon L. Bentley + + For more information on these sources, see the manual. + --*/ + + /*-- + CHANGES + ~~~~~~~ + 0.9.0 -- original version. + + 0.9.0a/b -- no changes in this file. + + 0.9.0c + * changed setting of nGroups in sendMTFValues() so as to + do a bit better on small files + --*/ + + #include "bzlib_private.h" + + + /*---------------------------------------------------*/ + /*--- Bit stream I/O ---*/ + /*---------------------------------------------------*/ + + /*---------------------------------------------------*/ + void BZ2_bsInitWrite ( EState* s ) + { + s->bsLive = 0; + s->bsBuff = 0; + } + + + /*---------------------------------------------------*/ + static + void bsFinishWrite ( EState* s ) + { + while (s->bsLive > 0) { + s->zbits[s->numZ] = (UChar)(s->bsBuff >> 24); + s->numZ++; + s->bsBuff <<= 8; + s->bsLive -= 8; + } + } + + + /*---------------------------------------------------*/ + #define bsNEEDW(nz) \ + { \ + while (s->bsLive >= 8) { \ + s->zbits[s->numZ] \ + = (UChar)(s->bsBuff >> 24); \ + s->numZ++; \ + s->bsBuff <<= 8; \ + s->bsLive -= 8; \ + } \ + } + + + /*---------------------------------------------------*/ + static + __inline__ + void bsW ( EState* s, Int32 n, UInt32 v ) + { + bsNEEDW ( n ); + s->bsBuff |= (v << (32 - s->bsLive - n)); + s->bsLive += n; + } + + + /*---------------------------------------------------*/ + static + void bsPutUInt32 ( EState* s, UInt32 u ) + { + bsW ( s, 8, (u >> 24) & 0xffL ); + bsW ( s, 8, (u >> 16) & 0xffL ); + bsW ( s, 8, (u >> 8) & 0xffL ); + bsW ( s, 8, u & 0xffL ); + } + + + /*---------------------------------------------------*/ + static + void bsPutUChar ( EState* s, UChar c ) + { + bsW( s, 8, (UInt32)c ); + } + + + /*---------------------------------------------------*/ + /*--- The back end proper ---*/ + /*---------------------------------------------------*/ + + /*---------------------------------------------------*/ + static + void makeMaps_e ( EState* s ) + { + Int32 i; + s->nInUse = 0; + for (i = 0; i < 256; i++) + if (s->inUse[i]) { + s->unseqToSeq[i] = s->nInUse; + s->nInUse++; + } + } + + + /*---------------------------------------------------*/ + static + void generateMTFValues ( EState* s ) + { + UChar yy[256]; + Int32 i, j; + Int32 zPend; + Int32 wr; + Int32 EOB; + + /* + After sorting (eg, here), + s->arr1 [ 0 .. s->nblock-1 ] holds sorted order, + and + ((UChar*)s->arr2) [ 0 .. s->nblock-1 ] + holds the original block data. + + The first thing to do is generate the MTF values, + and put them in + ((UInt16*)s->arr1) [ 0 .. s->nblock-1 ]. + Because there are strictly fewer or equal MTF values + than block values, ptr values in this area are overwritten + with MTF values only when they are no longer needed. + + The final compressed bitstream is generated into the + area starting at + (UChar*) (&((UChar*)s->arr2)[s->nblock]) + + These storage aliases are set up in bzCompressInit(), + except for the last one, which is arranged in + compressBlock(). + */ + UInt32* ptr = s->ptr; + UChar* block = s->block; + UInt16* mtfv = s->mtfv; + + makeMaps_e ( s ); + EOB = s->nInUse+1; + + for (i = 0; i <= EOB; i++) s->mtfFreq[i] = 0; + + wr = 0; + zPend = 0; + for (i = 0; i < s->nInUse; i++) yy[i] = (UChar) i; + + for (i = 0; i < s->nblock; i++) { + UChar ll_i; + AssertD ( wr <= i, "generateMTFValues(1)" ); + j = ptr[i]-1; if (j < 0) j += s->nblock; + ll_i = s->unseqToSeq[block[j]]; + AssertD ( ll_i < s->nInUse, "generateMTFValues(2a)" ); + + if (yy[0] == ll_i) { + zPend++; + } else { + + if (zPend > 0) { + zPend--; + while (True) { + if (zPend & 1) { + mtfv[wr] = BZ_RUNB; wr++; + s->mtfFreq[BZ_RUNB]++; + } else { + mtfv[wr] = BZ_RUNA; wr++; + s->mtfFreq[BZ_RUNA]++; + } + if (zPend < 2) break; + zPend = (zPend - 2) / 2; + }; + zPend = 0; + } + { + register UChar rtmp; + register UChar* ryy_j; + register UChar rll_i; + rtmp = yy[1]; + yy[1] = yy[0]; + ryy_j = &(yy[1]); + rll_i = ll_i; + while ( rll_i != rtmp ) { + register UChar rtmp2; + ryy_j++; + rtmp2 = rtmp; + rtmp = *ryy_j; + *ryy_j = rtmp2; + }; + yy[0] = rtmp; + j = ryy_j - &(yy[0]); + mtfv[wr] = j+1; wr++; s->mtfFreq[j+1]++; + } + + } + } + + if (zPend > 0) { + zPend--; + while (True) { + if (zPend & 1) { + mtfv[wr] = BZ_RUNB; wr++; + s->mtfFreq[BZ_RUNB]++; + } else { + mtfv[wr] = BZ_RUNA; wr++; + s->mtfFreq[BZ_RUNA]++; + } + if (zPend < 2) break; + zPend = (zPend - 2) / 2; + }; + zPend = 0; + } + + mtfv[wr] = EOB; wr++; s->mtfFreq[EOB]++; + + s->nMTF = wr; + } + + + /*---------------------------------------------------*/ + #define BZ_LESSER_ICOST 0 + #define BZ_GREATER_ICOST 15 + + static + void sendMTFValues ( EState* s ) + { + Int32 v, t, i, j, gs, ge, totc, bt, bc, iter; + Int32 nSelectors, alphaSize, minLen, maxLen, selCtr; + Int32 nGroups, nBytes; + + /*-- + UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + is a global since the decoder also needs it. + + Int32 code[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + are also globals only used in this proc. + Made global to keep stack frame size small. + --*/ + + + UInt16 cost[BZ_N_GROUPS]; + Int32 fave[BZ_N_GROUPS]; + + UInt16* mtfv = s->mtfv; + + if (s->verbosity >= 3) + VPrintf3( " %d in block, %d after MTF & 1-2 coding, " + "%d+2 syms in use\n", + s->nblock, s->nMTF, s->nInUse ); + + alphaSize = s->nInUse+2; + for (t = 0; t < BZ_N_GROUPS; t++) + for (v = 0; v < alphaSize; v++) + s->len[t][v] = BZ_GREATER_ICOST; + + /*--- Decide how many coding tables to use ---*/ + AssertH ( s->nMTF > 0, 3001 ); + if (s->nMTF < 200) nGroups = 2; else + if (s->nMTF < 600) nGroups = 3; else + if (s->nMTF < 1200) nGroups = 4; else + if (s->nMTF < 2400) nGroups = 5; else + nGroups = 6; + + /*--- Generate an initial set of coding tables ---*/ + { + Int32 nPart, remF, tFreq, aFreq; + + nPart = nGroups; + remF = s->nMTF; + gs = 0; + while (nPart > 0) { + tFreq = remF / nPart; + ge = gs-1; + aFreq = 0; + while (aFreq < tFreq && ge < alphaSize-1) { + ge++; + aFreq += s->mtfFreq[ge]; + } + + if (ge > gs + && nPart != nGroups && nPart != 1 + && ((nGroups-nPart) % 2 == 1)) { + aFreq -= s->mtfFreq[ge]; + ge--; + } + + if (s->verbosity >= 3) + VPrintf5( " initial group %d, [%d .. %d], " + "has %d syms (%4.1f%%)\n", + nPart, gs, ge, aFreq, + (100.0 * (float)aFreq) / (float)(s->nMTF) ); + + for (v = 0; v < alphaSize; v++) + if (v >= gs && v <= ge) + s->len[nPart-1][v] = BZ_LESSER_ICOST; else + s->len[nPart-1][v] = BZ_GREATER_ICOST; + + nPart--; + gs = ge+1; + remF -= aFreq; + } + } + + /*--- + Iterate up to BZ_N_ITERS times to improve the tables. + ---*/ + for (iter = 0; iter < BZ_N_ITERS; iter++) { + + for (t = 0; t < nGroups; t++) fave[t] = 0; + + for (t = 0; t < nGroups; t++) + for (v = 0; v < alphaSize; v++) + s->rfreq[t][v] = 0; + + /*--- + Set up an auxiliary length table which is used to fast-track + the common case (nGroups == 6). + ---*/ + if (nGroups == 6) { + for (v = 0; v < alphaSize; v++) { + s->len_pack[v][0] = (s->len[1][v] << 16) | s->len[0][v]; + s->len_pack[v][1] = (s->len[3][v] << 16) | s->len[2][v]; + s->len_pack[v][2] = (s->len[5][v] << 16) | s->len[4][v]; + } + } + + nSelectors = 0; + totc = 0; + gs = 0; + while (True) { + + /*--- Set group start & end marks. --*/ + if (gs >= s->nMTF) break; + ge = gs + BZ_G_SIZE - 1; + if (ge >= s->nMTF) ge = s->nMTF-1; + + /*-- + Calculate the cost of this group as coded + by each of the coding tables. + --*/ + for (t = 0; t < nGroups; t++) cost[t] = 0; + + if (nGroups == 6 && 50 == ge-gs+1) { + /*--- fast track the common case ---*/ + register UInt32 cost01, cost23, cost45; + register UInt16 icv; + cost01 = cost23 = cost45 = 0; + + # define BZ_ITER(nn) \ + icv = mtfv[gs+(nn)]; \ + cost01 += s->len_pack[icv][0]; \ + cost23 += s->len_pack[icv][1]; \ + cost45 += s->len_pack[icv][2]; \ + + BZ_ITER(0); BZ_ITER(1); BZ_ITER(2); BZ_ITER(3); BZ_ITER(4); + BZ_ITER(5); BZ_ITER(6); BZ_ITER(7); BZ_ITER(8); BZ_ITER(9); + BZ_ITER(10); BZ_ITER(11); BZ_ITER(12); BZ_ITER(13); BZ_ITER(14); + BZ_ITER(15); BZ_ITER(16); BZ_ITER(17); BZ_ITER(18); BZ_ITER(19); + BZ_ITER(20); BZ_ITER(21); BZ_ITER(22); BZ_ITER(23); BZ_ITER(24); + BZ_ITER(25); BZ_ITER(26); BZ_ITER(27); BZ_ITER(28); BZ_ITER(29); + BZ_ITER(30); BZ_ITER(31); BZ_ITER(32); BZ_ITER(33); BZ_ITER(34); + BZ_ITER(35); BZ_ITER(36); BZ_ITER(37); BZ_ITER(38); BZ_ITER(39); + BZ_ITER(40); BZ_ITER(41); BZ_ITER(42); BZ_ITER(43); BZ_ITER(44); + BZ_ITER(45); BZ_ITER(46); BZ_ITER(47); BZ_ITER(48); BZ_ITER(49); + + # undef BZ_ITER + + cost[0] = cost01 & 0xffff; cost[1] = cost01 >> 16; + cost[2] = cost23 & 0xffff; cost[3] = cost23 >> 16; + cost[4] = cost45 & 0xffff; cost[5] = cost45 >> 16; + + } else { + /*--- slow version which correctly handles all situations ---*/ + for (i = gs; i <= ge; i++) { + UInt16 icv = mtfv[i]; + for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv]; + } + } + + /*-- + Find the coding table which is best for this group, + and record its identity in the selector table. + --*/ + bc = 999999999; bt = -1; + for (t = 0; t < nGroups; t++) + if (cost[t] < bc) { bc = cost[t]; bt = t; }; + totc += bc; + fave[bt]++; + s->selector[nSelectors] = bt; + nSelectors++; + + /*-- + Increment the symbol frequencies for the selected table. + --*/ + if (nGroups == 6 && 50 == ge-gs+1) { + /*--- fast track the common case ---*/ + + # define BZ_ITUR(nn) s->rfreq[bt][ mtfv[gs+(nn)] ]++ + + BZ_ITUR(0); BZ_ITUR(1); BZ_ITUR(2); BZ_ITUR(3); BZ_ITUR(4); + BZ_ITUR(5); BZ_ITUR(6); BZ_ITUR(7); BZ_ITUR(8); BZ_ITUR(9); + BZ_ITUR(10); BZ_ITUR(11); BZ_ITUR(12); BZ_ITUR(13); BZ_ITUR(14); + BZ_ITUR(15); BZ_ITUR(16); BZ_ITUR(17); BZ_ITUR(18); BZ_ITUR(19); + BZ_ITUR(20); BZ_ITUR(21); BZ_ITUR(22); BZ_ITUR(23); BZ_ITUR(24); + BZ_ITUR(25); BZ_ITUR(26); BZ_ITUR(27); BZ_ITUR(28); BZ_ITUR(29); + BZ_ITUR(30); BZ_ITUR(31); BZ_ITUR(32); BZ_ITUR(33); BZ_ITUR(34); + BZ_ITUR(35); BZ_ITUR(36); BZ_ITUR(37); BZ_ITUR(38); BZ_ITUR(39); + BZ_ITUR(40); BZ_ITUR(41); BZ_ITUR(42); BZ_ITUR(43); BZ_ITUR(44); + BZ_ITUR(45); BZ_ITUR(46); BZ_ITUR(47); BZ_ITUR(48); BZ_ITUR(49); + + # undef BZ_ITUR + + } else { + /*--- slow version which correctly handles all situations ---*/ + for (i = gs; i <= ge; i++) + s->rfreq[bt][ mtfv[i] ]++; + } + + gs = ge+1; + } + if (s->verbosity >= 3) { + VPrintf2 ( " pass %d: size is %d, grp uses are ", + iter+1, totc/8 ); + for (t = 0; t < nGroups; t++) + VPrintf1 ( "%d ", fave[t] ); + VPrintf0 ( "\n" ); + } + + /*-- + Recompute the tables based on the accumulated frequencies. + --*/ + for (t = 0; t < nGroups; t++) + BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]), + alphaSize, 20 ); + } + + + AssertH( nGroups < 8, 3002 ); + AssertH( nSelectors < 32768 && + nSelectors <= (2 + (900000 / BZ_G_SIZE)), + 3003 ); + + + /*--- Compute MTF values for the selectors. ---*/ + { + UChar pos[BZ_N_GROUPS], ll_i, tmp2, tmp; + for (i = 0; i < nGroups; i++) pos[i] = i; + for (i = 0; i < nSelectors; i++) { + ll_i = s->selector[i]; + j = 0; + tmp = pos[j]; + while ( ll_i != tmp ) { + j++; + tmp2 = tmp; + tmp = pos[j]; + pos[j] = tmp2; + }; + pos[0] = tmp; + s->selectorMtf[i] = j; + } + }; + + /*--- Assign actual codes for the tables. --*/ + for (t = 0; t < nGroups; t++) { + minLen = 32; + maxLen = 0; + for (i = 0; i < alphaSize; i++) { + if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; + if (s->len[t][i] < minLen) minLen = s->len[t][i]; + } + AssertH ( !(maxLen > 20), 3004 ); + AssertH ( !(minLen < 1), 3005 ); + BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]), + minLen, maxLen, alphaSize ); + } + + /*--- Transmit the mapping table. ---*/ + { + Bool inUse16[16]; + for (i = 0; i < 16; i++) { + inUse16[i] = False; + for (j = 0; j < 16; j++) + if (s->inUse[i * 16 + j]) inUse16[i] = True; + } + + nBytes = s->numZ; + for (i = 0; i < 16; i++) + if (inUse16[i]) bsW(s,1,1); else bsW(s,1,0); + + for (i = 0; i < 16; i++) + if (inUse16[i]) + for (j = 0; j < 16; j++) { + if (s->inUse[i * 16 + j]) bsW(s,1,1); else bsW(s,1,0); + } + + if (s->verbosity >= 3) + VPrintf1( " bytes: mapping %d, ", s->numZ-nBytes ); + } + + /*--- Now the selectors. ---*/ + nBytes = s->numZ; + bsW ( s, 3, nGroups ); + bsW ( s, 15, nSelectors ); + for (i = 0; i < nSelectors; i++) { + for (j = 0; j < s->selectorMtf[i]; j++) bsW(s,1,1); + bsW(s,1,0); + } + if (s->verbosity >= 3) + VPrintf1( "selectors %d, ", s->numZ-nBytes ); + + /*--- Now the coding tables. ---*/ + nBytes = s->numZ; + + for (t = 0; t < nGroups; t++) { + Int32 curr = s->len[t][0]; + bsW ( s, 5, curr ); + for (i = 0; i < alphaSize; i++) { + while (curr < s->len[t][i]) { bsW(s,2,2); curr++; /* 10 */ }; + while (curr > s->len[t][i]) { bsW(s,2,3); curr--; /* 11 */ }; + bsW ( s, 1, 0 ); + } + } + + if (s->verbosity >= 3) + VPrintf1 ( "code lengths %d, ", s->numZ-nBytes ); + + /*--- And finally, the block data proper ---*/ + nBytes = s->numZ; + selCtr = 0; + gs = 0; + while (True) { + if (gs >= s->nMTF) break; + ge = gs + BZ_G_SIZE - 1; + if (ge >= s->nMTF) ge = s->nMTF-1; + AssertH ( s->selector[selCtr] < nGroups, 3006 ); + + if (nGroups == 6 && 50 == ge-gs+1) { + /*--- fast track the common case ---*/ + UInt16 mtfv_i; + UChar* s_len_sel_selCtr + = &(s->len[s->selector[selCtr]][0]); + Int32* s_code_sel_selCtr + = &(s->code[s->selector[selCtr]][0]); + + # define BZ_ITAH(nn) \ + mtfv_i = mtfv[gs+(nn)]; \ + bsW ( s, \ + s_len_sel_selCtr[mtfv_i], \ + s_code_sel_selCtr[mtfv_i] ) + + BZ_ITAH(0); BZ_ITAH(1); BZ_ITAH(2); BZ_ITAH(3); BZ_ITAH(4); + BZ_ITAH(5); BZ_ITAH(6); BZ_ITAH(7); BZ_ITAH(8); BZ_ITAH(9); + BZ_ITAH(10); BZ_ITAH(11); BZ_ITAH(12); BZ_ITAH(13); BZ_ITAH(14); + BZ_ITAH(15); BZ_ITAH(16); BZ_ITAH(17); BZ_ITAH(18); BZ_ITAH(19); + BZ_ITAH(20); BZ_ITAH(21); BZ_ITAH(22); BZ_ITAH(23); BZ_ITAH(24); + BZ_ITAH(25); BZ_ITAH(26); BZ_ITAH(27); BZ_ITAH(28); BZ_ITAH(29); + BZ_ITAH(30); BZ_ITAH(31); BZ_ITAH(32); BZ_ITAH(33); BZ_ITAH(34); + BZ_ITAH(35); BZ_ITAH(36); BZ_ITAH(37); BZ_ITAH(38); BZ_ITAH(39); + BZ_ITAH(40); BZ_ITAH(41); BZ_ITAH(42); BZ_ITAH(43); BZ_ITAH(44); + BZ_ITAH(45); BZ_ITAH(46); BZ_ITAH(47); BZ_ITAH(48); BZ_ITAH(49); + + # undef BZ_ITAH + + } else { + /*--- slow version which correctly handles all situations ---*/ + for (i = gs; i <= ge; i++) { + bsW ( s, + s->len [s->selector[selCtr]] [mtfv[i]], + s->code [s->selector[selCtr]] [mtfv[i]] ); + } + } + + + gs = ge+1; + selCtr++; + } + AssertH( selCtr == nSelectors, 3007 ); + + if (s->verbosity >= 3) + VPrintf1( "codes %d\n", s->numZ-nBytes ); + } + + + /*---------------------------------------------------*/ + void BZ2_compressBlock ( EState* s, Bool is_last_block ) + { + if (s->nblock > 0) { + + BZ_FINALISE_CRC ( s->blockCRC ); + s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31); + s->combinedCRC ^= s->blockCRC; + if (s->blockNo > 1) s->numZ = 0; + + if (s->verbosity >= 2) + VPrintf4( " block %d: crc = 0x%8x, " + "combined CRC = 0x%8x, size = %d\n", + s->blockNo, s->blockCRC, s->combinedCRC, s->nblock ); + + BZ2_blockSort ( s ); + } + + s->zbits = (UChar*) (&((UChar*)s->arr2)[s->nblock]); + + /*-- If this is the first block, create the stream header. --*/ + if (s->blockNo == 1) { + BZ2_bsInitWrite ( s ); + bsPutUChar ( s, BZ_HDR_B ); + bsPutUChar ( s, BZ_HDR_Z ); + bsPutUChar ( s, BZ_HDR_h ); + bsPutUChar ( s, (UChar)(BZ_HDR_0 + s->blockSize100k) ); + } + + if (s->nblock > 0) { + + bsPutUChar ( s, 0x31 ); bsPutUChar ( s, 0x41 ); + bsPutUChar ( s, 0x59 ); bsPutUChar ( s, 0x26 ); + bsPutUChar ( s, 0x53 ); bsPutUChar ( s, 0x59 ); + + /*-- Now the block's CRC, so it is in a known place. --*/ + bsPutUInt32 ( s, s->blockCRC ); + + /*-- + Now a single bit indicating (non-)randomisation. + As of version 0.9.5, we use a better sorting algorithm + which makes randomisation unnecessary. So always set + the randomised bit to 'no'. Of course, the decoder + still needs to be able to handle randomised blocks + so as to maintain backwards compatibility with + older versions of bzip2. + --*/ + bsW(s,1,0); + + bsW ( s, 24, s->origPtr ); + generateMTFValues ( s ); + sendMTFValues ( s ); + } + + + /*-- If this is the last block, add the stream trailer. --*/ + if (is_last_block) { + + bsPutUChar ( s, 0x17 ); bsPutUChar ( s, 0x72 ); + bsPutUChar ( s, 0x45 ); bsPutUChar ( s, 0x38 ); + bsPutUChar ( s, 0x50 ); bsPutUChar ( s, 0x90 ); + bsPutUInt32 ( s, s->combinedCRC ); + if (s->verbosity >= 2) + VPrintf1( " final combined CRC = 0x%x\n ", s->combinedCRC ); + bsFinishWrite ( s ); + } + } + + + /*-------------------------------------------------------------*/ + /*--- end compress.c ---*/ + /*-------------------------------------------------------------*/ Index: llvm/lib/Support/bzip2/crctable.c diff -c /dev/null llvm/lib/Support/bzip2/crctable.c:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/crctable.c Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,144 ---- + + /*-------------------------------------------------------------*/ + /*--- Table for doing CRCs ---*/ + /*--- crctable.c ---*/ + /*-------------------------------------------------------------*/ + + /*-- + This file is a part of bzip2 and/or libbzip2, a program and + library for lossless, block-sorting data compression. + + Copyright (C) 1996-2002 Julian R Seward. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Julian Seward, Cambridge, UK. + jseward at acm.org + bzip2/libbzip2 version 1.0 of 21 March 2000 + + This program is based on (at least) the work of: + Mike Burrows + David Wheeler + Peter Fenwick + Alistair Moffat + Radford Neal + Ian H. Witten + Robert Sedgewick + Jon L. Bentley + + For more information on these sources, see the manual. + --*/ + + + #include "bzlib_private.h" + + /*-- + I think this is an implementation of the AUTODIN-II, + Ethernet & FDDI 32-bit CRC standard. Vaguely derived + from code by Rob Warnock, in Section 51 of the + comp.compression FAQ. + --*/ + + UInt32 BZ2_crc32Table[256] = { + + /*-- Ugly, innit? --*/ + + 0x00000000L, 0x04c11db7L, 0x09823b6eL, 0x0d4326d9L, + 0x130476dcL, 0x17c56b6bL, 0x1a864db2L, 0x1e475005L, + 0x2608edb8L, 0x22c9f00fL, 0x2f8ad6d6L, 0x2b4bcb61L, + 0x350c9b64L, 0x31cd86d3L, 0x3c8ea00aL, 0x384fbdbdL, + 0x4c11db70L, 0x48d0c6c7L, 0x4593e01eL, 0x4152fda9L, + 0x5f15adacL, 0x5bd4b01bL, 0x569796c2L, 0x52568b75L, + 0x6a1936c8L, 0x6ed82b7fL, 0x639b0da6L, 0x675a1011L, + 0x791d4014L, 0x7ddc5da3L, 0x709f7b7aL, 0x745e66cdL, + 0x9823b6e0L, 0x9ce2ab57L, 0x91a18d8eL, 0x95609039L, + 0x8b27c03cL, 0x8fe6dd8bL, 0x82a5fb52L, 0x8664e6e5L, + 0xbe2b5b58L, 0xbaea46efL, 0xb7a96036L, 0xb3687d81L, + 0xad2f2d84L, 0xa9ee3033L, 0xa4ad16eaL, 0xa06c0b5dL, + 0xd4326d90L, 0xd0f37027L, 0xddb056feL, 0xd9714b49L, + 0xc7361b4cL, 0xc3f706fbL, 0xceb42022L, 0xca753d95L, + 0xf23a8028L, 0xf6fb9d9fL, 0xfbb8bb46L, 0xff79a6f1L, + 0xe13ef6f4L, 0xe5ffeb43L, 0xe8bccd9aL, 0xec7dd02dL, + 0x34867077L, 0x30476dc0L, 0x3d044b19L, 0x39c556aeL, + 0x278206abL, 0x23431b1cL, 0x2e003dc5L, 0x2ac12072L, + 0x128e9dcfL, 0x164f8078L, 0x1b0ca6a1L, 0x1fcdbb16L, + 0x018aeb13L, 0x054bf6a4L, 0x0808d07dL, 0x0cc9cdcaL, + 0x7897ab07L, 0x7c56b6b0L, 0x71159069L, 0x75d48ddeL, + 0x6b93dddbL, 0x6f52c06cL, 0x6211e6b5L, 0x66d0fb02L, + 0x5e9f46bfL, 0x5a5e5b08L, 0x571d7dd1L, 0x53dc6066L, + 0x4d9b3063L, 0x495a2dd4L, 0x44190b0dL, 0x40d816baL, + 0xaca5c697L, 0xa864db20L, 0xa527fdf9L, 0xa1e6e04eL, + 0xbfa1b04bL, 0xbb60adfcL, 0xb6238b25L, 0xb2e29692L, + 0x8aad2b2fL, 0x8e6c3698L, 0x832f1041L, 0x87ee0df6L, + 0x99a95df3L, 0x9d684044L, 0x902b669dL, 0x94ea7b2aL, + 0xe0b41de7L, 0xe4750050L, 0xe9362689L, 0xedf73b3eL, + 0xf3b06b3bL, 0xf771768cL, 0xfa325055L, 0xfef34de2L, + 0xc6bcf05fL, 0xc27dede8L, 0xcf3ecb31L, 0xcbffd686L, + 0xd5b88683L, 0xd1799b34L, 0xdc3abdedL, 0xd8fba05aL, + 0x690ce0eeL, 0x6dcdfd59L, 0x608edb80L, 0x644fc637L, + 0x7a089632L, 0x7ec98b85L, 0x738aad5cL, 0x774bb0ebL, + 0x4f040d56L, 0x4bc510e1L, 0x46863638L, 0x42472b8fL, + 0x5c007b8aL, 0x58c1663dL, 0x558240e4L, 0x51435d53L, + 0x251d3b9eL, 0x21dc2629L, 0x2c9f00f0L, 0x285e1d47L, + 0x36194d42L, 0x32d850f5L, 0x3f9b762cL, 0x3b5a6b9bL, + 0x0315d626L, 0x07d4cb91L, 0x0a97ed48L, 0x0e56f0ffL, + 0x1011a0faL, 0x14d0bd4dL, 0x19939b94L, 0x1d528623L, + 0xf12f560eL, 0xf5ee4bb9L, 0xf8ad6d60L, 0xfc6c70d7L, + 0xe22b20d2L, 0xe6ea3d65L, 0xeba91bbcL, 0xef68060bL, + 0xd727bbb6L, 0xd3e6a601L, 0xdea580d8L, 0xda649d6fL, + 0xc423cd6aL, 0xc0e2d0ddL, 0xcda1f604L, 0xc960ebb3L, + 0xbd3e8d7eL, 0xb9ff90c9L, 0xb4bcb610L, 0xb07daba7L, + 0xae3afba2L, 0xaafbe615L, 0xa7b8c0ccL, 0xa379dd7bL, + 0x9b3660c6L, 0x9ff77d71L, 0x92b45ba8L, 0x9675461fL, + 0x8832161aL, 0x8cf30badL, 0x81b02d74L, 0x857130c3L, + 0x5d8a9099L, 0x594b8d2eL, 0x5408abf7L, 0x50c9b640L, + 0x4e8ee645L, 0x4a4ffbf2L, 0x470cdd2bL, 0x43cdc09cL, + 0x7b827d21L, 0x7f436096L, 0x7200464fL, 0x76c15bf8L, + 0x68860bfdL, 0x6c47164aL, 0x61043093L, 0x65c52d24L, + 0x119b4be9L, 0x155a565eL, 0x18197087L, 0x1cd86d30L, + 0x029f3d35L, 0x065e2082L, 0x0b1d065bL, 0x0fdc1becL, + 0x3793a651L, 0x3352bbe6L, 0x3e119d3fL, 0x3ad08088L, + 0x2497d08dL, 0x2056cd3aL, 0x2d15ebe3L, 0x29d4f654L, + 0xc5a92679L, 0xc1683bceL, 0xcc2b1d17L, 0xc8ea00a0L, + 0xd6ad50a5L, 0xd26c4d12L, 0xdf2f6bcbL, 0xdbee767cL, + 0xe3a1cbc1L, 0xe760d676L, 0xea23f0afL, 0xeee2ed18L, + 0xf0a5bd1dL, 0xf464a0aaL, 0xf9278673L, 0xfde69bc4L, + 0x89b8fd09L, 0x8d79e0beL, 0x803ac667L, 0x84fbdbd0L, + 0x9abc8bd5L, 0x9e7d9662L, 0x933eb0bbL, 0x97ffad0cL, + 0xafb010b1L, 0xab710d06L, 0xa6322bdfL, 0xa2f33668L, + 0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L + }; + + + /*-------------------------------------------------------------*/ + /*--- end crctable.c ---*/ + /*-------------------------------------------------------------*/ Index: llvm/lib/Support/bzip2/decompress.c diff -c /dev/null llvm/lib/Support/bzip2/decompress.c:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/decompress.c Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,660 ---- + + /*-------------------------------------------------------------*/ + /*--- Decompression machinery ---*/ + /*--- decompress.c ---*/ + /*-------------------------------------------------------------*/ + + /*-- + This file is a part of bzip2 and/or libbzip2, a program and + library for lossless, block-sorting data compression. + + Copyright (C) 1996-2002 Julian R Seward. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Julian Seward, Cambridge, UK. + jseward at acm.org + bzip2/libbzip2 version 1.0 of 21 March 2000 + + This program is based on (at least) the work of: + Mike Burrows + David Wheeler + Peter Fenwick + Alistair Moffat + Radford Neal + Ian H. Witten + Robert Sedgewick + Jon L. Bentley + + For more information on these sources, see the manual. + --*/ + + + #include "bzlib_private.h" + + + /*---------------------------------------------------*/ + static + void makeMaps_d ( DState* s ) + { + Int32 i; + s->nInUse = 0; + for (i = 0; i < 256; i++) + if (s->inUse[i]) { + s->seqToUnseq[s->nInUse] = i; + s->nInUse++; + } + } + + + /*---------------------------------------------------*/ + #define RETURN(rrr) \ + { retVal = rrr; goto save_state_and_return; }; + + #define GET_BITS(lll,vvv,nnn) \ + case lll: s->state = lll; \ + while (True) { \ + if (s->bsLive >= nnn) { \ + UInt32 v; \ + v = (s->bsBuff >> \ + (s->bsLive-nnn)) & ((1 << nnn)-1); \ + s->bsLive -= nnn; \ + vvv = v; \ + break; \ + } \ + if (s->strm->avail_in == 0) RETURN(BZ_OK); \ + s->bsBuff \ + = (s->bsBuff << 8) | \ + ((UInt32) \ + (*((UChar*)(s->strm->next_in)))); \ + s->bsLive += 8; \ + s->strm->next_in++; \ + s->strm->avail_in--; \ + s->strm->total_in_lo32++; \ + if (s->strm->total_in_lo32 == 0) \ + s->strm->total_in_hi32++; \ + } + + #define GET_UCHAR(lll,uuu) \ + GET_BITS(lll,uuu,8) + + #define GET_BIT(lll,uuu) \ + GET_BITS(lll,uuu,1) + + /*---------------------------------------------------*/ + #define GET_MTF_VAL(label1,label2,lval) \ + { \ + if (groupPos == 0) { \ + groupNo++; \ + if (groupNo >= nSelectors) \ + RETURN(BZ_DATA_ERROR); \ + groupPos = BZ_G_SIZE; \ + gSel = s->selector[groupNo]; \ + gMinlen = s->minLens[gSel]; \ + gLimit = &(s->limit[gSel][0]); \ + gPerm = &(s->perm[gSel][0]); \ + gBase = &(s->base[gSel][0]); \ + } \ + groupPos--; \ + zn = gMinlen; \ + GET_BITS(label1, zvec, zn); \ + while (1) { \ + if (zn > 20 /* the longest code */) \ + RETURN(BZ_DATA_ERROR); \ + if (zvec <= gLimit[zn]) break; \ + zn++; \ + GET_BIT(label2, zj); \ + zvec = (zvec << 1) | zj; \ + }; \ + if (zvec - gBase[zn] < 0 \ + || zvec - gBase[zn] >= BZ_MAX_ALPHA_SIZE) \ + RETURN(BZ_DATA_ERROR); \ + lval = gPerm[zvec - gBase[zn]]; \ + } + + + /*---------------------------------------------------*/ + Int32 BZ2_decompress ( DState* s ) + { + UChar uc; + Int32 retVal; + Int32 minLen, maxLen; + bz_stream* strm = s->strm; + + /* stuff that needs to be saved/restored */ + Int32 i; + Int32 j; + Int32 t; + Int32 alphaSize; + Int32 nGroups; + Int32 nSelectors; + Int32 EOB; + Int32 groupNo; + Int32 groupPos; + Int32 nextSym; + Int32 nblockMAX; + Int32 nblock; + Int32 es; + Int32 N; + Int32 curr; + Int32 zt; + Int32 zn; + Int32 zvec; + Int32 zj; + Int32 gSel; + Int32 gMinlen; + Int32* gLimit; + Int32* gBase; + Int32* gPerm; + + if (s->state == BZ_X_MAGIC_1) { + /*initialise the save area*/ + s->save_i = 0; + s->save_j = 0; + s->save_t = 0; + s->save_alphaSize = 0; + s->save_nGroups = 0; + s->save_nSelectors = 0; + s->save_EOB = 0; + s->save_groupNo = 0; + s->save_groupPos = 0; + s->save_nextSym = 0; + s->save_nblockMAX = 0; + s->save_nblock = 0; + s->save_es = 0; + s->save_N = 0; + s->save_curr = 0; + s->save_zt = 0; + s->save_zn = 0; + s->save_zvec = 0; + s->save_zj = 0; + s->save_gSel = 0; + s->save_gMinlen = 0; + s->save_gLimit = NULL; + s->save_gBase = NULL; + s->save_gPerm = NULL; + } + + /*restore from the save area*/ + i = s->save_i; + j = s->save_j; + t = s->save_t; + alphaSize = s->save_alphaSize; + nGroups = s->save_nGroups; + nSelectors = s->save_nSelectors; + EOB = s->save_EOB; + groupNo = s->save_groupNo; + groupPos = s->save_groupPos; + nextSym = s->save_nextSym; + nblockMAX = s->save_nblockMAX; + nblock = s->save_nblock; + es = s->save_es; + N = s->save_N; + curr = s->save_curr; + zt = s->save_zt; + zn = s->save_zn; + zvec = s->save_zvec; + zj = s->save_zj; + gSel = s->save_gSel; + gMinlen = s->save_gMinlen; + gLimit = s->save_gLimit; + gBase = s->save_gBase; + gPerm = s->save_gPerm; + + retVal = BZ_OK; + + switch (s->state) { + + GET_UCHAR(BZ_X_MAGIC_1, uc); + if (uc != BZ_HDR_B) RETURN(BZ_DATA_ERROR_MAGIC); + + GET_UCHAR(BZ_X_MAGIC_2, uc); + if (uc != BZ_HDR_Z) RETURN(BZ_DATA_ERROR_MAGIC); + + GET_UCHAR(BZ_X_MAGIC_3, uc) + if (uc != BZ_HDR_h) RETURN(BZ_DATA_ERROR_MAGIC); + + GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8) + if (s->blockSize100k < (BZ_HDR_0 + 1) || + s->blockSize100k > (BZ_HDR_0 + 9)) RETURN(BZ_DATA_ERROR_MAGIC); + s->blockSize100k -= BZ_HDR_0; + + if (s->smallDecompress) { + s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) ); + s->ll4 = BZALLOC( + ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) + ); + if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR); + } else { + s->tt = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) ); + if (s->tt == NULL) RETURN(BZ_MEM_ERROR); + } + + GET_UCHAR(BZ_X_BLKHDR_1, uc); + + if (uc == 0x17) goto endhdr_2; + if (uc != 0x31) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_BLKHDR_2, uc); + if (uc != 0x41) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_BLKHDR_3, uc); + if (uc != 0x59) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_BLKHDR_4, uc); + if (uc != 0x26) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_BLKHDR_5, uc); + if (uc != 0x53) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_BLKHDR_6, uc); + if (uc != 0x59) RETURN(BZ_DATA_ERROR); + + s->currBlockNo++; + if (s->verbosity >= 2) + VPrintf1 ( "\n [%d: huff+mtf ", s->currBlockNo ); + + s->storedBlockCRC = 0; + GET_UCHAR(BZ_X_BCRC_1, uc); + s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_BCRC_2, uc); + s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_BCRC_3, uc); + s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_BCRC_4, uc); + s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); + + GET_BITS(BZ_X_RANDBIT, s->blockRandomised, 1); + + s->origPtr = 0; + GET_UCHAR(BZ_X_ORIGPTR_1, uc); + s->origPtr = (s->origPtr << 8) | ((Int32)uc); + GET_UCHAR(BZ_X_ORIGPTR_2, uc); + s->origPtr = (s->origPtr << 8) | ((Int32)uc); + GET_UCHAR(BZ_X_ORIGPTR_3, uc); + s->origPtr = (s->origPtr << 8) | ((Int32)uc); + + if (s->origPtr < 0) + RETURN(BZ_DATA_ERROR); + if (s->origPtr > 10 + 100000*s->blockSize100k) + RETURN(BZ_DATA_ERROR); + + /*--- Receive the mapping table ---*/ + for (i = 0; i < 16; i++) { + GET_BIT(BZ_X_MAPPING_1, uc); + if (uc == 1) + s->inUse16[i] = True; else + s->inUse16[i] = False; + } + + for (i = 0; i < 256; i++) s->inUse[i] = False; + + for (i = 0; i < 16; i++) + if (s->inUse16[i]) + for (j = 0; j < 16; j++) { + GET_BIT(BZ_X_MAPPING_2, uc); + if (uc == 1) s->inUse[i * 16 + j] = True; + } + makeMaps_d ( s ); + if (s->nInUse == 0) RETURN(BZ_DATA_ERROR); + alphaSize = s->nInUse+2; + + /*--- Now the selectors ---*/ + GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); + if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); + GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); + if (nSelectors < 1) RETURN(BZ_DATA_ERROR); + for (i = 0; i < nSelectors; i++) { + j = 0; + while (True) { + GET_BIT(BZ_X_SELECTOR_3, uc); + if (uc == 0) break; + j++; + if (j >= nGroups) RETURN(BZ_DATA_ERROR); + } + s->selectorMtf[i] = j; + } + + /*--- Undo the MTF values for the selectors. ---*/ + { + UChar pos[BZ_N_GROUPS], tmp, v; + for (v = 0; v < nGroups; v++) pos[v] = v; + + for (i = 0; i < nSelectors; i++) { + v = s->selectorMtf[i]; + tmp = pos[v]; + while (v > 0) { pos[v] = pos[v-1]; v--; } + pos[0] = tmp; + s->selector[i] = tmp; + } + } + + /*--- Now the coding tables ---*/ + for (t = 0; t < nGroups; t++) { + GET_BITS(BZ_X_CODING_1, curr, 5); + for (i = 0; i < alphaSize; i++) { + while (True) { + if (curr < 1 || curr > 20) RETURN(BZ_DATA_ERROR); + GET_BIT(BZ_X_CODING_2, uc); + if (uc == 0) break; + GET_BIT(BZ_X_CODING_3, uc); + if (uc == 0) curr++; else curr--; + } + s->len[t][i] = curr; + } + } + + /*--- Create the Huffman decoding tables ---*/ + for (t = 0; t < nGroups; t++) { + minLen = 32; + maxLen = 0; + for (i = 0; i < alphaSize; i++) { + if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; + if (s->len[t][i] < minLen) minLen = s->len[t][i]; + } + BZ2_hbCreateDecodeTables ( + &(s->limit[t][0]), + &(s->base[t][0]), + &(s->perm[t][0]), + &(s->len[t][0]), + minLen, maxLen, alphaSize + ); + s->minLens[t] = minLen; + } + + /*--- Now the MTF values ---*/ + + EOB = s->nInUse+1; + nblockMAX = 100000 * s->blockSize100k; + groupNo = -1; + groupPos = 0; + + for (i = 0; i <= 255; i++) s->unzftab[i] = 0; + + /*-- MTF init --*/ + { + Int32 ii, jj, kk; + kk = MTFA_SIZE-1; + for (ii = 256 / MTFL_SIZE - 1; ii >= 0; ii--) { + for (jj = MTFL_SIZE-1; jj >= 0; jj--) { + s->mtfa[kk] = (UChar)(ii * MTFL_SIZE + jj); + kk--; + } + s->mtfbase[ii] = kk + 1; + } + } + /*-- end MTF init --*/ + + nblock = 0; + GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym); + + while (True) { + + if (nextSym == EOB) break; + + if (nextSym == BZ_RUNA || nextSym == BZ_RUNB) { + + es = -1; + N = 1; + do { + if (nextSym == BZ_RUNA) es = es + (0+1) * N; else + if (nextSym == BZ_RUNB) es = es + (1+1) * N; + N = N * 2; + GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym); + } + while (nextSym == BZ_RUNA || nextSym == BZ_RUNB); + + es++; + uc = s->seqToUnseq[ s->mtfa[s->mtfbase[0]] ]; + s->unzftab[uc] += es; + + if (s->smallDecompress) + while (es > 0) { + if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); + s->ll16[nblock] = (UInt16)uc; + nblock++; + es--; + } + else + while (es > 0) { + if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); + s->tt[nblock] = (UInt32)uc; + nblock++; + es--; + }; + + continue; + + } else { + + if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); + + /*-- uc = MTF ( nextSym-1 ) --*/ + { + Int32 ii, jj, kk, pp, lno, off; + UInt32 nn; + nn = (UInt32)(nextSym - 1); + + if (nn < MTFL_SIZE) { + /* avoid general-case expense */ + pp = s->mtfbase[0]; + uc = s->mtfa[pp+nn]; + while (nn > 3) { + Int32 z = pp+nn; + s->mtfa[(z) ] = s->mtfa[(z)-1]; + s->mtfa[(z)-1] = s->mtfa[(z)-2]; + s->mtfa[(z)-2] = s->mtfa[(z)-3]; + s->mtfa[(z)-3] = s->mtfa[(z)-4]; + nn -= 4; + } + while (nn > 0) { + s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--; + }; + s->mtfa[pp] = uc; + } else { + /* general case */ + lno = nn / MTFL_SIZE; + off = nn % MTFL_SIZE; + pp = s->mtfbase[lno] + off; + uc = s->mtfa[pp]; + while (pp > s->mtfbase[lno]) { + s->mtfa[pp] = s->mtfa[pp-1]; pp--; + }; + s->mtfbase[lno]++; + while (lno > 0) { + s->mtfbase[lno]--; + s->mtfa[s->mtfbase[lno]] + = s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1]; + lno--; + } + s->mtfbase[0]--; + s->mtfa[s->mtfbase[0]] = uc; + if (s->mtfbase[0] == 0) { + kk = MTFA_SIZE-1; + for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) { + for (jj = MTFL_SIZE-1; jj >= 0; jj--) { + s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj]; + kk--; + } + s->mtfbase[ii] = kk + 1; + } + } + } + } + /*-- end uc = MTF ( nextSym-1 ) --*/ + + s->unzftab[s->seqToUnseq[uc]]++; + if (s->smallDecompress) + s->ll16[nblock] = (UInt16)(s->seqToUnseq[uc]); else + s->tt[nblock] = (UInt32)(s->seqToUnseq[uc]); + nblock++; + + GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym); + continue; + } + } + + /* Now we know what nblock is, we can do a better sanity + check on s->origPtr. + */ + if (s->origPtr < 0 || s->origPtr >= nblock) + RETURN(BZ_DATA_ERROR); + + s->state_out_len = 0; + s->state_out_ch = 0; + BZ_INITIALISE_CRC ( s->calculatedBlockCRC ); + s->state = BZ_X_OUTPUT; + if (s->verbosity >= 2) VPrintf0 ( "rt+rld" ); + + /*-- Set up cftab to facilitate generation of T^(-1) --*/ + s->cftab[0] = 0; + for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1]; + for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1]; + + if (s->smallDecompress) { + + /*-- Make a copy of cftab, used in generation of T --*/ + for (i = 0; i <= 256; i++) s->cftabCopy[i] = s->cftab[i]; + + /*-- compute the T vector --*/ + for (i = 0; i < nblock; i++) { + uc = (UChar)(s->ll16[i]); + SET_LL(i, s->cftabCopy[uc]); + s->cftabCopy[uc]++; + } + + /*-- Compute T^(-1) by pointer reversal on T --*/ + i = s->origPtr; + j = GET_LL(i); + do { + Int32 tmp = GET_LL(j); + SET_LL(j, i); + i = j; + j = tmp; + } + while (i != s->origPtr); + + s->tPos = s->origPtr; + s->nblock_used = 0; + if (s->blockRandomised) { + BZ_RAND_INIT_MASK; + BZ_GET_SMALL(s->k0); s->nblock_used++; + BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; + } else { + BZ_GET_SMALL(s->k0); s->nblock_used++; + } + + } else { + + /*-- compute the T^(-1) vector --*/ + for (i = 0; i < nblock; i++) { + uc = (UChar)(s->tt[i] & 0xff); + s->tt[s->cftab[uc]] |= (i << 8); + s->cftab[uc]++; + } + + s->tPos = s->tt[s->origPtr] >> 8; + s->nblock_used = 0; + if (s->blockRandomised) { + BZ_RAND_INIT_MASK; + BZ_GET_FAST(s->k0); s->nblock_used++; + BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; + } else { + BZ_GET_FAST(s->k0); s->nblock_used++; + } + + } + + RETURN(BZ_OK); + + + + endhdr_2: + + GET_UCHAR(BZ_X_ENDHDR_2, uc); + if (uc != 0x72) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_ENDHDR_3, uc); + if (uc != 0x45) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_ENDHDR_4, uc); + if (uc != 0x38) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_ENDHDR_5, uc); + if (uc != 0x50) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_ENDHDR_6, uc); + if (uc != 0x90) RETURN(BZ_DATA_ERROR); + + s->storedCombinedCRC = 0; + GET_UCHAR(BZ_X_CCRC_1, uc); + s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_CCRC_2, uc); + s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_CCRC_3, uc); + s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_CCRC_4, uc); + s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); + + s->state = BZ_X_IDLE; + RETURN(BZ_STREAM_END); + + default: AssertH ( False, 4001 ); + } + + AssertH ( False, 4002 ); + + save_state_and_return: + + s->save_i = i; + s->save_j = j; + s->save_t = t; + s->save_alphaSize = alphaSize; + s->save_nGroups = nGroups; + s->save_nSelectors = nSelectors; + s->save_EOB = EOB; + s->save_groupNo = groupNo; + s->save_groupPos = groupPos; + s->save_nextSym = nextSym; + s->save_nblockMAX = nblockMAX; + s->save_nblock = nblock; + s->save_es = es; + s->save_N = N; + s->save_curr = curr; + s->save_zt = zt; + s->save_zn = zn; + s->save_zvec = zvec; + s->save_zj = zj; + s->save_gSel = gSel; + s->save_gMinlen = gMinlen; + s->save_gLimit = gLimit; + s->save_gBase = gBase; + s->save_gPerm = gPerm; + + return retVal; + } + + + /*-------------------------------------------------------------*/ + /*--- end decompress.c ---*/ + /*-------------------------------------------------------------*/ Index: llvm/lib/Support/bzip2/huffman.c diff -c /dev/null llvm/lib/Support/bzip2/huffman.c:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/huffman.c Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,228 ---- + + /*-------------------------------------------------------------*/ + /*--- Huffman coding low-level stuff ---*/ + /*--- huffman.c ---*/ + /*-------------------------------------------------------------*/ + + /*-- + This file is a part of bzip2 and/or libbzip2, a program and + library for lossless, block-sorting data compression. + + Copyright (C) 1996-2002 Julian R Seward. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Julian Seward, Cambridge, UK. + jseward at acm.org + bzip2/libbzip2 version 1.0 of 21 March 2000 + + This program is based on (at least) the work of: + Mike Burrows + David Wheeler + Peter Fenwick + Alistair Moffat + Radford Neal + Ian H. Witten + Robert Sedgewick + Jon L. Bentley + + For more information on these sources, see the manual. + --*/ + + + #include "bzlib_private.h" + + /*---------------------------------------------------*/ + #define WEIGHTOF(zz0) ((zz0) & 0xffffff00) + #define DEPTHOF(zz1) ((zz1) & 0x000000ff) + #define MYMAX(zz2,zz3) ((zz2) > (zz3) ? (zz2) : (zz3)) + + #define ADDWEIGHTS(zw1,zw2) \ + (WEIGHTOF(zw1)+WEIGHTOF(zw2)) | \ + (1 + MYMAX(DEPTHOF(zw1),DEPTHOF(zw2))) + + #define UPHEAP(z) \ + { \ + Int32 zz, tmp; \ + zz = z; tmp = heap[zz]; \ + while (weight[tmp] < weight[heap[zz >> 1]]) { \ + heap[zz] = heap[zz >> 1]; \ + zz >>= 1; \ + } \ + heap[zz] = tmp; \ + } + + #define DOWNHEAP(z) \ + { \ + Int32 zz, yy, tmp; \ + zz = z; tmp = heap[zz]; \ + while (True) { \ + yy = zz << 1; \ + if (yy > nHeap) break; \ + if (yy < nHeap && \ + weight[heap[yy+1]] < weight[heap[yy]]) \ + yy++; \ + if (weight[tmp] < weight[heap[yy]]) break; \ + heap[zz] = heap[yy]; \ + zz = yy; \ + } \ + heap[zz] = tmp; \ + } + + + /*---------------------------------------------------*/ + void BZ2_hbMakeCodeLengths ( UChar *len, + Int32 *freq, + Int32 alphaSize, + Int32 maxLen ) + { + /*-- + Nodes and heap entries run from 1. Entry 0 + for both the heap and nodes is a sentinel. + --*/ + Int32 nNodes, nHeap, n1, n2, i, j, k; + Bool tooLong; + + Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ]; + Int32 weight [ BZ_MAX_ALPHA_SIZE * 2 ]; + Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ]; + + for (i = 0; i < alphaSize; i++) + weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8; + + while (True) { + + nNodes = alphaSize; + nHeap = 0; + + heap[0] = 0; + weight[0] = 0; + parent[0] = -2; + + for (i = 1; i <= alphaSize; i++) { + parent[i] = -1; + nHeap++; + heap[nHeap] = i; + UPHEAP(nHeap); + } + + AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 ); + + while (nHeap > 1) { + n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1); + n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1); + nNodes++; + parent[n1] = parent[n2] = nNodes; + weight[nNodes] = ADDWEIGHTS(weight[n1], weight[n2]); + parent[nNodes] = -1; + nHeap++; + heap[nHeap] = nNodes; + UPHEAP(nHeap); + } + + AssertH( nNodes < (BZ_MAX_ALPHA_SIZE * 2), 2002 ); + + tooLong = False; + for (i = 1; i <= alphaSize; i++) { + j = 0; + k = i; + while (parent[k] >= 0) { k = parent[k]; j++; } + len[i-1] = j; + if (j > maxLen) tooLong = True; + } + + if (! tooLong) break; + + for (i = 1; i < alphaSize; i++) { + j = weight[i] >> 8; + j = 1 + (j / 2); + weight[i] = j << 8; + } + } + } + + + /*---------------------------------------------------*/ + void BZ2_hbAssignCodes ( Int32 *code, + UChar *length, + Int32 minLen, + Int32 maxLen, + Int32 alphaSize ) + { + Int32 n, vec, i; + + vec = 0; + for (n = minLen; n <= maxLen; n++) { + for (i = 0; i < alphaSize; i++) + if (length[i] == n) { code[i] = vec; vec++; }; + vec <<= 1; + } + } + + + /*---------------------------------------------------*/ + void BZ2_hbCreateDecodeTables ( Int32 *limit, + Int32 *base, + Int32 *perm, + UChar *length, + Int32 minLen, + Int32 maxLen, + Int32 alphaSize ) + { + Int32 pp, i, j, vec; + + pp = 0; + for (i = minLen; i <= maxLen; i++) + for (j = 0; j < alphaSize; j++) + if (length[j] == i) { perm[pp] = j; pp++; }; + + for (i = 0; i < BZ_MAX_CODE_LEN; i++) base[i] = 0; + for (i = 0; i < alphaSize; i++) base[length[i]+1]++; + + for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1]; + + for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0; + vec = 0; + + for (i = minLen; i <= maxLen; i++) { + vec += (base[i+1] - base[i]); + limit[i] = vec-1; + vec <<= 1; + } + for (i = minLen + 1; i <= maxLen; i++) + base[i] = ((limit[i-1] + 1) << 1) - base[i]; + } + + + /*-------------------------------------------------------------*/ + /*--- end huffman.c ---*/ + /*-------------------------------------------------------------*/ Index: llvm/lib/Support/bzip2/randtable.c diff -c /dev/null llvm/lib/Support/bzip2/randtable.c:1.1 *** /dev/null Thu Nov 25 10:11:47 2004 --- llvm/lib/Support/bzip2/randtable.c Thu Nov 25 10:11:36 2004 *************** *** 0 **** --- 1,124 ---- + + /*-------------------------------------------------------------*/ + /*--- Table for randomising repetitive blocks ---*/ + /*--- randtable.c ---*/ + /*-------------------------------------------------------------*/ + + /*-- + This file is a part of bzip2 and/or libbzip2, a program and + library for lossless, block-sorting data compression. + + Copyright (C) 1996-2002 Julian R Seward. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Julian Seward, Cambridge, UK. + jseward at acm.org + bzip2/libbzip2 version 1.0 of 21 March 2000 + + This program is based on (at least) the work of: + Mike Burrows + David Wheeler + Peter Fenwick + Alistair Moffat + Radford Neal + Ian H. Witten + Robert Sedgewick + Jon L. Bentley + + For more information on these sources, see the manual. + --*/ + + + #include "bzlib_private.h" + + + /*---------------------------------------------*/ + Int32 BZ2_rNums[512] = { + 619, 720, 127, 481, 931, 816, 813, 233, 566, 247, + 985, 724, 205, 454, 863, 491, 741, 242, 949, 214, + 733, 859, 335, 708, 621, 574, 73, 654, 730, 472, + 419, 436, 278, 496, 867, 210, 399, 680, 480, 51, + 878, 465, 811, 169, 869, 675, 611, 697, 867, 561, + 862, 687, 507, 283, 482, 129, 807, 591, 733, 623, + 150, 238, 59, 379, 684, 877, 625, 169, 643, 105, + 170, 607, 520, 932, 727, 476, 693, 425, 174, 647, + 73, 122, 335, 530, 442, 853, 695, 249, 445, 515, + 909, 545, 703, 919, 874, 474, 882, 500, 594, 612, + 641, 801, 220, 162, 819, 984, 589, 513, 495, 799, + 161, 604, 958, 533, 221, 400, 386, 867, 600, 782, + 382, 596, 414, 171, 516, 375, 682, 485, 911, 276, + 98, 553, 163, 354, 666, 933, 424, 341, 533, 870, + 227, 730, 475, 186, 263, 647, 537, 686, 600, 224, + 469, 68, 770, 919, 190, 373, 294, 822, 808, 206, + 184, 943, 795, 384, 383, 461, 404, 758, 839, 887, + 715, 67, 618, 276, 204, 918, 873, 777, 604, 560, + 951, 160, 578, 722, 79, 804, 96, 409, 713, 940, + 652, 934, 970, 447, 318, 353, 859, 672, 112, 785, + 645, 863, 803, 350, 139, 93, 354, 99, 820, 908, + 609, 772, 154, 274, 580, 184, 79, 626, 630, 742, + 653, 282, 762, 623, 680, 81, 927, 626, 789, 125, + 411, 521, 938, 300, 821, 78, 343, 175, 128, 250, + 170, 774, 972, 275, 999, 639, 495, 78, 352, 126, + 857, 956, 358, 619, 580, 124, 737, 594, 701, 612, + 669, 112, 134, 694, 363, 992, 809, 743, 168, 974, + 944, 375, 748, 52, 600, 747, 642, 182, 862, 81, + 344, 805, 988, 739, 511, 655, 814, 334, 249, 515, + 897, 955, 664, 981, 649, 113, 974, 459, 893, 228, + 433, 837, 553, 268, 926, 240, 102, 654, 459, 51, + 686, 754, 806, 760, 493, 403, 415, 394, 687, 700, + 946, 670, 656, 610, 738, 392, 760, 799, 887, 653, + 978, 321, 576, 617, 626, 502, 894, 679, 243, 440, + 680, 879, 194, 572, 640, 724, 926, 56, 204, 700, + 707, 151, 457, 449, 797, 195, 791, 558, 945, 679, + 297, 59, 87, 824, 713, 663, 412, 693, 342, 606, + 134, 108, 571, 364, 631, 212, 174, 643, 304, 329, + 343, 97, 430, 751, 497, 314, 983, 374, 822, 928, + 140, 206, 73, 263, 980, 736, 876, 478, 430, 305, + 170, 514, 364, 692, 829, 82, 855, 953, 676, 246, + 369, 970, 294, 750, 807, 827, 150, 790, 288, 923, + 804, 378, 215, 828, 592, 281, 565, 555, 710, 82, + 896, 831, 547, 261, 524, 462, 293, 465, 502, 56, + 661, 821, 976, 991, 658, 869, 905, 758, 745, 193, + 768, 550, 608, 933, 378, 286, 215, 979, 792, 961, + 61, 688, 793, 644, 986, 403, 106, 366, 905, 644, + 372, 567, 466, 434, 645, 210, 389, 550, 919, 135, + 780, 773, 635, 389, 707, 100, 626, 958, 165, 504, + 920, 176, 193, 713, 857, 265, 203, 50, 668, 108, + 645, 990, 626, 197, 510, 357, 358, 850, 858, 364, + 936, 638 + }; + + + /*-------------------------------------------------------------*/ + /*--- end randtable.c ---*/ + /*-------------------------------------------------------------*/ From reid at x10sys.com Thu Nov 25 10:12:36 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 10:12:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/bzip2/Makefile Message-ID: <200411251612.KAA24705@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support/bzip2: Makefile updated: 1.1 -> 1.2 --- Log message: Revise to LLVM makefile standards. --- Diffs of the changes: (+15 -191) Index: llvm/lib/Support/bzip2/Makefile diff -u llvm/lib/Support/bzip2/Makefile:1.1 llvm/lib/Support/bzip2/Makefile:1.2 --- llvm/lib/Support/bzip2/Makefile:1.1 Thu Nov 25 10:11:36 2004 +++ llvm/lib/Support/bzip2/Makefile Thu Nov 25 10:12:25 2004 @@ -1,192 +1,16 @@ +##===- lib/Support/bzip2/Makefile --------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file was developed by the LLVM research group and is distributed under +# the University of Illinois Open Source License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +LEVEL = ../../.. +LIBRARYNAME = LLVMbzip2 +SOURCES= blocksort.c bzlib.c +SOURCES=blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c \ + bzlib.c +CFLAGS=-fno-strength-reduce -SHELL=/bin/sh - -# To assist in cross-compiling -CC=gcc -AR=ar -RANLIB=ranlib -LDFLAGS= - -# Suitably paranoid flags to avoid bugs in gcc-2.7 -BIGFILES=-D_FILE_OFFSET_BITS=64 -CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES) - -# Where you want it installed when you do 'make install' -PREFIX=/usr - - -OBJS= blocksort.o \ - huffman.o \ - crctable.o \ - randtable.o \ - compress.o \ - decompress.o \ - bzlib.o - -all: libbz2.a bzip2 bzip2recover test - -bzip2: libbz2.a bzip2.o - $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2 - -bzip2recover: bzip2recover.o - $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o - -libbz2.a: $(OBJS) - rm -f libbz2.a - $(AR) cq libbz2.a $(OBJS) - @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \ - -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \ - echo $(RANLIB) libbz2.a ; \ - $(RANLIB) libbz2.a ; \ - fi - -check: test -test: bzip2 - @cat words1 - ./bzip2 -1 < sample1.ref > sample1.rb2 - ./bzip2 -2 < sample2.ref > sample2.rb2 - ./bzip2 -3 < sample3.ref > sample3.rb2 - ./bzip2 -d < sample1.bz2 > sample1.tst - ./bzip2 -d < sample2.bz2 > sample2.tst - ./bzip2 -ds < sample3.bz2 > sample3.tst - cmp sample1.bz2 sample1.rb2 - cmp sample2.bz2 sample2.rb2 - cmp sample3.bz2 sample3.rb2 - cmp sample1.tst sample1.ref - cmp sample2.tst sample2.ref - cmp sample3.tst sample3.ref - @cat words3 - -install: bzip2 bzip2recover - if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi - if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi - if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi - if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi - if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi - cp -f bzip2 $(PREFIX)/bin/bzip2 - cp -f bzip2 $(PREFIX)/bin/bunzip2 - cp -f bzip2 $(PREFIX)/bin/bzcat - cp -f bzip2recover $(PREFIX)/bin/bzip2recover - chmod a+x $(PREFIX)/bin/bzip2 - chmod a+x $(PREFIX)/bin/bunzip2 - chmod a+x $(PREFIX)/bin/bzcat - chmod a+x $(PREFIX)/bin/bzip2recover - cp -f bzip2.1 $(PREFIX)/man/man1 - chmod a+r $(PREFIX)/man/man1/bzip2.1 - cp -f bzlib.h $(PREFIX)/include - chmod a+r $(PREFIX)/include/bzlib.h - cp -f libbz2.a $(PREFIX)/lib - chmod a+r $(PREFIX)/lib/libbz2.a - cp -f bzgrep $(PREFIX)/bin/bzgrep - ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep - ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep - chmod a+x $(PREFIX)/bin/bzgrep - cp -f bzmore $(PREFIX)/bin/bzmore - ln $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless - chmod a+x $(PREFIX)/bin/bzmore - cp -f bzdiff $(PREFIX)/bin/bzdiff - ln $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp - chmod a+x $(PREFIX)/bin/bzdiff - cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1 - chmod a+r $(PREFIX)/man/man1/bzgrep.1 - chmod a+r $(PREFIX)/man/man1/bzmore.1 - chmod a+r $(PREFIX)/man/man1/bzdiff.1 - echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1 - echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1 - echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1 - echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1 - -distclean: clean -clean: - rm -f *.o libbz2.a bzip2 bzip2recover \ - sample1.rb2 sample2.rb2 sample3.rb2 \ - sample1.tst sample2.tst sample3.tst - -blocksort.o: blocksort.c - @cat words0 - $(CC) $(CFLAGS) -c blocksort.c -huffman.o: huffman.c - $(CC) $(CFLAGS) -c huffman.c -crctable.o: crctable.c - $(CC) $(CFLAGS) -c crctable.c -randtable.o: randtable.c - $(CC) $(CFLAGS) -c randtable.c -compress.o: compress.c - $(CC) $(CFLAGS) -c compress.c -decompress.o: decompress.c - $(CC) $(CFLAGS) -c decompress.c -bzlib.o: bzlib.c - $(CC) $(CFLAGS) -c bzlib.c -bzip2.o: bzip2.c - $(CC) $(CFLAGS) -c bzip2.c -bzip2recover.o: bzip2recover.c - $(CC) $(CFLAGS) -c bzip2recover.c - -DISTNAME=bzip2-1.0.2 -tarfile: - rm -f $(DISTNAME) - ln -sf . $(DISTNAME) - tar cvf $(DISTNAME).tar \ - $(DISTNAME)/blocksort.c \ - $(DISTNAME)/huffman.c \ - $(DISTNAME)/crctable.c \ - $(DISTNAME)/randtable.c \ - $(DISTNAME)/compress.c \ - $(DISTNAME)/decompress.c \ - $(DISTNAME)/bzlib.c \ - $(DISTNAME)/bzip2.c \ - $(DISTNAME)/bzip2recover.c \ - $(DISTNAME)/bzlib.h \ - $(DISTNAME)/bzlib_private.h \ - $(DISTNAME)/Makefile \ - $(DISTNAME)/manual.texi \ - $(DISTNAME)/manual.ps \ - $(DISTNAME)/manual.pdf \ - $(DISTNAME)/LICENSE \ - $(DISTNAME)/bzip2.1 \ - $(DISTNAME)/bzip2.1.preformatted \ - $(DISTNAME)/bzip2.txt \ - $(DISTNAME)/words0 \ - $(DISTNAME)/words1 \ - $(DISTNAME)/words2 \ - $(DISTNAME)/words3 \ - $(DISTNAME)/sample1.ref \ - $(DISTNAME)/sample2.ref \ - $(DISTNAME)/sample3.ref \ - $(DISTNAME)/sample1.bz2 \ - $(DISTNAME)/sample2.bz2 \ - $(DISTNAME)/sample3.bz2 \ - $(DISTNAME)/dlltest.c \ - $(DISTNAME)/*.html \ - $(DISTNAME)/README \ - $(DISTNAME)/README.COMPILATION.PROBLEMS \ - $(DISTNAME)/CHANGES \ - $(DISTNAME)/libbz2.def \ - $(DISTNAME)/libbz2.dsp \ - $(DISTNAME)/dlltest.dsp \ - $(DISTNAME)/makefile.msc \ - $(DISTNAME)/Y2K_INFO \ - $(DISTNAME)/unzcrash.c \ - $(DISTNAME)/spewG.c \ - $(DISTNAME)/mk251.c \ - $(DISTNAME)/bzdiff \ - $(DISTNAME)/bzdiff.1 \ - $(DISTNAME)/bzmore \ - $(DISTNAME)/bzmore.1 \ - $(DISTNAME)/bzgrep \ - $(DISTNAME)/bzgrep.1 \ - $(DISTNAME)/Makefile-libbz2_so - gzip -v $(DISTNAME).tar - -# For rebuilding the manual from sources on my RedHat 7.2 box -manual: manual.ps manual.pdf manual.html - -manual.ps: manual.texi - tex manual.texi - dvips -o manual.ps manual.dvi - -manual.pdf: manual.ps - ps2pdf manual.ps - -manual.html: manual.texi - texi2html -split_chapter manual.texi +include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 11:13:28 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 11:13:28 -0600 Subject: [llvm-commits] CVS: llvm/docs/CFEBuildInstrs.html Message-ID: <200411251713.LAA25394@zion.cs.uiuc.edu> Changes in directory llvm/docs: CFEBuildInstrs.html updated: 1.26 -> 1.27 --- Log message: Add some instructions about ranlib'ing the CFE runtime libraries so that they link faster. This should eventually be codified into the CFE's makefile. --- Diffs of the changes: (+15 -1) Index: llvm/docs/CFEBuildInstrs.html diff -u llvm/docs/CFEBuildInstrs.html:1.26 llvm/docs/CFEBuildInstrs.html:1.27 --- llvm/docs/CFEBuildInstrs.html:1.26 Thu Nov 11 01:30:27 2004 +++ llvm/docs/CFEBuildInstrs.html Thu Nov 25 11:13:17 2004 @@ -232,6 +232,20 @@ % setenv LLVM_LIB_SEARCH_PATH $CFEINSTALL/bytecode-libs
    • +
    • Optionally, build a symbol table for the newly installed runtime +libraries. Although this step is optional, you are encouraged to do this as the +symbol tables will make a significant difference in your link times. Use +the llvm-ranlib tool to do this, as follows:

      +
      + % cd $CFEINSTALL/lib
      + % llvm-ranlib libiberty.a
      + % llvm-ranlib libstdc++.a
      + % llvm-ranlib libsubc++.a
      + % cd $CFEINSTALL/lib/target-triplet/3.4-llvm
      + % llvm-ranlib libgcc.a
      + % llvm-ranlib libgcov.a
      +
      +
    • Test the newly-installed C frontend by one or more of the following means:

        @@ -314,7 +328,7 @@ Brian Gaeke
        LLVM Compiler Infrastructure
        - Last modified: $Date: 2004/11/11 07:30:27 $ + Last modified: $Date: 2004/11/25 17:13:17 $ From reid at x10sys.com Thu Nov 25 13:37:53 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 13:37:53 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Compressor.h Message-ID: <200411251937.NAA26824@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Compressor.h updated: 1.3 -> 1.4 --- Log message: Restrict the interface to not allow algorithm selection --- Diffs of the changes: (+18 -35) Index: llvm/include/llvm/Support/Compressor.h diff -u llvm/include/llvm/Support/Compressor.h:1.3 llvm/include/llvm/Support/Compressor.h:1.4 --- llvm/include/llvm/Support/Compressor.h:1.3 Sun Nov 14 15:50:00 2004 +++ llvm/include/llvm/Support/Compressor.h Thu Nov 25 13:37:42 2004 @@ -19,32 +19,23 @@ namespace llvm { - /// This class provides an abstraction for compressing a block of memory using - /// a standard compression utility such as bzip2 or libz. This interface - /// allows us to abstract the notion of compression and deal with alternate - /// compression scheme availability depending on the configured platform. This - /// facility will always favor a bzip2 implementation if its available. - /// Otherwise, libz will be used if it is available. If neither zlib nor bzip2 - /// are available, a very simple algorithm provided by the Compressor class - /// will be used. The type of compression used can be determined by inspecting - /// the first byte of the compressed output. ASCII values '0', '1', and '2', - /// denote the compression type as given in the Algorithm enumeration below. - /// The Compressor is intended for use with memory mapped files where the - /// entire data block to be compressed or decompressed is available in - /// memory. However, output can be gathered in repeated calls to a callback. + /// This class provides an abstraction for compression and decompression of + /// a block of memory. The algorithm used here is currently bzip2 but that + /// may change without notice. Should newer algorithms prove to compress + /// bytecode better than bzip2, that newer algorithm will be added, but won't + /// replace bzip2. This interface allows us to abstract the notion of + /// compression and deal with alternate compression schemes over time. + /// The type of compression used can be determined by inspecting the + /// first byte of the compressed output. Currently value '0' means no + /// compression was used (for very small files) and value '2' means bzip2 + /// compression was used. The Compressor is intended for use with memory + /// mapped files where the entire data block to be compressed or decompressed + /// is available in memory. However, output can be gathered in repeated calls + /// to a callback. Utilities for sending compressed or decompressed output + /// to a stream or directly to a memory block are also provided. /// @since 1.4 /// @brief An abstraction for memory to memory data (de)compression class Compressor { - /// @name Types - /// @{ - public: - enum Algorithm { - COMP_TYPE_SIMPLE = '0', ///< Use simple but ubiquitous algorithm - COMP_TYPE_ZLIB = '1', ///< Use zlib algorithm, if available - COMP_TYPE_BZIP2 = '2', ///< Use bzip2 algorithm (preferred) - }; - - /// @} /// @name High Level Interface /// @{ public: @@ -58,9 +49,7 @@ static uint64_t compressToNewBuffer( const char* in, ///< The buffer to be compressed unsigned size, ///< The size of the buffer to be compressed - char*&out, ///< The returned output buffer - Algorithm hint ///< Hint for type of compression to perform - = COMP_TYPE_BZIP2 + char*&out ///< The returned output buffer ); /// This method compresses a block of memory pointed to by \p in with @@ -73,9 +62,7 @@ static uint64_t compressToStream( const char*in, ///< The buffer to be compressed unsigned size, ///< The size of the buffer to be compressed - std::ostream& out, ///< The output stream to write data on - Algorithm hint ///< Hint for type of compression to perform - = COMP_TYPE_BZIP2 + std::ostream& out ///< The output stream to write data on ); /// This method decompresses a block of memory pointed to by \p in with @@ -140,10 +127,7 @@ const char* in, ///< The buffer to be compressed unsigned size, ///< The size of the buffer to be compressed OutputDataCallback* cb, ///< Call back for memory allocation - Algorithm hint ///< Hint for type of compression to perform - = COMP_TYPE_BZIP2, - void* context ///< Context for callback - = 0 + void* context = 0 ///< Context for callback ); /// This function does the decompression work. The block of memory @@ -163,8 +147,7 @@ const char *in, ///< The buffer to be decompressed unsigned size, ///< Size of the buffer to be decompressed OutputDataCallback* cb, ///< Call back for memory allocation - void* context ///< Context for callback - = 0 + void* context = 0 ///< Context for callback ); /// @} From reid at x10sys.com Thu Nov 25 13:38:04 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 13:38:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Message-ID: <200411251938.NAA26835@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: ArchiveWriter.cpp updated: 1.9 -> 1.10 --- Log message: Adjust to Compressor interface change --- Diffs of the changes: (+1 -2) Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.9 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.10 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.9 Sat Nov 20 01:29:40 2004 +++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Thu Nov 25 13:37:53 2004 @@ -262,8 +262,7 @@ data +=4; fSize -= 4; } - fSize = Compressor::compressToNewBuffer( - data,fSize,output,Compressor::COMP_TYPE_ZLIB); + fSize = Compressor::compressToNewBuffer(data,fSize,output); data = output; if (member.isBytecode()) hdrSize = -fSize-4; From reid at x10sys.com Thu Nov 25 13:38:16 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 13:38:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200411251938.NAA26846@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.90 -> 1.91 --- Log message: Adjust to Compressor interface change --- Diffs of the changes: (+1 -2) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.90 llvm/lib/Bytecode/Writer/Writer.cpp:1.91 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.90 Mon Nov 15 16:39:49 2004 +++ llvm/lib/Bytecode/Writer/Writer.cpp Thu Nov 25 13:38:05 2004 @@ -1128,8 +1128,7 @@ uint64_t zipSize = Compressor::compressToStream( (char*)(FirstByte+4), // Skip the magic number Buffer.size()-4, // Skip the magic number - Out, // Where to write compressed data - Compressor::COMP_TYPE_BZIP2 // Try bzip2 compression first + Out // Where to write compressed data ); } else { From reid at x10sys.com Thu Nov 25 13:38:27 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 13:38:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/Compressor.cpp Message-ID: <200411251938.NAA26857@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Compressor.cpp updated: 1.7 -> 1.8 --- Log message: Remove zlib support in favor of our own bzip2 library --- Diffs of the changes: (+76 -176) Index: llvm/lib/Support/Compressor.cpp diff -u llvm/lib/Support/Compressor.cpp:1.7 llvm/lib/Support/Compressor.cpp:1.8 --- llvm/lib/Support/Compressor.cpp:1.7 Fri Nov 19 09:56:28 2004 +++ llvm/lib/Support/Compressor.cpp Thu Nov 25 13:38:16 2004 @@ -17,23 +17,15 @@ #include "llvm/ADT/StringExtras.h" #include #include - -#ifdef HAVE_BZIP2 -#ifdef HAVE_BZLIB_H -#include -#define BZIP2_GOOD -#endif -#endif - -#ifdef HAVE_ZLIB -#ifdef HAVE_ZLIB_H -#include -#define ZLIB_GOOD -#endif -#endif +#include "bzip2/bzlib.h" namespace { +enum CompressionTypes { + COMP_TYPE_NONE = '0', + COMP_TYPE_BZIP2 = '2', +}; + inline int getdata(char*& buffer, unsigned& size, llvm::Compressor::OutputDataCallback* cb, void* context) { buffer = 0; @@ -157,10 +149,10 @@ // Figure out what to return to the Compressor. If this is the first call, // then bc->buff will be null. In this case we want to return the entire // buffer because there was no previous allocation. Otherwise, when the - // buffer is reallocated, we save the new base pointer in the BufferContext.buff - // field but return the address of only the extension, mid-way through the - // buffer (since its size was doubled). Furthermore, the sz result must be - // 1/2 the total size of the buffer. + // buffer is reallocated, we save the new base pointer in the + // BufferContext.buff field but return the address of only the extension, + // mid-way through the buffer (since its size was doubled). Furthermore, + // the sz result must be 1/2 the total size of the buffer. if (bc->buff == 0 ) { buff = bc->buff = new_buff; sz = new_size; @@ -247,161 +239,108 @@ // Compress in one of three ways uint64_t Compressor::compress(const char* in, unsigned size, - OutputDataCallback* cb, Algorithm hint, void* context ) { + OutputDataCallback* cb, void* context ) { assert(in && "Can't compress null buffer"); assert(size && "Can't compress empty buffer"); assert(cb && "Can't compress without a callback function"); uint64_t result = 0; - switch (hint) { - case COMP_TYPE_BZIP2: { -#if defined(BZIP2_GOOD) - // Set up the bz_stream - bz_stream bzdata; - bzdata.bzalloc = 0; - bzdata.bzfree = 0; - bzdata.opaque = 0; - bzdata.next_in = (char*)in; - bzdata.avail_in = size; - bzdata.next_out = 0; - bzdata.avail_out = 0; - switch ( BZ2_bzCompressInit(&bzdata, 5, 0, 100) ) { - case BZ_CONFIG_ERROR: throw std::string("bzip2 library mis-compiled"); - case BZ_PARAM_ERROR: throw std::string("Compressor internal error"); - case BZ_MEM_ERROR: throw std::string("Out of memory"); - case BZ_OK: - default: - break; - } - - // Get a block of memory - if (0 != getdata(bzdata.next_out, bzdata.avail_out,cb,context)) { - BZ2_bzCompressEnd(&bzdata); - throw std::string("Can't allocate output buffer"); - } - - // Put compression code in first byte - (*bzdata.next_out++) = COMP_TYPE_BZIP2; - bzdata.avail_out--; - - // Compress it - int bzerr = BZ_FINISH_OK; - while (BZ_FINISH_OK == (bzerr = BZ2_bzCompress(&bzdata, BZ_FINISH))) { - if (0 != getdata(bzdata.next_out, bzdata.avail_out,cb,context)) { - BZ2_bzCompressEnd(&bzdata); - throw std::string("Can't allocate output buffer"); - } - } - switch (bzerr) { - case BZ_SEQUENCE_ERROR: - case BZ_PARAM_ERROR: throw std::string("Param/Sequence error"); - case BZ_FINISH_OK: - case BZ_STREAM_END: break; - default: throw std::string("Oops: ") + utostr(unsigned(bzerr)); - } - - // Finish - result = (static_cast(bzdata.total_out_hi32) << 32) | - bzdata.total_out_lo32 + 1; + // For small files, we just don't bother compressing. bzip2 isn't very good + // with tiny files and can actually make the file larger, so we just avoid + // it altogether. + if (size > 256) { + // Set up the bz_stream + bz_stream bzdata; + bzdata.bzalloc = 0; + bzdata.bzfree = 0; + bzdata.opaque = 0; + bzdata.next_in = (char*)in; + bzdata.avail_in = size; + bzdata.next_out = 0; + bzdata.avail_out = 0; + switch ( BZ2_bzCompressInit(&bzdata, 5, 0, 100) ) { + case BZ_CONFIG_ERROR: throw std::string("bzip2 library mis-compiled"); + case BZ_PARAM_ERROR: throw std::string("Compressor internal error"); + case BZ_MEM_ERROR: throw std::string("Out of memory"); + case BZ_OK: + default: + break; + } + // Get a block of memory + if (0 != getdata(bzdata.next_out, bzdata.avail_out,cb,context)) { BZ2_bzCompressEnd(&bzdata); - break; -#else - // FALL THROUGH -#endif + throw std::string("Can't allocate output buffer"); } - case COMP_TYPE_ZLIB: { -#if defined(ZLIB_GOOD) - z_stream zdata; - zdata.zalloc = Z_NULL; - zdata.zfree = Z_NULL; - zdata.opaque = Z_NULL; - zdata.next_in = (Bytef*)in; - zdata.avail_in = size; - if (Z_OK != deflateInit(&zdata,6)) - throw std::string(zdata.msg ? zdata.msg : "zlib error"); - - if (0 != getdata((char*&)(zdata.next_out), zdata.avail_out,cb,context)) { - deflateEnd(&zdata); + // Put compression code in first byte + (*bzdata.next_out++) = COMP_TYPE_BZIP2; + bzdata.avail_out--; + + // Compress it + int bzerr = BZ_FINISH_OK; + while (BZ_FINISH_OK == (bzerr = BZ2_bzCompress(&bzdata, BZ_FINISH))) { + if (0 != getdata(bzdata.next_out, bzdata.avail_out,cb,context)) { + BZ2_bzCompressEnd(&bzdata); throw std::string("Can't allocate output buffer"); } + } + switch (bzerr) { + case BZ_SEQUENCE_ERROR: + case BZ_PARAM_ERROR: throw std::string("Param/Sequence error"); + case BZ_FINISH_OK: + case BZ_STREAM_END: break; + default: throw std::string("Oops: ") + utostr(unsigned(bzerr)); + } - (*zdata.next_out++) = COMP_TYPE_ZLIB; - zdata.avail_out--; - - int flush = 0; - while ( Z_OK == deflate(&zdata,0) && zdata.avail_out == 0) { - if (0 != getdata((char*&)zdata.next_out, zdata.avail_out, cb,context)) { - deflateEnd(&zdata); - throw std::string("Can't allocate output buffer"); - } - } - - while ( Z_STREAM_END != deflate(&zdata, Z_FINISH)) { - if (0 != getdata((char*&)zdata.next_out, zdata.avail_out, cb,context)) { - deflateEnd(&zdata); - throw std::string("Can't allocate output buffer"); - } - } + // Finish + result = (static_cast(bzdata.total_out_hi32) << 32) | + bzdata.total_out_lo32 + 1; - result = static_cast(zdata.total_out) + 1; - deflateEnd(&zdata); - break; + BZ2_bzCompressEnd(&bzdata); + } else { + // Do null compression, for small files + NULLCOMP_stream sdata; + sdata.next_in = (char*)in; + sdata.avail_in = size; + NULLCOMP_init(&sdata); -#else - // FALL THROUGH -#endif + if (0 != getdata(sdata.next_out, sdata.avail_out,cb,context)) { + throw std::string("Can't allocate output buffer"); } - case COMP_TYPE_SIMPLE: { - NULLCOMP_stream sdata; - sdata.next_in = (char*)in; - sdata.avail_in = size; - NULLCOMP_init(&sdata); + *(sdata.next_out++) = COMP_TYPE_NONE; + sdata.avail_out--; + while (!NULLCOMP_compress(&sdata)) { if (0 != getdata(sdata.next_out, sdata.avail_out,cb,context)) { throw std::string("Can't allocate output buffer"); } - - *(sdata.next_out++) = COMP_TYPE_SIMPLE; - sdata.avail_out--; - - while (!NULLCOMP_compress(&sdata)) { - if (0 != getdata(sdata.next_out, sdata.avail_out,cb,context)) { - throw std::string("Can't allocate output buffer"); - } - } - - result = sdata.output_count + 1; - NULLCOMP_end(&sdata); - break; } - default: - throw std::string("Invalid compression type hint"); + + result = sdata.output_count + 1; + NULLCOMP_end(&sdata); } return result; } uint64_t -Compressor::compressToNewBuffer(const char* in, unsigned size, char*&out, - Algorithm hint) { +Compressor::compressToNewBuffer(const char* in, unsigned size, char*&out) { BufferContext bc(size); - unsigned result = compress(in,size,BufferContext::callback,hint,(void*)&bc); + unsigned result = compress(in,size,BufferContext::callback,(void*)&bc); out = bc.buff; return result; } uint64_t -Compressor::compressToStream(const char*in, unsigned size, std::ostream& out, - Algorithm hint) { +Compressor::compressToStream(const char*in, unsigned size, std::ostream& out) { // Set up the context and writer WriterContext ctxt(&out,size / 2); // Compress everything after the magic number (which we'll alter) uint64_t zipSize = Compressor::compress(in,size, - WriterContext::callback, hint, (void*)&ctxt); + WriterContext::callback, (void*)&ctxt); if (ctxt.chunk) { ctxt.write(zipSize - ctxt.written); @@ -410,7 +349,7 @@ } // Decompress in one of three ways -uint64_t Compressor::decompress(const char *in, unsigned size, +uint64_t Compressor::decompress(const char *in, unsigned size, OutputDataCallback* cb, void* context) { assert(in && "Can't decompress null buffer"); assert(size > 1 && "Can't decompress empty buffer"); @@ -420,9 +359,6 @@ switch (*in++) { case COMP_TYPE_BZIP2: { -#if !defined(BZIP2_GOOD) - throw std::string("Can't decompress BZIP2 data"); -#else // Set up the bz_stream bz_stream bzdata; bzdata.bzalloc = 0; @@ -471,45 +407,9 @@ bzdata.total_out_lo32; BZ2_bzDecompressEnd(&bzdata); break; -#endif - } - - case COMP_TYPE_ZLIB: { -#if !defined(ZLIB_GOOD) - throw std::string("Can't decompress ZLIB data"); -#else - z_stream zdata; - zdata.zalloc = Z_NULL; - zdata.zfree = Z_NULL; - zdata.opaque = Z_NULL; - zdata.next_in = (Bytef*)(in); - zdata.avail_in = size - 1; - if ( Z_OK != inflateInit(&zdata)) - throw std::string(zdata.msg ? zdata.msg : "zlib error"); - - if (0 != getdata((char*&)zdata.next_out, zdata.avail_out,cb,context)) { - inflateEnd(&zdata); - throw std::string("Can't allocate output buffer"); - } - - int zerr = Z_OK; - while (Z_OK == (zerr = inflate(&zdata,0))) { - if (0 != getdata((char*&)zdata.next_out, zdata.avail_out,cb,context)) { - inflateEnd(&zdata); - throw std::string("Can't allocate output buffer"); - } - } - - if (zerr != Z_STREAM_END) - throw std::string(zdata.msg?zdata.msg:"zlib error"); - - result = static_cast(zdata.total_out); - inflateEnd(&zdata); - break; -#endif } - case COMP_TYPE_SIMPLE: { + case COMP_TYPE_NONE: { NULLCOMP_stream sdata; sdata.next_in = (char*)in; sdata.avail_in = size - 1; From reid at x10sys.com Thu Nov 25 13:38:39 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 13:38:39 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/Makefile Message-ID: <200411251938.NAA26870@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Makefile updated: 1.7 -> 1.8 --- Log message: Add bzip2 subdirectory --- Diffs of the changes: (+1 -0) Index: llvm/lib/Support/Makefile diff -u llvm/lib/Support/Makefile:1.7 llvm/lib/Support/Makefile:1.8 --- llvm/lib/Support/Makefile:1.7 Wed Oct 27 18:18:44 2004 +++ llvm/lib/Support/Makefile Thu Nov 25 13:38:28 2004 @@ -7,6 +7,7 @@ # ##===----------------------------------------------------------------------===## LEVEL = ../.. +PARALLEL_DIRS=bzip2 LIBRARYNAME = LLVMSupport BUILD_ARCHIVE = 1 From reid at x10sys.com Thu Nov 25 13:38:50 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 13:38:50 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/c.in Message-ID: <200411251938.NAA26881@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: c.in updated: 1.1 -> 1.2 --- Log message: Always pass -D_GNU_SOURCE to cc1 --- Diffs of the changes: (+3 -2) Index: llvm/tools/llvmc/c.in diff -u llvm/tools/llvmc/c.in:1.1 llvm/tools/llvmc/c.in:1.2 --- llvm/tools/llvmc/c.in:1.1 Tue Nov 23 17:33:08 2004 +++ llvm/tools/llvmc/c.in Thu Nov 25 13:38:39 2004 @@ -28,7 +28,8 @@ # To compile stacker source, we just run the stacker # compiler with a default stack size of 2048 entries. translator.command=@LLVMCC1@ -quiet %in% -o %out% \ - %opt% %incls% %defs% %WOpts% %fOpts% %MOpts% %args% + %opt% %incls% %defs% %WOpts% %fOpts% %MOpts% %args% \ + -D_GNU_SOURCE # stkrc doesn't preprocess but we set this to true so # that we don't run the cp command by default. @@ -61,4 +62,4 @@ ########################################################## # Assembler definitions ########################################################## - assembler.command=llc %in% -o %out% %target% %time% %stats% + assembler.command=@LLVM_BINDIR@/llc %in% -o %out% %target% %time% %stats% From reid at x10sys.com Thu Nov 25 13:39:02 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 13:39:02 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/cpp.in Message-ID: <200411251939.NAA26898@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: cpp.in updated: 1.1 -> 1.2 --- Log message: Always pass -D_GNU_SOURCE to cc1plus --- Diffs of the changes: (+2 -1) Index: llvm/tools/llvmc/cpp.in diff -u llvm/tools/llvmc/cpp.in:1.1 llvm/tools/llvmc/cpp.in:1.2 --- llvm/tools/llvmc/cpp.in:1.1 Tue Nov 23 17:33:08 2004 +++ llvm/tools/llvmc/cpp.in Thu Nov 25 13:38:51 2004 @@ -28,7 +28,8 @@ # To compile stacker source, we just run the stacker # compiler with a default stack size of 2048 entries. translator.command=@LLVMCC1PLUS@ -quiet %in% -o %out% \ - %opt% %incls% %defs% %WOpts% %fOpts% %MOpts% %args% + %opt% %incls% %defs% %WOpts% %fOpts% %MOpts% %args% \ + -D_GNU_SOURCE # stkrc doesn't preprocess but we set this to true so # that we don't run the cp command by default. From reid at x10sys.com Thu Nov 25 14:22:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:05 -0600 Subject: [llvm-commits] CVS: llvm/docs/MakefileGuide.html Message-ID: <200411252022.OAA27398@zion.cs.uiuc.edu> Changes in directory llvm/docs: MakefileGuide.html updated: 1.13 -> 1.14 --- Log message: Remove HAVE_BZLIB and HAVE_BZIP2. We always have bzip2 now. --- Diffs of the changes: (+1 -7) Index: llvm/docs/MakefileGuide.html diff -u llvm/docs/MakefileGuide.html:1.13 llvm/docs/MakefileGuide.html:1.14 --- llvm/docs/MakefileGuide.html:1.13 Sun Nov 21 09:11:37 2004 +++ llvm/docs/MakefileGuide.html Thu Nov 25 14:21:53 2004 @@ -636,12 +636,6 @@
        Specifies the path to the flex tool.
        GCCLD(defaulted)
        Specifies the path to the gccld tool.
        -
        HAVE_BZIP2(configured)
        -
        This variable is set automatically if the configure script - could find the bzip2 library.
        -
        HAVE_ZLIB(configured)
        -
        This variable is set automatically if the configure script - could find the zlib library.
        INSTALL(configured)
        Specifies the path to the install tool.
        LDFLAGS(configured)
        @@ -853,7 +847,7 @@ Reid Spencer
        The LLVM Compiler Infrastructure
        - Last modified: $Date: 2004/11/21 15:11:37 $ + Last modified: $Date: 2004/11/25 20:21:53 $ From reid at x10sys.com Thu Nov 25 14:22:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:05 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in Message-ID: <200411252022.OAA27397@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.35 -> 1.36 --- Log message: Remove HAVE_BZLIB and HAVE_BZIP2. We always have bzip2 now. --- Diffs of the changes: (+0 -6) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.35 llvm/include/llvm/Config/config.h.in:1.36 --- llvm/include/llvm/Config/config.h.in:1.35 Thu Nov 18 03:49:13 2004 +++ llvm/include/llvm/Config/config.h.in Thu Nov 25 14:21:53 2004 @@ -21,9 +21,6 @@ /* Does not have bi-directional iterator */ #undef HAVE_BI_ITERATOR -/* Define if bzip2 library is available on this platform. */ -#undef HAVE_BZIP2 - /* Define to 1 if you have the header file. */ #undef HAVE_BZLIB_H @@ -209,9 +206,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_WINDOWS_H -/* Define if zlib library is available on this platform. */ -#undef HAVE_ZLIB - /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H From reid at x10sys.com Thu Nov 25 14:22:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:05 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200411252022.OAA27399@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.133 -> 1.134 --- Log message: Remove HAVE_BZLIB and HAVE_BZIP2. We always have bzip2 now. --- Diffs of the changes: (+0 -19) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.133 llvm/autoconf/configure.ac:1.134 --- llvm/autoconf/configure.ac:1.133 Thu Nov 25 01:28:19 2004 +++ llvm/autoconf/configure.ac Thu Nov 25 14:21:53 2004 @@ -326,25 +326,6 @@ dnl libelf is for sparc only; we can ignore it if we don't have it AC_CHECK_LIB(elf, elf_begin) -dnl Check for bzip2 and zlib compression libraries needed for archive -dnl and bytecode compression. -AC_CHECK_LIB(z,gzopen,[zlib_found=1],[zlib_found=0]) -if test $zlib_found -eq 1; then - AC_DEFINE([HAVE_ZLIB],[1], - [Define if zlib library is available on this platform.]) - AC_SUBST([HAVE_ZLIB],[1]) -else - AC_SUBST([HAVE_ZLIB],[0]) -fi -AC_CHECK_LIB(bz2,BZ2_bzCompressInit,[bzip2_found=1],[bzip2_found=0]) -if test $bzip2_found -eq 1 ; then - AC_DEFINE([HAVE_BZIP2],[1], - [Define if bzip2 library is available on this platform.]) - AC_SUBST([HAVE_BZIP2],[1]) -else - AC_SUBST([HAVE_BZIP2],[0]) -fi - dnl lt_dlopen may be required for plugin support. AC_SEARCH_LIBS(lt_dlopen,ltdl,AC_DEFINE([HAVE_LT_DLOPEN],[1], [Define if lt_dlopen() is available on this platform]), From reid at x10sys.com Thu Nov 25 14:22:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:05 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.config.in configure Message-ID: <200411252022.OAA27408@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.config.in updated: 1.38 -> 1.39 configure updated: 1.140 -> 1.141 --- Log message: Remove HAVE_BZLIB and HAVE_BZIP2. We always have bzip2 now. --- Diffs of the changes: (+1 -172) Index: llvm/Makefile.config.in diff -u llvm/Makefile.config.in:1.38 llvm/Makefile.config.in:1.39 --- llvm/Makefile.config.in:1.38 Sun Nov 7 17:29:39 2004 +++ llvm/Makefile.config.in Thu Nov 25 14:21:53 2004 @@ -161,10 +161,6 @@ LLVM_SRC_ROOT := $(BUILD_SRC_ROOT) endif -# Handle configured libraries -HAVE_BZIP2 := @HAVE_BZIP2@ -HAVE_ZLIB := @HAVE_ZLIB@ - # Installation directories, as provided by the configure script. exec_prefix = @exec_prefix@ prefix = @prefix@ Index: llvm/configure diff -u llvm/configure:1.140 llvm/configure:1.141 --- llvm/configure:1.140 Thu Nov 25 01:28:19 2004 +++ llvm/configure Thu Nov 25 14:21:53 2004 @@ -476,7 +476,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT LLVMGCCDIR CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ifGNUmake FIND GREP MKDIR MV RM SED TAR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA DOT ETAGS PYTHON QMTEST RUNTEST ETAGSFLAGS HAVE_ZLIB HAVE_BZIP2 ALLOCA MMAP_FILE LLVMGCC LLVMCC1 LLVMCC1PLUS SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR ! LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT LLVMGCCDIR CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ifGNUmake FIND GREP MKDIR MV RM SED TAR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA DOT ETAGS PYTHON QMTEST RUNTEST ETAGSFLAGS ALLOCA MMAP_FILE LLVMGCC LLVMCC1 LLVMCC1PLUS SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOC! SDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -20667,171 +20667,6 @@ fi -echo "$as_me:$LINENO: checking for gzopen in -lz" >&5 -echo $ECHO_N "checking for gzopen in -lz... $ECHO_C" >&6 -if test "${ac_cv_lib_z_gzopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gzopen (); -int -main () -{ -gzopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_z_gzopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_z_gzopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzopen" >&5 -echo "${ECHO_T}$ac_cv_lib_z_gzopen" >&6 -if test $ac_cv_lib_z_gzopen = yes; then - zlib_found=1 -else - zlib_found=0 -fi - -if test $zlib_found -eq 1; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ZLIB 1 -_ACEOF - - HAVE_ZLIB=1 - -else - HAVE_ZLIB=0 - -fi -echo "$as_me:$LINENO: checking for BZ2_bzCompressInit in -lbz2" >&5 -echo $ECHO_N "checking for BZ2_bzCompressInit in -lbz2... $ECHO_C" >&6 -if test "${ac_cv_lib_bz2_BZ2_bzCompressInit+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbz2 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char BZ2_bzCompressInit (); -int -main () -{ -BZ2_bzCompressInit (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_bz2_BZ2_bzCompressInit=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_bz2_BZ2_bzCompressInit=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_BZ2_bzCompressInit" >&5 -echo "${ECHO_T}$ac_cv_lib_bz2_BZ2_bzCompressInit" >&6 -if test $ac_cv_lib_bz2_BZ2_bzCompressInit = yes; then - bzip2_found=1 -else - bzip2_found=0 -fi - -if test $bzip2_found -eq 1 ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_BZIP2 1 -_ACEOF - - HAVE_BZIP2=1 - -else - HAVE_BZIP2=0 - -fi - echo "$as_me:$LINENO: checking for library containing lt_dlopen" >&5 echo $ECHO_N "checking for library containing lt_dlopen... $ECHO_C" >&6 if test "${ac_cv_search_lt_dlopen+set}" = set; then @@ -26454,8 +26289,6 @@ s, at QMTEST@,$QMTEST,;t t s, at RUNTEST@,$RUNTEST,;t t s, at ETAGSFLAGS@,$ETAGSFLAGS,;t t -s, at HAVE_ZLIB@,$HAVE_ZLIB,;t t -s, at HAVE_BZIP2@,$HAVE_BZIP2,;t t s, at ALLOCA@,$ALLOCA,;t t s, at MMAP_FILE@,$MMAP_FILE,;t t s, at LLVMGCC@,$LLVMGCC,;t t From reid at x10sys.com Thu Nov 25 14:22:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:22 -0600 Subject: [llvm-commits] CVS: llvm/projects/Stacker/tools/stkrc/Makefile Message-ID: <200411252022.OAA27514@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/tools/stkrc: Makefile updated: 1.5 -> 1.6 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/projects/Stacker/tools/stkrc/Makefile diff -u llvm/projects/Stacker/tools/stkrc/Makefile:1.5 llvm/projects/Stacker/tools/stkrc/Makefile:1.6 --- llvm/projects/Stacker/tools/stkrc/Makefile:1.5 Wed Oct 27 18:18:45 2004 +++ llvm/projects/Stacker/tools/stkrc/Makefile Thu Nov 25 14:22:07 2004 @@ -11,7 +11,7 @@ TOOLNAME = stkrc LLVMLIBS = LLVMAsmParser LLVMBCWriter LLVMTransforms LLVMipo.a LLVMipa.a \ LLVMScalarOpts LLVMAnalysis.a LLVMTarget.a LLVMTransformUtils \ - LLVMCore LLVMSupport.a LLVMSystem.a + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a USEDLIBS=stkr_compiler From reid at x10sys.com Thu Nov 25 14:22:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-as/Makefile Message-ID: <200411252022.OAA27515@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-as: Makefile updated: 1.14 -> 1.15 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+2 -1) Index: llvm/tools/llvm-as/Makefile diff -u llvm/tools/llvm-as/Makefile:1.14 llvm/tools/llvm-as/Makefile:1.15 --- llvm/tools/llvm-as/Makefile:1.14 Wed Oct 27 18:18:45 2004 +++ llvm/tools/llvm-as/Makefile Thu Nov 25 14:22:07 2004 @@ -8,6 +8,7 @@ ##===----------------------------------------------------------------------===## LEVEL = ../.. TOOLNAME = llvm-as -USEDLIBS = LLVMAsmParser LLVMBCWriter LLVMCore LLVMSupport.a LLVMSystem.a +USEDLIBS = LLVMAsmParser LLVMBCWriter \ + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/Makefile Message-ID: <200411252022.OAA27523@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: Makefile updated: 1.4 -> 1.5 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-ld/Makefile diff -u llvm/tools/llvm-ld/Makefile:1.4 llvm/tools/llvm-ld/Makefile:1.5 --- llvm/tools/llvm-ld/Makefile:1.4 Sun Nov 14 16:23:31 2004 +++ llvm/tools/llvm-ld/Makefile Thu Nov 25 14:22:07 2004 @@ -13,6 +13,6 @@ USEDLIBS = LLVMipo.a LLVMTransforms.a LLVMScalarOpts.a LLVMAnalysis.a \ LLVMipa.a LLVMTransformUtils.a LLVMTarget.a LLVMLinker.a \ LLVMArchive.a LLVMBCReader LLVMBCWriter \ - LLVMCore LLVMSupport.a LLVMSystem.a + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-prof/Makefile Message-ID: <200411252022.OAA27525@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-prof: Makefile updated: 1.4 -> 1.5 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+2 -1) Index: llvm/tools/llvm-prof/Makefile diff -u llvm/tools/llvm-prof/Makefile:1.4 llvm/tools/llvm-prof/Makefile:1.5 --- llvm/tools/llvm-prof/Makefile:1.4 Wed Oct 27 18:18:45 2004 +++ llvm/tools/llvm-prof/Makefile Thu Nov 25 14:22:07 2004 @@ -9,5 +9,6 @@ LEVEL = ../.. TOOLNAME = llvm-prof -USEDLIBS = LLVMAnalysis.a LLVMBCReader LLVMCore LLVMSupport.a LLVMSystem.a +USEDLIBS = LLVMAnalysis.a LLVMBCReader \ + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/extract/Makefile Message-ID: <200411252022.OAA27527@zion.cs.uiuc.edu> Changes in directory llvm/tools/extract: Makefile updated: 1.6 -> 1.7 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+2 -2) Index: llvm/tools/extract/Makefile diff -u llvm/tools/extract/Makefile:1.6 llvm/tools/extract/Makefile:1.7 --- llvm/tools/extract/Makefile:1.6 Wed Oct 27 18:18:45 2004 +++ llvm/tools/extract/Makefile Thu Nov 25 14:22:07 2004 @@ -10,7 +10,7 @@ TOOLNAME = extract USEDLIBS = LLVMBCReader LLVMBCWriter LLVMTransforms.a LLVMipo.a LLVMTarget.a \ - LLVMAnalysis.a LLVMTransformUtils.a LLVMipa.a LLVMCore LLVMSupport.a \ - LLVMSystem.a + LLVMAnalysis.a LLVMTransformUtils.a LLVMipa.a \ + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-nm/Makefile Message-ID: <200411252022.OAA27521@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-nm: Makefile updated: 1.5 -> 1.6 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+2 -1) Index: llvm/tools/llvm-nm/Makefile diff -u llvm/tools/llvm-nm/Makefile:1.5 llvm/tools/llvm-nm/Makefile:1.6 --- llvm/tools/llvm-nm/Makefile:1.5 Sun Nov 14 16:27:00 2004 +++ llvm/tools/llvm-nm/Makefile Thu Nov 25 14:22:07 2004 @@ -9,5 +9,6 @@ LEVEL = ../.. TOOLNAME = llvm-nm -USEDLIBS = LLVMArchive.a LLVMBCReader LLVMCore LLVMSupport.a LLVMSystem.a +USEDLIBS = LLVMArchive.a LLVMBCReader \ + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/Makefile Message-ID: <200411252022.OAA27528@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: Makefile updated: 1.10 -> 1.11 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/tools/bugpoint/Makefile diff -u llvm/tools/bugpoint/Makefile:1.10 llvm/tools/bugpoint/Makefile:1.11 --- llvm/tools/bugpoint/Makefile:1.10 Sun Nov 14 17:23:18 2004 +++ llvm/tools/bugpoint/Makefile Thu Nov 25 14:22:07 2004 @@ -16,7 +16,7 @@ USEDLIBS = LLVMipo LLVMScalarOpts LLVMAnalysis $(OPTLIBS) $(ANALIBS) \ LLVMTransformUtils \ LLVMAsmParser LLVMLinker.a LLVMBCReader LLVMBCWriter \ - LLVMCore LLVMSupport.a LLVMSystem.a + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a TOOLLINKOPTS = $(PLATFORMLIBDL) From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llc/Makefile Message-ID: <200411252022.OAA27520@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: Makefile updated: 1.61 -> 1.62 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -0) Index: llvm/tools/llc/Makefile diff -u llvm/tools/llc/Makefile:1.61 llvm/tools/llc/Makefile:1.62 --- llvm/tools/llc/Makefile:1.61 Thu Nov 18 12:37:55 2004 +++ llvm/tools/llc/Makefile Thu Nov 25 14:22:07 2004 @@ -31,6 +31,7 @@ LLVMBCWriter \ LLVMCore \ LLVMSupport.a \ + LLVMbzip2 \ LLVMSystem.a TOOLLINKOPTS = $(PLATFORMLIBDL) From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ranlib/Makefile Message-ID: <200411252022.OAA27545@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ranlib: Makefile updated: 1.1 -> 1.2 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+2 -1) Index: llvm/tools/llvm-ranlib/Makefile diff -u llvm/tools/llvm-ranlib/Makefile:1.1 llvm/tools/llvm-ranlib/Makefile:1.2 --- llvm/tools/llvm-ranlib/Makefile:1.1 Sun Nov 14 16:28:33 2004 +++ llvm/tools/llvm-ranlib/Makefile Thu Nov 25 14:22:07 2004 @@ -9,6 +9,7 @@ LEVEL = ../.. TOOLNAME = llvm-ranlib -USEDLIBS = LLVMArchive.a LLVMBCReader LLVMCore LLVMSupport.a LLVMSystem.a +USEDLIBS = LLVMArchive.a LLVMBCReader \ + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/opt/Makefile Message-ID: <200411252022.OAA27529@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: Makefile updated: 1.47 -> 1.48 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/tools/opt/Makefile diff -u llvm/tools/opt/Makefile:1.47 llvm/tools/opt/Makefile:1.48 --- llvm/tools/opt/Makefile:1.47 Wed Oct 27 18:18:45 2004 +++ llvm/tools/opt/Makefile Thu Nov 25 14:22:07 2004 @@ -12,7 +12,7 @@ USEDLIBS = LLVMBCReader LLVMBCWriter LLVMInstrumentation LLVMProfilePaths \ LLVMScalarOpts LLVMipo LLVMipa LLVMDataStructure LLVMTransforms \ LLVMTarget.a LLVMAnalysis LLVMTransformUtils LLVMCore LLVMSupport.a \ - LLVMSystem.a + LLVMbzip2 LLVMSystem.a TOOLLINKOPTS = $(PLATFORMLIBDL) From reid at x10sys.com Thu Nov 25 14:22:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/analyze/Makefile Message-ID: <200411252022.OAA27522@zion.cs.uiuc.edu> Changes in directory llvm/tools/analyze: Makefile updated: 1.24 -> 1.25 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/tools/analyze/Makefile diff -u llvm/tools/analyze/Makefile:1.24 llvm/tools/analyze/Makefile:1.25 --- llvm/tools/analyze/Makefile:1.24 Wed Oct 27 18:18:45 2004 +++ llvm/tools/analyze/Makefile Thu Nov 25 14:22:07 2004 @@ -10,7 +10,7 @@ TOOLNAME = analyze USEDLIBS = LLVMAsmParser LLVMBCReader LLVMAnalysis LLVMipa LLVMDataStructure \ LLVMScalarOpts.a LLVMTransforms.a LLVMTarget.a LLVMScalarOpts.a \ - LLVMTransformUtils.a LLVMCore LLVMSupport.a LLVMSystem.a + LLVMTransformUtils.a LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a TOOLLINKOPTS = $(PLATFORMLIBDL) From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/examples/ModuleMaker/Makefile Message-ID: <200411252022.OAA27546@zion.cs.uiuc.edu> Changes in directory llvm/examples/ModuleMaker: Makefile updated: 1.7 -> 1.8 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/examples/ModuleMaker/Makefile diff -u llvm/examples/ModuleMaker/Makefile:1.7 llvm/examples/ModuleMaker/Makefile:1.8 --- llvm/examples/ModuleMaker/Makefile:1.7 Thu Nov 18 04:03:47 2004 +++ llvm/examples/ModuleMaker/Makefile Thu Nov 25 14:22:07 2004 @@ -9,6 +9,6 @@ LEVEL=../.. TOOLNAME=ModuleMaker EXAMPLE_TOOL = 1 -USEDLIBS= LLVMBCWriter LLVMCore LLVMSupport.a LLVMSystem.a +USEDLIBS= LLVMBCWriter LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-link/Makefile Message-ID: <200411252022.OAA27540@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-link: Makefile updated: 1.11 -> 1.12 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-link/Makefile diff -u llvm/tools/llvm-link/Makefile:1.11 llvm/tools/llvm-link/Makefile:1.12 --- llvm/tools/llvm-link/Makefile:1.11 Sun Nov 14 17:12:22 2004 +++ llvm/tools/llvm-link/Makefile Thu Nov 25 14:22:07 2004 @@ -10,6 +10,6 @@ TOOLNAME = llvm-link USEDLIBS = LLVMLinker.a LLVMBCReader LLVMBCWriter \ - LLVMCore LLVMSupport.a LLVMSystem.a + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/Makefile Message-ID: <200411252022.OAA27571@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-bcanalyzer: Makefile updated: 1.3 -> 1.4 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-bcanalyzer/Makefile diff -u llvm/tools/llvm-bcanalyzer/Makefile:1.3 llvm/tools/llvm-bcanalyzer/Makefile:1.4 --- llvm/tools/llvm-bcanalyzer/Makefile:1.3 Wed Oct 27 18:18:45 2004 +++ llvm/tools/llvm-bcanalyzer/Makefile Thu Nov 25 14:22:07 2004 @@ -9,5 +9,5 @@ LEVEL = ../.. TOOLNAME = llvm-bcanalyzer -USEDLIBS = LLVMBCReader LLVMCore LLVMSupport.a LLVMSystem.a +USEDLIBS = LLVMBCReader LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/Makefile Message-ID: <200411252022.OAA27530@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: Makefile updated: 1.10 -> 1.11 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvmc/Makefile diff -u llvm/tools/llvmc/Makefile:1.10 llvm/tools/llvmc/Makefile:1.11 --- llvm/tools/llvmc/Makefile:1.10 Tue Nov 23 18:01:57 2004 +++ llvm/tools/llvmc/Makefile Thu Nov 25 14:22:07 2004 @@ -8,7 +8,7 @@ ##===----------------------------------------------------------------------===## LEVEL = ../.. TOOLNAME = llvmc -USEDLIBS = LLVMBCReader LLVMCore LLVMSupport.a LLVMSystem.a +USEDLIBS = LLVMBCReader LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a CONFIG_FILES = c cpp ll st EXTRA_DIST = c cpp ll st From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/Makefile.JIT Message-ID: <200411252022.OAA27524@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile.JIT updated: 1.5 -> 1.6 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/tools/Makefile.JIT diff -u llvm/tools/Makefile.JIT:1.5 llvm/tools/Makefile.JIT:1.6 --- llvm/tools/Makefile.JIT:1.5 Thu Nov 18 12:38:01 2004 +++ llvm/tools/Makefile.JIT Thu Nov 25 14:22:07 2004 @@ -63,4 +63,4 @@ USEDLIBS += LLVMInterpreter $(JITLIBS) $(ARCHLIBS) LLVMScalarOpts \ LLVMAnalysis.a LLVMTransformUtils.a LLVMBCReader LLVMCore \ - LLVMSupport.a LLVMTarget.a LLVMSystem.a + LLVMSupport.a LLVMTarget.a LLVMbzip2 LLVMSystem.a From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/Makefile Message-ID: <200411252022.OAA27526@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: Makefile updated: 1.10 -> 1.11 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/tools/gccld/Makefile diff -u llvm/tools/gccld/Makefile:1.10 llvm/tools/gccld/Makefile:1.11 --- llvm/tools/gccld/Makefile:1.10 Sun Nov 14 16:16:17 2004 +++ llvm/tools/gccld/Makefile Thu Nov 25 14:22:07 2004 @@ -13,6 +13,6 @@ USEDLIBS = LLVMipo.a LLVMTransforms.a LLVMScalarOpts.a LLVMAnalysis.a \ LLVMipa.a LLVMTransformUtils.a LLVMTarget.a LLVMLinker.a \ LLVMArchive.a LLVMBCReader LLVMBCWriter \ - LLVMCore LLVMSupport.a LLVMSystem.a + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-dis/Makefile Message-ID: <200411252022.OAA27539@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-dis: Makefile updated: 1.16 -> 1.17 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-dis/Makefile diff -u llvm/tools/llvm-dis/Makefile:1.16 llvm/tools/llvm-dis/Makefile:1.17 --- llvm/tools/llvm-dis/Makefile:1.16 Wed Oct 27 18:18:45 2004 +++ llvm/tools/llvm-dis/Makefile Thu Nov 25 14:22:07 2004 @@ -9,5 +9,5 @@ LEVEL = ../.. TOOLNAME = llvm-dis -USEDLIBS = LLVMBCReader LLVMCore LLVMSupport.a LLVMSystem.a +USEDLIBS = LLVMBCReader LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ar/Makefile Message-ID: <200411252022.OAA27531@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ar: Makefile updated: 1.5 -> 1.6 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+2 -1) Index: llvm/tools/llvm-ar/Makefile diff -u llvm/tools/llvm-ar/Makefile:1.5 llvm/tools/llvm-ar/Makefile:1.6 --- llvm/tools/llvm-ar/Makefile:1.5 Sun Nov 14 16:19:21 2004 +++ llvm/tools/llvm-ar/Makefile Thu Nov 25 14:22:07 2004 @@ -9,7 +9,8 @@ LEVEL = ../.. TOOLNAME = llvm-ar -USEDLIBS = LLVMArchive.a LLVMBCReader LLVMCore LLVMSupport.a LLVMSystem.a +USEDLIBS = LLVMArchive.a LLVMBCReader \ + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 14:22:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 14:22:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccas/Makefile Message-ID: <200411252022.OAA27532@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccas: Makefile updated: 1.19 -> 1.20 --- Log message: Add LLVMbzip2 library, now required. --- Diffs of the changes: (+1 -1) Index: llvm/tools/gccas/Makefile diff -u llvm/tools/gccas/Makefile:1.19 llvm/tools/gccas/Makefile:1.20 --- llvm/tools/gccas/Makefile:1.19 Fri Oct 29 18:26:09 2004 +++ llvm/tools/gccas/Makefile Thu Nov 25 14:22:07 2004 @@ -11,6 +11,6 @@ TOOLNAME = gccas USEDLIBS = LLVMAsmParser LLVMBCWriter LLVMTransforms LLVMipo.a LLVMipa.a \ LLVMScalarOpts LLVMAnalysis.a LLVMTarget.a LLVMTransformUtils \ - LLVMCore LLVMSupport.a LLVMSystem.a + LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Thu Nov 25 16:38:40 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 16:38:40 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411252238.QAA29584@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.256 -> 1.257 --- Log message: * Add features I implemented this release. * Wrap long lines at 80 cols * Indent lists so structure of document is a little more clear * Make the page HTML 4.01 Strict compliant. --- Diffs of the changes: (+101 -68) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.256 llvm/docs/ReleaseNotes.html:1.257 --- llvm/docs/ReleaseNotes.html:1.256 Thu Nov 25 00:33:10 2004 +++ llvm/docs/ReleaseNotes.html Thu Nov 25 16:38:30 2004 @@ -85,34 +85,60 @@
        -
          +
        1. LLVM now optimizes global variables significantly more than it did + before. +
        2. +
        3. LLVM now includes the new 'undef' value and + unreachable instruction, + which give the optimizer more information about the behavior of the + program. +
        4. +
        5. llvmgcc and llvmg++ now emit source line number information when '-g' is + passed in. This information can be used with llvm-db or other tools and + passes. +
        6. The test/Programs hierarchy has - been moved out of the main LLVM tree into a separate CVS repo and - tarball. This shrinks the distribution size of LLVM itself dramatically. + been moved out of the main LLVM tree into a separate CVS repository and + tarball. This shrinks the distribution size of LLVM itself significantly. +
        7. +
        8. Bytecode compression with bzip2 has been implemented. All bytecode files + generated by LLVM will now be compressed by default. Compression can be + disabled with the -disable-compression option to the tools that can + generate bytecode files.
        9. -
        10. LLVM now optimizes global variables significantly more than it did - before.
        11. -
        12. LLVM now includes the new 'undef' value and unreachable instruction, - which give the optimizer more information about the behavior of the - program.
        13. -
        14. The LLVM makefiles have been improved to build LLVM much faster (2x) and - includes new targets (like dist-check, uninstall). One important change is - associated with PR456. - The libraries and tools will now be built into - $builddir/Debug/{bin,lib} instead of - $builddir/tools/Debug and $builddir/lib/Debug. Similarly - for Release and Profile builds. +
        15. A generic compiler driver and + an associated generic linker have + been implemented. The compiler driver is generic because it can be configured + to pre-process, translate, optimize, assemble, and link code from any source + language. This aids compiler writers because all that is needed is a + source-to-bytecode or source-to-assembly translator and a configuration file. + The linker is generic because it allows dynamically loadable optimization + modules to be executed for link-time optimization. Language specific + link-time optimization modules can be created and executed automatically. +
        16. +
        17. The dependent libraries + feature has been implemented. This allows front end compilers to indicate in + the bytecode which libraries the bytecode needs to be linked with. Both the + C/C++ front end and Stacker support generating the required libraries. The + Linker now supports using this information to ensure required libaries are + linked into the module. This minimizes the need to use the -l option + when using llvmc +
        18. +
        19. The LLVM makefiles have been improved to build LLVM faster (2x) and + includes new targets (like dist-check, uninstall). One important change is + associated with PR456. The + libraries and tools will now be built into $builddir/Debug/{bin,lib} + instead of $builddir/tools/Debug and $builddir/lib/Debug. + Similarly for Release and Profile builds.
        20. The LLVM source code is much more compatible with Microsoft Visual C++, - including the JIT and runtime-code generation, though the entire system - may not work with it.
        21. -
        22. llvmgcc and llvmg++ now emit source line number information when '-g' is - passed in. This information can be used with llvm-db or other tools and - passes.
        23. + including the JIT and runtime-code generation, though the entire system + may not work with it. +
        24. The target-to-JIT interfaces are - now much simpler and more powerful.
        25. + now much simpler and more powerful. +
        @@ -127,14 +153,15 @@
        1. JIT interface should support - arbitrary calls
        2. + arbitrary calls +
        3. The llvm-ar tool was previously incomplete and didn't properly support other ar(1) implementations. This has been corrected. llvm-ar now fully supports all archive editing functions, table of contents listing, extraction, and printing. It can also read BSD4.4/MacOSX and SVR4 style - archives. See llvm-ar - for details.
        4. + archives. See llvm-ar for + details. +
        @@ -148,15 +175,18 @@
          -
        1. [llvmg++] Tons of warnings are spewed when - linking to libstdc++
        2. -
        3. include/{Support,Config} -> - include/llvm/{Support,Config}
        4. +
        5. [llvmg++] Tons of warnings + are spewed when linking to libstdc++ +
        6. +
        7. include/{Support,Config} -> + include/llvm/{Support,Config} +
        8. The names of the libraries generated by compiling LLVM source have been changed to ensure they do not conflict with other packages upon installation. Each LLVM library is now prefixed with LLVM and uses mixed clase. For example, the library libasmparser.a in 1.3 has become - libLLVMAsmParser.a in release 1.4.
        9. + libLLVMAsmParser.a in release 1.4. +
        @@ -170,7 +200,8 @@
        1. [autoconf] further standardizing autoconf usage. Various improvements in the configure.ac script were - made as well as the makefile system.
        2. + made as well as the makefile system. +
        @@ -182,8 +213,9 @@ @@ -198,32 +230,33 @@

        Bugs fixed in the LLVM Core:

          -
        1. [licm] LICM invalidates alias analysis info - and uses broken information (optimizer crash)
        2. -
        3. [asmwriter] Asmwriter is really slow for - functions with lots of values
        4. -
        5. [anders-aa] Andersen's AA is completely - broken in LLVM 1.3
        6. -
        7. [bcwriter] Empty compaction tables - defined
        8. -
        9. [X86] llc output for functions w/certain - names tickles GNU 'as' bugs
        10. +
        11. [licm] LICM invalidates alias + analysis info and uses broken information (optimizer crash)
        12. +
        13. [asmwriter] Asmwriter is really + slow for functions with lots of values
        14. +
        15. [anders-aa] Andersen's AA is + completely broken in LLVM 1.3
        16. +
        17. [bcwriter] Empty compaction + tables defined
        18. +
        19. [X86] llc output for functions + w/certain names tickles GNU 'as' bugs

        Bugs in the C/C++ front-end:

          -
        1. [llvmg++] not enough templates are instantiated
        2. -
        3. [llvmg++] Extern const globals cannot be -marked 'constant' if they have nontrivial ctors or dtors
        4. -
        5. [llvmgcc] Crash compiling unnamed +
        6. [llvmg++] not enough templates are + instantiated
        7. +
        8. [llvmg++] Extern const globals + cannot be marked 'constant' if they have nontrivial ctors or dtors
        9. +
        10. [llvmgcc] Crash compiling unnamed bitfield which does not increase struct size

        Bugs fixed in the Sparc V9 back-end:

          -
        1. [sparcv9] regalloc assertion +
        2. [sparcv9] regalloc assertion failure with certain indirect calls
        @@ -311,24 +344,24 @@
        @@ -668,7 +701,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
        - Last modified: $Date: 2004/11/25 06:33:10 $ + Last modified: $Date: 2004/11/25 22:38:30 $ From reid at x10sys.com Thu Nov 25 16:44:09 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 25 Nov 2004 16:44:09 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411252244.QAA29702@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.257 -> 1.258 --- Log message: Indicate that PR427: http://llvm.cs.uiuc.edu/PR427 won't be fixed. --- Diffs of the changes: (+5 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.257 llvm/docs/ReleaseNotes.html:1.258 --- llvm/docs/ReleaseNotes.html:1.257 Thu Nov 25 16:38:30 2004 +++ llvm/docs/ReleaseNotes.html Thu Nov 25 16:43:58 2004 @@ -362,6 +362,10 @@ mark values live across a setjmp as volatile. This missing feature only affects targets whose setjmp/longjmp libraries do not save and restore the entire register file. +
      • [bytecode] Assertion on V1 + Bytecode Files. This bug won't be fixed because V1 bytecode had its own + problems, no one is using V1 bytecode any more, and the fix is non-trivial. +
      @@ -701,7 +705,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/25 22:38:30 $ + Last modified: $Date: 2004/11/25 22:43:58 $ From lattner at cs.uiuc.edu Fri Nov 26 11:34:52 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 26 Nov 2004 11:34:52 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-out.c Message-ID: <200411261734.LAA01767@zion.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-out.c updated: 1.6 -> 1.7 --- Log message: Add crtend to the known list of deplibs --- Diffs of the changes: (+1 -1) Index: llvm-gcc/gcc/llvm-out.c diff -u llvm-gcc/gcc/llvm-out.c:1.6 llvm-gcc/gcc/llvm-out.c:1.7 --- llvm-gcc/gcc/llvm-out.c:1.6 Thu Nov 18 14:44:23 2004 +++ llvm-gcc/gcc/llvm-out.c Fri Nov 26 11:34:39 2004 @@ -119,7 +119,7 @@ fprintf(llvm_out_file, "\"stdc++\", "); if (c_dialect_objc()) fprintf(llvm_out_file, "\"objc\", "); - fprintf(llvm_out_file, "\"c\"]\n"); + fprintf(llvm_out_file, "\"c\", \"crtend\"]\n"); fprintf(llvm_out_file, "\n"); } From lattner at cs.uiuc.edu Fri Nov 26 13:19:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 26 Nov 2004 13:19:42 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/BasicAA/global-size.ll Message-ID: <200411261919.iAQJJgeE003940@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/BasicAA: global-size.ll added (r1.1) --- Log message: new testcase basicaa should handle --- Diffs of the changes: (+17 -0) Index: llvm/test/Regression/Analysis/BasicAA/global-size.ll diff -c /dev/null llvm/test/Regression/Analysis/BasicAA/global-size.ll:1.1 *** /dev/null Fri Nov 26 13:19:38 2004 --- llvm/test/Regression/Analysis/BasicAA/global-size.ll Fri Nov 26 13:19:28 2004 *************** *** 0 **** --- 1,17 ---- + ; A store or load cannot alias a global if the accessed amount is larger then + ; the global. + + ; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep load + + %B = global short 8 + + implementation + + short %test(int *%P) { + %X = load short* %B + store int 7, int* %P + %Y = load short* %B + %Z = sub short %Y, %X + ret short %Z + } + From lattner at cs.uiuc.edu Fri Nov 26 13:20:13 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 26 Nov 2004 13:20:13 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <200411261920.iAQJKDFU003979@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.55 -> 1.56 --- Log message: A store or load cannot alias a global if the accessed amount is larger then the global. This implements Regression/Analysis/BasicAA/global-size.ll --- Diffs of the changes: (+49 -20) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.55 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.56 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.55 Wed Nov 17 11:39:39 2004 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Fri Nov 26 13:20:01 2004 @@ -265,28 +265,57 @@ const Value *O2 = getUnderlyingObject(V2); // Pointing at a discernible object? - if (O1 && O2) { - if (isa(O1)) { - // Incoming argument cannot alias locally allocated object! - if (isa(O2)) return NoAlias; - // Otherwise, nothing is known... - } else if (isa(O2)) { - // Incoming argument cannot alias locally allocated object! - if (isa(O1)) return NoAlias; - // Otherwise, nothing is known... - } else { - // If they are two different objects, we know that we have no alias... - if (O1 != O2) return NoAlias; + if (O1) { + if (O2) { + if (isa(O1)) { + // Incoming argument cannot alias locally allocated object! + if (isa(O2)) return NoAlias; + // Otherwise, nothing is known... + } else if (isa(O2)) { + // Incoming argument cannot alias locally allocated object! + if (isa(O1)) return NoAlias; + // Otherwise, nothing is known... + } else if (O1 != O2) { + // If they are two different objects, we know that we have no alias... + return NoAlias; + } + + // If they are the same object, they we can look at the indexes. If they + // index off of the object is the same for both pointers, they must alias. + // If they are provably different, they must not alias. Otherwise, we + // can't tell anything. } - // If they are the same object, they we can look at the indexes. If they - // index off of the object is the same for both pointers, they must alias. - // If they are provably different, they must not alias. Otherwise, we can't - // tell anything. - } else if (O1 && !isa(O1) && isa(V2)) { - return NoAlias; // Unique values don't alias null - } else if (O2 && !isa(O2) && isa(V1)) { - return NoAlias; // Unique values don't alias null + + if (!isa(O1) && isa(V2)) + return NoAlias; // Unique values don't alias null + + if (const GlobalVariable *GV = dyn_cast(O1)) + if (GV->getType()->getElementType()->isSized()) { + // If the size of the other access is larger than the total size of the + // global, it cannot be accessing the global (it's undefined to load or + // store bytes after the global). + unsigned GlobalSize = + getTargetData().getTypeSize(GV->getType()->getElementType()); + if (GlobalSize < V2Size) + return NoAlias; + } + } + + if (O2) { + if (!isa(O2) && isa(V1)) + return NoAlias; // Unique values don't alias null + + if (const GlobalVariable *GV = dyn_cast(O2)) + if (GV->getType()->getElementType()->isSized()) { + // If the size of the other access is larger than the total size of the + // global, it cannot be accessing the global (it's undefined to load or + // store bytes after the global). + unsigned GlobalSize = + getTargetData().getTypeSize(GV->getType()->getElementType()); + if (GlobalSize < V1Size) + return NoAlias; + } } // If we have two gep instructions with must-alias'ing base pointers, figure From lattner at cs.uiuc.edu Fri Nov 26 14:02:05 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 26 Nov 2004 14:02:05 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <200411262002.iAQK25bE004552@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.56 -> 1.57 --- Log message: The trick with globals actually works with allocas and malloc too --- Diffs of the changes: (+12 -12) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.56 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.57 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.56 Fri Nov 26 13:20:01 2004 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Fri Nov 26 14:01:48 2004 @@ -290,13 +290,13 @@ if (!isa(O1) && isa(V2)) return NoAlias; // Unique values don't alias null - if (const GlobalVariable *GV = dyn_cast(O1)) - if (GV->getType()->getElementType()->isSized()) { + if (isa(O1) || isa(O1)) + if (cast(O1->getType())->getElementType()->isSized()) { // If the size of the other access is larger than the total size of the - // global, it cannot be accessing the global (it's undefined to load or - // store bytes after the global). - unsigned GlobalSize = - getTargetData().getTypeSize(GV->getType()->getElementType()); + // global/alloca/malloc, it cannot be accessing the global (it's + // undefined to load or store bytes before or after an object). + const Type *ElTy = cast(O1->getType())->getElementType(); + unsigned GlobalSize = getTargetData().getTypeSize(ElTy); if (GlobalSize < V2Size) return NoAlias; } @@ -306,13 +306,13 @@ if (!isa(O2) && isa(V1)) return NoAlias; // Unique values don't alias null - if (const GlobalVariable *GV = dyn_cast(O2)) - if (GV->getType()->getElementType()->isSized()) { + if (isa(O2) || isa(O2)) + if (cast(O2->getType())->getElementType()->isSized()) { // If the size of the other access is larger than the total size of the - // global, it cannot be accessing the global (it's undefined to load or - // store bytes after the global). - unsigned GlobalSize = - getTargetData().getTypeSize(GV->getType()->getElementType()); + // global/alloca/malloc, it cannot be accessing the object (it's + // undefined to load or store bytes before or after an object). + const Type *ElTy = cast(O2->getType())->getElementType(); + unsigned GlobalSize = getTargetData().getTypeSize(ElTy); if (GlobalSize < V1Size) return NoAlias; } From lattner at cs.uiuc.edu Fri Nov 26 14:25:32 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 26 Nov 2004 14:25:32 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Message-ID: <200411262025.iAQKPWZn030255@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32JITInfo.cpp updated: 1.11 -> 1.12 --- Log message: There is no reason to store , just store . --- Diffs of the changes: (+3 -5) Index: llvm/lib/Target/PowerPC/PPC32JITInfo.cpp diff -u llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.11 llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.12 --- llvm/lib/Target/PowerPC/PPC32JITInfo.cpp:1.11 Thu Nov 25 00:14:45 2004 +++ llvm/lib/Target/PowerPC/PPC32JITInfo.cpp Fri Nov 26 14:25:17 2004 @@ -16,7 +16,7 @@ #include "PPC32Relocations.h" #include "llvm/CodeGen/MachineCodeEmitter.h" #include "llvm/Config/alloca.h" -#include +#include using namespace llvm; static TargetJITInfo::JITCompilerFn JITCompilerFunction; @@ -210,10 +210,8 @@ // the pointer is relocated into instructions instead of the pointer // itself. Because we have to keep the mapping anyway, we just return // pointers to the values in the map as our new location. - static std::map Pointers; - void *&Ptr = Pointers[(void*)ResultPtr]; - Ptr = (void*)ResultPtr; - ResultPtr = (intptr_t)&Ptr; + static std::set Pointers; + ResultPtr = (intptr_t)&*Pointers.insert((void*)ResultPtr).first; } // FALL THROUGH case PPC::reloc_absolute_high: // high bits of ref -> low 16 of instr From lattner at cs.uiuc.edu Fri Nov 26 15:05:54 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 26 Nov 2004 15:05:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Message-ID: <200411262105.iAQL5sx4018904@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysisEvaluator.cpp updated: 1.19 -> 1.20 --- Log message: When evaluating an AA, pass in size info --- Diffs of the changes: (+38 -28) Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.19 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.20 --- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.19 Wed Sep 1 17:55:35 2004 +++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Fri Nov 26 15:05:39 2004 @@ -23,6 +23,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Assembly/Writer.h" +#include "llvm/Target/TargetData.h" #include "llvm/Support/InstIterator.h" #include "llvm/Support/CommandLine.h" #include @@ -92,6 +93,8 @@ bool AAEval::runOnFunction(Function &F) { AliasAnalysis &AA = getAnalysis(); + + const TargetData &TD = AA.getTargetData(); std::set Pointers; std::set CallSites; @@ -118,9 +121,17 @@ // iterate over the worklist, and run the full (n^2)/2 disambiguations for (std::set::iterator I1 = Pointers.begin(), E = Pointers.end(); - I1 != E; ++I1) - for (std::set::iterator I2 = Pointers.begin(); I2 != I1; ++I2) - switch (AA.alias(*I1, 0, *I2, 0)) { + I1 != E; ++I1) { + unsigned I1Size = 0; + const Type *I1ElTy = cast((*I1)->getType())->getElementType(); + if (I1ElTy->isSized()) I1Size = TD.getTypeSize(I1ElTy); + + for (std::set::iterator I2 = Pointers.begin(); I2 != I1; ++I2) { + unsigned I2Size = 0; + const Type *I2ElTy =cast((*I2)->getType())->getElementType(); + if (I2ElTy->isSized()) I2Size = TD.getTypeSize(I2ElTy); + + switch (AA.alias(*I1, I1Size, *I2, I2Size)) { case AliasAnalysis::NoAlias: PrintResults("NoAlias", PrintNoAlias, *I1, *I2, F.getParent()); ++NoAlias; break; @@ -133,37 +144,36 @@ default: std::cerr << "Unknown alias query result!\n"; } + } + } // Mod/ref alias analysis: compare all pairs of calls and values for (std::set::iterator V = Pointers.begin(), Ve = Pointers.end(); V != Ve; ++V) { unsigned Size = 0; - if (const PointerType *PTy = dyn_cast((*V)->getType())) - if (!(Size = PTy->getElementType()->getPrimitiveSize())) - if (isa(PTy->getElementType())) - Size = 4; // This is a hack, but it's good enough for eval. - - if (Size) - for (std::set::iterator C = CallSites.begin(), - Ce = CallSites.end(); C != Ce; ++C) { - Instruction *I = C->getInstruction(); - switch (AA.getModRefInfo(*C, *V, Size)) { - case AliasAnalysis::NoModRef: - PrintModRefResults("NoModRef", PrintNoModRef, I, *V, F.getParent()); - ++NoModRef; break; - case AliasAnalysis::Mod: - PrintModRefResults(" Mod", PrintMod, I, *V, F.getParent()); - ++Mod; break; - case AliasAnalysis::Ref: - PrintModRefResults(" Ref", PrintRef, I, *V, F.getParent()); - ++Ref; break; - case AliasAnalysis::ModRef: - PrintModRefResults(" ModRef", PrintModRef, I, *V, F.getParent()); - ++ModRef; break; - default: - std::cerr << "Unknown alias query result!\n"; - } + const Type *ElTy = cast((*V)->getType())->getElementType(); + if (ElTy->isSized()) Size = TD.getTypeSize(ElTy); + + for (std::set::iterator C = CallSites.begin(), + Ce = CallSites.end(); C != Ce; ++C) { + Instruction *I = C->getInstruction(); + switch (AA.getModRefInfo(*C, *V, Size)) { + case AliasAnalysis::NoModRef: + PrintModRefResults("NoModRef", PrintNoModRef, I, *V, F.getParent()); + ++NoModRef; break; + case AliasAnalysis::Mod: + PrintModRefResults(" Mod", PrintMod, I, *V, F.getParent()); + ++Mod; break; + case AliasAnalysis::Ref: + PrintModRefResults(" Ref", PrintRef, I, *V, F.getParent()); + ++Ref; break; + case AliasAnalysis::ModRef: + PrintModRefResults(" ModRef", PrintModRef, I, *V, F.getParent()); + ++ModRef; break; + default: + std::cerr << "Unknown alias query result!\n"; } + } } return false; From lattner at cs.uiuc.edu Fri Nov 26 15:20:24 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 26 Nov 2004 15:20:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Message-ID: <200411262120.iAQLKOkQ029589@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.67 -> 1.68 --- Log message: Provide size information when checking to see if we can LICM a load, this allows us to hoist more loads in some cases. --- Diffs of the changes: (+6 -3) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.67 llvm/lib/Transforms/Scalar/LICM.cpp:1.68 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.67 Tue Sep 14 21:34:40 2004 +++ llvm/lib/Transforms/Scalar/LICM.cpp Fri Nov 26 15:20:09 2004 @@ -170,9 +170,9 @@ /// pointerInvalidatedByLoop - Return true if the body of this loop may /// store into the memory location pointed to by V. /// - bool pointerInvalidatedByLoop(Value *V) { + bool pointerInvalidatedByLoop(Value *V, unsigned Size) { // Check to see if any of the basic blocks in CurLoop invalidate *V. - return CurAST->getAliasSetForPointer(V, 0).isMod(); + return CurAST->getAliasSetForPointer(V, Size).isMod(); } bool canSinkOrHoistInst(Instruction &I); @@ -351,7 +351,10 @@ return false; // Don't hoist volatile loads! // Don't hoist loads which have may-aliased stores in loop. - return !pointerInvalidatedByLoop(LI->getOperand(0)); + unsigned Size = 0; + if (LI->getType()->isSized()) + Size = AA->getTargetData().getTypeSize(LI->getType()); + return !pointerInvalidatedByLoop(LI->getOperand(0), Size); } else if (CallInst *CI = dyn_cast(&I)) { // Handle obvious cases efficiently. if (Function *Callee = CI->getCalledFunction()) { From lattner at cs.uiuc.edu Fri Nov 26 15:36:31 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 26 Nov 2004 15:36:31 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasSetTracker.h Message-ID: <200411262136.iAQLaV5f030477@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasSetTracker.h updated: 1.22 -> 1.23 --- Log message: Add a new interface --- Diffs of the changes: (+5 -0) Index: llvm/include/llvm/Analysis/AliasSetTracker.h diff -u llvm/include/llvm/Analysis/AliasSetTracker.h:1.22 llvm/include/llvm/Analysis/AliasSetTracker.h:1.23 --- llvm/include/llvm/Analysis/AliasSetTracker.h:1.22 Wed Oct 27 11:14:50 2004 +++ llvm/include/llvm/Analysis/AliasSetTracker.h Fri Nov 26 15:36:17 2004 @@ -306,6 +306,11 @@ AliasSet *getAliasSetForPointerIfExists(Value *P, unsigned Size) { return findAliasSetForPointer(P, Size); } + + /// containsPointer - Return true if the specified location is represented by + /// this alias set, false otherwise. This does not modify the AST object or + /// alias sets. + bool containsPointer(Value *P, unsigned Size) const; /// getAliasAnalysis - Return the underlying alias analysis object used by /// this tracker. From lattner at cs.uiuc.edu Fri Nov 26 15:36:37 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 26 Nov 2004 15:36:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasSetTracker.cpp Message-ID: <200411262136.iAQLabeJ030485@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasSetTracker.cpp updated: 1.29 -> 1.30 --- Log message: Add a new interface --- Diffs of the changes: (+12 -0) Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.29 llvm/lib/Analysis/AliasSetTracker.cpp:1.30 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.29 Thu Nov 4 22:52:08 2004 +++ llvm/lib/Analysis/AliasSetTracker.cpp Fri Nov 26 15:36:25 2004 @@ -189,6 +189,18 @@ return FoundSet; } +/// containsPointer - Return true if the specified location is represented by +/// this alias set, false otherwise. This does not modify the AST object or +/// alias sets. +bool AliasSetTracker::containsPointer(Value *Ptr, unsigned Size) const { + for (const_iterator I = begin(), E = end(); I != E; ++I) + if (!I->Forward && I->aliasesPointer(Ptr, Size, AA)) + return true; + return false; +} + + + AliasSet *AliasSetTracker::findAliasSetForCallSite(CallSite CS) { AliasSet *FoundSet = 0; for (iterator I = begin(), E = end(); I != E; ++I) From natebegeman at mac.com Fri Nov 26 22:45:22 2004 From: natebegeman at mac.com (Nate Begeman) Date: Fri, 26 Nov 2004 22:45:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp PowerPCAsmPrinter.cpp PowerPCTargetMachine.h Message-ID: <200411270445.WAA26941@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32ISelSimple.cpp updated: 1.112 -> 1.113 PowerPCAsmPrinter.cpp updated: 1.68 -> 1.69 PowerPCTargetMachine.h updated: 1.10 -> 1.11 --- Log message: Remove the ISel->AsmPrinter link via the TargetMachine that was put in place to help bring up the PowerPC back end on Darwin. This code is no longer serves any purpose now that the AsmPrinter does the right thing all the time printing GlobalValues. --Cruft. --- Diffs of the changes: (+2 -24) Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.112 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.113 --- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.112 Thu Nov 25 01:09:01 2004 +++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Fri Nov 26 22:45:11 2004 @@ -708,9 +708,6 @@ } else { BuildMI(*MBB, IP, PPC::LA, 2, R).addReg(TmpReg).addGlobalAddress(GV); } - - // Add the GV to the list of things whose addresses have been taken. - TM.AddressTaken.insert(GV); } else { std::cerr << "Offending constant: " << *C << "\n"; assert(0 && "Type not handled yet!"); @@ -1857,8 +1854,6 @@ } // Emit a CALL instruction with PC-relative displacement. TheCall = BuildMI(PPC::CALLpcrel, 1).addGlobalAddress(F, true); - // Add it to the set of functions called to be used by the Printer - TM.CalledFunctions.insert(F); } else { // Emit an indirect call through the CTR unsigned Reg = getReg(CI.getCalledValue()); BuildMI(BB, PPC::OR, 2, PPC::R12).addReg(Reg).addReg(Reg); @@ -2646,7 +2641,6 @@ Args.push_back(ValueRecord(Op0Reg, Type::FloatTy)); Args.push_back(ValueRecord(Op1Reg, Type::FloatTy)); doCall(ValueRecord(ResultReg, Type::FloatTy), TheCall, Args, false); - TM.CalledFunctions.insert(fmodfFn); } return; case cFP64: @@ -2664,7 +2658,6 @@ Args.push_back(ValueRecord(Op0Reg, Type::DoubleTy)); Args.push_back(ValueRecord(Op1Reg, Type::DoubleTy)); doCall(ValueRecord(ResultReg, Type::DoubleTy), TheCall, Args, false); - TM.CalledFunctions.insert(fmodFn); } return; case cLong: { @@ -2680,7 +2673,6 @@ Args.push_back(ValueRecord(Op0Reg, Type::LongTy)); Args.push_back(ValueRecord(Op1Reg, Type::LongTy)); doCall(ValueRecord(ResultReg, Type::LongTy), TheCall, Args, false); - TM.CalledFunctions.insert(Funcs[NameIdx]); return; } case cByte: case cShort: case cInt: @@ -3272,7 +3264,6 @@ MachineInstr *TheCall = BuildMI(PPC::CALLpcrel, 1).addGlobalAddress(floatFn, true); doCall(ValueRecord(DestReg, DestTy), TheCall, Args, false); - TM.CalledFunctions.insert(floatFn); } else { std::vector CmpArgs, ClrArgs, SetArgs; unsigned ZeroLong = getReg(ConstantUInt::get(SrcTy, 0)); @@ -3295,7 +3286,6 @@ MachineInstr *TheCall = BuildMI(PPC::CALLpcrel, 1).addGlobalAddress(__cmpdi2Fn, true); doCall(ValueRecord(CondReg, Type::IntTy), TheCall, CmpArgs, false); - TM.CalledFunctions.insert(__cmpdi2Fn); BuildMI(*MBB, IP, PPC::CMPWI, 2, PPC::CR0).addReg(CondReg).addSImm(0); BuildMI(*MBB, IP, PPC::BLE, 2).addReg(PPC::CR0).addMBB(SetMBB); @@ -3305,7 +3295,6 @@ ClrArgs.push_back(ValueRecord(SrcReg, SrcTy)); TheCall = BuildMI(PPC::CALLpcrel, 1).addGlobalAddress(floatFn, true); doCall(ValueRecord(ClrReg, DestTy), TheCall, ClrArgs, false); - TM.CalledFunctions.insert(floatFn); BuildMI(BB, PPC::B, 1).addMBB(PhiMBB); BB->addSuccessor(PhiMBB); @@ -3320,7 +3309,6 @@ SetArgs.push_back(ValueRecord(ShiftedReg, SrcTy)); TheCall = BuildMI(PPC::CALLpcrel, 1).addGlobalAddress(floatFn, true); doCall(ValueRecord(CallReg, DestTy), TheCall, SetArgs, false); - TM.CalledFunctions.insert(floatFn); unsigned SetOpcode = (DestClass == cFP32) ? PPC::FADDS : PPC::FADD; BuildMI(BB, SetOpcode, 2, SetReg).addReg(CallReg).addReg(CallReg); BB->addSuccessor(PhiMBB); @@ -3389,7 +3377,6 @@ MachineInstr *TheCall = BuildMI(PPC::CALLpcrel, 1).addGlobalAddress(floatFn, true); doCall(ValueRecord(DestReg, DestTy), TheCall, Args, false); - TM.CalledFunctions.insert(floatFn); return; } @@ -3928,7 +3915,6 @@ MachineInstr *TheCall = BuildMI(PPC::CALLpcrel, 1).addGlobalAddress(mallocFn, true); doCall(ValueRecord(getReg(I), I.getType()), TheCall, Args, false); - TM.CalledFunctions.insert(mallocFn); } /// visitFreeInst - Free instructions are code gen'd to call the free libc @@ -3940,7 +3926,6 @@ MachineInstr *TheCall = BuildMI(PPC::CALLpcrel, 1).addGlobalAddress(freeFn, true); doCall(ValueRecord(0, Type::VoidTy), TheCall, Args, false); - TM.CalledFunctions.insert(freeFn); } /// createPPC32ISelSimple - This pass converts an LLVM function into a machine Index: llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.68 llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.69 --- llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.68 Thu Nov 25 01:09:01 2004 +++ llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp Fri Nov 26 22:45:11 2004 @@ -360,15 +360,14 @@ // wary however not to output $stub for external functions whose addresses // are taken. Those should be emitted as $non_lazy_ptr below. Function *F = dyn_cast(GV); - if (F && F->isExternal() && IsCallOp && getTM().CalledFunctions.count(F)) { + if (F && IsCallOp && F->isExternal()) { FnStubs.insert(Name); O << "L" << Name << "$stub"; return; } // External or weakly linked global variables need non-lazily-resolved stubs - if ((GV->isExternal() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()) - && getTM().AddressTaken.count(GV)) { + if ((GV->isExternal() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage())){ if (GV->hasLinkOnceLinkage()) LinkOnceStubs.insert(Name); else Index: llvm/lib/Target/PowerPC/PowerPCTargetMachine.h diff -u llvm/lib/Target/PowerPC/PowerPCTargetMachine.h:1.10 llvm/lib/Target/PowerPC/PowerPCTargetMachine.h:1.11 --- llvm/lib/Target/PowerPC/PowerPCTargetMachine.h:1.10 Mon Nov 22 23:55:38 2004 +++ llvm/lib/Target/PowerPC/PowerPCTargetMachine.h Fri Nov 26 22:45:11 2004 @@ -17,7 +17,6 @@ #include "PowerPCFrameInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/PassManager.h" -#include namespace llvm { @@ -34,11 +33,6 @@ virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out); - - // Two shared sets between the instruction selector and the printer allow for - // correct linkage on Darwin - std::set CalledFunctions; - std::set AddressTaken; }; } // end namespace llvm From reid at x10sys.com Sat Nov 27 00:00:47 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 27 Nov 2004 00:00:47 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Archive/extract_GNU.ll extract_MacOSX.ll extract_SVR4.ll extract_xpg4.ll Message-ID: <200411270600.AAA27868@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Archive: extract_GNU.ll updated: 1.1 -> 1.2 extract_MacOSX.ll updated: 1.1 -> 1.2 extract_SVR4.ll updated: 1.1 -> 1.2 extract_xpg4.ll updated: 1.1 -> 1.2 --- Log message: Accommodate the braindead Solaris "diff" that doesn't understand the -q option. --- Diffs of the changes: (+4 -4) Index: llvm/test/Regression/Archive/extract_GNU.ll diff -u llvm/test/Regression/Archive/extract_GNU.ll:1.1 llvm/test/Regression/Archive/extract_GNU.ll:1.2 --- llvm/test/Regression/Archive/extract_GNU.ll:1.1 Sat Nov 20 01:25:41 2004 +++ llvm/test/Regression/Archive/extract_GNU.ll Sat Nov 27 00:00:36 2004 @@ -2,4 +2,4 @@ ;This test just makes sure that llvm-ar can extract bytecode members ;from GNU style archives ;RUN: llvm-ar x %p/GNU.a very_long_bytecode_file_name.bc -;RUN: diff -q %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc +;RUN: diff %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc >/dev/null 2>/dev/null Index: llvm/test/Regression/Archive/extract_MacOSX.ll diff -u llvm/test/Regression/Archive/extract_MacOSX.ll:1.1 llvm/test/Regression/Archive/extract_MacOSX.ll:1.2 --- llvm/test/Regression/Archive/extract_MacOSX.ll:1.1 Sat Nov 20 01:25:41 2004 +++ llvm/test/Regression/Archive/extract_MacOSX.ll Sat Nov 27 00:00:36 2004 @@ -3,4 +3,4 @@ ;from MacOSX style archives ;RUN: llvm-ar x %p/MacOSX.a very_long_bytecode_file_name.bc -;RUN: diff -q %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc +;RUN: diff %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc > /dev/null 2>/dev/null Index: llvm/test/Regression/Archive/extract_SVR4.ll diff -u llvm/test/Regression/Archive/extract_SVR4.ll:1.1 llvm/test/Regression/Archive/extract_SVR4.ll:1.2 --- llvm/test/Regression/Archive/extract_SVR4.ll:1.1 Sat Nov 20 01:25:41 2004 +++ llvm/test/Regression/Archive/extract_SVR4.ll Sat Nov 27 00:00:36 2004 @@ -3,4 +3,4 @@ ;from SVR4 style archives ;RUN: llvm-ar x %p/SVR4.a very_long_bytecode_file_name.bc -;RUN: diff -q %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc +;RUN: diff %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc >/dev/null 2>/dev/null Index: llvm/test/Regression/Archive/extract_xpg4.ll diff -u llvm/test/Regression/Archive/extract_xpg4.ll:1.1 llvm/test/Regression/Archive/extract_xpg4.ll:1.2 --- llvm/test/Regression/Archive/extract_xpg4.ll:1.1 Sat Nov 20 01:25:41 2004 +++ llvm/test/Regression/Archive/extract_xpg4.ll Sat Nov 27 00:00:36 2004 @@ -3,4 +3,4 @@ ;from xpg4 style archives ;RUN: llvm-ar x %p/xpg4.a very_long_bytecode_file_name.bc -;RUN: diff -q %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc +;RUN: diff %p/very_long_bytecode_file_name.bc very_long_bytecode_file_name.bc >/dev/null 2>/dev/null From reid at x10sys.com Sat Nov 27 00:27:40 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 27 Nov 2004 00:27:40 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Archive/ranlib_GNU.ll ranlib_MacOSX.ll ranlib_SVR4.ll ranlib_xpg4.ll toc_GNU.ll toc_MacOSX.ll toc_SVR4.ll toc_xpg4.ll Message-ID: <200411270627.AAA28082@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Archive: ranlib_GNU.ll updated: 1.4 -> 1.5 ranlib_MacOSX.ll updated: 1.3 -> 1.4 ranlib_SVR4.ll updated: 1.4 -> 1.5 ranlib_xpg4.ll updated: 1.4 -> 1.5 toc_GNU.ll updated: 1.1 -> 1.2 toc_MacOSX.ll updated: 1.1 -> 1.2 toc_SVR4.ll updated: 1.1 -> 1.2 toc_xpg4.ll updated: 1.1 -> 1.2 --- Log message: Use grep instead of sed because on Solaris sed doesn't copy null bytes and it needs to in order for the bug in MacOSX archives to be tested correctly. --- Diffs of the changes: (+6 -6) Index: llvm/test/Regression/Archive/ranlib_GNU.ll diff -u llvm/test/Regression/Archive/ranlib_GNU.ll:1.4 llvm/test/Regression/Archive/ranlib_GNU.ll:1.5 --- llvm/test/Regression/Archive/ranlib_GNU.ll:1.4 Sun Nov 21 20:46:31 2004 +++ llvm/test/Regression/Archive/ranlib_GNU.ll Sat Nov 27 00:27:30 2004 @@ -4,7 +4,7 @@ ;RUN: cp %p/GNU.a %t.GNU.a ;RUN: llvm-ranlib %t.GNU.a ;RUN: llvm-ar t %t.GNU.a > %t1 -;RUN: sed -e '/^;.*/d' %s >%t2 +;RUN: grep -v '^;' %s >%t2 ;RUN: diff %t2 %t1 evenlen oddlen Index: llvm/test/Regression/Archive/ranlib_MacOSX.ll Index: llvm/test/Regression/Archive/ranlib_SVR4.ll diff -u llvm/test/Regression/Archive/ranlib_SVR4.ll:1.4 llvm/test/Regression/Archive/ranlib_SVR4.ll:1.5 --- llvm/test/Regression/Archive/ranlib_SVR4.ll:1.4 Sun Nov 21 20:46:31 2004 +++ llvm/test/Regression/Archive/ranlib_SVR4.ll Sat Nov 27 00:27:30 2004 @@ -4,7 +4,7 @@ ;RUN: cp %p/SVR4.a %t.SVR4.a ;RUN: llvm-ranlib %t.SVR4.a ;RUN: llvm-ar t %t.SVR4.a > %t1 -;RUN: sed -e '/^;.*/d' %s >%t2 +;RUN: grep -v '^;' %s >%t2 ;RUN: diff %t2 %t1 evenlen oddlen Index: llvm/test/Regression/Archive/ranlib_xpg4.ll diff -u llvm/test/Regression/Archive/ranlib_xpg4.ll:1.4 llvm/test/Regression/Archive/ranlib_xpg4.ll:1.5 --- llvm/test/Regression/Archive/ranlib_xpg4.ll:1.4 Sun Nov 21 20:46:31 2004 +++ llvm/test/Regression/Archive/ranlib_xpg4.ll Sat Nov 27 00:27:30 2004 @@ -4,7 +4,7 @@ ;RUN: cp %p/xpg4.a %t.xpg4.a ;RUN: llvm-ranlib %t.xpg4.a ;RUN: llvm-ar t %t.xpg4.a > %t1 -;RUN: sed -e '/^;.*/d' %s >%t2 +;RUN: grep -v '^;' %s >%t2 ;RUN: diff %t2 %t1 evenlen oddlen Index: llvm/test/Regression/Archive/toc_GNU.ll diff -u llvm/test/Regression/Archive/toc_GNU.ll:1.1 llvm/test/Regression/Archive/toc_GNU.ll:1.2 --- llvm/test/Regression/Archive/toc_GNU.ll:1.1 Sat Nov 20 01:25:41 2004 +++ llvm/test/Regression/Archive/toc_GNU.ll Sat Nov 27 00:27:30 2004 @@ -2,7 +2,7 @@ ;This test just makes sure that llvm-ar can generate a table of contents for ;GNU style archives ;RUN: llvm-ar t %p/GNU.a > %t1 -;RUN: sed -e '/^;.*/d' %s >%t2 +;RUN: grep -v '^;' %s >%t2 ;RUN: diff %t2 %t1 evenlen oddlen Index: llvm/test/Regression/Archive/toc_MacOSX.ll Index: llvm/test/Regression/Archive/toc_SVR4.ll diff -u llvm/test/Regression/Archive/toc_SVR4.ll:1.1 llvm/test/Regression/Archive/toc_SVR4.ll:1.2 --- llvm/test/Regression/Archive/toc_SVR4.ll:1.1 Sat Nov 20 01:25:41 2004 +++ llvm/test/Regression/Archive/toc_SVR4.ll Sat Nov 27 00:27:30 2004 @@ -2,7 +2,7 @@ ;This test just makes sure that llvm-ar can generate a table of contents for ;SVR4 style archives ;RUN: llvm-ar t %p/SVR4.a > %t1 -;RUN: sed -e '/^;.*/d' %s >%t2 +;RUN: grep -v '^;' %s >%t2 ;RUN: diff %t2 %t1 evenlen oddlen Index: llvm/test/Regression/Archive/toc_xpg4.ll diff -u llvm/test/Regression/Archive/toc_xpg4.ll:1.1 llvm/test/Regression/Archive/toc_xpg4.ll:1.2 --- llvm/test/Regression/Archive/toc_xpg4.ll:1.1 Sat Nov 20 01:25:41 2004 +++ llvm/test/Regression/Archive/toc_xpg4.ll Sat Nov 27 00:27:30 2004 @@ -2,7 +2,7 @@ ;This test just makes sure that llvm-ar can generate a table of contents for ;xpg4 style archives ;RUN: llvm-ar t %p/xpg4.a > %t1 -;RUN: sed -e '/^;.*/d' %s >%t2 +;RUN: grep -v '^;' %s >%t2 ;RUN: diff %t2 %t1 evenlen oddlen From reid at x10sys.com Sat Nov 27 00:43:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 27 Nov 2004 00:43:14 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Archive/GNU.toc MacOSX.toc SVR4.toc xpg4.toc Message-ID: <200411270643.AAA28235@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Archive: GNU.toc added (r1.1) MacOSX.toc added (r1.1) SVR4.toc added (r1.1) xpg4.toc added (r1.1) --- Log message: Put the expected tables of contents of the test archives into separate files so we don't have to process them at test time at all. --- Diffs of the changes: (+12 -0) Index: llvm/test/Regression/Archive/GNU.toc diff -c /dev/null llvm/test/Regression/Archive/GNU.toc:1.1 *** /dev/null Sat Nov 27 00:43:13 2004 --- llvm/test/Regression/Archive/GNU.toc Sat Nov 27 00:43:03 2004 *************** *** 0 **** --- 1,4 ---- + evenlen + oddlen + very_long_bytecode_file_name.bc + IsNAN.o Index: llvm/test/Regression/Archive/MacOSX.toc Index: llvm/test/Regression/Archive/SVR4.toc diff -c /dev/null llvm/test/Regression/Archive/SVR4.toc:1.1 *** /dev/null Sat Nov 27 00:43:14 2004 --- llvm/test/Regression/Archive/SVR4.toc Sat Nov 27 00:43:03 2004 *************** *** 0 **** --- 1,4 ---- + evenlen + oddlen + very_long_bytecode_file_name.bc + IsNAN.o Index: llvm/test/Regression/Archive/xpg4.toc diff -c /dev/null llvm/test/Regression/Archive/xpg4.toc:1.1 *** /dev/null Sat Nov 27 00:43:14 2004 --- llvm/test/Regression/Archive/xpg4.toc Sat Nov 27 00:43:03 2004 *************** *** 0 **** --- 1,4 ---- + evenlen + oddlen + very_long_bytecode_file_name.bc + IsNAN.o From reid at x10sys.com Sat Nov 27 00:44:20 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 27 Nov 2004 00:44:20 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Archive/ranlib_GNU.ll ranlib_MacOSX.ll ranlib_SVR4.ll ranlib_xpg4.ll toc_GNU.ll toc_MacOSX.ll toc_SVR4.ll toc_xpg4.ll Message-ID: <200411270644.AAA28282@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Archive: ranlib_GNU.ll updated: 1.5 -> 1.6 ranlib_MacOSX.ll updated: 1.4 -> 1.5 ranlib_SVR4.ll updated: 1.5 -> 1.6 ranlib_xpg4.ll updated: 1.5 -> 1.6 toc_GNU.ll updated: 1.2 -> 1.3 toc_MacOSX.ll updated: 1.2 -> 1.3 toc_SVR4.ll updated: 1.2 -> 1.3 toc_xpg4.ll updated: 1.2 -> 1.3 --- Log message: Don't depend on grep or sed to be portable at all. Just compare against static test files. --- Diffs of the changes: (+6 -36) Index: llvm/test/Regression/Archive/ranlib_GNU.ll diff -u llvm/test/Regression/Archive/ranlib_GNU.ll:1.5 llvm/test/Regression/Archive/ranlib_GNU.ll:1.6 --- llvm/test/Regression/Archive/ranlib_GNU.ll:1.5 Sat Nov 27 00:27:30 2004 +++ llvm/test/Regression/Archive/ranlib_GNU.ll Sat Nov 27 00:44:10 2004 @@ -4,9 +4,4 @@ ;RUN: cp %p/GNU.a %t.GNU.a ;RUN: llvm-ranlib %t.GNU.a ;RUN: llvm-ar t %t.GNU.a > %t1 -;RUN: grep -v '^;' %s >%t2 -;RUN: diff %t2 %t1 -evenlen -oddlen -very_long_bytecode_file_name.bc -IsNAN.o +;RUN: diff %t1 %p/GNU.toc Index: llvm/test/Regression/Archive/ranlib_MacOSX.ll Index: llvm/test/Regression/Archive/ranlib_SVR4.ll diff -u llvm/test/Regression/Archive/ranlib_SVR4.ll:1.5 llvm/test/Regression/Archive/ranlib_SVR4.ll:1.6 --- llvm/test/Regression/Archive/ranlib_SVR4.ll:1.5 Sat Nov 27 00:27:30 2004 +++ llvm/test/Regression/Archive/ranlib_SVR4.ll Sat Nov 27 00:44:10 2004 @@ -4,9 +4,4 @@ ;RUN: cp %p/SVR4.a %t.SVR4.a ;RUN: llvm-ranlib %t.SVR4.a ;RUN: llvm-ar t %t.SVR4.a > %t1 -;RUN: grep -v '^;' %s >%t2 -;RUN: diff %t2 %t1 -evenlen -oddlen -very_long_bytecode_file_name.bc -IsNAN.o +;RUN: diff %t1 %p/SVR4.toc Index: llvm/test/Regression/Archive/ranlib_xpg4.ll diff -u llvm/test/Regression/Archive/ranlib_xpg4.ll:1.5 llvm/test/Regression/Archive/ranlib_xpg4.ll:1.6 --- llvm/test/Regression/Archive/ranlib_xpg4.ll:1.5 Sat Nov 27 00:27:30 2004 +++ llvm/test/Regression/Archive/ranlib_xpg4.ll Sat Nov 27 00:44:10 2004 @@ -4,9 +4,4 @@ ;RUN: cp %p/xpg4.a %t.xpg4.a ;RUN: llvm-ranlib %t.xpg4.a ;RUN: llvm-ar t %t.xpg4.a > %t1 -;RUN: grep -v '^;' %s >%t2 -;RUN: diff %t2 %t1 -evenlen -oddlen -very_long_bytecode_file_name.bc -IsNAN.o +;RUN: diff %t1 %p/xpg4.toc Index: llvm/test/Regression/Archive/toc_GNU.ll diff -u llvm/test/Regression/Archive/toc_GNU.ll:1.2 llvm/test/Regression/Archive/toc_GNU.ll:1.3 --- llvm/test/Regression/Archive/toc_GNU.ll:1.2 Sat Nov 27 00:27:30 2004 +++ llvm/test/Regression/Archive/toc_GNU.ll Sat Nov 27 00:44:10 2004 @@ -2,9 +2,4 @@ ;This test just makes sure that llvm-ar can generate a table of contents for ;GNU style archives ;RUN: llvm-ar t %p/GNU.a > %t1 -;RUN: grep -v '^;' %s >%t2 -;RUN: diff %t2 %t1 -evenlen -oddlen -very_long_bytecode_file_name.bc -IsNAN.o +;RUN: diff %t1 %p/GNU.toc Index: llvm/test/Regression/Archive/toc_MacOSX.ll Index: llvm/test/Regression/Archive/toc_SVR4.ll diff -u llvm/test/Regression/Archive/toc_SVR4.ll:1.2 llvm/test/Regression/Archive/toc_SVR4.ll:1.3 --- llvm/test/Regression/Archive/toc_SVR4.ll:1.2 Sat Nov 27 00:27:30 2004 +++ llvm/test/Regression/Archive/toc_SVR4.ll Sat Nov 27 00:44:10 2004 @@ -2,9 +2,4 @@ ;This test just makes sure that llvm-ar can generate a table of contents for ;SVR4 style archives ;RUN: llvm-ar t %p/SVR4.a > %t1 -;RUN: grep -v '^;' %s >%t2 -;RUN: diff %t2 %t1 -evenlen -oddlen -very_long_bytecode_file_name.bc -IsNAN.o +;RUN: diff %t1 %p/SVR4.toc Index: llvm/test/Regression/Archive/toc_xpg4.ll diff -u llvm/test/Regression/Archive/toc_xpg4.ll:1.2 llvm/test/Regression/Archive/toc_xpg4.ll:1.3 --- llvm/test/Regression/Archive/toc_xpg4.ll:1.2 Sat Nov 27 00:27:30 2004 +++ llvm/test/Regression/Archive/toc_xpg4.ll Sat Nov 27 00:44:10 2004 @@ -2,9 +2,4 @@ ;This test just makes sure that llvm-ar can generate a table of contents for ;xpg4 style archives ;RUN: llvm-ar t %p/xpg4.a > %t1 -;RUN: grep -v '^;' %s >%t2 -;RUN: diff %t2 %t1 -evenlen -oddlen -very_long_bytecode_file_name.bc -IsNAN.o +;RUN: diff %t1 %p/xpg4.toc From lattner at cs.uiuc.edu Sat Nov 27 11:55:35 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 11:55:35 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/getelementptr_cast.ll Message-ID: <200411271755.iARHtZc7007530@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: getelementptr_cast.ll added (r1.1) --- Log message: New testcase --- Diffs of the changes: (+9 -0) Index: llvm/test/Regression/Transforms/InstCombine/getelementptr_cast.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/getelementptr_cast.ll:1.1 *** /dev/null Sat Nov 27 11:55:30 2004 --- llvm/test/Regression/Transforms/InstCombine/getelementptr_cast.ll Sat Nov 27 11:55:20 2004 *************** *** 0 **** --- 1,9 ---- + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'getelementptr.*cast' + %G = external global [3 x sbyte] + + implementation + + ubyte *%foo(uint %Idx) { + %tmp = getelementptr ubyte* cast ([3 x sbyte]* %G to ubyte*), uint %Idx + ret ubyte* %tmp + } From lattner at cs.uiuc.edu Sat Nov 27 11:55:58 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 11:55:58 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200411271755.iARHtwok007542@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.286 -> 1.287 --- Log message: Implement Regression/Transforms/InstCombine/getelementptr_cast.ll, which occurs many times in crafty --- Diffs of the changes: (+15 -0) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.286 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.287 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.286 Thu Nov 18 15:41:39 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sat Nov 27 11:55:46 2004 @@ -3783,6 +3783,21 @@ GEP.setOperand(0, X); return &GEP; } + } else if (GEP.getNumOperands() == 2) { + // Transform things like: + // %t = getelementptr ubyte* cast ([2 x sbyte]* %str to ubyte*), uint %V + // into: %t1 = getelementptr [2 x sbyte*]* %str, int 0, uint %V; cast + Constant *X = CE->getOperand(0); + const Type *SrcElTy = cast(X->getType())->getElementType(); + const Type *ResElTy =cast(CE->getType())->getElementType(); + if (isa(SrcElTy) && + TD->getTypeSize(cast(SrcElTy)->getElementType()) == + TD->getTypeSize(ResElTy)) { + Value *V = InsertNewInstBefore( + new GetElementPtrInst(X, Constant::getNullValue(Type::IntTy), + GEP.getOperand(1), GEP.getName()), GEP); + return new CastInst(V, GEP.getType()); + } } } } From lattner at cs.uiuc.edu Sat Nov 27 12:37:20 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 12:37:20 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasSetTracker.h Message-ID: <200411271837.iARIbKJu008231@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasSetTracker.h updated: 1.23 -> 1.24 --- Log message: Change interface to this method a bit --- Diffs of the changes: (+1 -1) Index: llvm/include/llvm/Analysis/AliasSetTracker.h diff -u llvm/include/llvm/Analysis/AliasSetTracker.h:1.23 llvm/include/llvm/Analysis/AliasSetTracker.h:1.24 --- llvm/include/llvm/Analysis/AliasSetTracker.h:1.23 Fri Nov 26 15:36:17 2004 +++ llvm/include/llvm/Analysis/AliasSetTracker.h Sat Nov 27 12:37:04 2004 @@ -146,7 +146,7 @@ /// mergeSetIn - Merge the specified alias set into this alias set... /// - void mergeSetIn(AliasSet &AS); + void mergeSetIn(AliasSet &AS, AliasSetTracker &AST); // Alias Set iteration - Allow access to all of the pointer which are part of // this alias set... From lattner at cs.uiuc.edu Sat Nov 27 12:37:55 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 12:37:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasSetTracker.cpp Message-ID: <200411271837.iARIbtaj008243@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasSetTracker.cpp updated: 1.30 -> 1.31 --- Log message: When merging to alias sets, if they are both must alias, the result is not a must alias set unless all of the pointers in the resultant set are must aliased together. --- Diffs of the changes: (+22 -8) Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.30 llvm/lib/Analysis/AliasSetTracker.cpp:1.31 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.30 Fri Nov 26 15:36:25 2004 +++ llvm/lib/Analysis/AliasSetTracker.cpp Sat Nov 27 12:37:42 2004 @@ -21,9 +21,9 @@ #include using namespace llvm; -/// mergeSetIn - Merge the specified alias set into this alias set... +/// mergeSetIn - Merge the specified alias set into this alias set. /// -void AliasSet::mergeSetIn(AliasSet &AS) { +void AliasSet::mergeSetIn(AliasSet &AS, AliasSetTracker &AST) { assert(!AS.Forward && "Alias set is already forwarding!"); assert(!Forward && "This set is a forwarding set!!"); @@ -31,6 +31,20 @@ AccessTy |= AS.AccessTy; AliasTy |= AS.AliasTy; + if (AliasTy == MustAlias) { + // Check that these two merged sets really are must aliases. Since both + // used to be must-alias sets, we can just check any pointer from each set + // for aliasing. + AliasAnalysis &AA = AST.getAliasAnalysis(); + HashNodePair *L = getSomePointer(); + HashNodePair *R = AS.getSomePointer(); + + // If the pointers are not a must-alias pair, this set becomes a may alias. + if (AA.alias(L->first, L->second.getSize(), R->first, R->second.getSize()) + != AliasAnalysis::MustAlias) + AliasTy = MayAlias; + } + if (CallSites.empty()) { // Merge call sites... if (!AS.CallSites.empty()) std::swap(CallSites, AS.CallSites); @@ -179,10 +193,10 @@ AliasSet *FoundSet = 0; for (iterator I = begin(), E = end(); I != E; ++I) if (!I->Forward && I->aliasesPointer(Ptr, Size, AA)) { - if (FoundSet == 0) { // If this is the first alias set ptr can go into... + if (FoundSet == 0) { // If this is the first alias set ptr can go into. FoundSet = I; // Remember it. - } else { // Otherwise, we must merge the sets... - FoundSet->mergeSetIn(*I); // Merge in contents... + } else { // Otherwise, we must merge the sets. + FoundSet->mergeSetIn(*I, *this); // Merge in contents. } } @@ -205,10 +219,10 @@ AliasSet *FoundSet = 0; for (iterator I = begin(), E = end(); I != E; ++I) if (!I->Forward && I->aliasesCallSite(CS, AA)) { - if (FoundSet == 0) { // If this is the first alias set ptr can go into... + if (FoundSet == 0) { // If this is the first alias set ptr can go into. FoundSet = I; // Remember it. - } else if (!I->Forward) { // Otherwise, we must merge the sets... - FoundSet->mergeSetIn(*I); // Merge in contents... + } else if (!I->Forward) { // Otherwise, we must merge the sets. + FoundSet->mergeSetIn(*I, *this); // Merge in contents. } } From lattner at cs.uiuc.edu Sat Nov 27 13:18:28 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:28 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/amiga/Makefile.pup Makefile.sas Message-ID: <200411271918.iARJISIE009489@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/amiga: Makefile.pup (r1.1) removed Makefile.sas (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:44 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/vstudio/readme.txt Message-ID: <200411271918.iARJIiJk009666@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/vstudio: readme.txt (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:43 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/pascal/example.pas readme.txt zlibd32.mak zlibpas.pas Message-ID: <200411271918.iARJIhSB009640@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/pascal: example.pas (r1.1) removed readme.txt (r1.1) removed zlibd32.mak (r1.1) removed zlibpas.pas (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:43 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/masm686/match.asm Message-ID: <200411271918.iARJIhnt009615@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/masm686: match.asm (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:45 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:45 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/old/Make_vms.com Makefile.riscos README descrip.mms zlib.html Message-ID: <200411271918.iARJIjMq009708@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/old: Make_vms.com (r1.1) removed Makefile.riscos (r1.1) removed README (r1.1) removed descrip.mms (r1.1) removed zlib.html (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:44 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/vstudio/vc7/gvmat32.obj inffas32.obj miniunz.vcproj minizip.vcproj zlib.rc zlibstat.vcproj zlibvc.def zlibvc.sln zlibvc.vcproj Message-ID: <200411271918.iARJIiDF009691@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/vstudio/vc7: gvmat32.obj (r1.1) removed inffas32.obj (r1.1) removed miniunz.vcproj (r1.1) removed minizip.vcproj (r1.1) removed zlib.rc (r1.1) removed zlibstat.vcproj (r1.1) removed zlibvc.def (r1.1) removed zlibvc.sln (r1.1) removed zlibvc.vcproj (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:43 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/minizip/ChangeLogUnzip Makefile crypt.h ioapi.c ioapi.h iowin32.c iowin32.h miniunz.c minizip.c unzip.c unzip.h zip.c zip.h Message-ID: <200411271918.iARJIhgK009647@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/minizip: ChangeLogUnzip (r1.1) removed Makefile (r1.1) removed crypt.h (r1.1) removed ioapi.c (r1.1) removed ioapi.h (r1.1) removed iowin32.c (r1.1) removed iowin32.h (r1.1) removed miniunz.c (r1.1) removed minizip.c (r1.1) removed unzip.c (r1.1) removed unzip.h (r1.1) removed zip.c (r1.1) removed zip.h (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:42 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/iostream2/zstream.h zstream_test.cpp Message-ID: <200411271918.iARJIgYT009601@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/iostream2: zstream.h (r1.1) removed zstream_test.cpp (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:41 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:41 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/asm686/README.686 match.S Message-ID: <200411271918.iARJIfxn009559@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/asm686: README.686 (r1.1) removed match.S (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:44 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/testzlib/testzlib.c testzlib.sln testzlib.vcproj Message-ID: <200411271918.iARJIi3G009659@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/testzlib: testzlib.c (r1.1) removed testzlib.sln (r1.1) removed testzlib.vcproj (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:41 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:41 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/delphi/ZLib.pas ZLibConst.pas readme.txt zlibd32.mak Message-ID: <200411271918.iARJIfTs009565@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/delphi: ZLib.pas (r1.1) removed ZLibConst.pas (r1.1) removed readme.txt (r1.1) removed zlibd32.mak (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:42 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/inflate86/inffas86.c inffast.S Message-ID: <200411271918.iARJIgVc009582@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/inflate86: inffas86.c (r1.1) removed inffast.S (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:43 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/iostream3/README TODO test.cc zfstream.cc zfstream.h Message-ID: <200411271918.iARJIhx2009608@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/iostream3: README (r1.1) removed TODO (r1.1) removed test.cc (r1.1) removed zfstream.cc (r1.1) removed zfstream.h (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:42 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/iostream/test.cpp zfstream.cpp zfstream.h Message-ID: <200411271918.iARJIgSc009588@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/iostream: test.cpp (r1.1) removed zfstream.cpp (r1.1) removed zfstream.h (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:45 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:45 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/asm586/README.586 match.S Message-ID: <200411271918.iARJIj0X009730@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/asm586: README.586 (r1.1) removed match.S (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:45 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:45 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/blast/Makefile README blast.c blast.h test.pk test.txt Message-ID: <200411271918.iARJIjPT009735@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/blast: Makefile (r1.1) removed README (r1.1) removed blast.c (r1.1) removed blast.h (r1.1) removed test.pk (r1.1) removed test.txt (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:42 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/masmx86/gvmat32.asm gvmat32c.c inffas32.asm mkasm.bat readme.txt Message-ID: <200411271918.iARJIgCF009624@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/masmx86: gvmat32.asm (r1.1) removed gvmat32c.c (r1.1) removed inffas32.asm (r1.1) removed mkasm.bat (r1.1) removed readme.txt (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:45 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:45 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/old/os2/Makefile.os2 zlib.def Message-ID: <200411271918.iARJIjFt009712@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/old/os2: Makefile.os2 (r1.1) removed zlib.def (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:37 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:37 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/README.contrib visual-basic.txt Message-ID: <200411271918.iARJIbcR009549@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib: README.contrib (r1.1) removed visual-basic.txt (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:20:35 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:20:35 -0600 Subject: [llvm-commits] CVS: llvm/LICENSE.TXT Message-ID: <200411271920.iARJKZ0C009880@apoc.cs.uiuc.edu> Changes in directory llvm: LICENSE.TXT updated: 1.22 -> 1.23 --- Log message: Add bzip2 --- Diffs of the changes: (+1 -1) Index: llvm/LICENSE.TXT diff -u llvm/LICENSE.TXT:1.22 llvm/LICENSE.TXT:1.23 --- llvm/LICENSE.TXT:1.22 Sat Nov 27 13:19:44 2004 +++ llvm/LICENSE.TXT Sat Nov 27 13:20:23 2004 @@ -64,9 +64,9 @@ System Library llvm/lib/System Compiler Driver llvm/tools/llvmc PowerPC Backend llvm/lib/Target/PowerPC +bzip2: llvm/lib/Support/bzip2/LICENSE Autoconf: llvm/autoconf llvm/projects/ModuleMaker/autoconf llvm/projects/sample/autoconf Burg: llvm/utils/Burg GNU Libc: llvm/runtime/GCCLibraries/libc - From lattner at cs.uiuc.edu Sat Nov 27 13:18:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:42 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/as400/bndsrc compile.clp readme.txt zlib.inc Message-ID: <200411271918.iARJIgG5009578@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/as400: bndsrc (r1.1) removed compile.clp (r1.1) removed readme.txt (r1.1) removed zlib.inc (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:24:20 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:24:20 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411271924.iARJOKdZ009908@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.258 -> 1.259 --- Log message: Add some notes --- Diffs of the changes: (+4 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.258 llvm/docs/ReleaseNotes.html:1.259 --- llvm/docs/ReleaseNotes.html:1.258 Thu Nov 25 16:43:58 2004 +++ llvm/docs/ReleaseNotes.html Sat Nov 27 13:24:06 2004 @@ -86,6 +86,7 @@
        +
      1. LLVM now includes a JIT for the PowerPC target.
      2. LLVM now optimizes global variables significantly more than it did before.
      3. @@ -139,6 +140,8 @@
      4. The target-to-JIT interfaces are now much simpler and more powerful.
      5. +
      6. zlib and libpng are no longer + included in the main LLVM tarball.
      @@ -705,7 +708,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/25 22:43:58 $ + Last modified: $Date: 2004/11/27 19:24:06 $ From lattner at cs.uiuc.edu Sat Nov 27 13:18:59 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:59 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/ChangeLog FAQ INDEX LICENSE.TXT Makefile Makefile.orig README adler32.c algorithm.txt compress.c configure crc32.c crc32.h deflate.c deflate.h example.c gzio.c infback.c inffast.c inffast.h inffixed.h inflate.c inflate.h inftrees.c inftrees.h minigzip.c trees.c trees.h uncompr.c zconf.h zconf.in.h zlib.3 zlib.h zutil.c zutil.h Message-ID: <200411271918.iARJIx3e009821@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib: ChangeLog (r1.1) removed FAQ (r1.1) removed INDEX (r1.1) removed LICENSE.TXT (r1.1) removed Makefile (r1.3) removed Makefile.orig (r1.1) removed README (r1.1) removed adler32.c (r1.1) removed algorithm.txt (r1.1) removed compress.c (r1.1) removed configure (r1.1) removed crc32.c (r1.1) removed crc32.h (r1.1) removed deflate.c (r1.1) removed deflate.h (r1.1) removed example.c (r1.1) removed gzio.c (r1.1) removed infback.c (r1.1) removed inffast.c (r1.1) removed inffast.h (r1.1) removed inffixed.h (r1.1) removed inflate.c (r1.1) removed inflate.h (r1.1) removed inftrees.c (r1.1) removed inftrees.h (r1.1) removed minigzip.c (r1.1) removed trees.c (r1.1) removed trees.h (r1.1) removed uncompr.c (r1.1) removed zconf.h (r1.1) removed zconf.in.h (r1.1) removed zlib.3 (r1.1) removed zlib.h (r1.1) removed zutil.c (r1.1) removed zutil.h (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:42 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/infback9/README infback9.c infback9.h inffix9.h inflate9.h inftree9.c inftree9.h Message-ID: <200411271918.iARJIgkj009577@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/infback9: README (r1.1) removed infback9.c (r1.1) removed infback9.h (r1.1) removed inffix9.h (r1.1) removed inflate9.h (r1.1) removed inftree9.c (r1.1) removed inftree9.h (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:44 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/untgz/Makefile Makefile.msc untgz.c Message-ID: <200411271918.iARJIiJR009664@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/untgz: Makefile (r1.1) removed Makefile.msc (r1.1) removed untgz.c (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:19:57 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:19:57 -0600 Subject: [llvm-commits] CVS: llvm/LICENSE.TXT Message-ID: <200411271919.iARJJvbN009864@apoc.cs.uiuc.edu> Changes in directory llvm: LICENSE.TXT updated: 1.21 -> 1.22 --- Log message: These have been removed --- Diffs of the changes: (+0 -2) Index: llvm/LICENSE.TXT diff -u llvm/LICENSE.TXT:1.21 llvm/LICENSE.TXT:1.22 --- llvm/LICENSE.TXT:1.21 Thu Sep 16 11:41:31 2004 +++ llvm/LICENSE.TXT Sat Nov 27 13:19:44 2004 @@ -69,6 +69,4 @@ llvm/projects/sample/autoconf Burg: llvm/utils/Burg GNU Libc: llvm/runtime/GCCLibraries/libc -Zlib Library: llvm/runtime/zlib -PNG Library: llvm/runtime/libpng From lattner at cs.uiuc.edu Sat Nov 27 13:18:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:42 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/ada/mtest.adb read.adb readme.txt test.adb zlib-streams.adb zlib-streams.ads zlib-thin.adb zlib-thin.ads zlib.adb zlib.ads zlib.gpr Message-ID: <200411271918.iARJIgA3009613@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/ada: mtest.adb (r1.1) removed read.adb (r1.1) removed readme.txt (r1.1) removed test.adb (r1.1) removed zlib-streams.adb (r1.1) removed zlib-streams.ads (r1.1) removed zlib-thin.adb (r1.1) removed zlib-thin.ads (r1.1) removed zlib.adb (r1.1) removed zlib.ads (r1.1) removed zlib.gpr (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:42 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/gzappend/gzappend.c Message-ID: <200411271918.iARJIgcp009568@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/gzappend: gzappend.c (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:45 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:45 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/qnx/package.qpg Message-ID: <200411271918.iARJIjDN009715@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/qnx: package.qpg (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:44 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/contrib/puff/Makefile README puff.c puff.h zeros.raw Message-ID: <200411271918.iARJIiCQ009654@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/contrib/puff: Makefile (r1.1) removed README (r1.1) removed puff.c (r1.1) removed puff.h (r1.1) removed zeros.raw (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:45 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:45 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/win32/DLL_FAQ.txt Makefile.bor Makefile.emx Makefile.gcc Makefile.msc zlib.def zlib1.rc Message-ID: <200411271918.iARJIjhw009724@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/win32: DLL_FAQ.txt (r1.1) removed Makefile.bor (r1.1) removed Makefile.emx (r1.1) removed Makefile.gcc (r1.1) removed Makefile.msc (r1.1) removed zlib.def (r1.1) removed zlib1.rc (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:18:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:18:44 -0600 Subject: [llvm-commits] CVS: llvm/runtime/zlib/msdos/Makefile.bor Makefile.dj2 Makefile.emx Makefile.msc Makefile.tc Message-ID: <200411271918.iARJIilu009698@apoc.cs.uiuc.edu> Changes in directory llvm/runtime/zlib/msdos: Makefile.bor (r1.1) removed Makefile.dj2 (r1.1) removed Makefile.emx (r1.1) removed Makefile.msc (r1.1) removed Makefile.tc (r1.1) removed --- Log message: Remove zlib from the llvm tarball. This is only used (in theory by povray-31 which is part of llvm-test). If anyone is interested in adding it to llvm-test, feel free to go for it. This is part of PR417: http://llvm.cs.uiuc.edu/PR417 --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sat Nov 27 13:44:22 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:44:22 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2004-11-27-InvalidConstantExpr.c Message-ID: <200411271944.iARJiMbk010097@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2004-11-27-InvalidConstantExpr.c added (r1.1) --- Log message: New testcase for PR424: http://llvm.cs.uiuc.edu/PR424 --- Diffs of the changes: (+10 -0) Index: llvm/test/Regression/CFrontend/2004-11-27-InvalidConstantExpr.c diff -c /dev/null llvm/test/Regression/CFrontend/2004-11-27-InvalidConstantExpr.c:1.1 *** /dev/null Sat Nov 27 13:44:18 2004 --- llvm/test/Regression/CFrontend/2004-11-27-InvalidConstantExpr.c Sat Nov 27 13:44:07 2004 *************** *** 0 **** --- 1,10 ---- + // RUN: %llvmgcc %s -S -o - | not grep 'foo\* sub' + // This should not produce a subtrace constantexpr of a pointer + struct foo { + int Y; + char X[100]; + } F; + + int test(char *Y) { + return Y - F.X; + } From lattner at cs.uiuc.edu Sat Nov 27 13:45:28 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:45:28 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200411271945.iARJjS69010687@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.61 -> 1.62 --- Log message: Fix test/Regression/CFrontend/2004-11-27-InvalidConstantExpr.c and PR424: http://llvm.cs.uiuc.edu/PR424 --- Diffs of the changes: (+6 -0) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.61 llvm-gcc/gcc/llvm-expand.c:1.62 --- llvm-gcc/gcc/llvm-expand.c:1.61 Wed Nov 24 12:53:53 2004 +++ llvm-gcc/gcc/llvm-expand.c Sat Nov 27 13:45:12 2004 @@ -99,6 +99,9 @@ int AllOperandsConstant = 1; /* Scan for non-constant operands */ unsigned i; + if (I->Opcode == O_Sub) + assert(D2V(I)->Ty->ID != PointerTyID); + if (I->Opcode == O_Shl || I->Opcode == O_Shr) { assert(llvm_type_is_integral(I->Operands[0]->Ty) && I->Operands[0]->Ty != BoolTy); @@ -6096,6 +6099,9 @@ case NEGATE_EXPR: /* -A === 0-A */ op1 = llvm_expand_expr(Fn, TREE_OPERAND(exp, 0), 0); + if (op1->Ty->ID == PointerTyID) + op1 = cast_if_type_not_equal(Fn, op1, IntPtrTy); + if (!llvm_type_is_fp(op1->Ty)) op0 = llvm_constant_get_null(op1->Ty); else From lattner at cs.uiuc.edu Sat Nov 27 13:51:13 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 13:51:13 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411271951.iARJpDdI010721@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.259 -> 1.260 --- Log message: Add notes --- Diffs of the changes: (+6 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.259 llvm/docs/ReleaseNotes.html:1.260 --- llvm/docs/ReleaseNotes.html:1.259 Sat Nov 27 13:24:06 2004 +++ llvm/docs/ReleaseNotes.html Sat Nov 27 13:50:58 2004 @@ -142,6 +142,9 @@
    • zlib and libpng are no longer included in the main LLVM tarball.
    • +
    • The LLVM code generator now generates asm writers for the target from + an abstract target description, instead of requiring them to be hand + written.
    • @@ -254,6 +257,8 @@ cannot be marked 'constant' if they have nontrivial ctors or dtors
    • [llvmgcc] Crash compiling unnamed bitfield which does not increase struct size
    • +
    • [llvmgcc] llvmgcc emits invalid + constant exprs
    • Bugs fixed in the Sparc V9 back-end:

      @@ -708,7 +713,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/27 19:24:06 $ + Last modified: $Date: 2004/11/27 19:50:58 $ From lattner at cs.uiuc.edu Sat Nov 27 14:31:28 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 14:31:28 -0600 Subject: [llvm-commits] CVS: llvm/test/TestRunner.sh Message-ID: <200411272031.iARKVS5q012478@apoc.cs.uiuc.edu> Changes in directory llvm/test: TestRunner.sh updated: 1.7 -> 1.8 --- Log message: Pass in llvmgxx --- Diffs of the changes: (+1 -1) Index: llvm/test/TestRunner.sh diff -u llvm/test/TestRunner.sh:1.7 llvm/test/TestRunner.sh:1.8 --- llvm/test/TestRunner.sh:1.7 Sat Apr 10 01:03:22 2004 +++ llvm/test/TestRunner.sh Sat Nov 27 14:31:14 2004 @@ -30,7 +30,7 @@ ulimit -t 40 SCRIPT=$OUTPUT.script -grep 'RUN:' $FILENAME | sed "s|^.*RUN:\(.*\)$|\1|g;s|%s|$SUBST|g;s|%llvmgcc|llvmgcc|g" > $SCRIPT +grep 'RUN:' $FILENAME | sed "s|^.*RUN:\(.*\)$|\1|g;s|%s|$SUBST|g;s|%llvmgcc|llvmgcc|g;s|%llvmgxx|llvmg++|g" > $SCRIPT /bin/sh $SCRIPT > $OUTPUT 2>&1 || ( From lattner at cs.uiuc.edu Sat Nov 27 14:32:11 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 14:32:11 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2004-11-27-EmitsUnusedInlineFunctions.cpp Message-ID: <200411272032.iARKWB4s012493@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2004-11-27-EmitsUnusedInlineFunctions.cpp added (r1.1) --- Log message: New testcase --- Diffs of the changes: (+7 -0) Index: llvm/test/Regression/C++Frontend/2004-11-27-EmitsUnusedInlineFunctions.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2004-11-27-EmitsUnusedInlineFunctions.cpp:1.1 *** /dev/null Sat Nov 27 14:32:09 2004 --- llvm/test/Regression/C++Frontend/2004-11-27-EmitsUnusedInlineFunctions.cpp Sat Nov 27 14:31:59 2004 *************** *** 0 **** --- 1,7 ---- + // The C++ front-end was emitting WAY too many inline functions. This test + // verifies that it does not emit the body of getchar, because it is not used. + // This corresponds to PR459 + + // RUN: %llvmgxx %s -S -o - | not grep '^int .getchar' + + #include From lattner at cs.uiuc.edu Sat Nov 27 14:33:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 14:33:01 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c llvm-representation.c Message-ID: <200411272033.iARKX1gb012507@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.62 -> 1.63 llvm-representation.c updated: 1.11 -> 1.12 --- Log message: Adjust horrible code to match what GCC is doing now. This fixes PR459: http://llvm.cs.uiuc.edu/PR459 and test/Regression/C++Frontend/2004-11-27-EmitsUnusedInlineFunctions.cpp. --- Diffs of the changes: (+4 -7) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.62 llvm-gcc/gcc/llvm-expand.c:1.63 --- llvm-gcc/gcc/llvm-expand.c:1.62 Sat Nov 27 13:45:12 2004 +++ llvm-gcc/gcc/llvm-expand.c Sat Nov 27 14:32:49 2004 @@ -7090,12 +7090,6 @@ if (!DECL_LLVM_SET_P(decl)) llvm_make_decl_llvm(decl, asmspec); - - if (DECL_LLVM_SET_P(decl)) { /* Ignore builtin functions */ - /* This horrible code mirrors code found in varasm.c:assemble_name */ - if (!llvm_value_is_global(DECL_LLVM(decl))) abort(); - MarkNameAsUsed(DECL_LLVM(decl)->Name); - } } Index: llvm-gcc/gcc/llvm-representation.c diff -u llvm-gcc/gcc/llvm-representation.c:1.11 llvm-gcc/gcc/llvm-representation.c:1.12 --- llvm-gcc/gcc/llvm-representation.c:1.11 Sun Oct 17 23:15:45 2004 +++ llvm-gcc/gcc/llvm-representation.c Sat Nov 27 14:32:49 2004 @@ -249,13 +249,16 @@ fprintf(F, " to "); llvm_type_print(G2V(GV)->Ty, F); fprintf(F, ")"); - } else if (V->Name[0]) { fprintf(F, "%%%s", V->Name); } else if (!PrintType) { fprintf(stderr, "ERROR, didn't print ANYTHING for operand!"); abort(); } + + /* This horrible code mirrors code found in varasm.c:assemble_name */ + if (llvm_value_is_global(V)) + MarkNameAsUsed(V->Name); } /* llvm_constant implementation ******************************************** From lattner at cs.uiuc.edu Sat Nov 27 14:34:39 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 14:34:39 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411272034.iARKYdWE012534@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.260 -> 1.261 --- Log message: Bug fixed --- Diffs of the changes: (+3 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.260 llvm/docs/ReleaseNotes.html:1.261 --- llvm/docs/ReleaseNotes.html:1.260 Sat Nov 27 13:50:58 2004 +++ llvm/docs/ReleaseNotes.html Sat Nov 27 14:34:25 2004 @@ -259,6 +259,8 @@ bitfield which does not increase struct size
    • [llvmgcc] llvmgcc emits invalid constant exprs
    • +
    • [llvmg++] C++ frontend is expanding + lots of unused inline functions
    • Bugs fixed in the Sparc V9 back-end:

      @@ -713,7 +715,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/27 19:50:58 $ + Last modified: $Date: 2004/11/27 20:34:25 $ From lattner at cs.uiuc.edu Sat Nov 27 15:29:57 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 15:29:57 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411272129.iARLTvkj013860@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.261 -> 1.262 --- Log message: Mention dj --- Diffs of the changes: (+2 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.261 llvm/docs/ReleaseNotes.html:1.262 --- llvm/docs/ReleaseNotes.html:1.261 Sat Nov 27 14:34:25 2004 +++ llvm/docs/ReleaseNotes.html Sat Nov 27 15:29:43 2004 @@ -145,6 +145,7 @@
    • The LLVM code generator now generates asm writers for the target from an abstract target description, instead of requiring them to be hand written.
    • +
    • LLVM regression and feature tests can now be run with DejaGNU.
    • @@ -715,7 +716,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/27 20:34:25 $ + Last modified: $Date: 2004/11/27 21:29:43 $ From lattner at cs.uiuc.edu Sat Nov 27 15:33:40 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 15:33:40 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411272133.iARLXeok013949@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.262 -> 1.263 --- Log message: Move this to the QOI section --- Diffs of the changes: (+3 -3) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.262 llvm/docs/ReleaseNotes.html:1.263 --- llvm/docs/ReleaseNotes.html:1.262 Sat Nov 27 15:29:43 2004 +++ llvm/docs/ReleaseNotes.html Sat Nov 27 15:33:28 2004 @@ -194,6 +194,8 @@ the library libasmparser.a in 1.3 has become libLLVMAsmParser.a in release 1.4. +
    • [llvmg++] C++ frontend is expanding + lots of unused inline functions
    • @@ -260,8 +262,6 @@ bitfield which does not increase struct size
    • [llvmgcc] llvmgcc emits invalid constant exprs
    • -
    • [llvmg++] C++ frontend is expanding - lots of unused inline functions
    • Bugs fixed in the Sparc V9 back-end:

      @@ -716,7 +716,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/27 21:29:43 $ + Last modified: $Date: 2004/11/27 21:33:28 $ From lattner at cs.uiuc.edu Sat Nov 27 15:52:29 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 15:52:29 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200411272152.iARLqToc014349@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.63 -> 1.64 --- Log message: Save 4 bytes in the llvm_goto_fixup struct but packing bit fields into bits. Make llvm_fixup_list_dump a bit nicer. --- Diffs of the changes: (+6 -5) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.63 llvm-gcc/gcc/llvm-expand.c:1.64 --- llvm-gcc/gcc/llvm-expand.c:1.63 Sat Nov 27 14:32:49 2004 +++ llvm-gcc/gcc/llvm-expand.c Sat Nov 27 15:52:17 2004 @@ -645,13 +645,13 @@ /* Information about what happens if a cleanup expression throws an exception. See llvm_expand_goto_internal for information about this flag. */ - int CleanupsCanThrow; + int CleanupsCanThrow : 1; /* Information about whether this goto is part of an exception propagation. * If so, cleanups which are only supposed to be run on exception exits are * expanded. */ - int isExceptionEdge; + int isExceptionEdge : 1; /* List of cleanup expressions to be run by this goto in the current block. * This list ONLY includes cleanups in the current block: when the current @@ -775,10 +775,11 @@ void llvm_fixup_list_dump(llvm_function *Fn) { llvm_goto_fixup *f = Fn->ExpandInfo->GotoFixupList; for (; f; f = f->next) { - fprintf(stderr, "Fixup [%p]: to bb %%%s cct: %d iee: %d cleanups: %p" + fprintf(stderr, "Fixup [%p]: to bb %%%s cct: %s iee: %s cleanups: %p" " containing_block: %p\n", (void*)f, D2V(f->target_bb)->Name, - f->CleanupsCanThrow, f->isExceptionEdge, (void*)f->cleanup_list, - (void*)f->containing_block); + f->CleanupsCanThrow ? "Yes" : "No", + f->isExceptionEdge ? "Yes" : "No", + (void*)f->cleanup_list, (void*)f->containing_block); } } From reid at x10sys.com Sat Nov 27 16:00:08 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 27 Nov 2004 16:00:08 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/m4/c_printf_a.m4 Message-ID: <200411272200.QAA06225@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: c_printf_a.m4 updated: 1.3 -> 1.4 --- Log message: Get the cache variable name right. --- Diffs of the changes: (+5 -5) Index: llvm/autoconf/m4/c_printf_a.m4 diff -u llvm/autoconf/m4/c_printf_a.m4:1.3 llvm/autoconf/m4/c_printf_a.m4:1.4 --- llvm/autoconf/m4/c_printf_a.m4:1.3 Wed Nov 24 22:43:01 2004 +++ llvm/autoconf/m4/c_printf_a.m4 Sat Nov 27 15:59:57 2004 @@ -3,7 +3,7 @@ # This is modified from: # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html AC_DEFUN([AC_C_PRINTF_A], -[AC_CACHE_CHECK([if printf has the %a format character],[ac_cv_printf_a], +[AC_CACHE_CHECK([if printf has the %a format character],[llvm_cv_c_printf_a], [AC_LANG_PUSH([C]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ @@ -21,11 +21,11 @@ if (A != 0x1.999999999999ap-4) return (1); return (0);]])], - ac_c_printf_a=yes, - ac_c_printf_a=no, - ac_c_printf_a=no) + llvm_cv_c_printf_a=yes, + llvmac_cv_c_printf_a=no, + llvmac_cv_c_printf_a=no) AC_LANG_POP([C])]) - if test "$ac_cv_printf_a" = "yes"; then + if test "$llvm_cv_c_printf_a" = "yes"; then AC_DEFINE([HAVE_PRINTF_A],[1],[Define to have the %a format string]) fi ]) From reid at x10sys.com Sat Nov 27 16:01:53 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 27 Nov 2004 16:01:53 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200411272201.QAA06278@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.134 -> 1.135 --- Log message: Remove a dead check at the end of the configure script that was a left over from the bzip2 support. This dead check produced the error: test: -ne: unary operator expected --- Diffs of the changes: (+0 -9) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.134 llvm/autoconf/configure.ac:1.135 --- llvm/autoconf/configure.ac:1.134 Thu Nov 25 14:21:53 2004 +++ llvm/autoconf/configure.ac Sat Nov 27 16:01:42 2004 @@ -556,15 +556,6 @@ dnl Finally, crank out the output AC_OUTPUT -dnl Warn if we don't have a compression library -if test $bzip2_found -ne 1 ; then - if test $zlib_found -ne 1 ; then - AC_MSG_WARN([*** Neither zlib nor bzip2 compression libraries were found.]) - AC_MSG_WARN([*** Bytecode archives will not support compression!]) - AC_MSG_WARN([*** To correct, install the libraries and and re-run configure.]) - fi -fi - dnl Warn loudly if llvm-gcc was not obviously working if test "$llvm_cv_llvmgcc_sanity" = "no" ; then AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not]) From reid at x10sys.com Sat Nov 27 16:01:53 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 27 Nov 2004 16:01:53 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200411272201.QAA06275@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.141 -> 1.142 --- Log message: Remove a dead check at the end of the configure script that was a left over from the bzip2 support. This dead check produced the error: test: -ne: unary operator expected --- Diffs of the changes: (+7 -18) Index: llvm/configure diff -u llvm/configure:1.141 llvm/configure:1.142 --- llvm/configure:1.141 Thu Nov 25 14:21:53 2004 +++ llvm/configure Sat Nov 27 16:01:43 2004 @@ -22879,7 +22879,7 @@ echo "$as_me:$LINENO: checking if printf has the %a format character" >&5 echo $ECHO_N "checking if printf has the %a format character... $ECHO_C" >&6 -if test "${ac_cv_printf_a+set}" = set; then +if test "${llvm_cv_c_printf_a+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c @@ -22889,7 +22889,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$cross_compiling" = yes; then - ac_c_printf_a=no + llvmac_cv_c_printf_a=no else cat >conftest.$ac_ext <<_ACEOF @@ -22932,14 +22932,14 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_c_printf_a=yes + llvm_cv_c_printf_a=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -ac_c_printf_a=no +llvmac_cv_c_printf_a=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -22950,9 +22950,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_printf_a" >&5 -echo "${ECHO_T}$ac_cv_printf_a" >&6 - if test "$ac_cv_printf_a" = "yes"; then +echo "$as_me:$LINENO: result: $llvm_cv_c_printf_a" >&5 +echo "${ECHO_T}$llvm_cv_c_printf_a" >&6 + if test "$llvm_cv_c_printf_a" = "yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_PRINTF_A 1 @@ -27244,17 +27244,6 @@ fi -if test $bzip2_found -ne 1 ; then - if test $zlib_found -ne 1 ; then - { echo "$as_me:$LINENO: WARNING: *** Neither zlib nor bzip2 compression libraries were found." >&5 -echo "$as_me: WARNING: *** Neither zlib nor bzip2 compression libraries were found." >&2;} - { echo "$as_me:$LINENO: WARNING: *** Bytecode archives will not support compression!" >&5 -echo "$as_me: WARNING: *** Bytecode archives will not support compression!" >&2;} - { echo "$as_me:$LINENO: WARNING: *** To correct, install the libraries and and re-run configure." >&5 -echo "$as_me: WARNING: *** To correct, install the libraries and and re-run configure." >&2;} - fi -fi - if test "$llvm_cv_llvmgcc_sanity" = "no" ; then { echo "$as_me:$LINENO: WARNING: ***** llvm C/C++ front end was not found, or does not" >&5 echo "$as_me: WARNING: ***** llvm C/C++ front end was not found, or does not" >&2;} From lattner at cs.uiuc.edu Sat Nov 27 16:44:05 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 16:44:05 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2004-11-27-ExceptionCleanupAssertion.cpp Message-ID: <200411272244.iARMi5uU016263@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2004-11-27-ExceptionCleanupAssertion.cpp added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+14 -0) Index: llvm/test/Regression/C++Frontend/2004-11-27-ExceptionCleanupAssertion.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2004-11-27-ExceptionCleanupAssertion.cpp:1.1 *** /dev/null Sat Nov 27 16:44:01 2004 --- llvm/test/Regression/C++Frontend/2004-11-27-ExceptionCleanupAssertion.cpp Sat Nov 27 16:43:51 2004 *************** *** 0 **** --- 1,14 ---- + // RUN: %llvmgxx %s -S -o /dev/null + + // This is PR421 + + struct Strongbad { + Strongbad(const char *str ); + ~Strongbad(); + operator const char *() const; + }; + + void TheCheat () { + Strongbad foo(0); + Strongbad dirs[] = { Strongbad(0) + 1}; + } From lattner at cs.uiuc.edu Sat Nov 27 16:44:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 16:44:42 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200411272244.iARMignZ016274@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.64 -> 1.65 --- Log message: Relax an assertion a bit, fixing PR421: http://llvm.cs.uiuc.edu/PR421 and test/Regression/C++Frontend/2004-11-27-ExceptionCleanupAssertion.cpp --- Diffs of the changes: (+11 -2) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.64 llvm-gcc/gcc/llvm-expand.c:1.65 --- llvm-gcc/gcc/llvm-expand.c:1.64 Sat Nov 27 15:52:17 2004 +++ llvm-gcc/gcc/llvm-expand.c Sat Nov 27 16:44:30 2004 @@ -1114,8 +1114,17 @@ if (f->target_bb == BB) { /* Unlink this fixup */ *fl = f->next; - assert(f->containing_block == InnermostCleanupScope && - "Eliminating fixup for non-current scope!"); + + /* This fixup should either be the current cleanup scope or one of the + * parents. We may think the cleanup scope is one of our parents + * because we skip scopes without any cleanups. + */ + if (f->containing_block != InnermostCleanupScope) { + llvm_nesting *ContScope = InnermostCleanupScope; + while (ContScope && f->containing_block != ContScope) + ContScope = ContScope->next; + assert(ContScope && "Eliminating fixup for non-current scope!"); + } free(f); } else { fl = &f->next; From lattner at cs.uiuc.edu Sat Nov 27 16:47:22 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 16:47:22 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411272247.iARMlMXl016310@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.263 -> 1.264 --- Log message: Bug fixed --- Diffs of the changes: (+3 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.263 llvm/docs/ReleaseNotes.html:1.264 --- llvm/docs/ReleaseNotes.html:1.263 Sat Nov 27 15:33:28 2004 +++ llvm/docs/ReleaseNotes.html Sat Nov 27 16:47:08 2004 @@ -262,6 +262,8 @@ bitfield which does not increase struct size
    • [llvmgcc] llvmgcc emits invalid constant exprs
    • +
    • [llvmg++] Crash in initializing + array with constructors in hard EH situations
    • Bugs fixed in the Sparc V9 back-end:

      @@ -716,7 +718,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/27 21:33:28 $ + Last modified: $Date: 2004/11/27 22:47:08 $ From lattner at cs.uiuc.edu Sat Nov 27 17:00:50 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 17:00:50 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-representation.c Message-ID: <200411272300.iARN0o8T017078@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-representation.c updated: 1.12 -> 1.13 --- Log message: Avoid calling MarkNameUsed unless we haven't already. --- Diffs of the changes: (+13 -2) Index: llvm-gcc/gcc/llvm-representation.c diff -u llvm-gcc/gcc/llvm-representation.c:1.12 llvm-gcc/gcc/llvm-representation.c:1.13 --- llvm-gcc/gcc/llvm-representation.c:1.12 Sat Nov 27 14:32:49 2004 +++ llvm-gcc/gcc/llvm-representation.c Sat Nov 27 17:00:36 2004 @@ -256,9 +256,20 @@ abort(); } - /* This horrible code mirrors code found in varasm.c:assemble_name */ - if (llvm_value_is_global(V)) + /* This horrible code mirrors code found in varasm.c:assemble_name. This code + * allows GCC to notice that we are emitting a reference to a function or + * global. If the fn/global is inline, this will cause its body to be + * compiled to LLVM and emitted. We only need to do this once for each + * global, and the MarkNameAsUsed code isn't particularly fast, so keep track + * of whether we've done this already or not. + */ + if (V->VTy == Function && !V2F(V)->MarkedNameUsed) { + V2F(V)->MarkedNameUsed = 1; + MarkNameAsUsed(V->Name); + } else if (V->VTy == GlobalVariable && !V2GV(V)->MarkedNameUsed) { + V2GV(V)->MarkedNameUsed = 1; MarkNameAsUsed(V->Name); + } } /* llvm_constant implementation ******************************************** From lattner at cs.uiuc.edu Sat Nov 27 17:00:58 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 17:00:58 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-representation.h Message-ID: <200411272300.iARN0wka017084@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-representation.h updated: 1.10 -> 1.11 --- Log message: Shrink globals by 4 bytes, add flags to keep track of whether we have called MarkNameAsUsed for the symbol yet. --- Diffs of the changes: (+6 -4) Index: llvm-gcc/gcc/llvm-representation.h diff -u llvm-gcc/gcc/llvm-representation.h:1.10 llvm-gcc/gcc/llvm-representation.h:1.11 --- llvm-gcc/gcc/llvm-representation.h:1.10 Sun Oct 17 23:15:45 2004 +++ llvm-gcc/gcc/llvm-representation.h Sat Nov 27 17:00:16 2004 @@ -280,7 +280,8 @@ */ struct llvm_function *ForwardedFunction; - enum llvm_linkage Linkage; + enum llvm_linkage Linkage : 4; + int MarkedNameUsed : 1; char *PrettyFunctionName; } llvm_function; @@ -299,8 +300,11 @@ typedef struct llvm_global { llvm_constant ConstantBase; llvm_ilist_node(struct llvm_global, Globals); /* Part of Global list */ - int isConstant; /* Is the global immutable? */ llvm_constant *Init; /* Initializer or null for external */ + int isConstant : 1; /* Is the global immutable? */ + + enum llvm_linkage Linkage : 4; + int MarkedNameUsed : 1; /* ForwardedGlobal - This member is here only because we don't have a * replaceAllUsesWith equivalent in the C frontend. The C++ front-end expands @@ -311,8 +315,6 @@ */ struct llvm_global *ForwardedGlobal; - enum llvm_linkage Linkage; - char *PrettyGlobalName; } llvm_global; From lattner at cs.uiuc.edu Sat Nov 27 17:24:37 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 17:24:37 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2004-11-27-InlineAsmFunctionRedefinition.cpp Message-ID: <200411272324.iARNObV9018167@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2004-11-27-InlineAsmFunctionRedefinition.cpp added (r1.1) --- Log message: New testcase for PR397: http://llvm.cs.uiuc.edu/PR397 --- Diffs of the changes: (+26 -0) Index: llvm/test/Regression/C++Frontend/2004-11-27-InlineAsmFunctionRedefinition.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2004-11-27-InlineAsmFunctionRedefinition.cpp:1.1 *** /dev/null Sat Nov 27 17:24:33 2004 --- llvm/test/Regression/C++Frontend/2004-11-27-InlineAsmFunctionRedefinition.cpp Sat Nov 27 17:24:23 2004 *************** *** 0 **** --- 1,26 ---- + // RUN: %llvmgxx %s -S -o /dev/null + + // PR397 + + struct stat { }; + struct stat64 { }; + + extern "C" { + + extern int lstat(const char *, struct stat *) __asm__("lstat64"); + extern int lstat64(const char *, struct stat64 *); + + extern int __lxstat(int, const char *, struct stat *) __asm__("__lxstat64"); + extern int __lxstat64(int, const char *, struct stat64 *); + + extern __inline__ int lstat(const char *path, struct stat *statbuf) { + return __lxstat(3, path, statbuf); + } + extern __inline__ int lstat64(const char *path, struct stat64 *statbuf) { + return __lxstat64(3, path, statbuf); + } + } + + int do_one_file(void) { + return lstat(0, 0) + lstat64(0,0); + } From lattner at cs.uiuc.edu Sat Nov 27 17:25:08 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 17:25:08 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200411272325.iARNP8Lh018178@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.65 -> 1.66 --- Log message: Fix PR397: http://llvm.cs.uiuc.edu/PR397 , and test Regression/C++Frontend/2004-11-27-InlineAsmFunctionRedefinition.cpp This is horrible, just horrible. --- Diffs of the changes: (+1 -1) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.65 llvm-gcc/gcc/llvm-expand.c:1.66 --- llvm-gcc/gcc/llvm-expand.c:1.65 Sat Nov 27 16:44:30 2004 +++ llvm-gcc/gcc/llvm-expand.c Sat Nov 27 17:24:55 2004 @@ -6786,7 +6786,7 @@ * int main() { foo(); } * static void foo() {} // changes foo to be void() */ - { + if (Fn->ForwardedFunction == 0) { llvm_function *I = llvm_ilist_begin(TheProgram.Functions); for (; I; I = llvm_ilist_next(I)) if (I->ForwardedFunction == 0 && !strcmp(G2V(I)->Name, G2V(Fn)->Name) && From lattner at cs.uiuc.edu Sat Nov 27 17:27:40 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 17:27:40 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411272327.iARNReBP018206@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.264 -> 1.265 --- Log message: Bug fixed --- Diffs of the changes: (+3 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.264 llvm/docs/ReleaseNotes.html:1.265 --- llvm/docs/ReleaseNotes.html:1.264 Sat Nov 27 16:47:08 2004 +++ llvm/docs/ReleaseNotes.html Sat Nov 27 17:27:26 2004 @@ -264,6 +264,8 @@ constant exprs
    • [llvmg++] Crash in initializing array with constructors in hard EH situations
    • +
    • [llvm-gcc] Inline function + redefinitions error due to 'asm' function rename
    • Bugs fixed in the Sparc V9 back-end:

      @@ -718,7 +720,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/27 22:47:08 $ + Last modified: $Date: 2004/11/27 23:27:26 $ From lattner at cs.uiuc.edu Sat Nov 27 18:06:21 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 18:06:21 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2004-11-27-StaticFunctionRedeclare.c Message-ID: <200411280006.iAS06LHO019359@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2004-11-27-StaticFunctionRedeclare.c added (r1.1) --- Log message: New testcase for PR244: http://llvm.cs.uiuc.edu/PR244 --- Diffs of the changes: (+14 -0) Index: llvm/test/Regression/CFrontend/2004-11-27-StaticFunctionRedeclare.c diff -c /dev/null llvm/test/Regression/CFrontend/2004-11-27-StaticFunctionRedeclare.c:1.1 *** /dev/null Sat Nov 27 18:06:17 2004 --- llvm/test/Regression/CFrontend/2004-11-27-StaticFunctionRedeclare.c Sat Nov 27 18:06:07 2004 *************** *** 0 **** --- 1,14 ---- + // RUN: %llvmgcc -S 2004-11-27-StaticFunctionRedeclare.c -o - | gccas | llvm-dis | not grep 'declare int.*func' + + // There should not be an unresolved reference to func here. Believe it or not, + // the "expected result" is a function named 'func' which is internal and + // referenced by bar(). + + // This is PR244 + + static int func(); + void bar() { + int func(); + foo(func); + } + static int func(char** A, char ** B) {} From lattner at cs.uiuc.edu Sat Nov 27 18:07:39 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 18:07:39 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200411280007.iAS07d19019384@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.66 -> 1.67 --- Log message: Renaming was moved elsewhere in GCC, and one of our merges from the GCC tree didn't notice that this broke. This removes code to more closely match the make_decl_rtl function, which make_decl_llvm is supposed to match. This fixes CFrontend/2004-11-27-StaticFunctionRedeclare.c and PR244: http://llvm.cs.uiuc.edu/PR244 (again). --- Diffs of the changes: (+3 -20) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.66 llvm-gcc/gcc/llvm-expand.c:1.67 --- llvm-gcc/gcc/llvm-expand.c:1.66 Sat Nov 27 17:24:55 2004 +++ llvm-gcc/gcc/llvm-expand.c Sat Nov 27 18:07:26 2004 @@ -7012,7 +7012,7 @@ extern int decode_reg_name(const char *); void llvm_make_decl_llvm(tree decl, const char *asmspec) { int top_level = (DECL_CONTEXT (decl) == NULL_TREE); - const char *name = 0, *new_name = 0; + const char *name = 0; int reg_number; /* Check that we are not being given an automatic variable. */ @@ -7035,7 +7035,7 @@ if (DECL_LLVM_SET_P(decl)) return; - new_name = name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); + name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); reg_number = decode_reg_name (asmspec); if (reg_number == -2) { @@ -7044,7 +7044,7 @@ char *starred = alloca (strlen (asmspec) + 2); starred[0] = '*'; strcpy (starred + 1, asmspec); - new_name = starred; + SET_DECL_ASSEMBLER_NAME (decl, get_identifier (starred)); } if (TREE_CODE(decl) != FUNCTION_DECL && DECL_REGISTER(decl)) { @@ -7064,23 +7064,6 @@ if (TREE_CODE (decl) == VAR_DECL && DECL_WEAK (decl)) DECL_COMMON (decl) = 0; - /* Can't use just the variable's own name for a variable whose scope is less - than the whole file, unless it's a member of a local class (which will - already be unambiguous). Concatenate a distinguishing number. */ - if (!top_level && !TREE_PUBLIC (decl) - && !(DECL_CONTEXT (decl) && TYPE_P (DECL_CONTEXT (decl))) - && name == IDENTIFIER_POINTER (DECL_NAME (decl))) { - static int var_labelno = 0; - char *label = (char*)alloca(strlen(name) + 32); - sprintf(label, ".%s_%d", name, ++var_labelno); - new_name = label; - } - - if (name != new_name) { - SET_DECL_ASSEMBLER_NAME (decl, get_identifier (new_name)); - name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); - } - llvm_assemble_external(decl); } From lattner at cs.uiuc.edu Sat Nov 27 18:09:52 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 18:09:52 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411280009.iAS09qux019434@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.265 -> 1.266 --- Log message: Bug fixed --- Diffs of the changes: (+3 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.265 llvm/docs/ReleaseNotes.html:1.266 --- llvm/docs/ReleaseNotes.html:1.265 Sat Nov 27 17:27:26 2004 +++ llvm/docs/ReleaseNotes.html Sat Nov 27 18:09:38 2004 @@ -266,6 +266,8 @@ array with constructors in hard EH situations
    • [llvm-gcc] Inline function redefinitions error due to 'asm' function rename
    • +
    • [llvm-gcc] Error when an + implicitly external function is re-declared as static
    • Bugs fixed in the Sparc V9 back-end:

      @@ -720,7 +722,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/27 23:27:26 $ + Last modified: $Date: 2004/11/28 00:09:38 $ From lattner at cs.uiuc.edu Sat Nov 27 18:40:12 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 18:40:12 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2004-11-27-VariableSizeInStructure.c Message-ID: <200411280040.iAS0eCjR020016@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2004-11-27-VariableSizeInStructure.c added (r1.1) --- Log message: New testcase for PR360: http://llvm.cs.uiuc.edu/PR360 --- Diffs of the changes: (+11 -0) Index: llvm/test/Regression/CFrontend/2004-11-27-VariableSizeInStructure.c diff -c /dev/null llvm/test/Regression/CFrontend/2004-11-27-VariableSizeInStructure.c:1.1 *** /dev/null Sat Nov 27 18:40:08 2004 --- llvm/test/Regression/CFrontend/2004-11-27-VariableSizeInStructure.c Sat Nov 27 18:39:58 2004 *************** *** 0 **** --- 1,11 ---- + // RUN: %llvmgcc %s -S -o /dev/null + + // GCC allows variable sized arrays in structures, crazy! + + // This is PR360. + + int sub1(int i, char *pi) { + typedef int foo[i]; + struct bar {foo f1; int f2;} *p = (struct bar *) pi; + return p->f2; + } From lattner at cs.uiuc.edu Sat Nov 27 18:41:10 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 18:41:10 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200411280041.iAS0fAkC020027@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.67 -> 1.68 --- Log message: Add support for structures with members at non-constant offsets. This fixes Regression/CFrontend/2004-11-27-VariableSizeInStructure.c and PR360: http://llvm.cs.uiuc.edu/PR360 . --- Diffs of the changes: (+30 -7) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.67 llvm-gcc/gcc/llvm-expand.c:1.68 --- llvm-gcc/gcc/llvm-expand.c:1.67 Sat Nov 27 18:07:26 2004 +++ llvm-gcc/gcc/llvm-expand.c Sat Nov 27 18:40:58 2004 @@ -3739,13 +3739,21 @@ } } -/* GetFieldOffset - Return the offset (in bits) of a FIELD_DECL in a - * structure. +/* GetFieldOffset - Return the offset (in bits) of a FIELD_DECL in a structure. + * Note that GCC permits structures with variable sized objects embedded IN + * them, like { [N x int], int}. In this case, the offset to the second field + * will not be a constant. In this case, we expect the caller to be able to + * handle this, and we return a zero for the byte offset (there may still be a + * bit offset though). */ static unsigned GetFieldOffset(tree Field) { + unsigned Result; assert(DECL_FIELD_BIT_OFFSET(Field) != 0 && DECL_FIELD_OFFSET(Field) != 0); - return TREE_INT_CST_LOW(DECL_FIELD_BIT_OFFSET(Field)) + - TREE_INT_CST_LOW(DECL_FIELD_OFFSET(Field))*8; + Result = TREE_INT_CST_LOW(DECL_FIELD_BIT_OFFSET(Field)); + + if (TREE_CODE(DECL_FIELD_OFFSET(Field)) == INTEGER_CST) + Result += TREE_INT_CST_LOW(DECL_FIELD_OFFSET(Field))*8; + return Result; } /* GetDeclSize - Return the size of the declaration, in bits. */ @@ -3808,6 +3816,9 @@ unsigned FieldIndexVal = llvm_constant_get_integer_val(V2C(FieldIndex)); llvm_type *FieldType = GET_STRUCT_TYPE_ELEMENT(Ty, FieldIndexVal); unsigned FieldOffset = GetFieldOffset(field); + assert(TREE_CODE(DECL_FIELD_OFFSET(field)) == INTEGER_CST && + "Can't handle structures with variable sized objects in them"); + /* * Attempt to get the size of the field. @@ -5392,10 +5403,22 @@ } else { unsigned ActualOffset = GetFieldDeclOffset(FieldDecl)*8; unsigned ActualSize; - llvm_value *FieldNo = DECL_LLVM(FieldDecl); llvm_type *ResultElTy; - I = create_gep3(Op0, llvm_constant_intptr_0, FieldNo); - Result = append_inst(Fn, I); + + if (TREE_CODE(DECL_FIELD_OFFSET(FieldDecl)) == INTEGER_CST) { + llvm_value *FieldNo = DECL_LLVM(FieldDecl); + I = create_gep3(Op0, llvm_constant_intptr_0, FieldNo); + Result = append_inst(Fn, I); + } else { + /* Otherwise, this field has a variable offset to it. Handle it now. */ + llvm_value *Offset = + llvm_expand_expr(Fn, DECL_FIELD_OFFSET(FieldDecl), 0); + Result = cast_if_type_not_equal(Fn, Op0, Offset->Ty); + I = create_binary_inst("tmp", O_Add, Offset, Result); + Result = append_inst(Fn, I); + Result = cast_if_type_not_equal(Fn, Result, + llvm_type_get_pointer(FieldDeclTy)); + } ResultElTy = GET_POINTER_TYPE_ELEMENT(Result->Ty); ActualSize = llvm_type_get_size(ResultElTy)*8; From lattner at cs.uiuc.edu Sat Nov 27 18:44:11 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 18:44:11 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411280044.iAS0iBoU020668@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.266 -> 1.267 --- Log message: Bug fixed --- Diffs of the changes: (+4 -2) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.266 llvm/docs/ReleaseNotes.html:1.267 --- llvm/docs/ReleaseNotes.html:1.266 Sat Nov 27 18:09:38 2004 +++ llvm/docs/ReleaseNotes.html Sat Nov 27 18:43:59 2004 @@ -266,8 +266,10 @@ array with constructors in hard EH situations
    • [llvm-gcc] Inline function redefinitions error due to 'asm' function rename
    • -
    • [llvm-gcc] Error when an +
    • [llvm-gcc] Error when an implicitly external function is re-declared as static
    • +
    • [llvmgcc] Structure field with + non-constant offset crashes llvmgcc
    • Bugs fixed in the Sparc V9 back-end:

      @@ -722,7 +724,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/28 00:09:38 $ + Last modified: $Date: 2004/11/28 00:43:59 $ From lattner at cs.uiuc.edu Sat Nov 27 19:23:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 19:23:01 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2004-11-27-FriendDefaultArgCrash.cpp Message-ID: <200411280123.iAS1N1EO021624@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2004-11-27-FriendDefaultArgCrash.cpp added (r1.1) --- Log message: New testcase for PR447: http://llvm.cs.uiuc.edu/PR447 --- Diffs of the changes: (+9 -0) Index: llvm/test/Regression/C++Frontend/2004-11-27-FriendDefaultArgCrash.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2004-11-27-FriendDefaultArgCrash.cpp:1.1 *** /dev/null Sat Nov 27 19:22:59 2004 --- llvm/test/Regression/C++Frontend/2004-11-27-FriendDefaultArgCrash.cpp Sat Nov 27 19:22:49 2004 *************** *** 0 **** --- 1,9 ---- + // RUN: %llvmgxx %s -o /dev/null -S + + // PR447 + + namespace nm { + struct str { + friend int foo(int arg = 0); + }; + } From lattner at cs.uiuc.edu Sat Nov 27 19:23:17 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 19:23:17 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/cp/parser.c Message-ID: <200411280123.iAS1NHAV021634@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc/cp: parser.c updated: 1.1.1.2 -> 1.2 --- Log message: Merge in this patch: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.126&r2=1.127 to fix PR447: http://llvm.cs.uiuc.edu/PR447 /GCC PR13166: http://llvm.cs.uiuc.edu/PR13166 Testcase here: test/Regression/C++Frontend/2004-11-27-FriendDefaultArgCrash.cpp --- Diffs of the changes: (+2 -2) Index: llvm-gcc/gcc/cp/parser.c diff -u llvm-gcc/gcc/cp/parser.c:1.1.1.2 llvm-gcc/gcc/cp/parser.c:1.2 --- llvm-gcc/gcc/cp/parser.c:1.1.1.2 Tue Jan 13 10:49:38 2004 +++ llvm-gcc/gcc/cp/parser.c Sat Nov 27 19:23:05 2004 @@ -13935,10 +13935,10 @@ saved_local_variables_forbidden_p = parser->local_variables_forbidden_p; parser->local_variables_forbidden_p = true; /* Parse the assignment-expression. */ - if (DECL_CONTEXT (fn)) + if (DECL_CLASS_SCOPE_P (fn)) push_nested_class (DECL_CONTEXT (fn)); TREE_PURPOSE (parameters) = cp_parser_assignment_expression (parser); - if (DECL_CONTEXT (fn)) + if (DECL_CLASS_SCOPE_P (fn)) pop_nested_class (); /* Restore saved state. */ From lattner at cs.uiuc.edu Sat Nov 27 19:25:32 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 27 Nov 2004 19:25:32 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200411280125.iAS1PWor021658@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.267 -> 1.268 --- Log message: Bug fixed --- Diffs of the changes: (+3 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.267 llvm/docs/ReleaseNotes.html:1.268 --- llvm/docs/ReleaseNotes.html:1.267 Sat Nov 27 18:43:59 2004 +++ llvm/docs/ReleaseNotes.html Sat Nov 27 19:25:20 2004 @@ -270,6 +270,8 @@ implicitly external function is re-declared as static
    • [llvmgcc] Structure field with non-constant offset crashes llvmgcc
    • +
    • [llvmg++] Crash compiling + friend with default argument
    • Bugs fixed in the Sparc V9 back-end:

      @@ -724,7 +726,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/11/28 00:43:59 $ + Last modified: $Date: 2004/11/28 01:25:20 $ From reid at x10sys.com Sat Nov 27 21:13:12 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 27 Nov 2004 21:13:12 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveReader.cpp Message-ID: <200411280313.VAA12292@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: ArchiveReader.cpp updated: 1.32 -> 1.33 --- Log message: Compute the firstFileOffset correctly after reading the LLVM symbol table. --- Diffs of the changes: (+3 -2) Index: llvm/lib/Bytecode/Archive/ArchiveReader.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.32 llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.33 --- llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.32 Tue Nov 23 16:35:39 2004 +++ llvm/lib/Bytecode/Archive/ArchiveReader.cpp Sat Nov 27 21:13:02 2004 @@ -354,9 +354,10 @@ // See if its the symbol table if (mbr->isLLVMSymbolTable()) { parseSymbolTable(mbr->getData(), mbr->getSize()); - FirstFile = At + mbr->getSize(); + At += mbr->getSize(); if ((intptr_t(At) & 1) == 1) - FirstFile++; + At++; + FirstFile = At; } else { // There's no symbol table in the file. We have to rebuild it from scratch // because the intent of this method is to get the symbol table loaded so From reid at x10sys.com Sat Nov 27 22:29:40 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 27 Nov 2004 22:29:40 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll Message-ID: <200411280429.WAA12845@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: 2004-11-27-SetCCForCastLargerAndConstant.ll added (r1.1) --- Log message: Test case for PR454: http://llvm.cs.uiuc.edu/PR454 --- Diffs of the changes: (+159 -0) Index: llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll:1.1 *** /dev/null Sat Nov 27 22:29:39 2004 --- llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll Sat Nov 27 22:29:29 2004 *************** *** 0 **** --- 1,159 ---- + ; This test case tests the InstructionCombining optimization that + ; reduces things like: + ; %Y = cast sbyte %X to uint + ; %C = setlt uint %Y, 1024 + ; to + ; %C = bool true + ; It includes test cases for different constant values, signedness of the + ; cast operands, and types of setCC operators. In all cases, the cast should + ; be eliminated. In many cases the setCC is also eliminated based on the + ; constant value and the range of the casted value. + ; + ; RUN: llvm-as %s -o - | opt -instcombine -o - | llvm-dis -o - | grep -v cast + + implementation ; Functions: + + ; + bool %lt_signed_to_large_unsigned(sbyte %SB) { + %Y = cast sbyte %SB to uint ; [#uses=1] + %C = setlt uint %Y, 1024 ; [#uses=1] + ret bool %C + } + + bool %lt_signed_to_large_signed(sbyte %SB) { + %Y = cast sbyte %SB to int + %C = setlt int %Y, 1024 + ret bool %C + } + + bool %lt_signed_to_large_negative(sbyte %SB) { + %Y = cast sbyte %SB to int + %C = setlt int %Y, -1024 + ret bool %C + } + + bool %lt_signed_to_small_unsigned(sbyte %SB) { + %Y = cast sbyte %SB to uint ; [#uses=1] + %C = setlt uint %Y, 17 ; [#uses=1] + ret bool %C + } + + bool %lt_signed_to_small_signed(sbyte %SB) { + %Y = cast sbyte %SB to int + %C = setlt int %Y, 17 + ret bool %C + } + + bool %lt_signed_to_small_negative(sbyte %SB) { + %Y = cast sbyte %SB to int + %C = setlt int %Y, -17 + ret bool %C + } + + bool %lt_unsigned_to_large_unsigned(ubyte %SB) { + %Y = cast ubyte %SB to uint ; [#uses=1] + %C = setlt uint %Y, 1024 ; [#uses=1] + ret bool %C + } + + bool %lt_unsigned_to_large_signed(ubyte %SB) { + %Y = cast ubyte %SB to int + %C = setlt int %Y, 1024 + ret bool %C + } + + bool %lt_unsigned_to_large_negative(ubyte %SB) { + %Y = cast ubyte %SB to int + %C = setlt int %Y, -1024 + ret bool %C + } + + bool %lt_unsigned_to_small_unsigned(ubyte %SB) { + %Y = cast ubyte %SB to uint ; [#uses=1] + %C = setlt uint %Y, 17 ; [#uses=1] + ret bool %C + } + + bool %lt_unsigned_to_small_signed(ubyte %SB) { + %Y = cast ubyte %SB to int + %C = setlt int %Y, 17 + ret bool %C + } + + bool %lt_unsigned_to_small_negative(ubyte %SB) { + %Y = cast ubyte %SB to int + %C = setlt int %Y, -17 + ret bool %C + } + + bool %gt_signed_to_large_unsigned(sbyte %SB) { + %Y = cast sbyte %SB to uint ; [#uses=1] + %C = setgt uint %Y, 1024 ; [#uses=1] + ret bool %C + } + + bool %gt_signed_to_large_signed(sbyte %SB) { + %Y = cast sbyte %SB to int + %C = setgt int %Y, 1024 + ret bool %C + } + + bool %gt_signed_to_large_negative(sbyte %SB) { + %Y = cast sbyte %SB to int + %C = setgt int %Y, -1024 + ret bool %C + } + + bool %gt_signed_to_small_unsigned(sbyte %SB) { + %Y = cast sbyte %SB to uint ; [#uses=1] + %C = setgt uint %Y, 17 ; [#uses=1] + ret bool %C + } + + bool %gt_signed_to_small_signed(sbyte %SB) { + %Y = cast sbyte %SB to int + %C = setgt int %Y, 17 + ret bool %C + } + + bool %gt_signed_to_small_negative(sbyte %SB) { + %Y = cast sbyte %SB to int + %C = setgt int %Y, -17 + ret bool %C + } + + bool %gt_unsigned_to_large_unsigned(ubyte %SB) { + %Y = cast ubyte %SB to uint ; [#uses=1] + %C = setgt uint %Y, 1024 ; [#uses=1] + ret bool %C + } + + bool %gt_unsigned_to_large_signed(ubyte %SB) { + %Y = cast ubyte %SB to int + %C = setgt int %Y, 1024 + ret bool %C + } + + bool %gt_unsigned_to_large_negative(ubyte %SB) { + %Y = cast ubyte %SB to int + %C = setgt int %Y, -1024 + ret bool %C + } + + bool %gt_unsigned_to_small_unsigned(ubyte %SB) { + %Y = cast ubyte %SB to uint ; [#uses=1] + %C = setgt uint %Y, 17 ; [#uses=1] + ret bool %C + } + + bool %gt_unsigned_to_small_signed(ubyte %SB) { + %Y = cast ubyte %SB to int + %C = setgt int %Y, 17 + ret bool %C + } + + bool %gt_unsigned_to_small_negative(ubyte %SB) { + %Y = cast ubyte %SB to int + %C = setgt int %Y, -17 + ret bool %C + } From lattner at cs.uiuc.edu Sun Nov 28 00:34:33 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 00:34:33 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c llvm-representation.c Message-ID: <200411280634.iAS6YX6c022937@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.68 -> 1.69 llvm-representation.c updated: 1.13 -> 1.14 --- Log message: Revert patch for PR459: http://llvm.cs.uiuc.edu/PR459 , which breaks libstdc++. --- Diffs of the changes: (+8 -0) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.68 llvm-gcc/gcc/llvm-expand.c:1.69 --- llvm-gcc/gcc/llvm-expand.c:1.68 Sat Nov 27 18:40:58 2004 +++ llvm-gcc/gcc/llvm-expand.c Sun Nov 28 00:34:18 2004 @@ -7106,6 +7106,12 @@ if (!DECL_LLVM_SET_P(decl)) llvm_make_decl_llvm(decl, asmspec); + + if (DECL_LLVM_SET_P(decl)) { /* Ignore builtin functions */ + /* This horrible code mirrors code found in varasm.c:assemble_name */ + if (!llvm_value_is_global(DECL_LLVM(decl))) abort(); + MarkNameAsUsed(DECL_LLVM(decl)->Name); + } } Index: llvm-gcc/gcc/llvm-representation.c diff -u llvm-gcc/gcc/llvm-representation.c:1.13 llvm-gcc/gcc/llvm-representation.c:1.14 --- llvm-gcc/gcc/llvm-representation.c:1.13 Sat Nov 27 17:00:36 2004 +++ llvm-gcc/gcc/llvm-representation.c Sun Nov 28 00:34:18 2004 @@ -263,6 +263,7 @@ * global, and the MarkNameAsUsed code isn't particularly fast, so keep track * of whether we've done this already or not. */ +#if 0 if (V->VTy == Function && !V2F(V)->MarkedNameUsed) { V2F(V)->MarkedNameUsed = 1; MarkNameAsUsed(V->Name); @@ -270,6 +271,7 @@ V2GV(V)->MarkedNameUsed = 1; MarkNameAsUsed(V->Name); } +#endif } /* llvm_constant implementation ******************************************** From lattner at cs.uiuc.edu Sun Nov 28 01:52:31 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 01:52:31 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-internals.h llvm-out.c Message-ID: <200411280752.iAS7qVP9026049@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-internals.h updated: 1.2 -> 1.3 llvm-out.c updated: 1.7 -> 1.8 --- Log message: Remove the MarkNameAsUsed function --- Diffs of the changes: (+0 -12) Index: llvm-gcc/gcc/llvm-internals.h diff -u llvm-gcc/gcc/llvm-internals.h:1.2 llvm-gcc/gcc/llvm-internals.h:1.3 --- llvm-gcc/gcc/llvm-internals.h:1.2 Thu Nov 18 14:44:23 2004 +++ llvm-gcc/gcc/llvm-internals.h Sun Nov 28 01:52:17 2004 @@ -87,8 +87,6 @@ /* Reset the identifier rename table now that we are out of function scope */ void ResetIdentifierTableForEndOfFunction(void); -void MarkNameAsUsed(const char *); - struct llvm_value *llvm_get_empty_class_pointer(struct llvm_function *Fn, union tree_node *type); Index: llvm-gcc/gcc/llvm-out.c diff -u llvm-gcc/gcc/llvm-out.c:1.7 llvm-gcc/gcc/llvm-out.c:1.8 --- llvm-gcc/gcc/llvm-out.c:1.7 Fri Nov 26 11:34:39 2004 +++ llvm-gcc/gcc/llvm-out.c Sun Nov 28 01:52:17 2004 @@ -239,16 +239,6 @@ llvm_c_expand_body_1(Fn, 0); } -/* This horrible code mirrors code found in varasm.c:assemble_name. It - basically marks all external names that are used by the program as - REFERENCED, which, if the name corresponds to an inline function, causes the - inline function to be code generated for this translation unit. */ -void MarkNameAsUsed(const char *Name) { - tree id = maybe_get_identifier(Name); - if (id) mark_referenced(id); -} - - void llvm_emit_final_program(const char *version) { if (EMIT_CODE_INCREMENTALLY) fprintf(llvm_out_file, "*** EMIT_CODE_INCREMENTALLY defined\n"); From lattner at cs.uiuc.edu Sun Nov 28 01:54:57 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 01:54:57 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-representation.h llvm-expand.c llvm-representation.c Message-ID: <200411280754.iAS7svSw026811@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-representation.h updated: 1.11 -> 1.12 llvm-expand.c updated: 1.69 -> 1.70 llvm-representation.c updated: 1.14 -> 1.15 --- Log message: Implement new MarkLLVMNameAsUsed function, remove old MarkNameAsUsed function. Reimplement PR459: http://llvm.cs.uiuc.edu/PR459 , lazily emitting inline functions instead of emitting them all. --- Diffs of the changes: (+56 -17) Index: llvm-gcc/gcc/llvm-representation.h diff -u llvm-gcc/gcc/llvm-representation.h:1.11 llvm-gcc/gcc/llvm-representation.h:1.12 --- llvm-gcc/gcc/llvm-representation.h:1.11 Sat Nov 27 17:00:16 2004 +++ llvm-gcc/gcc/llvm-representation.h Sun Nov 28 01:54:45 2004 @@ -67,6 +67,11 @@ it now. */ llvm_value *llvm_get_global_alias(const char *ExternalName); +/* MarkLLVMNameAsUsed - This is used to implement lazy emission of inline + * functions. Whenever we "emit" a reference to a global, call this to tell GCC + * that the global was used. + */ +void MarkLLVMNameAsUsed(llvm_value*); /*===---------------------------------------------------------------------===*/ Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.69 llvm-gcc/gcc/llvm-expand.c:1.70 --- llvm-gcc/gcc/llvm-expand.c:1.69 Sun Nov 28 00:34:18 2004 +++ llvm-gcc/gcc/llvm-expand.c Sun Nov 28 01:54:45 2004 @@ -7106,15 +7106,34 @@ if (!DECL_LLVM_SET_P(decl)) llvm_make_decl_llvm(decl, asmspec); +} + +/* This horrible code mirrors code found in varasm.c:assemble_name. It + basically marks all external names that are used by the program as + REFERENCED, which, if the name corresponds to an inline function, causes the + inline function to be code generated for this translation unit. */ +void MarkLLVMNameAsUsed(llvm_value *V) { + const char *Name = V->Name; + tree id; - if (DECL_LLVM_SET_P(decl)) { /* Ignore builtin functions */ - /* This horrible code mirrors code found in varasm.c:assemble_name */ - if (!llvm_value_is_global(DECL_LLVM(decl))) abort(); - MarkNameAsUsed(DECL_LLVM(decl)->Name); + /* We only need to do this once for each global, and the code below isn't + * particularly fast, so keep track of whether we've done this already or not. + */ + if (V->VTy == Function) { + if (V2F(V)->MarkedNameUsed) return; + V2F(V)->MarkedNameUsed = 1; + } else { + assert(V->VTy == GlobalVariable && "Only functions and gv's go here!"); + if (V2GV(V)->MarkedNameUsed) return; + V2GV(V)->MarkedNameUsed = 1; } + + id = maybe_get_identifier(Name); + if (id) mark_referenced(id); } + /* llvm_assemble_external - This function is called once for each external * function and variable as they are used. */ @@ -7221,6 +7240,8 @@ /* An initializer was specified for the global */ if (TREE_CODE(DECL_INITIAL(decl)) != STRING_CST) { G->Init = llvm_expand_constant_expr(DECL_INITIAL(decl), BaseTy); + if (llvm_value_is_global(D2V(G->Init))) + MarkLLVMNameAsUsed(D2V(G->Init)); } else { /* Handle string initializers specially to allow zero padding the end. */ llvm_type *BaseTy = GET_POINTER_TYPE_ELEMENT(G2V(G)->Ty); @@ -7644,7 +7665,7 @@ llvm_instruction *store_dbg_inst; llvm_basicblock *CurBB = 0; - // If we're not emitting debug info, just bypass this. + /* If we're not emitting debug info, just bypass this. */ if (debug_info_level <= DINFO_LEVEL_NONE) return; Index: llvm-gcc/gcc/llvm-representation.c diff -u llvm-gcc/gcc/llvm-representation.c:1.14 llvm-gcc/gcc/llvm-representation.c:1.15 --- llvm-gcc/gcc/llvm-representation.c:1.14 Sun Nov 28 00:34:18 2004 +++ llvm-gcc/gcc/llvm-representation.c Sun Nov 28 01:54:45 2004 @@ -259,19 +259,10 @@ /* This horrible code mirrors code found in varasm.c:assemble_name. This code * allows GCC to notice that we are emitting a reference to a function or * global. If the fn/global is inline, this will cause its body to be - * compiled to LLVM and emitted. We only need to do this once for each - * global, and the MarkNameAsUsed code isn't particularly fast, so keep track - * of whether we've done this already or not. + * compiled to LLVM and emitted. */ -#if 0 - if (V->VTy == Function && !V2F(V)->MarkedNameUsed) { - V2F(V)->MarkedNameUsed = 1; - MarkNameAsUsed(V->Name); - } else if (V->VTy == GlobalVariable && !V2GV(V)->MarkedNameUsed) { - V2GV(V)->MarkedNameUsed = 1; - MarkNameAsUsed(V->Name); - } -#endif + if (llvm_value_is_global(V)) + MarkLLVMNameAsUsed(V); } /* llvm_constant implementation ******************************************** @@ -370,10 +361,16 @@ /* llvm_constant_expr implementation ****************************************** */ llvm_constant_expr *llvm_constant_expr_new(llvm_instruction *I) { + unsigned i; llvm_constant_expr *CE = (llvm_constant_expr*)xcalloc(sizeof(llvm_constant_expr), 1); llvm_constant_construct(G2C(CE), D2V(I)->Ty, "", ConstantExpr, ""); CE->Inst = I; + + + for (i = 0; i != I->NumOperands; ++i) + if (llvm_value_is_global(I->Operands[i])) + MarkLLVMNameAsUsed(I->Operands[i]); return CE; } @@ -446,8 +443,24 @@ llvm_value **Init) { llvm_constant_aggregate *CA = (llvm_constant_aggregate*)xcalloc(sizeof(llvm_constant_aggregate), 1); + unsigned Size, i; llvm_constant_construct(G2C(CA), Ty, "", ConstantAggregate, ""); CA->Initializers = Init; + + /* If any of the initializers is a global, make sure we recognize it for + * emission. + */ + if (Ty->ID == StructTyID) { + Size = Ty->NumElements; + } else { + assert(Ty->ID == ArrayTyID && "Invalid composite type!"); + Size = Ty->x.Array.Size; + } + + for (i = 0; i != Size; ++i) + if (llvm_value_is_global(Init[i])) + MarkLLVMNameAsUsed(Init[i]); + return CA; } From reid at x10sys.com Sun Nov 28 02:15:43 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 02:15:43 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll Message-ID: <200411280815.CAA15493@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: 2004-11-27-SetCCForCastLargerAndConstant.ll updated: 1.1 -> 1.2 --- Log message: Correct the RUN line to remove unneeded parameters and make sure the test case is testing the right thing. --- Diffs of the changes: (+1 -1) Index: llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll diff -u llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll:1.1 llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll:1.2 --- llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll:1.1 Sat Nov 27 22:29:29 2004 +++ llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll Sun Nov 28 02:15:33 2004 @@ -9,7 +9,7 @@ ; be eliminated. In many cases the setCC is also eliminated based on the ; constant value and the range of the casted value. ; -; RUN: llvm-as %s -o - | opt -instcombine -o - | llvm-dis -o - | grep -v cast +; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | not grep cast implementation ; Functions: From lattner at cs.uiuc.edu Sun Nov 28 10:46:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 10:46:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200411281646.iASGk1nG012682@apoc.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.206 -> 1.207 --- Log message: Fix PR463: http://llvm.cs.uiuc.edu/PR463 --- Diffs of the changes: (+4 -1) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.206 llvm/lib/AsmParser/llvmAsmParser.y:1.207 --- llvm/lib/AsmParser/llvmAsmParser.y:1.206 Tue Oct 26 13:26:14 2004 +++ llvm/lib/AsmParser/llvmAsmParser.y Sun Nov 28 10:45:45 2004 @@ -1294,7 +1294,10 @@ delete $1; } | Types ZEROINITIALIZER { - $$ = Constant::getNullValue($1->get()); + const Type *Ty = $1->get(); + if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) + ThrowException("Cannot create a null initialized value of this type!"); + $$ = Constant::getNullValue(Ty); delete $1; }; From lattner at cs.uiuc.edu Sun Nov 28 10:48:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 10:48:00 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Assembler/2004-11-28-InvalidTypeCrash.ll Message-ID: <200411281648.iASGm079012731@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Assembler: 2004-11-28-InvalidTypeCrash.ll added (r1.1) --- Log message: new testcase for PR463: http://llvm.cs.uiuc.edu/PR463 --- Diffs of the changes: (+3 -0) Index: llvm/test/Regression/Assembler/2004-11-28-InvalidTypeCrash.ll diff -c /dev/null llvm/test/Regression/Assembler/2004-11-28-InvalidTypeCrash.ll:1.1 *** /dev/null Sun Nov 28 10:47:56 2004 --- llvm/test/Regression/Assembler/2004-11-28-InvalidTypeCrash.ll Sun Nov 28 10:47:46 2004 *************** *** 0 **** --- 1,3 ---- + ; RUN: (llvm-as < %s) 2>&1 | grep 'Cannot create a' + ; Test for PR463. This program is erroneous, but should not crash llvm-as. + %.FOO = internal global %struct.none zeroinitializer From lattner at cs.uiuc.edu Sun Nov 28 11:54:35 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 11:54:35 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c Message-ID: <200411281754.iASHsZL0000480@apoc.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests: 2004-11-28-GlobalBoolLayout.c added (r1.1) --- Log message: Fix a testcase that the asmwriter is breaking LLC for on multiple platforms. --- Diffs of the changes: (+16 -0) Index: llvm-test/SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c diff -c /dev/null llvm-test/SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c:1.1 *** /dev/null Sun Nov 28 11:54:31 2004 --- llvm-test/SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c Sun Nov 28 11:54:20 2004 *************** *** 0 **** --- 1,16 ---- + #include + #include + + struct S { _Bool X, Y; char str[100]; }; + + struct S G = { 1, 1, "fooo" }; + + int main() { + int X = strlen(G.str); + if (X == 10) { + scanf("%d, %d\n", &G.X, &G.Y); + } + printf("%d %d %d\n", G.X, G.Y, X); + return X-4; + } + From lattner at cs.uiuc.edu Sun Nov 28 11:56:59 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 11:56:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp Message-ID: <200411281756.iASHuxCW002586@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.11 -> 1.12 --- Log message: Fix SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c, and hopefully PR449: http://llvm.cs.uiuc.edu/PR449 --- Diffs of the changes: (+1 -1) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.11 llvm/lib/CodeGen/AsmPrinter.cpp:1.12 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.11 Sat Oct 16 13:19:08 2004 +++ llvm/lib/CodeGen/AsmPrinter.cpp Sun Nov 28 11:56:47 2004 @@ -275,13 +275,13 @@ const Type *type = CV->getType(); switch (type->getTypeID()) { + case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID: O << Data8bitsDirective; break; case Type::UShortTyID: case Type::ShortTyID: O << Data16bitsDirective; break; - case Type::BoolTyID: case Type::PointerTyID: case Type::UIntTyID: case Type::IntTyID: O << Data32bitsDirective; From lattner at cs.uiuc.edu Sun Nov 28 13:54:16 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 13:54:16 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll Message-ID: <200411281954.iASJsG8R003225@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DeadStoreElimination: 2004-11-28-LiveStoreDeleted.ll added (r1.1) --- Log message: New testcase. The store is not dead here. --- Diffs of the changes: (+13 -0) Index: llvm/test/Regression/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll diff -c /dev/null llvm/test/Regression/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll:1.1 *** /dev/null Sun Nov 28 13:54:12 2004 --- llvm/test/Regression/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll Sun Nov 28 13:54:02 2004 *************** *** 0 **** --- 1,13 ---- + ; RUN: llvm-as < %s | opt -dse -scalarrepl -instcombine | llvm-dis | not grep 'ret int undef' + + int %test(double %__x) { + %__u = alloca { [3 x int] } + %tmp.1 = cast { [3 x int] }* %__u to double* + store double %__x, double* %tmp.1 + %tmp.4 = getelementptr { [3 x int] }* %__u, int 0, uint 0, int 1 + %tmp.5 = load int* %tmp.4 + %tmp.6 = setlt int %tmp.5, 0 + %tmp.7 = cast bool %tmp.6 to int + ret int %tmp.7 + } + From lattner at cs.uiuc.edu Sun Nov 28 14:30:29 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 14:30:29 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <200411282030.iASKUTGi004266@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.57 -> 1.58 --- Log message: Fix DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll --- Diffs of the changes: (+3 -3) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.57 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.58 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.57 Fri Nov 26 14:01:48 2004 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Sun Nov 28 14:30:15 2004 @@ -297,7 +297,7 @@ // undefined to load or store bytes before or after an object). const Type *ElTy = cast(O1->getType())->getElementType(); unsigned GlobalSize = getTargetData().getTypeSize(ElTy); - if (GlobalSize < V2Size) + if (GlobalSize < V2Size && V2Size != ~0U) return NoAlias; } } @@ -313,7 +313,7 @@ // undefined to load or store bytes before or after an object). const Type *ElTy = cast(O2->getType())->getElementType(); unsigned GlobalSize = getTargetData().getTypeSize(ElTy); - if (GlobalSize < V1Size) + if (GlobalSize < V1Size && V1Size != ~0U) return NoAlias; } } @@ -496,7 +496,7 @@ // A[i][0] != A[j][1] iff (&A[0][1]-&A[0][0] >= std::max(G1S, G2S)) // unsigned SizeMax = std::max(G1S, G2S); - if (SizeMax == ~0U) return MayAlias; // Avoid frivolous work... + if (SizeMax == ~0U) return MayAlias; // Avoid frivolous work. // Scan for the first operand that is constant and unequal in the // two getelementptrs... From lattner at cs.uiuc.edu Sun Nov 28 14:44:51 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 14:44:51 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp Message-ID: <200411282044.iASKipfo005464@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: DeadStoreElimination.cpp updated: 1.7 -> 1.8 --- Log message: Make DSE potentially more aggressive by being more specific about alloca sizes. --- Diffs of the changes: (+10 -4) Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp diff -u llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.7 llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.8 --- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.7 Sun Sep 19 23:43:14 2004 +++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp Sun Nov 28 14:44:37 2004 @@ -16,6 +16,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Scalar.h" +#include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/Instructions.h" #include "llvm/Analysis/AliasAnalysis.h" @@ -63,13 +64,18 @@ AliasAnalysis &AA = getAnalysis(); AliasSetTracker KillLocs(AA); - // If this block ends in a return, unwind, and eventually tailcall/barrier, - // then all allocas are dead at its end. + // If this block ends in a return, unwind, unreachable, and eventually + // tailcall, then all allocas are dead at its end. if (BB.getTerminator()->getNumSuccessors() == 0) { BasicBlock *Entry = BB.getParent()->begin(); for (BasicBlock::iterator I = Entry->begin(), E = Entry->end(); I != E; ++I) - if (AllocaInst *AI = dyn_cast(I)) - KillLocs.add(AI, ~0); + if (AllocaInst *AI = dyn_cast(I)) { + unsigned Size = ~0U; + if (!AI->isArrayAllocation() && + AI->getType()->getElementType()->isSized()) + Size = TD.getTypeSize(AI->getType()->getElementType()); + KillLocs.add(AI, Size); + } } // PotentiallyDeadInsts - Deleting dead stores from the program can make other From lattner at persephone.cs.uiuc.edu Sun Nov 28 15:13:51 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 15:13:51 -0600 (CST) Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/McGill/misr.c Message-ID: <20041128211351.BCD1177DB1F@persephone.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/McGill: misr.c updated: 1.1 -> 1.2 --- Log message: I have no idea what mp.h is, but darwin doesn't have it --- Diffs of the changes: (+0 -1) Index: llvm-test/SingleSource/Benchmarks/McGill/misr.c diff -u llvm-test/SingleSource/Benchmarks/McGill/misr.c:1.1 llvm-test/SingleSource/Benchmarks/McGill/misr.c:1.2 --- llvm-test/SingleSource/Benchmarks/McGill/misr.c:1.1 Tue Oct 5 15:58:37 2004 +++ llvm-test/SingleSource/Benchmarks/McGill/misr.c Sun Nov 28 15:13:24 2004 @@ -32,7 +32,6 @@ #include #include -#include #define INF 10000 #define MAX_REG_LN 100 From lattner at persephone.cs.uiuc.edu Sun Nov 28 15:17:02 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 15:17:02 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Message-ID: <20041128211702.3F4ED77DD93@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCTargetMachine.cpp updated: 1.42 -> 1.43 --- Log message: The LLVM bool type shall have 1 byte alignment on PPC. --- Diffs of the changes: (+2 -2) Index: llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.42 llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.43 --- llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp:1.42 Wed Nov 24 22:14:54 2004 +++ llvm/lib/Target/PowerPC/PowerPCTargetMachine.cpp Sun Nov 28 15:16:45 2004 @@ -142,14 +142,14 @@ /// PPC32TargetMachine::PPC32TargetMachine(const Module &M, IntrinsicLowering *IL) : PowerPCTargetMachine(PPC32ID, IL, - TargetData(PPC32ID,false,4,4,4,4,4,4,2,1,4), + TargetData(PPC32ID,false,4,4,4,4,4,4,2,1,1), PowerPCFrameInfo(*this, false)), JITInfo(*this) {} /// PPC64TargetMachine ctor - Create a LP64 architecture model /// PPC64TargetMachine::PPC64TargetMachine(const Module &M, IntrinsicLowering *IL) : PowerPCTargetMachine(PPC64ID, IL, - TargetData(PPC64ID,false,8,4,4,4,4,4,2,1,4), + TargetData(PPC64ID,false,8,4,4,4,4,4,2,1,1), PowerPCFrameInfo(*this, true)) {} unsigned PPC32TargetMachine::getModuleMatchQuality(const Module &M) { From lattner at persephone.cs.uiuc.edu Sun Nov 28 15:17:51 2004 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 15:17:51 -0600 (CST) Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-types.c Message-ID: <20041128211751.0C5C177DDB9@persephone.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-types.c updated: 1.16 -> 1.17 --- Log message: On PowerPC, C++ bool has size and alignment of 4 bytes. In LLVM, this is spelled 'int', not 'bool'. --- Diffs of the changes: (+5 -1) Index: llvm-gcc/gcc/llvm-types.c diff -u llvm-gcc/gcc/llvm-types.c:1.16 llvm-gcc/gcc/llvm-types.c:1.17 --- llvm-gcc/gcc/llvm-types.c:1.16 Thu Nov 25 00:25:45 2004 +++ llvm-gcc/gcc/llvm-types.c Sun Nov 28 15:17:34 2004 @@ -1368,7 +1368,11 @@ return (HTE->Dest = llvm_type_get_cannonical_struct(Result)); } case VOID_TYPE: return VoidTy; - case BOOLEAN_TYPE: return BoolTy; + case BOOLEAN_TYPE: + if (TREE_INT_CST_LOW(TYPE_SIZE(type)) == 32) + return IntTy; + else + return BoolTy; case ENUMERAL_TYPE: if (TYPE_SIZE(type) == 0) { From reid at x10sys.com Sun Nov 28 15:31:26 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 15:31:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200411282131.PAA28717@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.287 -> 1.288 --- Log message: Fix for PR454: http://llvm.cs.uiuc.edu/PR454 : * Make sure we handle signed to unsigned conversion correctly * Move this visitSetCondInst case to its own method. --- Diffs of the changes: (+80 -41) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.287 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.288 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.287 Sat Nov 27 11:55:46 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sun Nov 28 15:31:15 2004 @@ -111,6 +111,9 @@ Instruction *visitOr (BinaryOperator &I); Instruction *visitXor(BinaryOperator &I); Instruction *visitSetCondInst(BinaryOperator &I); + Instruction *visitSetCondInstWithCastAndConstant(BinaryOperator&I, + CastInst*LHSI, + ConstantInt* CI); Instruction *visitShiftInst(ShiftInst &I); Instruction *visitCastInst(CastInst &CI); Instruction *visitSelectInst(SelectInst &CI); @@ -2034,49 +2037,15 @@ } break; - case Instruction::Cast: { // (setcc (cast X to larger), CI) - const Type *SrcTy = LHSI->getOperand(0)->getType(); - if (SrcTy->isIntegral() && LHSI->getType()->isIntegral()) { - unsigned SrcBits = SrcTy->getPrimitiveSize()*8; - if (SrcTy == Type::BoolTy) SrcBits = 1; - unsigned DestBits = LHSI->getType()->getPrimitiveSize()*8; - if (LHSI->getType() == Type::BoolTy) DestBits = 1; - if (SrcBits < DestBits && - // FIXME: Reenable the code below for < and >. However, we have - // to handle the cases when the source of the cast and the dest of - // the cast have different signs. e.g: - // (cast sbyte %X to uint) >u 255U -> X getType()) != CI) { - switch (I.getOpcode()) { - default: assert(0 && "unknown integer comparison"); -#if 0 - case Instruction::SetLT: { - Constant *Max = ConstantIntegral::getMaxValue(SrcTy); - Max = ConstantExpr::getCast(Max, LHSI->getType()); - return ReplaceInstUsesWith(I, ConstantExpr::getSetLT(Max, CI)); - } - case Instruction::SetGT: { - Constant *Min = ConstantIntegral::getMinValue(SrcTy); - Min = ConstantExpr::getCast(Min, LHSI->getType()); - return ReplaceInstUsesWith(I, ConstantExpr::getSetGT(Min, CI)); - } -#endif - case Instruction::SetEQ: - return ReplaceInstUsesWith(I, ConstantBool::False); - case Instruction::SetNE: - return ReplaceInstUsesWith(I, ConstantBool::True); - } - } - - return new SetCondInst(I.getOpcode(), LHSI->getOperand(0), NewCst); - } - } + // (setcc (cast X to larger), CI) + case Instruction::Cast: { + Instruction* replacement = + visitSetCondInstWithCastAndConstant(I,cast(LHSI),CI); + if (replacement) + return replacement; break; } + case Instruction::Shl: // (setcc (shl X, ShAmt), CI) if (ConstantUInt *ShAmt = dyn_cast(LHSI->getOperand(1))) { switch (I.getOpcode()) { @@ -2530,6 +2499,76 @@ return Changed ? &I : 0; } +// visitSetCondInstWithCastAndConstant - this method is part of the +// visitSetCondInst method. It handles the situation where we have: +// (setcc (cast X to larger), CI) +// It tries to remove the cast and even the setcc if the CI value +// and range of the cast allow it. +Instruction * +InstCombiner::visitSetCondInstWithCastAndConstant(BinaryOperator&I, + CastInst* LHSI, + ConstantInt* CI) { + const Type *SrcTy = LHSI->getOperand(0)->getType(); + const Type *DestTy = LHSI->getType(); + if (SrcTy->isIntegral() && DestTy->isIntegral()) { + unsigned SrcBits = SrcTy->getPrimitiveSize()*8; + unsigned DestBits = DestTy->getPrimitiveSize()*8; + if (SrcTy == Type::BoolTy) + SrcBits = 1; + if (DestTy == Type::BoolTy) + DestBits = 1; + if (SrcBits < DestBits) { + // There are fewer bits in the source of the cast than in the result + // of the cast. Any other case doesn't matter because the constant + // value won't have changed due to sign extension. + Constant *NewCst = ConstantExpr::getCast(CI, SrcTy); + if (ConstantExpr::getCast(NewCst, DestTy) == CI) { + // The constant value operand of the setCC before and after a + // cast to the source type of the cast instruction is the same + // value, so we just replace with the same setcc opcode, but + // using the source value compared to the constant casted to the + // source type. + if (SrcTy->isSigned() && DestTy->isUnsigned()) { + CastInst* Cst = new CastInst(LHSI->getOperand(0), + SrcTy->getUnsignedVersion(), LHSI->getName()); + InsertNewInstBefore(Cst,I); + return new SetCondInst(I.getOpcode(), Cst, + ConstantExpr::getCast(CI, SrcTy->getUnsignedVersion())); + } + return new SetCondInst(I.getOpcode(), LHSI->getOperand(0),NewCst); + } + // The constant value before and after a cast to the source type + // is different, so various cases are possible depending on the + // opcode and the signs of the types involved in the cast. + switch (I.getOpcode()) { + case Instruction::SetLT: { + Constant* Max = ConstantIntegral::getMaxValue(SrcTy); + Max = ConstantExpr::getCast(Max, DestTy); + return ReplaceInstUsesWith(I, ConstantExpr::getSetLT(Max, CI)); + } + case Instruction::SetGT: { + Constant* Min = ConstantIntegral::getMinValue(SrcTy); + Min = ConstantExpr::getCast(Min, DestTy); + return ReplaceInstUsesWith(I, ConstantExpr::getSetGT(Min, CI)); + } + case Instruction::SetEQ: + // We're looking for equality, and we know the values are not + // equal so replace with constant False. + return ReplaceInstUsesWith(I, ConstantBool::False); + case Instruction::SetNE: + // We're testing for inequality, and we know the values are not + // equal so replace with constant True. + return ReplaceInstUsesWith(I, ConstantBool::True); + case Instruction::SetLE: + case Instruction::SetGE: + assert(!"SetLE and SetGE should be handled elsewhere"); + default: + assert(!"unknown integer comparison"); + } + } + } + return 0; +} Instruction *InstCombiner::visitShiftInst(ShiftInst &I) { From reid at x10sys.com Sun Nov 28 15:37:02 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 15:37:02 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll Message-ID: <200411282137.PAA28759@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: 2004-11-27-SetCCForCastLargerAndConstant.ll updated: 1.2 -> 1.3 --- Log message: Update the test to match the optimization. The optimization can let some casts through, but they will only be sbyte -> ubyte in this test case so make sure we don't let any other kinds through. --- Diffs of the changes: (+1 -1) Index: llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll diff -u llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll:1.2 llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll:1.3 --- llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll:1.2 Sun Nov 28 02:15:33 2004 +++ llvm/test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll Sun Nov 28 15:36:52 2004 @@ -9,7 +9,7 @@ ; be eliminated. In many cases the setCC is also eliminated based on the ; constant value and the range of the casted value. ; -; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | not grep cast +; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | not grep 'cast.*int' implementation ; Functions: From tbrethou at cs.uiuc.edu Sun Nov 28 17:36:31 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Sun, 28 Nov 2004 17:36:31 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp MSSchedule.h MSchedGraph.cpp MSchedGraph.h Message-ID: <200411282336.RAA24446@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/ModuloScheduling: MSSchedule.cpp updated: 1.10 -> 1.11 MSSchedule.h updated: 1.2 -> 1.3 MSchedGraph.cpp updated: 1.10 -> 1.11 MSchedGraph.h updated: 1.5 -> 1.6 --- Log message: Fixed bug where instructions in the kernel were not ordered right to preserve dependencies in a cycle. --- Diffs of the changes: (+32 -7) Index: llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp diff -u llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp:1.10 llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp:1.11 --- llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp:1.10 Tue Nov 23 19:49:10 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.cpp Sun Nov 28 17:36:15 2004 @@ -27,7 +27,8 @@ if (schedule[cycle].size() < numIssue) { //Now check if all the resources in their respective cycles are available if(resourcesFree(node, cycle)) { - schedule[cycle].push_back(node); + //Insert to preserve dependencies + addToSchedule(cycle,node); DEBUG(std::cerr << "Found spot in map, and there is an issue slot\n"); return false; } @@ -49,6 +50,24 @@ } +void MSSchedule::addToSchedule(int cycle, MSchedGraphNode *node) { + std::vector nodesAtCycle = schedule[cycle]; + + std::map indexMap; + for(unsigned i=0; i < nodesAtCycle.size(); ++i) { + indexMap[nodesAtCycle[i]->getIndex()] = nodesAtCycle[i]; + } + + indexMap[node->getIndex()] = node; + + std::vector nodes; + for(std::map::iterator I = indexMap.begin(), E = indexMap.end(); I != E; ++I) + nodes.push_back(I->second); + + schedule[cycle] = nodes; +} + + bool MSSchedule::resourcesFree(MSchedGraphNode *node, int cycle) { //Get Resource usage for this instruction Index: llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.h diff -u llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.h:1.2 llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.h:1.3 --- llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.h:1.2 Sun Oct 10 17:44:35 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/MSSchedule.h Sun Nov 28 17:36:15 2004 @@ -35,6 +35,9 @@ //Max stage count int maxStage; + //add at the right spot in the schedule + void addToSchedule(int, MSchedGraphNode*); + public: MSSchedule(int num) : numIssue(num) {} MSSchedule() : numIssue(4) {} Index: llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp diff -u llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp:1.10 llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp:1.11 --- llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp:1.10 Sun Oct 10 18:34:50 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp Sun Nov 28 17:36:15 2004 @@ -22,9 +22,9 @@ using namespace llvm; MSchedGraphNode::MSchedGraphNode(const MachineInstr* inst, - MSchedGraph *graph, + MSchedGraph *graph, unsigned idx, unsigned late, bool isBranch) - : Inst(inst), Parent(graph), latency(late), isBranchInstr(isBranch) { + : Inst(inst), Parent(graph), index(idx), latency(late), isBranchInstr(isBranch) { //Add to the graph graph->addNode(inst, this); @@ -113,7 +113,7 @@ //Save PHI instructions to deal with later std::vector phiInstrs; - + unsigned index = 0; //Loop over instructions in MBB and add nodes and edges for (MachineBasicBlock::const_iterator MI = BB->begin(), e = BB->end(); MI != e; ++MI) { //Get each instruction of machine basic block, get the delay @@ -149,7 +149,7 @@ isBranch = true; //Node is created and added to the graph automatically - MSchedGraphNode *node = new MSchedGraphNode(MI, this, delay, isBranch); + MSchedGraphNode *node = new MSchedGraphNode(MI, this, index, delay, isBranch); DEBUG(std::cerr << "Created Node: " << *node << "\n"); @@ -211,6 +211,7 @@ } } } + ++index; } addMemEdges(memInstructions); addMachRegEdges(regNumtoNodeMap); Index: llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.h diff -u llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.h:1.5 llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.h:1.6 --- llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.h:1.5 Fri Oct 29 19:39:07 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.h Sun Nov 28 17:36:15 2004 @@ -58,15 +58,17 @@ const MachineInstr* Inst; //Machine Instruction MSchedGraph* Parent; //Graph this node belongs to + unsigned index; //Index in BB unsigned latency; //Latency of Instruction bool isBranchInstr; //Is this node the branch instr or not + std::vector Predecessors; //Predecessor Nodes std::vector Successors; public: MSchedGraphNode(const MachineInstr *inst, MSchedGraph *graph, - unsigned late=0, bool isBranch=false); + unsigned index, unsigned late=0, bool isBranch=false); //Iterators typedef std::vector::iterator pred_iterator; @@ -102,7 +104,7 @@ bool hasSuccessors() { return (Successors.size() > 0); } unsigned getLatency() { return latency; } unsigned getLatency() const { return latency; } - + unsigned getIndex() { return index; } MSchedGraphEdge getInEdge(MSchedGraphNode *pred); unsigned getInEdgeNum(MSchedGraphNode *pred); From reid at x10sys.com Sun Nov 28 21:33:33 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 21:33:33 -0600 Subject: [llvm-commits] CVS: llvm/docs/doxygen.cfg.in Message-ID: <200411290333.VAA32231@zion.cs.uiuc.edu> Changes in directory llvm/docs: doxygen.cfg.in updated: 1.9 -> 1.10 --- Log message: For PR393: http://llvm.cs.uiuc.edu/PR393 : This file was originally doxygen.cfg, but it needs to be configured to get the right srcdir/objdir paths for things. This is needed because building the doxygen will now be part of the install and dist-check targets. --- Diffs of the changes: (+14 -14) Index: llvm/docs/doxygen.cfg.in diff -u llvm/docs/doxygen.cfg.in:1.9 llvm/docs/doxygen.cfg.in:1.10 --- llvm/docs/doxygen.cfg.in:1.9 Sat Jun 12 09:46:02 2004 +++ llvm/docs/doxygen.cfg.in Sun Nov 28 21:33:22 2004 @@ -23,14 +23,14 @@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = @PACKAGE_VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = doxygen +OUTPUT_DIRECTORY = @abs_top_builddir@/docs/doxygen # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this @@ -301,7 +301,7 @@ # directories like "/usr/src/myproject". Separate the files or directories with # spaces. -INPUT = .. ./doxygen.intro +INPUT = @abs_top_srcdir@/include @abs_top_srcdir@/lib @abs_top_srcdir@/docs/doxygen.intro # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp @@ -318,11 +318,11 @@ RECURSIVE = YES -# The EXCLUDE tag can be used to specify files and/or directories that should +# The EXCLUDE tag can be u sed to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. -EXCLUDE = ../test ../include/boost +EXCLUDE = # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude @@ -334,7 +334,7 @@ # directories that contain example code fragments that are included (see # the \include command). -EXAMPLE_PATH = +EXAMPLE_PATH = @abs_top_srcdir@/examples # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp @@ -348,13 +348,13 @@ # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. -EXAMPLE_RECURSIVE = NO +EXAMPLE_RECURSIVE = YES # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). -IMAGE_PATH = +IMAGE_PATH = @abs_top_srcdir@/docs/img # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -418,7 +418,7 @@ # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. -IGNORE_PREFIX = +IGNORE_PREFIX = llvm:: #--------------------------------------------------------------------------- # configuration options related to the HTML output @@ -433,26 +433,26 @@ # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. -HTML_OUTPUT = . +HTML_OUTPUT = html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. -HTML_HEADER = doxygen.header +HTML_HEADER = @abs_top_srcdir@/docs/doxygen.header # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = doxygen.footer +HTML_FOOTER = @abs_top_srcdir@/docs/doxygen.footer # The HTML_STYLESHEET tag can be used to specify a user defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet -HTML_STYLESHEET = doxygen.css +HTML_STYLESHEET = @abs_top_srcdir@/docs/doxygen.css # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to @@ -817,7 +817,7 @@ # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found on the path. -DOT_PATH = +DOT_PATH = @DOT@ # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the From reid at x10sys.com Sun Nov 28 21:37:26 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 21:37:26 -0600 Subject: [llvm-commits] CVS: llvm/docs/CommandGuide/llvm-ar.pod Message-ID: <200411290337.VAA32316@zion.cs.uiuc.edu> Changes in directory llvm/docs/CommandGuide: llvm-ar.pod updated: 1.7 -> 1.8 --- Log message: Add a link. --- Diffs of the changes: (+1 -1) Index: llvm/docs/CommandGuide/llvm-ar.pod diff -u llvm/docs/CommandGuide/llvm-ar.pod:1.7 llvm/docs/CommandGuide/llvm-ar.pod:1.8 --- llvm/docs/CommandGuide/llvm-ar.pod:1.7 Wed Nov 17 14:19:18 2004 +++ llvm/docs/CommandGuide/llvm-ar.pod Sun Nov 28 21:37:15 2004 @@ -398,7 +398,7 @@ =head1 SEE ALSO -L +L, L =head1 AUTHORS From reid at x10sys.com Sun Nov 28 21:38:04 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 21:38:04 -0600 Subject: [llvm-commits] CVS: llvm/docs/CommandGuide/llvm-ranlib.pod Message-ID: <200411290338.VAA32369@zion.cs.uiuc.edu> Changes in directory llvm/docs/CommandGuide: llvm-ranlib.pod updated: 1.2 -> 1.3 --- Log message: Add a link. --- Diffs of the changes: (+1 -1) Index: llvm/docs/CommandGuide/llvm-ranlib.pod diff -u llvm/docs/CommandGuide/llvm-ranlib.pod:1.2 llvm/docs/CommandGuide/llvm-ranlib.pod:1.3 --- llvm/docs/CommandGuide/llvm-ranlib.pod:1.2 Mon Nov 15 13:47:20 2004 +++ llvm/docs/CommandGuide/llvm-ranlib.pod Sun Nov 28 21:37:54 2004 @@ -43,7 +43,7 @@ =head1 SEE ALSO -L +L, L =head1 AUTHORS From reid at x10sys.com Sun Nov 28 21:43:40 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 21:43:40 -0600 Subject: [llvm-commits] CVS: llvm/docs/CommandGuide/llvm-ld.pod Message-ID: <200411290343.VAA32474@zion.cs.uiuc.edu> Changes in directory llvm/docs/CommandGuide: llvm-ld.pod updated: 1.1 -> 1.2 --- Log message: * Fix an item list. * Add an ENVIRONMENT section to describe LLVM_LIB_SEARCH_PATH --- Diffs of the changes: (+10 -0) Index: llvm/docs/CommandGuide/llvm-ld.pod diff -u llvm/docs/CommandGuide/llvm-ld.pod:1.1 llvm/docs/CommandGuide/llvm-ld.pod:1.2 --- llvm/docs/CommandGuide/llvm-ld.pod:1.1 Sun Nov 21 12:20:16 2004 +++ llvm/docs/CommandGuide/llvm-ld.pod Sun Nov 28 21:43:29 2004 @@ -140,16 +140,26 @@ =head2 Miscellaneous Options +=over + =item B<-v> Specifies verbose mode. In this mode the linker will print additional information about the actions it takes, programs it executes, etc. +=back + =head1 EXIT STATUS If B succeeds, it will exit with 0 return code. If an error occurs, it will exit with a non-zero return code. +=head1 ENVIRONMENT + +The C environment variable is used to find bytecode +libraries. Any paths specified in this variable will be searched after the C<-L> +options. + =head1 SEE ALSO L From reid at x10sys.com Sun Nov 28 21:45:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 21:45:13 -0600 Subject: [llvm-commits] CVS: llvm/docs/CommandGuide/Makefile Message-ID: <200411290345.VAA32538@zion.cs.uiuc.edu> Changes in directory llvm/docs/CommandGuide: Makefile updated: 1.4 -> 1.5 --- Log message: * Adjust so this falls in line with LLVM Makefile standards. * Implement installation of doxygen and html documentation * Fix it so it works with objdir != srcdir. --- Diffs of the changes: (+48 -11) Index: llvm/docs/CommandGuide/Makefile diff -u llvm/docs/CommandGuide/Makefile:1.4 llvm/docs/CommandGuide/Makefile:1.5 --- llvm/docs/CommandGuide/Makefile:1.4 Mon Nov 15 14:06:11 2004 +++ llvm/docs/CommandGuide/Makefile Sun Nov 28 21:45:02 2004 @@ -1,23 +1,60 @@ -POD = $(wildcard *.pod) -HTML = $(patsubst %.pod, html/%.html, $(POD)) -MAN = $(patsubst %.pod, man/man1/%.1, $(POD)) -PS = $(patsubst %.pod, ps/%.ps, $(POD)) +##===- docs/CommandGuide/Makefile --------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file was developed by the LLVM research group and is distributed under +# the University of Illinois Open Source License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## -all: $(HTML) $(MAN) $(PS) +LEVEL := ../.. + +include $(LEVEL)/Makefile.common + +POD := $(wildcard $(BUILD_SRC_DIR)/*.pod) + +EXTRA_DIST := $(POD) index.html + +HTML = $(patsubst $(BUILD_SRC_DIR)/%.pod, html/%.html, $(POD)) +MAN = $(patsubst $(BUILD_SRC_DIR)/%.pod, man/man1/%.1, $(POD)) +PS = $(patsubst $(BUILD_SRC_DIR)/%.pod, ps/%.ps, $(POD)) + +all-local:: $(HTML) $(MAN) $(PS) .SUFFIXES: .SUFFIXES: .html .pod .1 .ps +$(HTML) : html/.dir man/.dir man/man1/.dir ps/.dir + html/%.html: %.pod - pod2html --css=manpage.css --htmlroot=. \ - --podpath=. --noindex --infile=$< --outfile=$@ + $(POD2HTML) --css=manpage.css --htmlroot=. --podpath=. \ + --noindex --infile=$< --outfile=$@ --title=$* man/man1/%.1: %.pod - pod2man --release=1.4 --center="LLVM Command Guide" $< $@ + $(POD2MAN) --release=$(PACKAGE_VERSION) \ + --center="LLVM Command Guide" $< $@ ps/%.ps: man/man1/%.1 - groff -Tps -man $< > $@ + $(GROFF) -Tps -man $< > $@ -clean: - rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) +clean-local:: + $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) +install-local:: $(HTML) $(MAN) $(PS) + $(Echo) Installing HTML CommandGuide Documentation + $(Verb) $(INSTALL) -d $(LLVM_DOCSDIR)/html/CommandGuide + $(Verb) $(INSTALL) -C $(HTML) $(LLVM_DOCSDIR)/html/CommandGuide + $(Echo) Installing MAN CommandGuide Documentation + $(Verb) $(INSTALL) -d $(LLVM_MANDIR)/man1 + $(Verb) $(INSTALL) -C $(MAN) $(LLVM_MANDIR)/man1 + $(Echo) Installing PS CommandGuide Documentation + $(Verb) $(INSTALL) -d $(LLVM_DOCSDIR)/ps + $(Verb) $(INSTALL) -C $(PS) $(LLVM_DOCSDIR)/ps + +uninstall-local:: + $(Echo) Uninstalling Documentation + $(Verb) $(RM) -rf $(LLVM_DOCSDIR) + +printvars:: + $(Echo) "POD : " '$(POD)' + $(Echo) "HTML : " '$(HTML)' From reid at x10sys.com Sun Nov 28 21:47:47 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 21:47:47 -0600 Subject: [llvm-commits] CVS: llvm/docs/doxygen.intro Message-ID: <200411290347.VAA32614@zion.cs.uiuc.edu> Changes in directory llvm/docs: doxygen.intro updated: 1.2 -> 1.3 --- Log message: Adjust this so that doxygen doesn't barf on it. --- Diffs of the changes: (+2 -9) Index: llvm/docs/doxygen.intro diff -u llvm/docs/doxygen.intro:1.2 llvm/docs/doxygen.intro:1.3 --- llvm/docs/doxygen.intro:1.2 Thu Jun 3 10:23:59 2004 +++ llvm/docs/doxygen.intro Sun Nov 28 21:47:37 2004 @@ -1,14 +1,7 @@ -//////////////////////////////////////////////////////////////////////////////// -/// @file doxygen.intro -/// @author Reid Spencer -/// @date 2003/12/30 -/// @brief LLVM API documentation introduction. -//////////////////////////////////////////////////////////////////////////////// -/// -/// @mainpage LLVM:Low Level Virtual Machine +/// @mainpage Low Level Virtual Machine /// /// @section main_intro Introduction -/// Welcome to the Low Level Virtual Machine (LLVM) +/// Welcome to the Low Level Virtual Machine (LLVM). /// /// This documentation describes the @b internal software that makes /// up LLVM, not the @b external use of LLVM. There are no instructions From reid at x10sys.com Sun Nov 28 22:32:48 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 22:32:48 -0600 Subject: [llvm-commits] CVS: llvm/docs/CommandGuide/index.html Message-ID: <200411290432.WAA00456@zion.cs.uiuc.edu> Changes in directory llvm/docs/CommandGuide: index.html updated: 1.20 -> 1.21 --- Log message: * add llvmc and llvm-ld * fix the links to not be in an html subdir as that's not how this gets installed (anymore). --- Diffs of the changes: (+26 -20) Index: llvm/docs/CommandGuide/index.html diff -u llvm/docs/CommandGuide/index.html:1.20 llvm/docs/CommandGuide/index.html:1.21 --- llvm/docs/CommandGuide/index.html:1.20 Mon Nov 15 13:53:43 2004 +++ llvm/docs/CommandGuide/index.html Sun Nov 28 22:32:37 2004 @@ -32,40 +32,46 @@
        -
      • llvm-as - +
      • llvm-as - assemble a human-readable .ll file into bytecode
      • -
      • llvm-dis - +
      • llvm-dis - disassemble a bytecode file into a human-readable .ll file
      • -
      • opt - +
      • opt - run a series of LLVM-to-LLVM optimizations on a bytecode file
      • -
      • llc - +
      • llc - generate native machine code for a bytecode file
      • -
      • lli - +
      • lli - directly run a program compiled to bytecode using a JIT compiler or interpreter
      • -
      • llvm-link - +
      • llvm-link - link several bytecode files into one
      • -
      • analyze - +
      • analyze - run LLVM analyses on a bytecode file and print the results
      • -
      • llvm-ar - +
      • llvm-ar - archive bytecode files
      • -
      • llvm-ranlib - +
      • llvm-ranlib - create an index for archives made with llvm-ar
      • -
      • llvm-nm - +
      • llvm-nm - print out the names and types of symbols in a bytecode file
      • -
      • llvm-prof - +
      • llvm-prof - format raw `llvmprof.out' data into a human-readable report
      • +
      • llvmc - + generic and configurable compiler driver
      • + +
      • llvm-ld - + general purpose linker with loadable runtime optimization support
      • +
      @@ -79,19 +85,19 @@
        -
      • llvmgcc - +
      • llvmgcc - GCC-based C front-end for LLVM -
      • llvmg++ - +
      • llvmg++ - GCC-based C++ front-end for LLVM
      • -
      • gccas - +
      • gccas - compile-time optimizer used by llvm-g++ and llvm-gcc
      • -
      • gccld - +
      • gccld - linker and link-time optimizer used by llvm-g++ and llvm-gcc
      • -
      • stkrc - +
      • stkrc - front-end compiler for the Stacker language
      • @@ -110,13 +116,13 @@
          -
        • bugpoint - +
        • bugpoint - automatic test-case reducer
        • -
        • extract - +
        • extract - extract a function from an LLVM bytecode file
        • -
        • llvm-bcanalyzer - +
        • llvm-bcanalyzer - bytecode analyzer (analyzes the binary encoding itself, not the program it represents)
        • @@ -134,7 +140,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
          - Last modified: $Date: 2004/11/15 19:53:43 $ + Last modified: $Date: 2004/11/29 04:32:37 $ From reid at x10sys.com Sun Nov 28 22:34:16 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 22:34:16 -0600 Subject: [llvm-commits] CVS: llvm/docs/CommandGuide/Makefile Message-ID: <200411290434.WAA00504@zion.cs.uiuc.edu> Changes in directory llvm/docs/CommandGuide: Makefile updated: 1.5 -> 1.6 --- Log message: * Get rid of extraneous directories * Ensure things installed to same place are all getting there by using a variable to name that place. * Make sure missing index.html, images and *.css files get installed. --- Diffs of the changes: (+18 -12) Index: llvm/docs/CommandGuide/Makefile diff -u llvm/docs/CommandGuide/Makefile:1.5 llvm/docs/CommandGuide/Makefile:1.6 --- llvm/docs/CommandGuide/Makefile:1.5 Sun Nov 28 21:45:02 2004 +++ llvm/docs/CommandGuide/Makefile Sun Nov 28 22:34:05 2004 @@ -15,9 +15,9 @@ EXTRA_DIST := $(POD) index.html -HTML = $(patsubst $(BUILD_SRC_DIR)/%.pod, html/%.html, $(POD)) -MAN = $(patsubst $(BUILD_SRC_DIR)/%.pod, man/man1/%.1, $(POD)) -PS = $(patsubst $(BUILD_SRC_DIR)/%.pod, ps/%.ps, $(POD)) +HTML = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.html, $(POD)) +MAN = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.1, $(POD)) +PS = $(patsubst $(BUILD_SRC_DIR)/%.pod, $(BUILD_OBJ_DIR)/%.ps, $(POD)) all-local:: $(HTML) $(MAN) $(PS) @@ -26,30 +26,36 @@ $(HTML) : html/.dir man/.dir man/man1/.dir ps/.dir -html/%.html: %.pod +$(BUILD_OBJ_DIR)/%.html: %.pod $(POD2HTML) --css=manpage.css --htmlroot=. --podpath=. \ --noindex --infile=$< --outfile=$@ --title=$* -man/man1/%.1: %.pod +$(BUILD_OBJ_DIR)/%.1: %.pod $(POD2MAN) --release=$(PACKAGE_VERSION) \ --center="LLVM Command Guide" $< $@ -ps/%.ps: man/man1/%.1 +$(BUILD_OBJ_DIR)/%.ps: man/man1/%.1 $(GROFF) -Tps -man $< > $@ clean-local:: $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) +HTML_DIR := $(LLVM_DOCSDIR)/html/CommandGuide +MAN_DIR := $(LLVM_MANDIR)/man1 +PS_DIR := $(LLVM_DOCSDIR)/ps + install-local:: $(HTML) $(MAN) $(PS) $(Echo) Installing HTML CommandGuide Documentation - $(Verb) $(INSTALL) -d $(LLVM_DOCSDIR)/html/CommandGuide - $(Verb) $(INSTALL) -C $(HTML) $(LLVM_DOCSDIR)/html/CommandGuide + $(Verb) $(INSTALL) -d $(HTML_DIR) + $(Verb) $(INSTALL) -C $(HTML) $(HTML_DIR) + $(Verb) $(INSTALL) -C $(BUILD_SRC_DIR)/index.html $(HTML_DIR) + $(Verb) $(INSTALL) -C $(BUILD_SRC_DIR)/manpage.css $(HTML_DIR) $(Echo) Installing MAN CommandGuide Documentation - $(Verb) $(INSTALL) -d $(LLVM_MANDIR)/man1 - $(Verb) $(INSTALL) -C $(MAN) $(LLVM_MANDIR)/man1 + $(Verb) $(INSTALL) -d $(MAN_DIR) + $(Verb) $(INSTALL) -C $(MAN) $(MAN_DIR) $(Echo) Installing PS CommandGuide Documentation - $(Verb) $(INSTALL) -d $(LLVM_DOCSDIR)/ps - $(Verb) $(INSTALL) -C $(PS) $(LLVM_DOCSDIR)/ps + $(Verb) $(INSTALL) -d $(PS_DIR) + $(Verb) $(INSTALL) -C $(PS) $(PS_DIR) uninstall-local:: $(Echo) Uninstalling Documentation From tbrethou at cs.uiuc.edu Sun Nov 28 22:40:04 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Sun, 28 Nov 2004 22:40:04 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp ModuloScheduling.h Message-ID: <200411290440.WAA04154@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/ModuloScheduling: ModuloScheduling.cpp updated: 1.36 -> 1.37 ModuloScheduling.h updated: 1.20 -> 1.21 --- Log message: Reworked branching so we don't handle BAs specially. It just updates the branchTO regardless of what type of branch it is. --- Diffs of the changes: (+97 -139) Index: llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp diff -u llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.36 llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.37 --- llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.36 Tue Nov 23 19:49:10 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp Sun Nov 28 22:39:46 2004 @@ -752,7 +752,7 @@ //Only push BA branches onto the final node order, we put other branches after it //FIXME: Should we really be pushing branches on it a specific order instead of relying //on BA being there? - std::vector otherBranch; + std::vector branches; //Loop over all recurrences and add to our partial order //be sure to remove nodes that are already in the partial order in @@ -777,10 +777,7 @@ } if(!found) { if((*N)->isBranch()) { - if((*N)->getInst()->getOpcode() == V9::BA) - FinalNodeOrder.push_back(*N); - else - otherBranch.push_back(*N); + branches.push_back(*N); } else new_recurrence.insert(*N); @@ -804,10 +801,7 @@ if(!predFound) if(!new_recurrence.count(*P)) { if((*P)->isBranch()) { - if((*P)->getInst()->getOpcode() == V9::BA) - FinalNodeOrder.push_back(*P); - else - otherBranch.push_back(*P); + branches.push_back(*P); } else new_recurrence.insert(*P); @@ -833,12 +827,9 @@ } if(!found) { if(I->first->isBranch()) { - if(std::find(FinalNodeOrder.begin(), FinalNodeOrder.end(), I->first) == FinalNodeOrder.end()) - if((I->first)->getInst()->getOpcode() == V9::BA) - FinalNodeOrder.push_back(I->first); - else - otherBranch.push_back(I->first); - } + if(std::find(branches.begin(), branches.end(), I->first) == branches.end()) + branches.push_back(I->first); + } else lastNodes.insert(I->first); } @@ -856,9 +847,13 @@ //partialOrder.push_back(lastNodes); //Clean up branches by putting them in final order - for(std::vector::iterator I = otherBranch.begin(), E = otherBranch.end(); I != E; ++I) - FinalNodeOrder.push_back(*I); - + std::map branchOrder; + for(std::vector::iterator I = branches.begin(), E = branches.end(); I != E; ++I) + branchOrder[(*I)->getIndex()] = *I; + + for(std::map::reverse_iterator I = branchOrder.rbegin(), E = branchOrder.rend(); I != E; ++I) + FinalNodeOrder.push_back(I->second); + } @@ -1153,7 +1148,11 @@ int capII = 30; while(!success) { - + + int branchES = II - 1; + int branchLS = II - 1; + bool lastBranch = true; + //Loop over the final node order and process each node for(std::vector::iterator I = FinalNodeOrder.begin(), E = FinalNodeOrder.end(); I != E; ++I) { @@ -1197,15 +1196,18 @@ } } else { - //WARNING: HACK! FIXME!!!! - if((*I)->getInst()->getOpcode() == V9::BA) { - EarlyStart = II-1; - LateStart = II-1; + if(lastBranch) { + EarlyStart = branchES; + LateStart = branchLS; + lastBranch = false; + --branchES; + branchLS = 0; } else { - EarlyStart = II-2; - LateStart = 0; + EarlyStart = branchES; + LateStart = branchLS; assert( (EarlyStart >= 0) && (LateStart >=0) && "EarlyStart and LateStart must be greater then 0"); + --branchES; } hasPred = 1; hasSucc = 1; @@ -1939,69 +1941,72 @@ writeEpilogues(epilogues, BB, llvm_epilogues, valuesToSave, newValues, newValLocation, kernelPHIs); + //Fix our branches + fixBranches(prologues, llvm_prologues, machineKernelBB, llvmKernelBB, epilogues, llvm_epilogues, BB); + + //Remove phis + removePHIs(BB, prologues, epilogues, machineKernelBB, newValLocation); + + //Print out epilogues and prologue + DEBUG(for(std::vector::iterator I = prologues.begin(), E = prologues.end(); + I != E; ++I) { + std::cerr << "PROLOGUE\n"; + (*I)->print(std::cerr); + }); + + DEBUG(std::cerr << "KERNEL\n"); + DEBUG(machineKernelBB->print(std::cerr)); + + DEBUG(for(std::vector::iterator I = epilogues.begin(), E = epilogues.end(); + I != E; ++I) { + std::cerr << "EPILOGUE\n"; + (*I)->print(std::cerr); + }); + + + DEBUG(std::cerr << "New Machine Function" << "\n"); + DEBUG(std::cerr << BB->getParent() << "\n"); + + +} + +void ModuloSchedulingPass::fixBranches(std::vector &prologues, std::vector &llvm_prologues, MachineBasicBlock *machineKernelBB, BasicBlock *llvmKernelBB, std::vector &epilogues, std::vector &llvm_epilogues, MachineBasicBlock *BB) { + const TargetInstrInfo *TMI = target.getInstrInfo(); - //Fix up machineBB and llvmBB branches + //Fix prologue branches for(unsigned I = 0; I < prologues.size(); ++I) { - MachineInstr *branch = 0; - MachineInstr *branch2 = 0; - - //Find terminator since getFirstTerminator does not work! + //Find terminator since getFirstTerminator does not work! for(MachineBasicBlock::reverse_iterator mInst = prologues[I]->rbegin(), mInstEnd = prologues[I]->rend(); mInst != mInstEnd; ++mInst) { MachineOpCode OC = mInst->getOpcode(); + //If its a branch update its branchto if(TMI->isBranch(OC)) { - if(mInst->getOpcode() == V9::BA) - branch2 = &*mInst; - else - branch = &*mInst; - DEBUG(std::cerr << *mInst << "\n"); - if(branch !=0 && branch2 !=0) - break; - } - } - - //Update branch1 - for(unsigned opNum = 0; opNum < branch->getNumOperands(); ++opNum) { - MachineOperand &mOp = branch->getOperand(opNum); - if (mOp.getType() == MachineOperand::MO_PCRelativeDisp) { - //Check if we are branching to the kernel, if not branch to epilogue - if(mOp.getVRegValue() == BB->getBasicBlock()) { - if(I == prologues.size()-1) - mOp.setValueReg(llvmKernelBB); - else - mOp.setValueReg(llvm_prologues[I+1]); + for(unsigned opNum = 0; opNum < mInst->getNumOperands(); ++opNum) { + MachineOperand &mOp = mInst->getOperand(opNum); + if (mOp.getType() == MachineOperand::MO_PCRelativeDisp) { + //Check if we are branching to the kernel, if not branch to epilogue + if(mOp.getVRegValue() == BB->getBasicBlock()) { + if(I == prologues.size()-1) + mOp.setValueReg(llvmKernelBB); + else + mOp.setValueReg(llvm_prologues[I+1]); + } + else { + mOp.setValueReg(llvm_epilogues[(llvm_epilogues.size()-1-I)]); + } + } } - else - mOp.setValueReg(llvm_epilogues[(llvm_epilogues.size()-1-I)]); - } - } - //Update branch1 - for(unsigned opNum = 0; opNum < branch2->getNumOperands(); ++opNum) { - MachineOperand &mOp = branch2->getOperand(opNum); - if (mOp.getType() == MachineOperand::MO_PCRelativeDisp) { - //Check if we are branching to the kernel, if not branch to epilogue - if(mOp.getVRegValue() == BB->getBasicBlock()) { - if(I == prologues.size()-1) - mOp.setValueReg(llvmKernelBB); - else - mOp.setValueReg(llvm_prologues[I+1]); - } - else - mOp.setValueReg(llvm_epilogues[(llvm_epilogues.size()-1-I)]); + DEBUG(std::cerr << "New Prologue Branch: " << *mInst << "\n"); } } + //Update llvm basic block with our new branch instr DEBUG(std::cerr << BB->getBasicBlock()->getTerminator() << "\n"); const BranchInst *branchVal = dyn_cast(BB->getBasicBlock()->getTerminator()); - //TmpInstruction *tmp = new TmpInstruction(branchVal->getCondition()); - - //Add TmpInstruction to original branches MCFI - //MachineCodeForInstruction & tempMvec = MachineCodeForInstruction::get(branchVal); - //tempMvec.addTemp((Value*) tmp); - + if(I == prologues.size()-1) { TerminatorInst *newBranch = new BranchInst(llvmKernelBB, llvm_epilogues[(llvm_epilogues.size()-1-I)], @@ -2014,60 +2019,34 @@ branchVal->getCondition(), llvm_prologues[I]); - assert(branch != 0 && "There must be a terminator for this machine basic block!\n"); - } - //Fix up kernel machine branches - MachineInstr *branch = 0; - MachineInstr *BAbranch = 0; + Value *origBranchExit = 0; + //Fix up kernel machine branches for(MachineBasicBlock::reverse_iterator mInst = machineKernelBB->rbegin(), mInstEnd = machineKernelBB->rend(); mInst != mInstEnd; ++mInst) { MachineOpCode OC = mInst->getOpcode(); if(TMI->isBranch(OC)) { - if(mInst->getOpcode() == V9::BA) { - BAbranch = &*mInst; - } - else { - branch = &*mInst; - break; + for(unsigned opNum = 0; opNum < mInst->getNumOperands(); ++opNum) { + MachineOperand &mOp = mInst->getOperand(opNum); + + if(mOp.getType() == MachineOperand::MO_PCRelativeDisp) { + if(mOp.getVRegValue() == BB->getBasicBlock()) + mOp.setValueReg(llvmKernelBB); + else + if(llvm_epilogues.size() > 0) { + assert(origBranchExit == 0 && "There should only be one branch out of the loop"); + + origBranchExit = mOp.getVRegValue(); + mOp.setValueReg(llvm_epilogues[0]); + } + } } } } - - assert(branch != 0 && "There must be a terminator for the kernel machine basic block!\n"); - //Update kernel self loop branch - for(unsigned opNum = 0; opNum < branch->getNumOperands(); ++opNum) { - MachineOperand &mOp = branch->getOperand(opNum); - - if (mOp.getType() == MachineOperand::MO_PCRelativeDisp) { - mOp.setValueReg(llvmKernelBB); - } - } - - Value *origBAVal = 0; - - //Update kernel BA branch - for(unsigned opNum = 0; opNum < BAbranch->getNumOperands(); ++opNum) { - MachineOperand &mOp = BAbranch->getOperand(opNum); - if (mOp.getType() == MachineOperand::MO_PCRelativeDisp) { - origBAVal = mOp.getVRegValue(); - if(llvm_epilogues.size() > 0) - mOp.setValueReg(llvm_epilogues[0]); - - } - } - - assert((origBAVal != 0) && "Could not find original branch always value"); - //Update kernelLLVM branches const BranchInst *branchVal = dyn_cast(BB->getBasicBlock()->getTerminator()); - //TmpInstruction *tmp = new TmpInstruction(branchVal->getCondition()); - - //Add TmpInstruction to original branches MCFI - //MachineCodeForInstruction & tempMvec = MachineCodeForInstruction::get(branchVal); - //tempMvec.addTemp((Value*) tmp); assert(llvm_epilogues.size() != 0 && "We must have epilogues!"); @@ -2089,7 +2068,7 @@ } else { - BuildMI(epilogues[I], V9::BA, 1).addPCDisp(origBAVal); + BuildMI(epilogues[I], V9::BA, 1).addPCDisp(origBranchExit); //Update last epilogue exit branch @@ -2177,29 +2156,6 @@ } } - removePHIs(BB, prologues, epilogues, machineKernelBB, newValLocation); - - - - //Print out epilogues and prologue - DEBUG(for(std::vector::iterator I = prologues.begin(), E = prologues.end(); - I != E; ++I) { - std::cerr << "PROLOGUE\n"; - (*I)->print(std::cerr); - }); - - DEBUG(std::cerr << "KERNEL\n"); - DEBUG(machineKernelBB->print(std::cerr)); - - DEBUG(for(std::vector::iterator I = epilogues.begin(), E = epilogues.end(); - I != E; ++I) { - std::cerr << "EPILOGUE\n"; - (*I)->print(std::cerr); - }); - - - DEBUG(std::cerr << "New Machine Function" << "\n"); - DEBUG(std::cerr << BB->getParent() << "\n"); //BB->getParent()->getBasicBlockList().erase(BB); Index: llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h diff -u llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h:1.20 llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h:1.21 --- llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h:1.20 Mon Nov 22 14:41:24 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h Sun Nov 28 22:39:47 2004 @@ -99,6 +99,8 @@ //void saveValue(const MachineInstr*, const std::set&, std::vector*); + void fixBranches(std::vector &prologues, std::vector &llvm_prologues, MachineBasicBlock *machineBB, BasicBlock *llvmBB, std::vector &epilogues, std::vector &llvm_epilogues, MachineBasicBlock*); + void writePrologues(std::vector &prologues, MachineBasicBlock *origBB, std::vector &llvm_prologues, std::map > &valuesToSave, std::map > &newValues, std::map &newValLocation); void writeEpilogues(std::vector &epilogues, const MachineBasicBlock *origBB, std::vector &llvm_epilogues, std::map > &valuesToSave,std::map > &newValues, std::map &newValLocation, std::map > &kernelPHIs); From llvm at cs.uiuc.edu Sun Nov 28 22:46:23 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sun, 28 Nov 2004 22:46:23 -0600 Subject: [llvm-commits] CVS: llvm/docs/doxygen.cfg Message-ID: <200411290446.WAA00572@zion.cs.uiuc.edu> Changes in directory llvm/docs: doxygen.cfg (r1.9) removed --- Log message: Moved --> doxygen.cfg.in --- Diffs of the changes: (+0 -0) From reid at x10sys.com Sun Nov 28 22:47:45 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 22:47:45 -0600 Subject: [llvm-commits] CVS: llvm/docs/Makefile Message-ID: <200411290447.WAA00622@zion.cs.uiuc.edu> Changes in directory llvm/docs: Makefile updated: 1.4 -> 1.5 --- Log message: * Make this makefile compliant with LLVM makefile standards * Implement optional doxygen doc generation * Implement HTML and doxygen installation --- Diffs of the changes: (+53 -5) Index: llvm/docs/Makefile diff -u llvm/docs/Makefile:1.4 llvm/docs/Makefile:1.5 --- llvm/docs/Makefile:1.4 Tue Oct 21 09:32:18 2003 +++ llvm/docs/Makefile Sun Nov 28 22:47:35 2004 @@ -6,9 +6,57 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## -doxygen-files: - doxygen doxygen.cfg -doxygen.tar.gz: doxygen/index.html - rm -rf $@ - gtar czvf $@ doxygen +LEVEL := .. +DIRS := CommandGuide + +include $(LEVEL)/Makefile.common + +HTML := $(wildcard $(BUILD_SRC_DIR)/*.html) \ + $(wildcard $(BUILD_SRC_DIR)/*.css) +IMAGES := $(wildcard $(BUILD_SRC_DIR)/img/*.*) +DOXYFILES := $(wildcard $(BUILD_SRC_DIR)/doxygen.*) +EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img + +.PHONY: install-html install-doxygen doxygen + +ifeq ($(ENABLE_DOXYGEN),1) +install-local:: install-html install-doxygen +else +install-local:: install-html +endif + +install-html: $(BUILD_OBJ_DIR)/html.tar.gz + $(Echo) Installing HTML documentation + $(Verb) $(INSTALL) -d $(LLVM_DOCSDIR)/html + $(Verb) $(INSTALL) -d $(LLVM_DOCSDIR)/html/img + $(Verb) $(INSTALL) -C $(HTML) $(LLVM_DOCSDIR)/html + $(Verb) $(INSTALL) -C $(IMAGES) $(LLVM_DOCSDIR)/html/img + $(Verb) $(INSTALL) -C $(BUILD_OBJ_DIR)/html.tar.gz $(LLVM_DOCSDIR) + +$(BUILD_OBJ_DIR)/html.tar.gz: $(HTML) + $(Echo) Packaging HTML documentation + $(Verb) $(RM) -rf $@ $(BUILD_OBJ_DIR)/html.tar + $(Verb) cd $(BUILD_SRC_DIR) && \ + $(TAR) cf $(BUILD_OBJ_DIR)/html.tar *.html + $(Verb) $(GZIP) $(BUILD_OBJ_DIR)/html.tar + +install-doxygen: doxygen + $(Echo) Installing doxygen documentation + $(Echo) Installing doxygen documentation + $(Verb) $(INSTALL) -d $(LLVM_DOCSDIR)/html/doxygen + $(Verb) $(INSTALL) $(BUILD_OBJ_DIR)/doxygen.tar.gz $(LLVM_DOCSDIR) + $(Verb) cd $(BUILD_OBJ_DIR)/doxygen && \ + $(FIND) . -type f -exec \ + $(INSTALL) -C {} $(LLVM_DOCSDIR)/html/doxygen \; + +doxygen: $(BUILD_OBJ_DIR)/doxygen.tar.gz + +$(BUILD_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(BUILD_OBJ_DIR)/doxygen.cfg + $(Echo) Building doxygen documentation + $(Verb) $(DOXYGEN) $(BUILD_OBJ_DIR)/doxygen.cfg + $(Echo) Packaging doxygen documentation + $(Verb) $(RM) -rf $@ $(BUILD_OBJ_DIR)/doxygen.tar + $(Verb) $(TAR) cf $(BUILD_OBJ_DIR)/doxygen.tar doxygen + $(Verb) $(GZIP) $(BUILD_OBJ_DIR)/doxygen.tar + From reid at x10sys.com Sun Nov 28 22:52:09 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 22:52:09 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ar/Makefile Message-ID: <200411290452.WAA00674@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ar: Makefile updated: 1.6 -> 1.7 --- Log message: Make the check a little quieter. --- Diffs of the changes: (+5 -3) Index: llvm/tools/llvm-ar/Makefile diff -u llvm/tools/llvm-ar/Makefile:1.6 llvm/tools/llvm-ar/Makefile:1.7 --- llvm/tools/llvm-ar/Makefile:1.6 Thu Nov 25 14:22:07 2004 +++ llvm/tools/llvm-ar/Makefile Sun Nov 28 22:51:58 2004 @@ -15,6 +15,8 @@ include $(LEVEL)/Makefile.common check-local:: - $(ToolDir)/llvm-ar zRrS nada.a . - $(ToolDir)/llvm-ar tv nada.a | grep Debug/llvm-ar.d >/dev/null 2>&1 - $(RM) -f nada.a + $(Echo) Checking llvm-ar + $(Verb) $(ToolDir)/llvm-ar zRrS nada.a . + $(Verb) $(ToolDir)/llvm-ar tv nada.a | \ + grep Debug/llvm-ar.d >/dev/null 2>&1 + $(Verb) $(RM) -f nada.a From reid at x10sys.com Sun Nov 28 22:54:00 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 22:54:00 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.config.in Message-ID: <200411290454.WAA00694@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.config.in updated: 1.39 -> 1.40 --- Log message: * Get additional configured values into the makefiles * Provide support for ENABLE_DOXYGEN * New tools that documentation generation requires --- Diffs of the changes: (+54 -31) Index: llvm/Makefile.config.in diff -u llvm/Makefile.config.in:1.39 llvm/Makefile.config.in:1.40 --- llvm/Makefile.config.in:1.39 Thu Nov 25 14:21:53 2004 +++ llvm/Makefile.config.in Sun Nov 28 22:53:50 2004 @@ -12,6 +12,21 @@ # #===------------------------------------------------------------------------===# +# Define LLVM speific info and directories +PACKAGE_NAME := @PACKAGE_NAME@ +PACKAGE_VERSION := @PACKAGE_VERSION@ +LLVM_PREFIX := @LLVM_PREFIX@ +LLVM_BINDIR := @LLVM_BINDIR@ +LLVM_LIBDIR := @LLVM_LIBDIR@ +LLVM_DATADIR := @LLVM_DATADIR@ +LLVM_DOCSDIR := @LLVM_DOCSDIR@ +LLVM_ETCDIR := @LLVM_ETCDIR@ +LLVM_INCLUDEDIR := @LLVM_INCLUDEDIR@ +LLVM_INFODIR := @LLVM_INFODIR@ +LLVM_MANDIR := @LLVM_MANDIR@ +LLVM_CONFIGTIME := @LLVM_CONFIGTIME@ +LLVM_TARBALL_NAME := @PACKAGE_NAME at -@PACKAGE_VERSION@ + # Target operating system for which LLVM will be compiled. OS=@OS@ @@ -31,12 +46,6 @@ # Path to the CC binary, which use used by testcases for native builds. CC := @CC@ -# Path to the Python interpreter -PYTHON := @PYTHON@ - -# Path to the Deja-Gnu runtest program -RUNTEST := @RUNTEST@ - # Linker flags. LDFLAGS+=@LDFLAGS@ @@ -47,28 +56,42 @@ AR_PATH = @AR@ # The pathnames of the programs we require to build -YACC = @YACC@ -BISON = @BISON@ -FLEX = @LEX@ -TAR = @TAR@ -INSTALL = @INSTALL@ -DOT = @DOT@ -ETAGS = @ETAGS@ -ETAGSFLAGS = @ETAGSFLAGS@ +BISON := @BISON@ +DATE := @DATE@ +FIND := @FIND@ +FLEX := @LEX@ +GREP := @GREP@ +INSTALL := @INSTALL@ +INSTALL_SH := $(BUILD_SRC_ROOT)/autoconf/install-sh +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ +MKDIR := @abs_top_srcdir@/autoconf/mkinstalldirs +MV := @MV@ +PAX := @PAX@ +RANLIB := @RANLIB@ +RM := @RM@ +SED := @SED@ +TAR := @TAR@ +YACC := @YACC@ + +# Paths to miscellaneous programs we hope are present but might not be +BZIP2 := @BZIP2@ +DOT := @DOT@ +DOXYGEN := @DOXYGEN@ +ETAGS := @ETAGS@ +ETAGSFLAGS := @ETAGSFLAGS@ +GROFF := @GROFF@ +GZIP := @GZIP@ +POD2HTML := @POD2HTML@ +POD2MAN := @POD2MAN@ +PYTHON := @PYTHON@ +RUNTEST := @RUNTEST@ +ZIP := @ZIP@ # Paths to miscellaneous programs we assume are present -RPWD = pwd -SED = sed -RM = rm -ECHO = echo -MKDIR = @abs_top_srcdir@/autoconf/mkinstalldirs -INSTALL_SH = $(BUILD_SRC_ROOT)/autoconf/install-sh -DATE = date -MV = mv -GZIP = gzip -ZIP = zip -BZIP2 = bzip2 - +RPWD := pwd +ECHO := echo # Determine the target for which LLVM should generate code. LLVMGCCARCH := @target@/3.4-llvm @@ -97,6 +120,9 @@ # information to allow gprof to be used to get execution frequencies. #ENABLE_PROFILING = 1 +# When ENABLE_DOXYGEN is enabled, the doxygen documentation will be built +ENABLE_DOXYGEN = @ENABLE_DOXYGEN@ + # This option tells the Makefiles to produce verbose output. # It essentially prints the commands that make is executing #VERBOSE = 1 @@ -162,6 +188,8 @@ endif # Installation directories, as provided by the configure script. +abs_top_srcdir = @abs_top_srcdir@ +abs_top_builddir = @abs_top_builddir@ exec_prefix = @exec_prefix@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -177,8 +205,3 @@ includedir = @includedir@ infodir = @infodir@ mandir = @mandir@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_DATA = @INSTALL_DATA@ -LLVM_TARBALL_NAME = @PACKAGE_NAME at -@PACKAGE_VERSION@ - From reid at x10sys.com Sun Nov 28 22:56:45 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 22:56:45 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200411290456.WAA00740@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.135 -> 1.136 --- Log message: * allow doxygen documentation to be enabled/disabled (default off) * organize programs we test for properly * add new programs needed for documentation generation * Adjust install paths so llvm stuff doesn't muck up /usr/local or /usr if $prefix is set to those. --- Diffs of the changes: (+35 -10) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.135 llvm/autoconf/configure.ac:1.136 --- llvm/autoconf/configure.ac:1.135 Sat Nov 27 16:01:42 2004 +++ llvm/autoconf/configure.ac Sun Nov 28 22:56:35 2004 @@ -187,6 +187,18 @@ esac fi +dnl Allow enablement of doxygen generated documentation +AC_ARG_ENABLE(doxygen, + AS_HELP_STRING([--enable-doxygen], + [Build doxygen documentation (default is NO)]),, + enableval=default) +case "$enableval" in + yes) AC_SUBST(ENABLE_DOXYGEN,[1]) ;; + no) AC_SUBST(ENABLE_DOXYGEN,[0]) ;; + default) AC_SUBST(ENABLE_DOXYGEN,[0]) ;; + *) AC_MSG_ERROR([Invalid setting for --enable-doxygen. Use "yes" or "no"]) ;; +esac + dnl Find the LLVM GCC-based C/C++ front end AC_ARG_WITH(llvmgccdir, AS_HELP_STRING(--with-llvmgccdir,[Location of LLVM GCC front-end]), @@ -230,26 +242,36 @@ dnl Check for the tools that the makefiles require AC_CHECK_GNU_MAKE AC_PROG_LN_S +AC_PATH_PROG(DATE, [date], [date]) AC_PATH_PROG(FIND, [find], [find]) AC_PATH_PROG(GREP, [grep], [grep]) AC_PATH_PROG(MKDIR,[mkdir],[mkdir]) -AC_PATH_PROG(MV, [mv], [mv]) +AC_PATH_PROG(MV, [mv], [mv]) +AC_PATH_PROG(PAX, [pax], [pax]) AC_PROG_RANLIB -AC_PATH_PROG(RM, [rm], [rm]) -AC_PATH_PROG(SED, [sed], [sed]) -AC_PATH_PROG(TAR, [tar],[gtar]) +AC_PATH_PROG(RM, [rm], [rm]) +AC_PATH_PROG(SED, [sed], [sed]) +AC_PATH_PROG(TAR, [tar], [gtar]) dnl Find the install program AC_PROG_INSTALL -dnl Checks for tools we can get away with not having: +dnl Checks for documentation and testing tools that we can do without. If these +dnl are not found then they are set to "true" which always succeeds but does +dnl nothing. This just lets the build output show that we could have done +dnl something if the tool was available. +AC_PATH_PROG(BZIP2,[bzip2],[true bzip2]) AC_PATH_PROG(DOT,[dot],[true dot]) +AC_PATH_PROG(DOXYGEN,[doxygen],[true doxygen]) AC_PATH_PROG(ETAGS,[etags],[true etags]) - -dnl Check for optional testing tools +AC_PATH_PROG(GROFF,[groff],[true groff]) +AC_PATH_PROG(GZIP,[gzip],[true gzip]) +AC_PATH_PROG(POD2HTML,[pod2html],[true pod2html]) +AC_PATH_PROG(POD2MAN,[pod2man],[true pod2man]) AC_PATH_PROG(PYTHON,[python],[true python]) AC_PATH_PROG(QMTEST,[qmtest],[true qmtest]) AC_PATH_PROG(RUNTEST,[runtest],[true runtest]) +AC_PATH_PROG(ZIP,[zip],[true zip]) dnl Determine if the linker supports the -R option. AC_LINK_USE_R @@ -476,9 +498,9 @@ eval LLVM_PREFIX="${prefix}"; eval LLVM_BINDIR="${prefix}/bin"; eval LLVM_LIBDIR="${prefix}/lib"; -eval LLVM_DATADIR="${prefix}/data"; -eval LLVM_DOCSDIR="${prefix}/docs"; -eval LLVM_ETCDIR="${prefix}/etc"; +eval LLVM_DATADIR="${prefix}/share/llvm"; +eval LLVM_DOCSDIR="${prefix}/docs/llvm"; +eval LLVM_ETCDIR="${prefix}/etc/llvm"; eval LLVM_INCLUDEDIR="${prefix}/include"; eval LLVM_INFODIR="${prefix}/info"; eval LLVM_MANDIR="${prefix}/man"; @@ -538,6 +560,9 @@ dnl Configure llvmc's configuration files AC_CONFIG_FILES([tools/llvmc/st tools/llvmc/cpp tools/llvmc/ll tools/llvmc/c]) +dnl Configure doxygen's configuration file +AC_CONFIG_FILES([docs/doxygen.cfg]) + dnl Do special configuration of Makefiles AC_CONFIG_MAKEFILE(Makefile) AC_CONFIG_MAKEFILE(Makefile.common) From reid at x10sys.com Sun Nov 28 22:56:45 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 22:56:45 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200411290456.WAA00743@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.142 -> 1.143 --- Log message: * allow doxygen documentation to be enabled/disabled (default off) * organize programs we test for properly * add new programs needed for documentation generation * Adjust install paths so llvm stuff doesn't muck up /usr/local or /usr if $prefix is set to those. --- Diffs of the changes: (+423 -32) Index: llvm/configure diff -u llvm/configure:1.142 llvm/configure:1.143 --- llvm/configure:1.142 Sat Nov 27 16:01:43 2004 +++ llvm/configure Sun Nov 28 22:56:34 2004 @@ -476,7 +476,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT LLVMGCCDIR CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ifGNUmake FIND GREP MKDIR MV RM SED TAR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA DOT ETAGS PYTHON QMTEST RUNTEST ETAGSFLAGS ALLOCA MMAP_FILE LLVMGCC LLVMCC1 LLVMCC1PLUS SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOC! SDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT ENABLE_DOXYGEN LLVMGCCDIR CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ifGNUmake DATE FIND GREP MKDIR MV PAX RM SED TAR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA BZIP2 DOT DOXYGEN ETAGS GROFF GZIP POD2HTML POD2MAN PYTHON QMTEST RUNTEST ZIP ETAGSFLAGS ALLOCA MMAP_FILE LLVMGCC LLVMCC1 LLVMCC1P! LUS SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1036,6 +1036,7 @@ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-optimized --enable-jit Enable Just In Time Compiling (default is YES) + --enable-doxygen Build doxygen documentation (default is NO) --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] @@ -2957,6 +2958,23 @@ esac fi +# Check whether --enable-doxygen or --disable-doxygen was given. +if test "${enable_doxygen+set}" = set; then + enableval="$enable_doxygen" + enableval=yes +else + enableval=no +fi; +case "$enableval" in + yes) ENABLE_DOXYGEN=1 + ;; + no) ENABLE_DOXYGEN=0 + ;; + *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-doxygen. Use \"yes\" or \"no\"" >&5 +echo "$as_me: error: Invalid setting for --enable-doxygen. Use \"yes\" or \"no\"" >&2;} + { (exit 1); exit 1; }; } ;; +esac + # Check whether --with-llvmgccdir or --without-llvmgccdir was given. if test "${with_llvmgccdir+set}" = set; then @@ -4989,7 +5007,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4992 "configure"' > conftest.$ac_ext + echo '#line 5010 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5863,7 +5881,7 @@ # Provide some information about the compiler. -echo "$as_me:5866:" \ +echo "$as_me:5884:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -6920,11 +6938,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6923: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6941: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6927: \$? = $ac_status" >&5 + echo "$as_me:6945: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -7163,11 +7181,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7166: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7184: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7170: \$? = $ac_status" >&5 + echo "$as_me:7188: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -7223,11 +7241,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7226: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7244: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7230: \$? = $ac_status" >&5 + echo "$as_me:7248: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9408,7 +9426,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:11720: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11706: \$? = $ac_status" >&5 + echo "$as_me:11724: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -11759,11 +11777,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11762: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11780: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11766: \$? = $ac_status" >&5 + echo "$as_me:11784: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -13120,7 +13138,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:14076: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14062: \$? = $ac_status" >&5 + echo "$as_me:14080: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -14115,11 +14133,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14118: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14136: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14122: \$? = $ac_status" >&5 + echo "$as_me:14140: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16154,11 +16172,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16157: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16175: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16161: \$? = $ac_status" >&5 + echo "$as_me:16179: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16397,11 +16415,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16400: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16418: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16404: \$? = $ac_status" >&5 + echo "$as_me:16422: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16457,11 +16475,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16460: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16478: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16464: \$? = $ac_status" >&5 + echo "$as_me:16482: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18642,7 +18660,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&6 fi +# Extract the first word of "date", so it can be a program name with args. +set dummy date; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DATE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DATE in + [\\/]* | ?:[\\/]*) + ac_cv_path_DATE="$DATE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DATE="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_DATE" && ac_cv_path_DATE="date" + ;; +esac +fi +DATE=$ac_cv_path_DATE + +if test -n "$DATE"; then + echo "$as_me:$LINENO: result: $DATE" >&5 +echo "${ECHO_T}$DATE" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + # Extract the first word of "find", so it can be a program name with args. set dummy find; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -19956,6 +20014,46 @@ echo "${ECHO_T}no" >&6 fi +# Extract the first word of "pax", so it can be a program name with args. +set dummy pax; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PAX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PAX in + [\\/]* | ?:[\\/]*) + ac_cv_path_PAX="$PAX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PAX="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_PAX" && ac_cv_path_PAX="pax" + ;; +esac +fi +PAX=$ac_cv_path_PAX + +if test -n "$PAX"; then + echo "$as_me:$LINENO: result: $PAX" >&5 +echo "${ECHO_T}$PAX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 @@ -20237,6 +20335,46 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +# Extract the first word of "bzip2", so it can be a program name with args. +set dummy bzip2; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_BZIP2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $BZIP2 in + [\\/]* | ?:[\\/]*) + ac_cv_path_BZIP2="$BZIP2" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_BZIP2="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_BZIP2" && ac_cv_path_BZIP2="true bzip2" + ;; +esac +fi +BZIP2=$ac_cv_path_BZIP2 + +if test -n "$BZIP2"; then + echo "$as_me:$LINENO: result: $BZIP2" >&5 +echo "${ECHO_T}$BZIP2" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + # Extract the first word of "dot", so it can be a program name with args. set dummy dot; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -20277,6 +20415,46 @@ echo "${ECHO_T}no" >&6 fi +# Extract the first word of "doxygen", so it can be a program name with args. +set dummy doxygen; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DOXYGEN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DOXYGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_DOXYGEN" && ac_cv_path_DOXYGEN="true doxygen" + ;; +esac +fi +DOXYGEN=$ac_cv_path_DOXYGEN + +if test -n "$DOXYGEN"; then + echo "$as_me:$LINENO: result: $DOXYGEN" >&5 +echo "${ECHO_T}$DOXYGEN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + # Extract the first word of "etags", so it can be a program name with args. set dummy etags; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -20317,6 +20495,165 @@ echo "${ECHO_T}no" >&6 fi +# Extract the first word of "groff", so it can be a program name with args. +set dummy groff; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GROFF+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GROFF in + [\\/]* | ?:[\\/]*) + ac_cv_path_GROFF="$GROFF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GROFF="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_GROFF" && ac_cv_path_GROFF="true groff" + ;; +esac +fi +GROFF=$ac_cv_path_GROFF + +if test -n "$GROFF"; then + echo "$as_me:$LINENO: result: $GROFF" >&5 +echo "${ECHO_T}$GROFF" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "gzip", so it can be a program name with args. +set dummy gzip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GZIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GZIP in + [\\/]* | ?:[\\/]*) + ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_GZIP" && ac_cv_path_GZIP="true gzip" + ;; +esac +fi +GZIP=$ac_cv_path_GZIP + +if test -n "$GZIP"; then + echo "$as_me:$LINENO: result: $GZIP" >&5 +echo "${ECHO_T}$GZIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "pod2html", so it can be a program name with args. +set dummy pod2html; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_POD2HTML+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $POD2HTML in + [\\/]* | ?:[\\/]*) + ac_cv_path_POD2HTML="$POD2HTML" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_POD2HTML="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_POD2HTML" && ac_cv_path_POD2HTML="true pod2html" + ;; +esac +fi +POD2HTML=$ac_cv_path_POD2HTML + +if test -n "$POD2HTML"; then + echo "$as_me:$LINENO: result: $POD2HTML" >&5 +echo "${ECHO_T}$POD2HTML" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "pod2man", so it can be a program name with args. +set dummy pod2man; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_POD2MAN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $POD2MAN in + [\\/]* | ?:[\\/]*) + ac_cv_path_POD2MAN="$POD2MAN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_POD2MAN="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_POD2MAN" && ac_cv_path_POD2MAN="true pod2man" + ;; +esac +fi +POD2MAN=$ac_cv_path_POD2MAN + +if test -n "$POD2MAN"; then + echo "$as_me:$LINENO: result: $POD2MAN" >&5 +echo "${ECHO_T}$POD2MAN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi # Extract the first word of "python", so it can be a program name with args. set dummy python; ac_word=$2 @@ -20438,6 +20775,46 @@ echo "${ECHO_T}no" >&6 fi +# Extract the first word of "zip", so it can be a program name with args. +set dummy zip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ZIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ZIP in + [\\/]* | ?:[\\/]*) + ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_ZIP" && ac_cv_path_ZIP="true zip" + ;; +esac +fi +ZIP=$ac_cv_path_ZIP + +if test -n "$ZIP"; then + echo "$as_me:$LINENO: result: $ZIP" >&5 +echo "${ECHO_T}$ZIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + echo "$as_me:$LINENO: checking for compiler -Wl,-R option" >&5 echo $ECHO_N "checking for compiler -Wl,-R option... $ECHO_C" >&6 @@ -25428,9 +25805,9 @@ eval LLVM_PREFIX="${prefix}"; eval LLVM_BINDIR="${prefix}/bin"; eval LLVM_LIBDIR="${prefix}/lib"; -eval LLVM_DATADIR="${prefix}/data"; -eval LLVM_DOCSDIR="${prefix}/docs"; -eval LLVM_ETCDIR="${prefix}/etc"; +eval LLVM_DATADIR="${prefix}/share/llvm"; +eval LLVM_DOCSDIR="${prefix}/docs/llvm"; +eval LLVM_ETCDIR="${prefix}/etc/llvm"; eval LLVM_INCLUDEDIR="${prefix}/include"; eval LLVM_INFODIR="${prefix}/info"; eval LLVM_MANDIR="${prefix}/man"; @@ -25520,6 +25897,9 @@ ac_config_files="$ac_config_files tools/llvmc/st tools/llvmc/cpp tools/llvmc/ll tools/llvmc/c" + ac_config_files="$ac_config_files docs/doxygen.cfg" + + ac_config_commands="$ac_config_commands Makefile" @@ -26115,6 +26495,7 @@ "tools/llvmc/cpp" ) CONFIG_FILES="$CONFIG_FILES tools/llvmc/cpp" ;; "tools/llvmc/ll" ) CONFIG_FILES="$CONFIG_FILES tools/llvmc/ll" ;; "tools/llvmc/c" ) CONFIG_FILES="$CONFIG_FILES tools/llvmc/c" ;; + "docs/doxygen.cfg" ) CONFIG_FILES="$CONFIG_FILES docs/doxygen.cfg" ;; "lib/System/platform" ) CONFIG_LINKS="$CONFIG_LINKS lib/System/platform:lib/System/$llvm_cv_platform_type" ;; "Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; "Makefile.common" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.common" ;; @@ -26247,6 +26628,7 @@ s, at OBJEXT@,$OBJEXT,;t t s, at ENABLE_OPTIMIZED@,$ENABLE_OPTIMIZED,;t t s, at JIT@,$JIT,;t t +s, at ENABLE_DOXYGEN@,$ENABLE_DOXYGEN,;t t s, at LLVMGCCDIR@,$LLVMGCCDIR,;t t s, at CPP@,$CPP,;t t s, at CXX@,$CXX,;t t @@ -26273,21 +26655,30 @@ s, at ac_ct_F77@,$ac_ct_F77,;t t s, at LIBTOOL@,$LIBTOOL,;t t s, at ifGNUmake@,$ifGNUmake,;t t +s, at DATE@,$DATE,;t t s, at FIND@,$FIND,;t t s, at GREP@,$GREP,;t t s, at MKDIR@,$MKDIR,;t t s, at MV@,$MV,;t t +s, at PAX@,$PAX,;t t s, at RM@,$RM,;t t s, at SED@,$SED,;t t s, at TAR@,$TAR,;t t s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s, at INSTALL_DATA@,$INSTALL_DATA,;t t +s, at BZIP2@,$BZIP2,;t t s, at DOT@,$DOT,;t t +s, at DOXYGEN@,$DOXYGEN,;t t s, at ETAGS@,$ETAGS,;t t +s, at GROFF@,$GROFF,;t t +s, at GZIP@,$GZIP,;t t +s, at POD2HTML@,$POD2HTML,;t t +s, at POD2MAN@,$POD2MAN,;t t s, at PYTHON@,$PYTHON,;t t s, at QMTEST@,$QMTEST,;t t s, at RUNTEST@,$RUNTEST,;t t +s, at ZIP@,$ZIP,;t t s, at ETAGSFLAGS@,$ETAGSFLAGS,;t t s, at ALLOCA@,$ALLOCA,;t t s, at MMAP_FILE@,$MMAP_FILE,;t t From reid at x10sys.com Sun Nov 28 22:58:06 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 22:58:06 -0600 Subject: [llvm-commits] CVS: llvm/Makefile Message-ID: <200411290458.WAA00763@zion.cs.uiuc.edu> Changes in directory llvm: Makefile updated: 1.42 -> 1.43 --- Log message: Add "docs" as a descendable directory (at the end) --- Diffs of the changes: (+2 -2) Index: llvm/Makefile diff -u llvm/Makefile:1.42 llvm/Makefile:1.43 --- llvm/Makefile:1.42 Thu Nov 25 03:08:54 2004 +++ llvm/Makefile Sun Nov 28 22:57:55 2004 @@ -10,7 +10,7 @@ DIRS = lib/System lib/Support utils lib tools ifneq ($(MAKECMDGOALS),tools-only) -DIRS += runtime +DIRS += runtime docs OPTIONAL_DIRS = examples projects endif @@ -44,7 +44,7 @@ $(TopDistDir)/include/llvm/Support/ThreadSupport.h check :: - cd test; $(MAKE) + $(MAKE) -C test tools-only: all From reid at x10sys.com Sun Nov 28 23:00:44 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 28 Nov 2004 23:00:44 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200411290500.XAA00827@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.239 -> 1.240 --- Log message: * Allow date command to be printed in verbose mode * Get rid of appending -lbz2 and -lz to ExtraLibs now that we don't need them any more. * Fix the dist-check target so that EXTRA_DIST can be defined AFTER the include of Makefile.common. This is needed because Makefile.common provides variable definitions that may need to be used in computing the value of EXTRA_DIST. * Clean up some "distdir" target output. --- Diffs of the changes: (+8 -17) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.239 llvm/Makefile.rules:1.240 --- llvm/Makefile.rules:1.239 Mon Nov 22 23:59:53 2004 +++ llvm/Makefile.rules Sun Nov 28 23:00:33 2004 @@ -341,7 +341,7 @@ # To create other directories, as needed, and timestamp their creation %/.dir: $(Verb) $(MKDIR) $* > /dev/null - @$(DATE) > $@ + $(Verb) $(DATE) > $@ .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir @@ -636,17 +636,6 @@ LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs)) #--------------------------------------------------------- -# Handle optional compression libraries automatically -#--------------------------------------------------------- -ExtraLibs := $(LIBS) -ifeq ($(HAVE_BZIP2),1) -ExtraLibs += -lbz2 -endif -ifeq ($(HAVE_ZLIB),1) -ExtraLibs += -lz -endif - -#--------------------------------------------------------- # Tell make that we need to rebuild subdirectories before # we can link the tool. This affects things like LLI which # has library subdirectories. @@ -1003,9 +992,9 @@ $(BUILD_SRC_DIR)/*.def \ $(BUILD_SRC_DIR)/*.ll \ $(BUILD_SRC_DIR)/*.in)) -DistSources := $(Sources) $(EXTRA_DIST) DistSubDirs := $(SubDirs) -DistFiles := $(DistAlways) $(DistSources) $(DistOther) +DistSources = $(Sources) $(EXTRA_DIST) +DistFiles = $(DistAlways) $(DistSources) $(DistOther) #------------------------------------------------------------------------ # We MUST build distribution with OBJ_DIR != SRC_DIR @@ -1044,13 +1033,15 @@ $(DistTarGZip) : distdir $(Echo) Packing gzipped distribution tar file. - $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | gzip -c > "$(DistTarGZip)" + $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \ + $(GZIP) -c > "$(DistTarGZip)" dist-bzip2:: $(DistTarBZ2) $(DistTarBZ2) : distdir $(Echo) Packing bzipped distribution tar file. - $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - $(DistName) | $(BZIP2) -c >$(DistTarBZ2) + $(Verb) cd $(BUILD_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \ + $(BZIP2) -c >$(DistTarBZ2) dist-zip:: $(DistZip) @@ -1095,7 +1086,6 @@ # Provide the recursive distdir target for building the distribution directory #------------------------------------------------------------------------ distdir : $(DistSources) - $(Echo) Building Distribution Directory $(DistDir) $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \ if test -d "$(DistDir)" ; then \ find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \ @@ -1104,6 +1094,7 @@ $(EchoCmd) Removing $(DistDir) ; \ $(RM) -rf $(DistDir); \ fi + $(Echo) Building Distribution Directory $(DistDir) $(Verb) $(MKDIR) $(DistDir) $(Verb) srcdirstrip=`echo "$(BUILD_SRC_DIR)" | sed 's|.|.|g'`; \ srcrootstrip=`echo "$(BUILD_SRC_ROOT)" | sed 's|.|.|g'`; \ From lattner at cs.uiuc.edu Sun Nov 28 23:55:39 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 28 Nov 2004 23:55:39 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelSimple.cpp Message-ID: <200411290555.iAT5td4G007800@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelSimple.cpp updated: 1.296 -> 1.297 --- Log message: Revamp long/ulong comparisons to use a much more efficient sequence (thanks to Brian and the Sun compiler for pointing out that the obvious works :) This also enables folding all long comparisons into setcc and branch instructions: before we could only do == and != For example, for: void test(unsigned long long A, unsigned long long B) { if (A < B) foo(); } We now generate: test: subl $4, %esp movl %esi, (%esp) movl 8(%esp), %eax movl 12(%esp), %ecx movl 16(%esp), %edx movl 20(%esp), %esi subl %edx, %eax sbbl %esi, %ecx jae .LBBtest_2 # UnifiedReturnBlock .LBBtest_1: # then call foo movl (%esp), %esi addl $4, %esp ret .LBBtest_2: # UnifiedReturnBlock movl (%esp), %esi addl $4, %esp ret Instead of: test: subl $12, %esp movl %esi, 8(%esp) movl %ebx, 4(%esp) movl 16(%esp), %eax movl 20(%esp), %ecx movl 24(%esp), %edx movl 28(%esp), %esi cmpl %edx, %eax setb %al cmpl %esi, %ecx setb %bl cmove %ax, %bx testb %bl, %bl je .LBBtest_2 # UnifiedReturnBlock .LBBtest_1: # then call foo movl 4(%esp), %ebx movl 8(%esp), %esi addl $12, %esp ret .LBBtest_2: # UnifiedReturnBlock movl 4(%esp), %ebx movl 8(%esp), %esi addl $12, %esp ret --- Diffs of the changes: (+15 -36) Index: llvm/lib/Target/X86/X86ISelSimple.cpp diff -u llvm/lib/Target/X86/X86ISelSimple.cpp:1.296 llvm/lib/Target/X86/X86ISelSimple.cpp:1.297 --- llvm/lib/Target/X86/X86ISelSimple.cpp:1.296 Tue Nov 16 12:40:52 2004 +++ llvm/lib/Target/X86/X86ISelSimple.cpp Sun Nov 28 23:55:24 2004 @@ -868,11 +868,8 @@ if (SetCondInst *SCI = dyn_cast(V)) if (SCI->hasOneUse()) { Instruction *User = cast(SCI->use_back()); - if ((isa(User) || isa(User)) && - (getClassB(SCI->getOperand(0)->getType()) != cLong || - SCI->getOpcode() == Instruction::SetEQ || - SCI->getOpcode() == Instruction::SetNE) && - (isa(User) || User->getOperand(0) == V)) + if (isa(User) || (isa(User) && + User->getOperand(0) == V)) return SCI; } return 0; @@ -1012,29 +1009,11 @@ BuildMI(*MBB, IP, X86::OR32rr, 2, FinalTmp).addReg(LoTmp).addReg(HiTmp); return OpNum; } else { - // Emit a sequence of code which compares the high and low parts once - // each, then uses a conditional move to handle the overflow case. For - // example, a setlt for long would generate code like this: - // - // AL = lo(op1) < lo(op2) // Always unsigned comparison - // BL = hi(op1) < hi(op2) // Signedness depends on operands - // dest = hi(op1) == hi(op2) ? BL : AL; - // - - // FIXME: This would be much better if we had hierarchical register - // classes! Until then, hardcode registers so that we can deal with - // their aliases (because we don't have conditional byte moves). - // - BuildMI(*MBB, IP, X86::CMP32ri, 2).addReg(Op0r).addImm(LowCst); - BuildMI(*MBB, IP, SetCCOpcodeTab[0][OpNum], 0, X86::AL); - BuildMI(*MBB, IP, X86::CMP32ri, 2).addReg(Op0r+1).addImm(HiCst); - BuildMI(*MBB, IP, SetCCOpcodeTab[CompTy->isSigned()][OpNum], 0,X86::BL); - BuildMI(*MBB, IP, X86::IMPLICIT_DEF, 0, X86::BH); - BuildMI(*MBB, IP, X86::IMPLICIT_DEF, 0, X86::AH); - BuildMI(*MBB, IP, X86::CMOVE16rr, 2, X86::BX).addReg(X86::BX) - .addReg(X86::AX); - // NOTE: visitSetCondInst knows that the value is dumped into the BL - // register at this point for long values... + // To compare A op B, compute A-B, and check the result flag. + unsigned LowTmp = makeAnotherReg(Type::IntTy); + unsigned HiTmp = makeAnotherReg(Type::IntTy); + BuildMI(*MBB, IP, X86::SUB32ri, 2, LowTmp).addReg(Op0r).addImm(LowCst); + BuildMI(*MBB, IP, X86::SBB32ri, 2, HiTmp).addReg(Op0r+1).addImm(HiCst); return OpNum; } } @@ -1080,6 +1059,13 @@ BuildMI(*MBB, IP, X86::OR32rr, 2, FinalTmp).addReg(LoTmp).addReg(HiTmp); break; // Allow the sete or setne to be generated from flags set by OR } else { + // To compare A op B, compute A-B, and check the result flag. + unsigned LowTmp = makeAnotherReg(Type::IntTy); + unsigned HiTmp = makeAnotherReg(Type::IntTy); + BuildMI(*MBB, IP, X86::SUB32rr, 2, LowTmp).addReg(Op0r).addReg(Op1r); + BuildMI(*MBB, IP, X86::SBB32rr, 2, HiTmp).addReg(Op0r+1).addReg(Op1r+1); + return OpNum; + // Emit a sequence of code which compares the high and low parts once // each, then uses a conditional move to handle the overflow case. For // example, a setlt for long would generate code like this: @@ -1136,14 +1122,7 @@ unsigned CompClass = getClassB(CompTy); bool isSigned = CompTy->isSigned() && CompClass != cFP; - if (CompClass != cLong || OpNum < 2) { - // Handle normal comparisons with a setcc instruction... - BuildMI(*MBB, IP, SetCCOpcodeTab[isSigned][OpNum], 0, TargetReg); - } else { - // Handle long comparisons by copying the value which is already in BL into - // the register we want... - BuildMI(*MBB, IP, X86::MOV8rr, 1, TargetReg).addReg(X86::BL); - } + BuildMI(*MBB, IP, SetCCOpcodeTab[isSigned][OpNum], 0, TargetReg); } void X86ISel::visitSelectInst(SelectInst &SI) {