1 //===-- llvm/CodeGen/X86COFFMachineModuleInfo.h -----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This is an MMI implementation for X86 COFF (windows) targets.
12 //===----------------------------------------------------------------------===//
14 #ifndef X86COFF_MACHINEMODULEINFO_H
15 #define X86COFF_MACHINEMODULEINFO_H
17 #include "llvm/CodeGen/MachineModuleInfo.h"
18 #include "llvm/ADT/StringSet.h"
19 #include "X86MachineFunctionInfo.h"
22 class X86MachineFunctionInfo;
25 /// X86COFFMachineModuleInfo - This is a MachineModuleInfoImpl implementation
26 /// for X86 COFF targets.
27 class X86COFFMachineModuleInfo : public MachineModuleInfoImpl {
28 StringSet<> CygMingStubs;
30 // We have to propagate some information about MachineFunction to
31 // AsmPrinter. It's ok, when we're printing the function, since we have
32 // access to MachineFunction and can get the appropriate MachineFunctionInfo.
33 // Unfortunately, this is not possible when we're printing reference to
34 // Function (e.g. calling it and so on). Even more, there is no way to get the
35 // corresponding MachineFunctions: it can even be not created at all. That's
36 // why we should use additional structure, when we're collecting all necessary
39 // This structure is using e.g. for name decoration for stdcall & fastcall'ed
40 // function, since we have to use arguments' size for decoration.
41 typedef std::map<const Function*, X86MachineFunctionInfo> FMFInfoMap;
42 FMFInfoMap FunctionInfoMap;
45 X86COFFMachineModuleInfo(const MachineModuleInfo &);
46 ~X86COFFMachineModuleInfo();
49 void DecorateCygMingName(MCSymbol* &Name, MCContext &Ctx,
50 const GlobalValue *GV, const TargetData &TD);
51 void DecorateCygMingName(SmallVectorImpl<char> &Name, const GlobalValue *GV,
52 const TargetData &TD);
54 void AddFunctionInfo(const Function *F, const X86MachineFunctionInfo &Val);
57 typedef StringSet<>::const_iterator stub_iterator;
58 stub_iterator stub_begin() const { return CygMingStubs.begin(); }
59 stub_iterator stub_end() const { return CygMingStubs.end(); }
66 } // end namespace llvm