[llvm-commits] [llvm] r74488 - in /llvm/trunk: include/llvm/LLVMContext.h lib/VMCore/CMakeLists.txt lib/VMCore/LLVMContext.cpp lib/VMCore/LLVMContextImpl.h

Chris Lattner clattner at apple.com
Mon Jun 29 22:28:13 PDT 2009


On Jun 29, 2009, at 5:48 PM, Owen Anderson wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=74488&view=rev
> Log:
> Add LLVMContext, which will eventually be used as a container for  
> privatizing a lot of (currently) global state, including the
> constant and type uniquing tables.  For now, just make it a wrapper  
> around the existing APIs.

Thanks!

> +++ llvm/trunk/include/llvm/LLVMContext.h Mon Jun 29 19:48:55 2009
> @@ -0,0 +1,162 @@
> +//===-- llvm/LLVMContext.h - Class for managing "global" state --*-  
> C++ -*-===//
> +//
> +//                     The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open  
> Source
> +// License. See LICENSE.TXT for details.
> +//
> +// 
> = 
> = 
> = 
> ----------------------------------------------------------------------= 
> ==//

Please follow the standard header style, adding the blob that  
describes what this header is all about.

> +#ifndef LLVM_LLVMCONTEXT_H
> +#define LLVM_LLVMCONTEXT_H
> +
> +#include "llvm/Support/DataTypes.h"
> +#include <vector>
> +#include <string>

It is really unfortunate to include vector and string in this header,  
would it be possible to fix these API mistakes incrementally by making  
this API take "start pointer + count"-style APIs?

> +
> +class LLVMContext {

The class needs a big fat doxygen comment.  You need to disable copy  
ctor and operator=.

> +++ llvm/trunk/lib/VMCore/LLVMContext.cpp Mon Jun 29 19:48:55 2009
> @@ -0,0 +1,379 @@
> +//===-- LLVMContext.cpp - Implement LLVMContext  
> -----------------------===//
> +//
> +//                     The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open  
> Source
> +// License. See LICENSE.TXT for details.
> +//
> +// 
> = 
> = 
> = 
> ----------------------------------------------------------------------= 
> ==//

Likewise, please use the standard format.  Note that the first line is  
too short and you're missing the second block.

> +++ llvm/trunk/lib/VMCore/LLVMContextImpl.h Mon Jun 29 19:48:55 2009
> @@ -0,0 +1,20 @@
> +//===-- llvm/SymbolTableListTraitsImpl.h - Implementation ------*- C 
> ++ -*--===//
> +//
> +//                     The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open  
> Source
> +// License. See LICENSE.TXT for details.
> +//
> +// 
> = 
> = 
> = 
> ----------------------------------------------------------------------= 
> ==//
> +
> +#ifndef LLVM_LLVMCONTEXT_IMPL_H
> +#define LLVM_LLVMCONTEXT_IMPL_H
> +
> +namespace llvm {
> +class LLVMContextImpl {

Same issues as the LLVMContext.h file and class.

> +
> +};
> +
> +}
> +
> +#endif
> \ No newline at end of file

Newline plz. :)

-Chris



More information about the llvm-commits mailing list