[LLVMdev] APFloat.h header file usage

Ted Kremenek kremenek at apple.com
Sat Dec 8 06:59:34 PST 2007


On Dec 8, 2007, at 1:13 AM, Reid Spencer wrote:

> Hi,
>
> I'm trying to separate the Support, System, ADT and Config header  
> files
> into the support module, per previous plans. However, APFloat.h is not
> self-contained:
>
> APFloat.h:105:43: error: llvm/Bitcode/SerializationFwd.h: No such file
> or directory
> APFloat.h:106:37: error: llvm/CodeGen/ValueTypes.h: No such file or
> directory
>
> As you can see, APFloat.h depends on things that are not in the ADT,
> Support, or System header files. This, in my mind, constitutes a  
> design
> flaw. Can we move the functionality that depends on these header files
> elsewhere?

The inclusion of SerializationFwd.h can be removed by forward  
declaring the following two classes in APFloat.h:

Serializer;
Deserializer;

If this doesn't seem like a clean enough solution, there are other  
ways to potentially decouple APFloat more from the Serialization  
"library."  The tradeoff is that it would require some code rewriting/ 
addition, and could potentially make deserialization of APFloats (as  
done in the new C frontend) slightly less efficient.



More information about the llvm-dev mailing list