From 8f124fe88409b444fc3139b38423e3a61d4095dd Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 4 Mar 2014 12:46:06 +0000 Subject: [PATCH] [Modules] Move the LeakDetector header into the IR library where the source file had already been moved. Also move the unittest into the IR unittest library. This may seem an odd thing to put in the IR library but we only really use this with instructions and it needs the LLVM context to work, so it is intrinsically tied to the IR library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202842 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/{Support => IR}/LeakDetector.h | 6 +++--- lib/CodeGen/MachineBasicBlock.cpp | 2 +- lib/IR/BasicBlock.cpp | 2 +- lib/IR/Function.cpp | 2 +- lib/IR/Globals.cpp | 2 +- lib/IR/Instruction.cpp | 2 +- lib/IR/LeakDetector.cpp | 2 +- lib/IR/Metadata.cpp | 2 +- lib/IR/Module.cpp | 2 +- lib/IR/Value.cpp | 2 +- unittests/IR/CMakeLists.txt | 1 + unittests/{Support => IR}/LeakDetectorTest.cpp | 4 ++-- unittests/Support/CMakeLists.txt | 1 - 13 files changed, 15 insertions(+), 15 deletions(-) rename include/llvm/{Support => IR}/LeakDetector.h (95%) rename unittests/{Support => IR}/LeakDetectorTest.cpp (86%) diff --git a/include/llvm/Support/LeakDetector.h b/include/llvm/IR/LeakDetector.h similarity index 95% rename from include/llvm/Support/LeakDetector.h rename to include/llvm/IR/LeakDetector.h index 501a9db72c1..cb18df87586 100644 --- a/include/llvm/Support/LeakDetector.h +++ b/include/llvm/IR/LeakDetector.h @@ -1,4 +1,4 @@ -//===-- llvm/Support/LeakDetector.h - Provide leak detection ----*- C++ -*-===// +//===- LeakDetector.h - Provide leak detection ------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -19,8 +19,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_LEAKDETECTOR_H -#define LLVM_SUPPORT_LEAKDETECTOR_H +#ifndef LLVM_IR_LEAKDETECTOR_H +#define LLVM_IR_LEAKDETECTOR_H #include diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 769ba2a255e..077e74db736 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -24,10 +24,10 @@ #include "llvm/CodeGen/SlotIndexes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/DataLayout.h" +#include "llvm/IR/LeakDetector.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/LeakDetector.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" diff --git a/lib/IR/BasicBlock.cpp b/lib/IR/BasicBlock.cpp index 1b1236bd686..ef264d27fcd 100644 --- a/lib/IR/BasicBlock.cpp +++ b/lib/IR/BasicBlock.cpp @@ -19,8 +19,8 @@ #include "llvm/IR/Instructions.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/LLVMContext.h" +#include "llvm/IR/LeakDetector.h" #include "llvm/IR/Type.h" -#include "llvm/Support/LeakDetector.h" #include using namespace llvm; diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp index 6d418a4c366..72f38c54756 100644 --- a/lib/IR/Function.cpp +++ b/lib/IR/Function.cpp @@ -23,8 +23,8 @@ #include "llvm/IR/InstIterator.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/LLVMContext.h" +#include "llvm/IR/LeakDetector.h" #include "llvm/IR/Module.h" -#include "llvm/Support/LeakDetector.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/RWMutex.h" #include "llvm/Support/StringPool.h" diff --git a/lib/IR/Globals.cpp b/lib/IR/Globals.cpp index ee882c3eace..11152d5d6c2 100644 --- a/lib/IR/Globals.cpp +++ b/lib/IR/Globals.cpp @@ -18,9 +18,9 @@ #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/GlobalAlias.h" #include "llvm/IR/GlobalVariable.h" +#include "llvm/IR/LeakDetector.h" #include "llvm/IR/Module.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/LeakDetector.h" using namespace llvm; //===----------------------------------------------------------------------===// diff --git a/lib/IR/Instruction.cpp b/lib/IR/Instruction.cpp index a08cd9ff106..4bcf7484d67 100644 --- a/lib/IR/Instruction.cpp +++ b/lib/IR/Instruction.cpp @@ -15,10 +15,10 @@ #include "llvm/IR/CallSite.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Instructions.h" +#include "llvm/IR/LeakDetector.h" #include "llvm/IR/Module.h" #include "llvm/IR/Operator.h" #include "llvm/IR/Type.h" -#include "llvm/Support/LeakDetector.h" using namespace llvm; Instruction::Instruction(Type *ty, unsigned it, Use *Ops, unsigned NumOps, diff --git a/lib/IR/LeakDetector.cpp b/lib/IR/LeakDetector.cpp index 835e5e61cdf..6f71627fcf9 100644 --- a/lib/IR/LeakDetector.cpp +++ b/lib/IR/LeakDetector.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/LeakDetector.h" +#include "llvm/IR/LeakDetector.h" #include "LLVMContextImpl.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/IR/Value.h" diff --git a/lib/IR/Metadata.cpp b/lib/IR/Metadata.cpp index d46eec69f58..f8a1776599f 100644 --- a/lib/IR/Metadata.cpp +++ b/lib/IR/Metadata.cpp @@ -22,9 +22,9 @@ #include "llvm/IR/ConstantRange.h" #include "llvm/IR/Instruction.h" #include "llvm/IR/LLVMContext.h" +#include "llvm/IR/LeakDetector.h" #include "llvm/IR/Module.h" #include "llvm/IR/ValueHandle.h" -#include "llvm/Support/LeakDetector.h" using namespace llvm; //===----------------------------------------------------------------------===// diff --git a/lib/IR/Module.cpp b/lib/IR/Module.cpp index 4204c8ef5fc..d3ef2195a89 100644 --- a/lib/IR/Module.cpp +++ b/lib/IR/Module.cpp @@ -22,7 +22,7 @@ #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/InstrTypes.h" #include "llvm/IR/LLVMContext.h" -#include "llvm/Support/LeakDetector.h" +#include "llvm/IR/LeakDetector.h" #include #include #include diff --git a/lib/IR/Value.cpp b/lib/IR/Value.cpp index eb12bc5a8e3..bdb544bef42 100644 --- a/lib/IR/Value.cpp +++ b/lib/IR/Value.cpp @@ -21,13 +21,13 @@ #include "llvm/IR/GetElementPtrTypeIterator.h" #include "llvm/IR/InstrTypes.h" #include "llvm/IR/Instructions.h" +#include "llvm/IR/LeakDetector.h" #include "llvm/IR/Module.h" #include "llvm/IR/Operator.h" #include "llvm/IR/ValueHandle.h" #include "llvm/IR/ValueSymbolTable.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/LeakDetector.h" #include "llvm/Support/ManagedStatic.h" #include using namespace llvm; diff --git a/unittests/IR/CMakeLists.txt b/unittests/IR/CMakeLists.txt index e1c295d0bee..7368a240513 100644 --- a/unittests/IR/CMakeLists.txt +++ b/unittests/IR/CMakeLists.txt @@ -13,6 +13,7 @@ set(IRSources DominatorTreeTest.cpp IRBuilderTest.cpp InstructionsTest.cpp + LeakDetectorTest.cpp LegacyPassManagerTest.cpp MDBuilderTest.cpp MetadataTest.cpp diff --git a/unittests/Support/LeakDetectorTest.cpp b/unittests/IR/LeakDetectorTest.cpp similarity index 86% rename from unittests/Support/LeakDetectorTest.cpp rename to unittests/IR/LeakDetectorTest.cpp index d198c7a8bda..94eed4c1432 100644 --- a/unittests/Support/LeakDetectorTest.cpp +++ b/unittests/IR/LeakDetectorTest.cpp @@ -1,4 +1,4 @@ -//===- llvm/unittest/LeakDetector/LeakDetector.cpp - LeakDetector tests ---===// +//===- LeakDetectorTest.cpp -----------------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// +#include "llvm/IR/LeakDetector.h" #include "gtest/gtest.h" -#include "llvm/Support/LeakDetector.h" using namespace llvm; diff --git a/unittests/Support/CMakeLists.txt b/unittests/Support/CMakeLists.txt index 9df2e172776..93f707e4e2b 100644 --- a/unittests/Support/CMakeLists.txt +++ b/unittests/Support/CMakeLists.txt @@ -17,7 +17,6 @@ add_llvm_unittest(SupportTests ErrorOrTest.cpp FileOutputBufferTest.cpp LEB128Test.cpp - LeakDetectorTest.cpp LineIteratorTest.cpp LockFileManagerTest.cpp ManagedStatic.cpp -- 2.34.1