From 935125126c4ffde74ef3a82959fde69ee8c6b648 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 25 Feb 2014 17:30:31 +0000 Subject: 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 --- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp') 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(); - if (!DL) + + DataLayoutPass *DLP = getAnalysisIfAvailable(); + 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(); - - if (!DL) + DataLayoutPass *DLP = getAnalysisIfAvailable(); + if (!DLP) return false; + DL = &DLP->getDataLayout(); + BL.reset(SpecialCaseList::createOrDie(BlacklistFile)); DynamicallyInitializedGlobals.Init(M); -- cgit v1.2.3