LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros
IncludeFile.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  llvm::IncludeFile
 Class to ensure linking of corresponding object file. More...
 

Namespaces

 llvm
 List of target independent CodeGen pass IDs.
 

Macros

#define FORCE_DEFINING_FILE_TO_BE_LINKED(name)
 
#define DEFINING_FILE_FOR(name)   namespace llvm { const char name ## LinkVar = 0; }
 

Macro Definition Documentation

#define DEFINING_FILE_FOR (   name)    namespace llvm { const char name ## LinkVar = 0; }

This macro is the counterpart to FORCE_DEFINING_FILE_TO_BE_LINKED. It should be used in a .cpp file to define the name referenced in a header file that will cause linkage of the .cpp file. It should only be used at extern level.

Definition at line 50 of file IncludeFile.h.

#define FORCE_DEFINING_FILE_TO_BE_LINKED (   name)
Value:
namespace llvm { \
extern const char name ## LinkVar; \
static const IncludeFile name ## LinkObj ( &name ## LinkVar ); \
}

This macro is the public interface that IncludeFile.h exports. This gives us the option to implement the "link the definition" capability in any manner that we choose. All header files that depend on a specific .cpp file being linked at run time should use this macro instead of the IncludeFile class directly.

For example, foo.h would use:
FORCE_DEFINING_FILE_TO_BE_LINKED(foo)

And, foo.cp would use:
DEFINING_FILE_FOR(foo)

Definition at line 40 of file IncludeFile.h.