LLVM API Documentation

IncludeFile.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  llvm

Classes

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

Defines

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


Define Documentation

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

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 38 of file IncludeFile.h.

#define FORCE_DEFINING_FILE_TO_BE_LINKED ( name   ) 

Value:

namespace llvm { \
    extern char name ## LinkVar; \
    static 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 29 of file IncludeFile.h.