[cfe-commits] r165885 - /cfe/trunk/lib/CodeGen/CodeGenModule.cpp

John McCall rjmccall at apple.com
Tue Oct 16 09:13:58 PDT 2012


On Oct 13, 2012, at 2:56 PM, Nico Weber wrote:
> Author: nico
> Date: Sat Oct 13 16:56:05 2012
> New Revision: 165885
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=165885&view=rev
> Log:
> Simplify. Suggestion by Sean Silva.
> 
> Modified:
>    cfe/trunk/lib/CodeGen/CodeGenModule.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=165885&r1=165884&r2=165885&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sat Oct 13 16:56:05 2012
> @@ -2814,16 +2814,7 @@
>   llvm::APInt Field0(32, StringRef(Uuidstr     , 8), 16);
>   llvm::APInt Field1(16, StringRef(Uuidstr +  9, 4), 16);
>   llvm::APInt Field2(16, StringRef(Uuidstr + 14, 4), 16);
> -  llvm::APInt Field3Values[] = {
> -    llvm::APInt(8, StringRef(Uuidstr + 19, 2), 16),
> -    llvm::APInt(8, StringRef(Uuidstr + 21, 2), 16),
> -    llvm::APInt(8, StringRef(Uuidstr + 24, 2), 16),
> -    llvm::APInt(8, StringRef(Uuidstr + 26, 2), 16),
> -    llvm::APInt(8, StringRef(Uuidstr + 28, 2), 16),
> -    llvm::APInt(8, StringRef(Uuidstr + 30, 2), 16),
> -    llvm::APInt(8, StringRef(Uuidstr + 32, 2), 16),
> -    llvm::APInt(8, StringRef(Uuidstr + 34, 2), 16),
> -  };
> +  int Field3ValueOffsets[] = { 19, 21, 24, 26, 28, 30, 32, 34 };

Might as well make it static const.

John.



More information about the cfe-commits mailing list