LLVM,metadata for namespaces

Hello,
I am wring front end for compiler ,the project I am working on,is based on llvm.
I have a problem with generating metadata for namespaces.
I call createNameSpace (with correct arguments) and get DINameSpace .
But in IR file no metadata for namespace is generated.
Can you advice me please what is the problem?Have I integrate in some way the DINameSpace I got with module or context?