1 //===-- Process.cpp - Implement OS Process Concept --------------*- 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 header file implements the operating system Process concept.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/Config/config.h"
15 #include "llvm/Support/Process.h"
16 #include "llvm/Support/ErrorHandling.h"
21 //===----------------------------------------------------------------------===//
22 //=== WARNING: Implementation here must contain only TRULY operating system
23 //=== independent code.
24 //===----------------------------------------------------------------------===//
26 // Empty virtual destructor to anchor the vtable for the process class.
27 process::~process() {}
29 self_process *process::get_self() {
30 // Use a function local static for thread safe initialization and allocate it
31 // as a raw pointer to ensure it is never destroyed.
32 static self_process *SP = new self_process();
37 // The destructor for the self_process subclass must never actually be
38 // executed. There should be at most one instance of this class, and that
39 // instance should live until the process terminates to avoid the potential for
40 // racy accesses during shutdown.
41 self_process::~self_process() {
42 llvm_unreachable("This destructor must never be executed!");
47 // Include the platform-specific parts of this class.
49 #include "Unix/Process.inc"
52 #include "Windows/Process.inc"