#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/ManagedStatic.h"
+
using namespace llvm;
enum {
// creating now, so that we can match up the body with them later.
if (!isProto) {
FunctionsWithBodies.push_back(Func);
- if (LazyStreamer) DeferredFunctionInfo[Func] = 0;
+ if (LazyStreamer)
+ DeferredFunctionInfo[Func] = 0;
}
break;
}
assert(DeferredFunctionInfo.count(F) && "No info to read function later?");
// Just forget the function body, we can remat it later.
- F->deleteBody();
+ F->dropAllReferences();
}
std::error_code BitcodeReader::MaterializeModule(Module *M) {
};
}
+static ManagedStatic<BitcodeErrorCategoryType> ErrorCategory;
+
const std::error_category &llvm::BitcodeErrorCategory() {
- static BitcodeErrorCategoryType O;
- return O;
+ return *ErrorCategory;
}
//===----------------------------------------------------------------------===//