diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-25 17:30:31 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-25 17:30:31 +0000 |
| commit | 935125126c4ffde74ef3a82959fde69ee8c6b648 (patch) | |
| tree | c8f13ff32afa704ca5ae5ad3faf4650f9ea2f4c2 /llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | |
| parent | 48f52e926d6e8273587f5befc997fc784b04855b (diff) | |
| download | bcm5719-llvm-935125126c4ffde74ef3a82959fde69ee8c6b648.tar.gz bcm5719-llvm-935125126c4ffde74ef3a82959fde69ee8c6b648.zip | |
Make DataLayout a plain object, not a pass.
Instead, have a DataLayoutPass that holds one. This will allow parts of LLVM
don't don't handle passes to also use DataLayout.
llvm-svn: 202168
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 5b8df9c466f..224387fd914 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -910,9 +910,12 @@ void AddressSanitizerModule::initializeCallbacks(Module &M) { // redzones and inserts this function into llvm.global_ctors. bool AddressSanitizerModule::runOnModule(Module &M) { if (!ClGlobals) return false; - DL = getAnalysisIfAvailable<DataLayout>(); - if (!DL) + + DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>(); + if (!DLP) return false; + DL = &DLP->getDataLayout(); + BL.reset(SpecialCaseList::createOrDie(BlacklistFile)); if (BL->isIn(M)) return false; C = &(M.getContext()); @@ -1086,10 +1089,11 @@ void AddressSanitizer::initializeCallbacks(Module &M) { // virtual bool AddressSanitizer::doInitialization(Module &M) { // Initialize the private fields. No one has accessed them before. - DL = getAnalysisIfAvailable<DataLayout>(); - - if (!DL) + DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>(); + if (!DLP) return false; + DL = &DLP->getDataLayout(); + BL.reset(SpecialCaseList::createOrDie(BlacklistFile)); DynamicallyInitializedGlobals.Init(M); |

