projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[FastISel][AArch64] Fix a few BuildMI callsites where the result register was added...
[oota-llvm.git]
/
lib
/
IR
/
Module.cpp
diff --git
a/lib/IR/Module.cpp
b/lib/IR/Module.cpp
index 0f73d44ce455c5e790da9d1c7a23007533d42306..f1b1f9a2acc877f094343c5c0bfbbe1919891346 100644
(file)
--- a/
lib/IR/Module.cpp
+++ b/
lib/IR/Module.cpp
@@
-413,10
+413,13
@@
std::error_code Module::materializeAll() {
return Materializer->MaterializeModule(this);
}
return Materializer->MaterializeModule(this);
}
-std::error_code Module::materializeAllPermanently() {
+std::error_code Module::materializeAllPermanently(
bool ReleaseBuffer
) {
if (std::error_code EC = materializeAll())
return EC;
if (std::error_code EC = materializeAll())
return EC;
+ if (ReleaseBuffer)
+ Materializer->releaseBuffer();
+
Materializer.reset();
return std::error_code();
}
Materializer.reset();
return std::error_code();
}
@@
-434,14
+437,14
@@
std::error_code Module::materializeAllPermanently() {
// has "dropped all references", except operator delete.
//
void Module::dropAllReferences() {
// has "dropped all references", except operator delete.
//
void Module::dropAllReferences() {
- for
(Module::iterator I = begin(), E = end(); I != E; ++I
)
-
I->
dropAllReferences();
+ for
(Function &F : *this
)
+
F.
dropAllReferences();
- for
(Module::global_iterator I = global_begin(), E = global_end(); I != E; ++I
)
-
I->
dropAllReferences();
+ for
(GlobalVariable &GV : globals()
)
+
GV.
dropAllReferences();
- for
(Module::alias_iterator I = alias_begin(), E = alias_end(); I != E; ++I
)
-
I->
dropAllReferences();
+ for
(GlobalAlias &GA : aliases()
)
+
GA.
dropAllReferences();
}
unsigned Module::getDwarfVersion() const {
}
unsigned Module::getDwarfVersion() const {
@@
-450,3
+453,11
@@
unsigned Module::getDwarfVersion() const {
return dwarf::DWARF_VERSION;
return cast<ConstantInt>(Val)->getZExtValue();
}
return dwarf::DWARF_VERSION;
return cast<ConstantInt>(Val)->getZExtValue();
}
+
+Comdat *Module::getOrInsertComdat(StringRef Name) {
+ Comdat C;
+ StringMapEntry<Comdat> &Entry =
+ ComdatSymTab.GetOrCreateValue(Name, std::move(C));
+ Entry.second.Name = &Entry;
+ return &Entry.second;
+}