[llvm-commits] [llvm] r45238 - in /llvm/trunk: include/llvm/LinkTimeOptimizer.h tools/lto/lto.cpp

Chris Lattner clattner at apple.com
Wed Dec 19 16:32:25 PST 2007


On Dec 19, 2007, at 4:24 PM, Devang Patel wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=45238&view=rev
> Log:
> Add lto version check mechanism.

nice.

>  #include <set>
>  #include <llvm/ADT/hash_map>
>
> +#define LLVM_LTO_VERSION 1
> +
>  namespace llvm {

Can this be an enum in the llvm namespace?

> ====================================================================== 
> ========
> --- llvm/trunk/tools/lto/lto.cpp (original)
> +++ llvm/trunk/tools/lto/lto.cpp Wed Dec 19 18:24:01 2007
> @@ -45,8 +45,11 @@
>  using namespace llvm;
>
>  extern "C"
> -llvm::LinkTimeOptimizer *createLLVMOptimizer()
> +llvm::LinkTimeOptimizer *createLLVMOptimizer(unsigned VERSION)
>  {
> +  if (VERSION != LLVM_LTO_VERSION)
> +    return NULL;

Please add a comment about what this is doing, it is non-obvious.

Thanks!

-Chris




More information about the llvm-commits mailing list