Prune some includes and forward declarations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153429 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2012-03-26 06:58:25 +00:00
parent 7e1e18fa1e
commit f1d0f7781e
33 changed files with 44 additions and 61 deletions

View File

@ -23,7 +23,6 @@ class Function;
class BasicBlock; class BasicBlock;
class Instruction; class Instruction;
class Value; class Value;
class raw_ostream;
class formatted_raw_ostream; class formatted_raw_ostream;
class AssemblyAnnotationWriter { class AssemblyAnnotationWriter {

View File

@ -21,7 +21,6 @@ namespace llvm {
class Module; class Module;
class MemoryBuffer; class MemoryBuffer;
class SMDiagnostic; class SMDiagnostic;
class raw_ostream;
class LLVMContext; class LLVMContext;
/// This function is the main interface to the LLVM Assembly Parser. It parses /// This function is the main interface to the LLVM Assembly Parser. It parses

View File

@ -19,7 +19,6 @@
namespace llvm { namespace llvm {
class Type;
class Module; class Module;
class Value; class Value;
class raw_ostream; class raw_ostream;

View File

@ -17,6 +17,7 @@
#define LLVM_INLINEASM_H #define LLVM_INLINEASM_H
#include "llvm/Value.h" #include "llvm/Value.h"
#include "llvm/ADT/StringRef.h"
#include <vector> #include <vector>
namespace llvm { namespace llvm {

View File

@ -15,14 +15,15 @@
#define LLVM_LINKER_H #define LLVM_LINKER_H
#include <memory> #include <memory>
#include <string>
#include <vector> #include <vector>
#include "llvm/ADT/StringRef.h"
namespace llvm { namespace llvm {
namespace sys { class Path; } namespace sys { class Path; }
class Module; class Module;
class LLVMContext; class LLVMContext;
class StringRef;
/// This class provides the core functionality of linking in LLVM. It retains a /// This class provides the core functionality of linking in LLVM. It retains a
/// Module object which is the composite of the modules and libraries linked /// Module object which is the composite of the modules and libraries linked

View File

@ -12,7 +12,6 @@
#include "llvm/MC/MCDirectives.h" #include "llvm/MC/MCDirectives.h"
#include "llvm/MC/MCFixup.h" #include "llvm/MC/MCFixup.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/Support/DataTypes.h" #include "llvm/Support/DataTypes.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
@ -20,15 +19,13 @@ namespace llvm {
class MCAsmLayout; class MCAsmLayout;
class MCAssembler; class MCAssembler;
class MCELFObjectTargetWriter; class MCELFObjectTargetWriter;
class MCFixup; struct MCFixupKindInfo;
class MCFragment; class MCFragment;
class MCInst; class MCInst;
class MCInstFragment; class MCInstFragment;
class MCObjectWriter; class MCObjectWriter;
class MCSection; class MCSection;
class MCValue; class MCValue;
template<typename T>
class SmallVectorImpl;
class raw_ostream; class raw_ostream;
/// MCAsmBackend - Generic interface to target specific assembler backends. /// MCAsmBackend - Generic interface to target specific assembler backends.

View File

@ -25,7 +25,6 @@ namespace llvm {
class raw_ostream; class raw_ostream;
class MCAsmLayout; class MCAsmLayout;
class MCAssembler; class MCAssembler;
class MCBinaryExpr;
class MCContext; class MCContext;
class MCCodeEmitter; class MCCodeEmitter;
class MCExpr; class MCExpr;

View File

@ -10,12 +10,8 @@
#ifndef LLVM_MC_MCCODEEMITTER_H #ifndef LLVM_MC_MCCODEEMITTER_H
#define LLVM_MC_MCCODEEMITTER_H #define LLVM_MC_MCCODEEMITTER_H
#include "llvm/MC/MCFixup.h"
#include <cassert>
namespace llvm { namespace llvm {
class MCExpr; class MCFixup;
class MCInst; class MCInst;
class raw_ostream; class raw_ostream;
template<typename T> class SmallVectorImpl; template<typename T> class SmallVectorImpl;

View File

@ -16,7 +16,6 @@
#include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringMap.h"
#include "llvm/Support/Allocator.h" #include "llvm/Support/Allocator.h"
#include "llvm/Support/Compiler.h" #include "llvm/Support/Compiler.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include <vector> // FIXME: Shouldn't be needed. #include <vector> // FIXME: Shouldn't be needed.
@ -31,6 +30,7 @@ namespace llvm {
class MCObjectFileInfo; class MCObjectFileInfo;
class MCRegisterInfo; class MCRegisterInfo;
class MCLineSection; class MCLineSection;
class SMLoc;
class StringRef; class StringRef;
class Twine; class Twine;
class MCSectionMachO; class MCSectionMachO;

View File

@ -17,20 +17,16 @@
#include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringRef.h"
#include "llvm/MC/MachineLocation.h" #include "llvm/MC/MachineLocation.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Dwarf.h" #include "llvm/Support/Dwarf.h"
#include <vector> #include <vector>
namespace llvm { namespace llvm {
class MCContext; class MCContext;
class MCExpr; class MCObjectWriter;
class MCSection; class MCSection;
class MCSectionData;
class MCStreamer; class MCStreamer;
class MCSymbol; class MCSymbol;
class MCObjectStreamer;
class raw_ostream;
class SourceMgr; class SourceMgr;
class SMLoc; class SMLoc;

View File

@ -10,12 +10,19 @@
#ifndef LLVM_MC_MCELFOBJECTWRITER_H #ifndef LLVM_MC_MCELFOBJECTWRITER_H
#define LLVM_MC_MCELFOBJECTWRITER_H #define LLVM_MC_MCELFOBJECTWRITER_H
#include "llvm/MC/MCObjectWriter.h" #include "llvm/ADT/Triple.h"
#include "llvm/Support/DataTypes.h" #include "llvm/Support/DataTypes.h"
#include "llvm/Support/ELF.h" #include "llvm/Support/ELF.h"
#include <vector> #include <vector>
namespace llvm { namespace llvm {
class MCAssembler;
class MCFixup;
class MCFragment;
class MCObjectWriter;
class MCSymbol;
class MCValue;
/// @name Relocation Data /// @name Relocation Data
/// @{ /// @{

View File

@ -15,7 +15,6 @@
#include "llvm/Support/DataTypes.h" #include "llvm/Support/DataTypes.h"
namespace llvm { namespace llvm {
class MCAsmInfo;
class MCAsmLayout; class MCAsmLayout;
class MCAssembler; class MCAssembler;
class MCContext; class MCContext;

View File

@ -14,13 +14,12 @@
#ifndef LLVM_MC_MCBJECTFILEINFO_H #ifndef LLVM_MC_MCBJECTFILEINFO_H
#define LLVM_MC_MCBJECTFILEINFO_H #define LLVM_MC_MCBJECTFILEINFO_H
#include "llvm/MC/MCCodeGenInfo.h" #include "llvm/Support/CodeGen.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/MC/SectionKind.h"
namespace llvm { namespace llvm {
class MCContext; class MCContext;
class MCSection; class MCSection;
class StringRef;
class Triple; class Triple;
class MCObjectFileInfo { class MCObjectFileInfo {

View File

@ -10,7 +10,6 @@
#ifndef LLVM_MC_MCOBJECTWRITER_H #ifndef LLVM_MC_MCOBJECTWRITER_H
#define LLVM_MC_MCOBJECTWRITER_H #define LLVM_MC_MCOBJECTWRITER_H
#include "llvm/ADT/Triple.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include "llvm/Support/DataTypes.h" #include "llvm/Support/DataTypes.h"
#include <cassert> #include <cassert>
@ -20,11 +19,9 @@ class MCAsmLayout;
class MCAssembler; class MCAssembler;
class MCFixup; class MCFixup;
class MCFragment; class MCFragment;
class MCSymbol;
class MCSymbolData; class MCSymbolData;
class MCSymbolRefExpr; class MCSymbolRefExpr;
class MCValue; class MCValue;
class raw_ostream;
/// MCObjectWriter - Defines the object file and target independent interfaces /// MCObjectWriter - Defines the object file and target independent interfaces
/// used by the assembler backend to write native file format object files. /// used by the assembler backend to write native file format object files.

View File

@ -14,12 +14,10 @@
#ifndef LLVM_MC_MCSECTION_H #ifndef LLVM_MC_MCSECTION_H
#define LLVM_MC_MCSECTION_H #define LLVM_MC_MCSECTION_H
#include "llvm/ADT/StringRef.h"
#include "llvm/MC/SectionKind.h" #include "llvm/MC/SectionKind.h"
#include "llvm/Support/Casting.h" #include "llvm/Support/Casting.h"
namespace llvm { namespace llvm {
class MCContext;
class MCAsmInfo; class MCAsmInfo;
class raw_ostream; class raw_ostream;

View File

@ -15,8 +15,8 @@
#define LLVM_MC_MCSECTIONCOFF_H #define LLVM_MC_MCSECTIONCOFF_H
#include "llvm/MC/MCSection.h" #include "llvm/MC/MCSection.h"
#include "llvm/Support/COFF.h" #include "llvm/Support/COFF.h"
#include "llvm/ADT/StringRef.h"
namespace llvm { namespace llvm {

View File

@ -16,6 +16,7 @@
#include "llvm/MC/MCSection.h" #include "llvm/MC/MCSection.h"
#include "llvm/Support/ELF.h" #include "llvm/Support/ELF.h"
#include "llvm/ADT/StringRef.h"
namespace llvm { namespace llvm {

View File

@ -15,6 +15,7 @@
#define LLVM_MC_MCSECTIONMACHO_H #define LLVM_MC_MCSECTIONMACHO_H
#include "llvm/MC/MCSection.h" #include "llvm/MC/MCSection.h"
#include "llvm/ADT/StringRef.h"
namespace llvm { namespace llvm {

View File

@ -23,7 +23,6 @@
namespace llvm { namespace llvm {
class MCAsmBackend; class MCAsmBackend;
class MCAsmInfo;
class MCCodeEmitter; class MCCodeEmitter;
class MCContext; class MCContext;
class MCExpr; class MCExpr;
@ -32,7 +31,6 @@ namespace llvm {
class MCSection; class MCSection;
class MCSymbol; class MCSymbol;
class StringRef; class StringRef;
class TargetLoweringObjectFile;
class Twine; class Twine;
class raw_ostream; class raw_ostream;
class formatted_raw_ostream; class formatted_raw_ostream;

View File

@ -15,7 +15,6 @@
#define LLVM_VALUE_H #define LLVM_VALUE_H
#include "llvm/Use.h" #include "llvm/Use.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h" #include "llvm/Support/Casting.h"
namespace llvm { namespace llvm {
@ -31,8 +30,6 @@ class GlobalAlias;
class InlineAsm; class InlineAsm;
class ValueSymbolTable; class ValueSymbolTable;
template<typename ValueTy> class StringMapEntry; template<typename ValueTy> class StringMapEntry;
template <typename ValueTy = Value>
class AssertingVH;
typedef StringMapEntry<Value*> ValueName; typedef StringMapEntry<Value*> ValueName;
class raw_ostream; class raw_ostream;
class AssemblyAnnotationWriter; class AssemblyAnnotationWriter;
@ -41,6 +38,7 @@ class LLVMContext;
class Twine; class Twine;
class MDNode; class MDNode;
class Type; class Type;
class StringRef;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Value Class // Value Class

View File

@ -11,14 +11,15 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "DwarfAccelTable.h"
#include "DwarfDebug.h"
#include "DIE.h"
#include "llvm/ADT/Twine.h"
#include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCSymbol.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
#include "DwarfAccelTable.h"
#include "DwarfDebug.h"
#include "DIE.h"
using namespace llvm; using namespace llvm;

View File

@ -17,7 +17,6 @@
#include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallString.h"
#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringMap.h"
#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCAsmBackend.h" #include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmLayout.h" #include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCAssembler.h"
@ -25,13 +24,13 @@
#include "llvm/MC/MCELFObjectWriter.h" #include "llvm/MC/MCELFObjectWriter.h"
#include "llvm/MC/MCELFSymbolFlags.h" #include "llvm/MC/MCELFSymbolFlags.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCValue.h" #include "llvm/MC/MCValue.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ELF.h" #include "llvm/Support/ELF.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/ADT/StringSwitch.h"
#include <vector> #include <vector>
using namespace llvm; using namespace llvm;

View File

@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/MC/MCAsmBackend.h" #include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCFixupKindInfo.h"
using namespace llvm; using namespace llvm;
MCAsmBackend::MCAsmBackend() MCAsmBackend::MCAsmBackend()

View File

@ -13,13 +13,13 @@
#include "llvm/MC/MCCodeEmitter.h" #include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h" #include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSection.h" #include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCValue.h" #include "llvm/MC/MCValue.h"
#include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCAsmBackend.h" #include "llvm/MC/MCAsmBackend.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Twine.h" #include "llvm/ADT/Twine.h"

View File

@ -14,6 +14,7 @@
#include "llvm/MC/MCAsmLayout.h" #include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h" #include "llvm/MC/MCContext.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCValue.h" #include "llvm/MC/MCValue.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"

View File

@ -7,17 +7,17 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCObjectStreamer.h" #include "llvm/MC/MCObjectStreamer.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCCodeEmitter.h" #include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h" #include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCAsmBackend.h" #include "llvm/Support/ErrorHandling.h"
using namespace llvm; using namespace llvm;
MCObjectStreamer::MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB, MCObjectStreamer::MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB,

View File

@ -8,13 +8,13 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/MC/MCMachObjectWriter.h" #include "llvm/MC/MCMachObjectWriter.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringMap.h"
#include "llvm/ADT/Twine.h" #include "llvm/ADT/Twine.h"
#include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCAsmBackend.h" #include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmLayout.h" #include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCSymbol.h"

View File

@ -16,6 +16,7 @@
#include "llvm/MC/MCDirectives.h" #include "llvm/MC/MCDirectives.h"
#include "llvm/MC/MCELFObjectWriter.h" #include "llvm/MC/MCELFObjectWriter.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCMachObjectWriter.h" #include "llvm/MC/MCMachObjectWriter.h"
#include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCSectionELF.h"

View File

@ -11,6 +11,7 @@
#include "MCTargetDesc/ARMMCTargetDesc.h" #include "MCTargetDesc/ARMMCTargetDesc.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/StringSwitch.h"
#include "llvm/MC/MCELFObjectWriter.h" #include "llvm/MC/MCELFObjectWriter.h"

View File

@ -14,19 +14,13 @@
#include "MipsFixupKinds.h" #include "MipsFixupKinds.h"
#include "MCTargetDesc/MipsMCTargetDesc.h" #include "MCTargetDesc/MipsMCTargetDesc.h"
#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCAsmBackend.h" #include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCDirectives.h" #include "llvm/MC/MCDirectives.h"
#include "llvm/MC/MCELFObjectWriter.h" #include "llvm/MC/MCELFObjectWriter.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCMachObjectWriter.h"
#include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Object/MachOFormat.h"
#include "llvm/Support/ELF.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"

View File

@ -11,6 +11,7 @@
#include "MCTargetDesc/PPCFixupKinds.h" #include "MCTargetDesc/PPCFixupKinds.h"
#include "llvm/MC/MCAsmBackend.h" #include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCELFObjectWriter.h" #include "llvm/MC/MCELFObjectWriter.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCMachObjectWriter.h" #include "llvm/MC/MCMachObjectWriter.h"
#include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCObjectWriter.h"

View File

@ -14,7 +14,6 @@
#include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCCodeGenInfo.h" #include "llvm/MC/MCCodeGenInfo.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
using namespace llvm; using namespace llvm;

View File

@ -74,7 +74,7 @@ static void PrintOps(Instruction *I, const SmallVectorImpl<ValueEntry> &Ops) {
namespace { namespace {
class Reassociate : public FunctionPass { class Reassociate : public FunctionPass {
DenseMap<BasicBlock*, unsigned> RankMap; DenseMap<BasicBlock*, unsigned> RankMap;
DenseMap<AssertingVH<>, unsigned> ValueRankMap; DenseMap<AssertingVH<Value>, unsigned> ValueRankMap;
SmallVector<WeakVH, 8> RedoInsts; SmallVector<WeakVH, 8> RedoInsts;
SmallVector<WeakVH, 8> DeadInsts; SmallVector<WeakVH, 8> DeadInsts;
bool MadeChange; bool MadeChange;
@ -210,7 +210,7 @@ static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode) {
/// LowerNegateToMultiply - Replace 0-X with X*-1. /// LowerNegateToMultiply - Replace 0-X with X*-1.
/// ///
static Instruction *LowerNegateToMultiply(Instruction *Neg, static Instruction *LowerNegateToMultiply(Instruction *Neg,
DenseMap<AssertingVH<>, unsigned> &ValueRankMap) { DenseMap<AssertingVH<Value>, unsigned> &ValueRankMap) {
Constant *Cst = Constant::getAllOnesValue(Neg->getType()); Constant *Cst = Constant::getAllOnesValue(Neg->getType());
Instruction *Res = BinaryOperator::CreateMul(Neg->getOperand(1), Cst, "",Neg); Instruction *Res = BinaryOperator::CreateMul(Neg->getOperand(1), Cst, "",Neg);
@ -492,7 +492,7 @@ static bool ShouldBreakUpSubtract(Instruction *Sub) {
/// only used by an add, transform this into (X+(0-Y)) to promote better /// only used by an add, transform this into (X+(0-Y)) to promote better
/// reassociation. /// reassociation.
static Instruction *BreakUpSubtract(Instruction *Sub, static Instruction *BreakUpSubtract(Instruction *Sub,
DenseMap<AssertingVH<>, unsigned> &ValueRankMap) { DenseMap<AssertingVH<Value>, unsigned> &ValueRankMap) {
// Convert a subtract into an add and a neg instruction. This allows sub // Convert a subtract into an add and a neg instruction. This allows sub
// instructions to be commuted with other add instructions. // instructions to be commuted with other add instructions.
// //
@ -518,7 +518,7 @@ static Instruction *BreakUpSubtract(Instruction *Sub,
/// by one, change this into a multiply by a constant to assist with further /// by one, change this into a multiply by a constant to assist with further
/// reassociation. /// reassociation.
static Instruction *ConvertShiftToMul(Instruction *Shl, static Instruction *ConvertShiftToMul(Instruction *Shl,
DenseMap<AssertingVH<>, unsigned> &ValueRankMap) { DenseMap<AssertingVH<Value>, unsigned> &ValueRankMap) {
// If an operand of this shift is a reassociable multiply, or if the shift // If an operand of this shift is a reassociable multiply, or if the shift
// is used by a reassociable multiply or add, turn into a multiply. // is used by a reassociable multiply or add, turn into a multiply.
if (isReassociableOp(Shl->getOperand(0), Instruction::Mul) || if (isReassociableOp(Shl->getOperand(0), Instruction::Mul) ||