#else /* _MSC_VER */
// Visual C++ doesn't provide standard integer headers, but it does provide
// built-in data types.
+#include <stddef.h>
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef signed int int32_t;
//===----------------------------------------------------------------------===//
#include "Win32.h"
-#include <windef.h>
namespace llvm {
using namespace sys;
//===----------------------------------------------------------------------===//
DynamicLibrary::DynamicLibrary() : handle(0) {
- handle = new HMODULE;
- *((HMODULE*)handle) = GetModuleHandle(NULL);
+ handle = (void*) GetModuleHandle(NULL);
- if (*((HMODULE*)handle) == 0) {
+ if (handle == 0) {
ThrowError("Can't GetModuleHandle: ");
}
}
DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
- handle = new HMODULE;
- *((HMODULE*)handle) = LoadLibrary(filename);
+ handle = LoadLibrary(filename);
- if (*((HMODULE*)handle) == 0) {
+ if (handle == 0) {
ThrowError("Can't LoadLibrary: ");
}
}
DynamicLibrary::~DynamicLibrary() {
assert(handle !=0 && "Invalid DynamicLibrary handle");
- if (*((HMODULE*)handle))
- FreeLibrary(*((HMODULE*)handle));
- delete (HMODULE*)handle;
+ if (handle)
+ FreeLibrary((HMODULE*)handle);
}
void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) {
assert(handle !=0 && "Invalid DynamicLibrary handle");
- return (void*) GetProcAddress(*((HMODULE*)handle), symbolName);
+ return (void*) GetProcAddress((HMODULE*)handle, symbolName);
}
}
//===----------------------------------------------------------------------===//
#include "Win32.h"
-#include <windef.h>
namespace llvm {
using namespace sys;
//===----------------------------------------------------------------------===//
DynamicLibrary::DynamicLibrary() : handle(0) {
- handle = new HMODULE;
- *((HMODULE*)handle) = GetModuleHandle(NULL);
+ handle = (void*) GetModuleHandle(NULL);
- if (*((HMODULE*)handle) == 0) {
+ if (handle == 0) {
ThrowError("Can't GetModuleHandle: ");
}
}
DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
- handle = new HMODULE;
- *((HMODULE*)handle) = LoadLibrary(filename);
+ handle = LoadLibrary(filename);
- if (*((HMODULE*)handle) == 0) {
+ if (handle == 0) {
ThrowError("Can't LoadLibrary: ");
}
}
DynamicLibrary::~DynamicLibrary() {
assert(handle !=0 && "Invalid DynamicLibrary handle");
- if (*((HMODULE*)handle))
- FreeLibrary(*((HMODULE*)handle));
- delete (HMODULE*)handle;
+ if (handle)
+ FreeLibrary((HMODULE*)handle);
}
void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) {
assert(handle !=0 && "Invalid DynamicLibrary handle");
- return (void*) GetProcAddress(*((HMODULE*)handle), symbolName);
+ return (void*) GetProcAddress((HMODULE*)handle, symbolName);
}
}
<File
RelativePath="..\..\lib\Transforms\Scalar\SimplifyCFG.cpp">
</File>
- <File
- RelativePath="..\..\lib\Transforms\Scalar\SymbolStripping.cpp">
- </File>
<File
RelativePath="..\..\lib\Transforms\Scalar\TailDuplication.cpp">
</File>