Whitespace!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116664 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer 2010-10-16 08:25:21 +00:00
parent 138abae2a2
commit e70c526d59
4 changed files with 111 additions and 111 deletions

View File

@ -57,7 +57,7 @@ class MachineFunction;
class Module; class Module;
class PointerType; class PointerType;
class StructType; class StructType;
/// MachineModuleInfoImpl - This class can be derived from and used by targets /// MachineModuleInfoImpl - This class can be derived from and used by targets
/// to hold private target-specific information for each Module. Objects of /// to hold private target-specific information for each Module. Objects of
/// type are accessed/created with MMI::getInfo and destroyed when the /// type are accessed/created with MMI::getInfo and destroyed when the
@ -70,8 +70,8 @@ public:
protected: protected:
static SymbolListTy GetSortedStubs(const DenseMap<MCSymbol*, StubValueTy>&); static SymbolListTy GetSortedStubs(const DenseMap<MCSymbol*, StubValueTy>&);
}; };
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// LandingPadInfo - This structure is used to retain landing pad info for /// LandingPadInfo - This structure is used to retain landing pad info for
@ -90,19 +90,19 @@ struct LandingPadInfo {
}; };
class MMIAddrLabelMap; class MMIAddrLabelMap;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// MachineModuleInfo - This class contains meta information specific to a /// MachineModuleInfo - This class contains meta information specific to a
/// module. Queries can be made by different debugging and exception handling /// module. Queries can be made by different debugging and exception handling
/// schemes and reformated for specific use. /// schemes and reformated for specific use.
/// ///
class MachineModuleInfo : public ImmutablePass { class MachineModuleInfo : public ImmutablePass {
/// Context - This is the MCContext used for the entire code generator. /// Context - This is the MCContext used for the entire code generator.
MCContext Context; MCContext Context;
/// TheModule - This is the LLVM Module being worked on. /// TheModule - This is the LLVM Module being worked on.
const Module *TheModule; const Module *TheModule;
/// ObjFileMMI - This is the object-file-format-specific implementation of /// ObjFileMMI - This is the object-file-format-specific implementation of
/// MachineModuleInfoImpl, which lets targets accumulate whatever info they /// MachineModuleInfoImpl, which lets targets accumulate whatever info they
/// want. /// want.
@ -111,7 +111,7 @@ class MachineModuleInfo : public ImmutablePass {
// FrameMoves - List of moves done by a function's prolog. Used to construct // FrameMoves - List of moves done by a function's prolog. Used to construct
// frame maps by debug and exception handling consumers. // frame maps by debug and exception handling consumers.
std::vector<MachineMove> FrameMoves; std::vector<MachineMove> FrameMoves;
// LandingPads - List of LandingPadInfo describing the landing pad information // LandingPads - List of LandingPadInfo describing the landing pad information
// in the current function. // in the current function.
std::vector<LandingPadInfo> LandingPads; std::vector<LandingPadInfo> LandingPads;
@ -145,14 +145,14 @@ class MachineModuleInfo : public ImmutablePass {
/// llvm.compiler.used. /// llvm.compiler.used.
SmallPtrSet<const Function *, 32> UsedFunctions; SmallPtrSet<const Function *, 32> UsedFunctions;
/// AddrLabelSymbols - This map keeps track of which symbol is being used for /// AddrLabelSymbols - This map keeps track of which symbol is being used for
/// the specified basic block's address of label. /// the specified basic block's address of label.
MMIAddrLabelMap *AddrLabelSymbols; MMIAddrLabelMap *AddrLabelSymbols;
bool CallsEHReturn; bool CallsEHReturn;
bool CallsUnwindInit; bool CallsUnwindInit;
/// DbgInfoAvailable - True if debugging information is available /// DbgInfoAvailable - True if debugging information is available
/// in this module. /// in this module.
bool DbgInfoAvailable; bool DbgInfoAvailable;
@ -168,20 +168,20 @@ public:
MachineModuleInfo(); // DUMMY CONSTRUCTOR, DO NOT CALL. MachineModuleInfo(); // DUMMY CONSTRUCTOR, DO NOT CALL.
MachineModuleInfo(const MCAsmInfo &MAI); // Real constructor. MachineModuleInfo(const MCAsmInfo &MAI); // Real constructor.
~MachineModuleInfo(); ~MachineModuleInfo();
bool doInitialization(); bool doInitialization();
bool doFinalization(); bool doFinalization();
/// EndFunction - Discard function meta information. /// EndFunction - Discard function meta information.
/// ///
void EndFunction(); void EndFunction();
const MCContext &getContext() const { return Context; } const MCContext &getContext() const { return Context; }
MCContext &getContext() { return Context; } MCContext &getContext() { return Context; }
void setModule(const Module *M) { TheModule = M; } void setModule(const Module *M) { TheModule = M; }
const Module *getModule() const { return TheModule; } const Module *getModule() const { return TheModule; }
/// getInfo - Keep track of various per-function pieces of information for /// getInfo - Keep track of various per-function pieces of information for
/// backends that would like to do so. /// backends that would like to do so.
/// ///
@ -191,16 +191,16 @@ public:
ObjFileMMI = new Ty(*this); ObjFileMMI = new Ty(*this);
return *static_cast<Ty*>(ObjFileMMI); return *static_cast<Ty*>(ObjFileMMI);
} }
template<typename Ty> template<typename Ty>
const Ty &getObjFileInfo() const { const Ty &getObjFileInfo() const {
return const_cast<MachineModuleInfo*>(this)->getObjFileInfo<Ty>(); return const_cast<MachineModuleInfo*>(this)->getObjFileInfo<Ty>();
} }
/// AnalyzeModule - Scan the module for global debug information. /// AnalyzeModule - Scan the module for global debug information.
/// ///
void AnalyzeModule(const Module &M); void AnalyzeModule(const Module &M);
/// hasDebugInfo - Returns true if valid debug info is present. /// hasDebugInfo - Returns true if valid debug info is present.
/// ///
bool hasDebugInfo() const { return DbgInfoAvailable; } bool hasDebugInfo() const { return DbgInfoAvailable; }
@ -216,7 +216,7 @@ public:
/// function's prologue. Used to construct frame maps for debug and exception /// function's prologue. Used to construct frame maps for debug and exception
/// handling comsumers. /// handling comsumers.
std::vector<MachineMove> &getFrameMoves() { return FrameMoves; } std::vector<MachineMove> &getFrameMoves() { return FrameMoves; }
/// getAddrLabelSymbol - Return the symbol to be used for the specified basic /// getAddrLabelSymbol - Return the symbol to be used for the specified basic
/// block when its address is taken. This cannot be its normal LBB label /// block when its address is taken. This cannot be its normal LBB label
/// because the block may be accessed outside its containing function. /// because the block may be accessed outside its containing function.
@ -226,15 +226,15 @@ public:
/// basic block when its address is taken. If other blocks were RAUW'd to /// basic block when its address is taken. If other blocks were RAUW'd to
/// this one, we may have to emit them as well, return the whole set. /// this one, we may have to emit them as well, return the whole set.
std::vector<MCSymbol*> getAddrLabelSymbolToEmit(const BasicBlock *BB); std::vector<MCSymbol*> getAddrLabelSymbolToEmit(const BasicBlock *BB);
/// takeDeletedSymbolsForFunction - If the specified function has had any /// takeDeletedSymbolsForFunction - If the specified function has had any
/// references to address-taken blocks generated, but the block got deleted, /// references to address-taken blocks generated, but the block got deleted,
/// return the symbol now so we can emit it. This prevents emitting a /// return the symbol now so we can emit it. This prevents emitting a
/// reference to a symbol that has no definition. /// reference to a symbol that has no definition.
void takeDeletedSymbolsForFunction(const Function *F, void takeDeletedSymbolsForFunction(const Function *F,
std::vector<MCSymbol*> &Result); std::vector<MCSymbol*> &Result);
//===- EH ---------------------------------------------------------------===// //===- EH ---------------------------------------------------------------===//
/// getOrCreateLandingPadInfo - Find or create an LandingPadInfo for the /// getOrCreateLandingPadInfo - Find or create an LandingPadInfo for the
@ -245,11 +245,11 @@ public:
/// associate it with a try landing pad block. /// associate it with a try landing pad block.
void addInvoke(MachineBasicBlock *LandingPad, void addInvoke(MachineBasicBlock *LandingPad,
MCSymbol *BeginLabel, MCSymbol *EndLabel); MCSymbol *BeginLabel, MCSymbol *EndLabel);
/// addLandingPad - Add a new panding pad. Returns the label ID for the /// addLandingPad - Add a new panding pad. Returns the label ID for the
/// landing pad entry. /// landing pad entry.
MCSymbol *addLandingPad(MachineBasicBlock *LandingPad); MCSymbol *addLandingPad(MachineBasicBlock *LandingPad);
/// addPersonality - Provide the personality function for the exception /// addPersonality - Provide the personality function for the exception
/// information. /// information.
void addPersonality(MachineBasicBlock *LandingPad, void addPersonality(MachineBasicBlock *LandingPad,
@ -285,7 +285,7 @@ public:
/// ///
void addCleanup(MachineBasicBlock *LandingPad); void addCleanup(MachineBasicBlock *LandingPad);
/// getTypeIDFor - Return the type id for the specified typeinfo. This is /// getTypeIDFor - Return the type id for the specified typeinfo. This is
/// function wide. /// function wide.
unsigned getTypeIDFor(const GlobalVariable *TI); unsigned getTypeIDFor(const GlobalVariable *TI);
@ -296,7 +296,7 @@ public:
/// TidyLandingPads - Remap landing pad labels and remove any deleted landing /// TidyLandingPads - Remap landing pad labels and remove any deleted landing
/// pads. /// pads.
void TidyLandingPads(DenseMap<MCSymbol*, uintptr_t> *LPMap = 0); void TidyLandingPads(DenseMap<MCSymbol*, uintptr_t> *LPMap = 0);
/// getLandingPads - Return a reference to the landing pad info for the /// getLandingPads - Return a reference to the landing pad info for the
/// current function. /// current function.
const std::vector<LandingPadInfo> &getLandingPads() const { const std::vector<LandingPadInfo> &getLandingPads() const {

View File

@ -98,7 +98,7 @@ protected: // Can only create subclasses.
/// TheTarget - The Target that this machine was created for. /// TheTarget - The Target that this machine was created for.
const Target &TheTarget; const Target &TheTarget;
/// AsmInfo - Contains target specific asm information. /// AsmInfo - Contains target specific asm information.
/// ///
const MCAsmInfo *AsmInfo; const MCAsmInfo *AsmInfo;
@ -121,11 +121,11 @@ public:
virtual const TargetLowering *getTargetLowering() const { return 0; } virtual const TargetLowering *getTargetLowering() const { return 0; }
virtual const TargetSelectionDAGInfo *getSelectionDAGInfo() const{ return 0; } virtual const TargetSelectionDAGInfo *getSelectionDAGInfo() const{ return 0; }
virtual const TargetData *getTargetData() const { return 0; } virtual const TargetData *getTargetData() const { return 0; }
/// getMCAsmInfo - Return target specific asm information. /// getMCAsmInfo - Return target specific asm information.
/// ///
const MCAsmInfo *getMCAsmInfo() const { return AsmInfo; } const MCAsmInfo *getMCAsmInfo() const { return AsmInfo; }
/// getSubtarget - This method returns a pointer to the specified type of /// getSubtarget - This method returns a pointer to the specified type of
/// TargetSubtarget. In debug builds, it verifies that the object being /// TargetSubtarget. In debug builds, it verifies that the object being
/// returned is of the correct type. /// returned is of the correct type.
@ -138,7 +138,7 @@ public:
/// details of graph coloring register allocation removed from it. /// details of graph coloring register allocation removed from it.
/// ///
virtual const TargetRegisterInfo *getRegisterInfo() const { return 0; } virtual const TargetRegisterInfo *getRegisterInfo() const { return 0; }
/// getIntrinsicInfo - If intrinsic information is available, return it. If /// getIntrinsicInfo - If intrinsic information is available, return it. If
/// not, return null. /// not, return null.
/// ///
@ -148,17 +148,17 @@ public:
/// otherwise return null. /// otherwise return null.
/// ///
virtual TargetJITInfo *getJITInfo() { return 0; } virtual TargetJITInfo *getJITInfo() { return 0; }
/// getInstrItineraryData - Returns instruction itinerary data for the target /// getInstrItineraryData - Returns instruction itinerary data for the target
/// or specific subtarget. /// or specific subtarget.
/// ///
virtual const InstrItineraryData *getInstrItineraryData() const { virtual const InstrItineraryData *getInstrItineraryData() const {
return 0; return 0;
} }
/// getELFWriterInfo - If this target supports an ELF writer, return /// getELFWriterInfo - If this target supports an ELF writer, return
/// information for it, otherwise return null. /// information for it, otherwise return null.
/// ///
virtual const TargetELFWriterInfo *getELFWriterInfo() const { return 0; } virtual const TargetELFWriterInfo *getELFWriterInfo() const { return 0; }
/// hasMCRelaxAll - Check whether all machine code instructions should be /// hasMCRelaxAll - Check whether all machine code instructions should be
@ -267,7 +267,7 @@ class LLVMTargetMachine : public TargetMachine {
protected: // Can only create subclasses. protected: // Can only create subclasses.
LLVMTargetMachine(const Target &T, const std::string &TargetTriple); LLVMTargetMachine(const Target &T, const std::string &TargetTriple);
private: private:
/// addCommonCodeGenPasses - Add standard LLVM codegen passes used for /// addCommonCodeGenPasses - Add standard LLVM codegen passes used for
/// both emitting to assembly files or machine code output. /// both emitting to assembly files or machine code output.
@ -277,11 +277,11 @@ private:
virtual void setCodeModelForJIT(); virtual void setCodeModelForJIT();
virtual void setCodeModelForStatic(); virtual void setCodeModelForStatic();
public: public:
const std::string &getTargetTriple() const { return TargetTriple; } const std::string &getTargetTriple() const { return TargetTriple; }
/// addPassesToEmitFile - Add passes to the specified pass manager to get the /// addPassesToEmitFile - Add passes to the specified pass manager to get the
/// specified file emitted. Typically this will involve several steps of code /// specified file emitted. Typically this will involve several steps of code
/// generation. If OptLevel is None, the code generator should emit code as /// generation. If OptLevel is None, the code generator should emit code as
@ -291,7 +291,7 @@ public:
CodeGenFileType FileType, CodeGenFileType FileType,
CodeGenOpt::Level, CodeGenOpt::Level,
bool DisableVerify = true); bool DisableVerify = true);
/// addPassesToEmitMachineCode - Add passes to the specified pass manager to /// addPassesToEmitMachineCode - Add passes to the specified pass manager to
/// get machine code emitted. This uses a JITCodeEmitter object to handle /// get machine code emitted. This uses a JITCodeEmitter object to handle
/// actually outputting the machine code and resolving things like the address /// actually outputting the machine code and resolving things like the address
@ -312,7 +312,7 @@ public:
MCContext *&Ctx, MCContext *&Ctx,
CodeGenOpt::Level OptLevel, CodeGenOpt::Level OptLevel,
bool DisableVerify = true); bool DisableVerify = true);
/// Target-Independent Code Generator Pass Configuration Options. /// Target-Independent Code Generator Pass Configuration Options.
/// addPreISelPasses - This method should add any "last minute" LLVM->LLVM /// addPreISelPasses - This method should add any "last minute" LLVM->LLVM
@ -349,15 +349,15 @@ public:
virtual bool addPreSched2(PassManagerBase &, CodeGenOpt::Level) { virtual bool addPreSched2(PassManagerBase &, CodeGenOpt::Level) {
return false; return false;
} }
/// addPreEmitPass - This pass may be implemented by targets that want to run /// addPreEmitPass - This pass may be implemented by targets that want to run
/// passes immediately before machine code is emitted. This should return /// passes immediately before machine code is emitted. This should return
/// true if -print-machineinstrs should print out the code after the passes. /// true if -print-machineinstrs should print out the code after the passes.
virtual bool addPreEmitPass(PassManagerBase &, CodeGenOpt::Level) { virtual bool addPreEmitPass(PassManagerBase &, CodeGenOpt::Level) {
return false; return false;
} }
/// addCodeEmitter - This pass should be overridden by the target to add a /// addCodeEmitter - This pass should be overridden by the target to add a
/// code emitter, if supported. If this is not supported, 'true' should be /// code emitter, if supported. If this is not supported, 'true' should be
/// returned. /// returned.

View File

@ -41,30 +41,30 @@ class MMIAddrLabelMapCallbackPtr : CallbackVH {
public: public:
MMIAddrLabelMapCallbackPtr() : Map(0) {} MMIAddrLabelMapCallbackPtr() : Map(0) {}
MMIAddrLabelMapCallbackPtr(Value *V) : CallbackVH(V), Map(0) {} MMIAddrLabelMapCallbackPtr(Value *V) : CallbackVH(V), Map(0) {}
void setPtr(BasicBlock *BB) { void setPtr(BasicBlock *BB) {
ValueHandleBase::operator=(BB); ValueHandleBase::operator=(BB);
} }
void setMap(MMIAddrLabelMap *map) { Map = map; } void setMap(MMIAddrLabelMap *map) { Map = map; }
virtual void deleted(); virtual void deleted();
virtual void allUsesReplacedWith(Value *V2); virtual void allUsesReplacedWith(Value *V2);
}; };
class MMIAddrLabelMap { class MMIAddrLabelMap {
MCContext &Context; MCContext &Context;
struct AddrLabelSymEntry { struct AddrLabelSymEntry {
/// Symbols - The symbols for the label. This is a pointer union that is /// Symbols - The symbols for the label. This is a pointer union that is
/// either one symbol (the common case) or a list of symbols. /// either one symbol (the common case) or a list of symbols.
PointerUnion<MCSymbol *, std::vector<MCSymbol*>*> Symbols; PointerUnion<MCSymbol *, std::vector<MCSymbol*>*> Symbols;
Function *Fn; // The containing function of the BasicBlock. Function *Fn; // The containing function of the BasicBlock.
unsigned Index; // The index in BBCallbacks for the BasicBlock. unsigned Index; // The index in BBCallbacks for the BasicBlock.
}; };
DenseMap<AssertingVH<BasicBlock>, AddrLabelSymEntry> AddrLabelSymbols; DenseMap<AssertingVH<BasicBlock>, AddrLabelSymEntry> AddrLabelSymbols;
/// BBCallbacks - Callbacks for the BasicBlock's that we have entries for. We /// BBCallbacks - Callbacks for the BasicBlock's that we have entries for. We
/// use this so we get notified if a block is deleted or RAUWd. /// use this so we get notified if a block is deleted or RAUWd.
std::vector<MMIAddrLabelMapCallbackPtr> BBCallbacks; std::vector<MMIAddrLabelMapCallbackPtr> BBCallbacks;
@ -76,23 +76,23 @@ class MMIAddrLabelMap {
DenseMap<AssertingVH<Function>, std::vector<MCSymbol*> > DenseMap<AssertingVH<Function>, std::vector<MCSymbol*> >
DeletedAddrLabelsNeedingEmission; DeletedAddrLabelsNeedingEmission;
public: public:
MMIAddrLabelMap(MCContext &context) : Context(context) {} MMIAddrLabelMap(MCContext &context) : Context(context) {}
~MMIAddrLabelMap() { ~MMIAddrLabelMap() {
assert(DeletedAddrLabelsNeedingEmission.empty() && assert(DeletedAddrLabelsNeedingEmission.empty() &&
"Some labels for deleted blocks never got emitted"); "Some labels for deleted blocks never got emitted");
// Deallocate any of the 'list of symbols' case. // Deallocate any of the 'list of symbols' case.
for (DenseMap<AssertingVH<BasicBlock>, AddrLabelSymEntry>::iterator for (DenseMap<AssertingVH<BasicBlock>, AddrLabelSymEntry>::iterator
I = AddrLabelSymbols.begin(), E = AddrLabelSymbols.end(); I != E; ++I) I = AddrLabelSymbols.begin(), E = AddrLabelSymbols.end(); I != E; ++I)
if (I->second.Symbols.is<std::vector<MCSymbol*>*>()) if (I->second.Symbols.is<std::vector<MCSymbol*>*>())
delete I->second.Symbols.get<std::vector<MCSymbol*>*>(); delete I->second.Symbols.get<std::vector<MCSymbol*>*>();
} }
MCSymbol *getAddrLabelSymbol(BasicBlock *BB); MCSymbol *getAddrLabelSymbol(BasicBlock *BB);
std::vector<MCSymbol*> getAddrLabelSymbolToEmit(BasicBlock *BB); std::vector<MCSymbol*> getAddrLabelSymbolToEmit(BasicBlock *BB);
void takeDeletedSymbolsForFunction(Function *F, void takeDeletedSymbolsForFunction(Function *F,
std::vector<MCSymbol*> &Result); std::vector<MCSymbol*> &Result);
void UpdateForDeletedBlock(BasicBlock *BB); void UpdateForDeletedBlock(BasicBlock *BB);
@ -104,7 +104,7 @@ MCSymbol *MMIAddrLabelMap::getAddrLabelSymbol(BasicBlock *BB) {
assert(BB->hasAddressTaken() && assert(BB->hasAddressTaken() &&
"Shouldn't get label for block without address taken"); "Shouldn't get label for block without address taken");
AddrLabelSymEntry &Entry = AddrLabelSymbols[BB]; AddrLabelSymEntry &Entry = AddrLabelSymbols[BB];
// If we already had an entry for this block, just return it. // If we already had an entry for this block, just return it.
if (!Entry.Symbols.isNull()) { if (!Entry.Symbols.isNull()) {
assert(BB->getParent() == Entry.Fn && "Parent changed"); assert(BB->getParent() == Entry.Fn && "Parent changed");
@ -112,7 +112,7 @@ MCSymbol *MMIAddrLabelMap::getAddrLabelSymbol(BasicBlock *BB) {
return Entry.Symbols.get<MCSymbol*>(); return Entry.Symbols.get<MCSymbol*>();
return (*Entry.Symbols.get<std::vector<MCSymbol*>*>())[0]; return (*Entry.Symbols.get<std::vector<MCSymbol*>*>())[0];
} }
// Otherwise, this is a new entry, create a new symbol for it and add an // Otherwise, this is a new entry, create a new symbol for it and add an
// entry to BBCallbacks so we can be notified if the BB is deleted or RAUWd. // entry to BBCallbacks so we can be notified if the BB is deleted or RAUWd.
BBCallbacks.push_back(BB); BBCallbacks.push_back(BB);
@ -129,9 +129,9 @@ MMIAddrLabelMap::getAddrLabelSymbolToEmit(BasicBlock *BB) {
assert(BB->hasAddressTaken() && assert(BB->hasAddressTaken() &&
"Shouldn't get label for block without address taken"); "Shouldn't get label for block without address taken");
AddrLabelSymEntry &Entry = AddrLabelSymbols[BB]; AddrLabelSymEntry &Entry = AddrLabelSymbols[BB];
std::vector<MCSymbol*> Result; std::vector<MCSymbol*> Result;
// If we already had an entry for this block, just return it. // If we already had an entry for this block, just return it.
if (Entry.Symbols.isNull()) if (Entry.Symbols.isNull())
Result.push_back(getAddrLabelSymbol(BB)); Result.push_back(getAddrLabelSymbol(BB));
@ -152,7 +152,7 @@ takeDeletedSymbolsForFunction(Function *F, std::vector<MCSymbol*> &Result) {
// If there are no entries for the function, just return. // If there are no entries for the function, just return.
if (I == DeletedAddrLabelsNeedingEmission.end()) return; if (I == DeletedAddrLabelsNeedingEmission.end()) return;
// Otherwise, take the list. // Otherwise, take the list.
std::swap(Result, I->second); std::swap(Result, I->second);
DeletedAddrLabelsNeedingEmission.erase(I); DeletedAddrLabelsNeedingEmission.erase(I);
@ -175,7 +175,7 @@ void MMIAddrLabelMap::UpdateForDeletedBlock(BasicBlock *BB) {
if (MCSymbol *Sym = Entry.Symbols.dyn_cast<MCSymbol*>()) { if (MCSymbol *Sym = Entry.Symbols.dyn_cast<MCSymbol*>()) {
if (Sym->isDefined()) if (Sym->isDefined())
return; return;
// If the block is not yet defined, we need to emit it at the end of the // If the block is not yet defined, we need to emit it at the end of the
// function. Add the symbol to the DeletedAddrLabelsNeedingEmission list // function. Add the symbol to the DeletedAddrLabelsNeedingEmission list
// for the containing Function. Since the block is being deleted, its // for the containing Function. Since the block is being deleted, its
@ -187,7 +187,7 @@ void MMIAddrLabelMap::UpdateForDeletedBlock(BasicBlock *BB) {
for (unsigned i = 0, e = Syms->size(); i != e; ++i) { for (unsigned i = 0, e = Syms->size(); i != e; ++i) {
MCSymbol *Sym = (*Syms)[i]; MCSymbol *Sym = (*Syms)[i];
if (Sym->isDefined()) continue; // Ignore already emitted labels. if (Sym->isDefined()) continue; // Ignore already emitted labels.
// If the block is not yet defined, we need to emit it at the end of the // If the block is not yet defined, we need to emit it at the end of the
// function. Add the symbol to the DeletedAddrLabelsNeedingEmission list // function. Add the symbol to the DeletedAddrLabelsNeedingEmission list
// for the containing Function. Since the block is being deleted, its // for the containing Function. Since the block is being deleted, its
@ -195,7 +195,7 @@ void MMIAddrLabelMap::UpdateForDeletedBlock(BasicBlock *BB) {
// 'Entry'. // 'Entry'.
DeletedAddrLabelsNeedingEmission[Entry.Fn].push_back(Sym); DeletedAddrLabelsNeedingEmission[Entry.Fn].push_back(Sym);
} }
// The entry is deleted, free the memory associated with the symbol list. // The entry is deleted, free the memory associated with the symbol list.
delete Syms; delete Syms;
} }
@ -225,7 +225,7 @@ void MMIAddrLabelMap::UpdateForRAUWBlock(BasicBlock *Old, BasicBlock *New) {
SymList->push_back(PrevSym); SymList->push_back(PrevSym);
NewEntry.Symbols = SymList; NewEntry.Symbols = SymList;
} }
std::vector<MCSymbol*> *SymList = std::vector<MCSymbol*> *SymList =
NewEntry.Symbols.get<std::vector<MCSymbol*>*>(); NewEntry.Symbols.get<std::vector<MCSymbol*>*>();
@ -234,7 +234,7 @@ void MMIAddrLabelMap::UpdateForRAUWBlock(BasicBlock *Old, BasicBlock *New) {
SymList->push_back(Sym); SymList->push_back(Sym);
return; return;
} }
// Otherwise, concatenate the list. // Otherwise, concatenate the list.
std::vector<MCSymbol*> *Syms =OldEntry.Symbols.get<std::vector<MCSymbol*>*>(); std::vector<MCSymbol*> *Syms =OldEntry.Symbols.get<std::vector<MCSymbol*>*>();
SymList->insert(SymList->end(), Syms->begin(), Syms->end()); SymList->insert(SymList->end(), Syms->begin(), Syms->end());
@ -272,7 +272,7 @@ MachineModuleInfo::MachineModuleInfo()
MachineModuleInfo::~MachineModuleInfo() { MachineModuleInfo::~MachineModuleInfo() {
delete ObjFileMMI; delete ObjFileMMI;
// FIXME: Why isn't doFinalization being called?? // FIXME: Why isn't doFinalization being called??
//assert(AddrLabelSymbols == 0 && "doFinalization not called"); //assert(AddrLabelSymbols == 0 && "doFinalization not called");
delete AddrLabelSymbols; delete AddrLabelSymbols;
@ -472,7 +472,7 @@ void MachineModuleInfo::TidyLandingPads(DenseMap<MCSymbol*, uintptr_t> *LPMap) {
(LPMap && (*LPMap)[BeginLabel] != 0)) && (LPMap && (*LPMap)[BeginLabel] != 0)) &&
(EndLabel->isDefined() || (EndLabel->isDefined() ||
(LPMap && (*LPMap)[EndLabel] != 0))) continue; (LPMap && (*LPMap)[EndLabel] != 0))) continue;
LandingPad.BeginLabels.erase(LandingPad.BeginLabels.begin() + j); LandingPad.BeginLabels.erase(LandingPad.BeginLabels.begin() + j);
LandingPad.EndLabels.erase(LandingPad.EndLabels.begin() + j); LandingPad.EndLabels.erase(LandingPad.EndLabels.begin() + j);
--j, --e; --j, --e;

View File

@ -73,7 +73,7 @@ LimitFPPrecision("limit-float-precision",
static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL, static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL,
const SDValue *Parts, unsigned NumParts, const SDValue *Parts, unsigned NumParts,
EVT PartVT, EVT ValueVT); EVT PartVT, EVT ValueVT);
/// getCopyFromParts - Create a value that contains the specified legal parts /// getCopyFromParts - Create a value that contains the specified legal parts
/// combined into the value they represent. If the parts combine to a type /// combined into the value they represent. If the parts combine to a type
/// larger then ValueVT then AssertOp can be used to specify whether the extra /// larger then ValueVT then AssertOp can be used to specify whether the extra
@ -85,7 +85,7 @@ static SDValue getCopyFromParts(SelectionDAG &DAG, DebugLoc DL,
ISD::NodeType AssertOp = ISD::DELETED_NODE) { ISD::NodeType AssertOp = ISD::DELETED_NODE) {
if (ValueVT.isVector()) if (ValueVT.isVector())
return getCopyFromPartsVector(DAG, DL, Parts, NumParts, PartVT, ValueVT); return getCopyFromPartsVector(DAG, DL, Parts, NumParts, PartVT, ValueVT);
assert(NumParts > 0 && "No parts to assemble!"); assert(NumParts > 0 && "No parts to assemble!");
const TargetLowering &TLI = DAG.getTargetLoweringInfo(); const TargetLowering &TLI = DAG.getTargetLoweringInfo();
SDValue Val = Parts[0]; SDValue Val = Parts[0];
@ -206,7 +206,7 @@ static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL,
assert(NumParts > 0 && "No parts to assemble!"); assert(NumParts > 0 && "No parts to assemble!");
const TargetLowering &TLI = DAG.getTargetLoweringInfo(); const TargetLowering &TLI = DAG.getTargetLoweringInfo();
SDValue Val = Parts[0]; SDValue Val = Parts[0];
// Handle a multi-element vector. // Handle a multi-element vector.
if (NumParts > 1) { if (NumParts > 1) {
EVT IntermediateVT, RegisterVT; EVT IntermediateVT, RegisterVT;
@ -219,7 +219,7 @@ static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL,
assert(RegisterVT == PartVT && "Part type doesn't match vector breakdown!"); assert(RegisterVT == PartVT && "Part type doesn't match vector breakdown!");
assert(RegisterVT == Parts[0].getValueType() && assert(RegisterVT == Parts[0].getValueType() &&
"Part type doesn't match part!"); "Part type doesn't match part!");
// Assemble the parts into intermediate operands. // Assemble the parts into intermediate operands.
SmallVector<SDValue, 8> Ops(NumIntermediates); SmallVector<SDValue, 8> Ops(NumIntermediates);
if (NumIntermediates == NumParts) { if (NumIntermediates == NumParts) {
@ -238,20 +238,20 @@ static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL,
Ops[i] = getCopyFromParts(DAG, DL, &Parts[i * Factor], Factor, Ops[i] = getCopyFromParts(DAG, DL, &Parts[i * Factor], Factor,
PartVT, IntermediateVT); PartVT, IntermediateVT);
} }
// Build a vector with BUILD_VECTOR or CONCAT_VECTORS from the // Build a vector with BUILD_VECTOR or CONCAT_VECTORS from the
// intermediate operands. // intermediate operands.
Val = DAG.getNode(IntermediateVT.isVector() ? Val = DAG.getNode(IntermediateVT.isVector() ?
ISD::CONCAT_VECTORS : ISD::BUILD_VECTOR, DL, ISD::CONCAT_VECTORS : ISD::BUILD_VECTOR, DL,
ValueVT, &Ops[0], NumIntermediates); ValueVT, &Ops[0], NumIntermediates);
} }
// There is now one part, held in Val. Correct it to match ValueVT. // There is now one part, held in Val. Correct it to match ValueVT.
PartVT = Val.getValueType(); PartVT = Val.getValueType();
if (PartVT == ValueVT) if (PartVT == ValueVT)
return Val; return Val;
if (PartVT.isVector()) { if (PartVT.isVector()) {
// If the element type of the source/dest vectors are the same, but the // If the element type of the source/dest vectors are the same, but the
// parts vector has more elements than the value vector, then we have a // parts vector has more elements than the value vector, then we have a
@ -262,12 +262,12 @@ static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL,
"Cannot narrow, it would be a lossy transformation"); "Cannot narrow, it would be a lossy transformation");
return DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, ValueVT, Val, return DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, ValueVT, Val,
DAG.getIntPtrConstant(0)); DAG.getIntPtrConstant(0));
} }
// Vector/Vector bitcast. // Vector/Vector bitcast.
return DAG.getNode(ISD::BIT_CONVERT, DL, ValueVT, Val); return DAG.getNode(ISD::BIT_CONVERT, DL, ValueVT, Val);
} }
assert(ValueVT.getVectorElementType() == PartVT && assert(ValueVT.getVectorElementType() == PartVT &&
ValueVT.getVectorNumElements() == 1 && ValueVT.getVectorNumElements() == 1 &&
"Only trivial scalar-to-vector conversions should get here!"); "Only trivial scalar-to-vector conversions should get here!");
@ -280,7 +280,7 @@ static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL,
static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc dl, static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc dl,
SDValue Val, SDValue *Parts, unsigned NumParts, SDValue Val, SDValue *Parts, unsigned NumParts,
EVT PartVT); EVT PartVT);
/// getCopyToParts - Create a series of nodes that contain the specified value /// getCopyToParts - Create a series of nodes that contain the specified value
/// split into legal parts. If the parts contain more bits than Val, then, for /// split into legal parts. If the parts contain more bits than Val, then, for
/// integers, ExtendKind can be used to specify how to generate the extra bits. /// integers, ExtendKind can be used to specify how to generate the extra bits.
@ -289,11 +289,11 @@ static void getCopyToParts(SelectionDAG &DAG, DebugLoc DL,
EVT PartVT, EVT PartVT,
ISD::NodeType ExtendKind = ISD::ANY_EXTEND) { ISD::NodeType ExtendKind = ISD::ANY_EXTEND) {
EVT ValueVT = Val.getValueType(); EVT ValueVT = Val.getValueType();
// Handle the vector case separately. // Handle the vector case separately.
if (ValueVT.isVector()) if (ValueVT.isVector())
return getCopyToPartsVector(DAG, DL, Val, Parts, NumParts, PartVT); return getCopyToPartsVector(DAG, DL, Val, Parts, NumParts, PartVT);
const TargetLowering &TLI = DAG.getTargetLoweringInfo(); const TargetLowering &TLI = DAG.getTargetLoweringInfo();
unsigned PartBits = PartVT.getSizeInBits(); unsigned PartBits = PartVT.getSizeInBits();
unsigned OrigNumParts = NumParts; unsigned OrigNumParts = NumParts;
@ -316,7 +316,7 @@ static void getCopyToParts(SelectionDAG &DAG, DebugLoc DL,
Val = DAG.getNode(ISD::FP_EXTEND, DL, PartVT, Val); Val = DAG.getNode(ISD::FP_EXTEND, DL, PartVT, Val);
} else { } else {
assert(PartVT.isInteger() && ValueVT.isInteger() && assert(PartVT.isInteger() && ValueVT.isInteger() &&
"Unknown mismatch!"); "Unknown mismatch!");
ValueVT = EVT::getIntegerVT(*DAG.getContext(), NumParts * PartBits); ValueVT = EVT::getIntegerVT(*DAG.getContext(), NumParts * PartBits);
Val = DAG.getNode(ExtendKind, DL, ValueVT, Val); Val = DAG.getNode(ExtendKind, DL, ValueVT, Val);
} }
@ -403,7 +403,7 @@ static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc DL,
EVT ValueVT = Val.getValueType(); EVT ValueVT = Val.getValueType();
assert(ValueVT.isVector() && "Not a vector"); assert(ValueVT.isVector() && "Not a vector");
const TargetLowering &TLI = DAG.getTargetLoweringInfo(); const TargetLowering &TLI = DAG.getTargetLoweringInfo();
if (NumParts == 1) { if (NumParts == 1) {
if (PartVT == ValueVT) { if (PartVT == ValueVT) {
// Nothing to do. // Nothing to do.
@ -420,7 +420,7 @@ static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc DL,
for (unsigned i = 0, e = ValueVT.getVectorNumElements(); i != e; ++i) for (unsigned i = 0, e = ValueVT.getVectorNumElements(); i != e; ++i)
Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL,
ElementVT, Val, DAG.getIntPtrConstant(i))); ElementVT, Val, DAG.getIntPtrConstant(i)));
for (unsigned i = ValueVT.getVectorNumElements(), for (unsigned i = ValueVT.getVectorNumElements(),
e = PartVT.getVectorNumElements(); i != e; ++i) e = PartVT.getVectorNumElements(); i != e; ++i)
Ops.push_back(DAG.getUNDEF(ElementVT)); Ops.push_back(DAG.getUNDEF(ElementVT));
@ -428,7 +428,7 @@ static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc DL,
Val = DAG.getNode(ISD::BUILD_VECTOR, DL, PartVT, &Ops[0], Ops.size()); Val = DAG.getNode(ISD::BUILD_VECTOR, DL, PartVT, &Ops[0], Ops.size());
// FIXME: Use CONCAT for 2x -> 4x. // FIXME: Use CONCAT for 2x -> 4x.
//SDValue UndefElts = DAG.getUNDEF(VectorTy); //SDValue UndefElts = DAG.getUNDEF(VectorTy);
//Val = DAG.getNode(ISD::CONCAT_VECTORS, DL, PartVT, Val, UndefElts); //Val = DAG.getNode(ISD::CONCAT_VECTORS, DL, PartVT, Val, UndefElts);
} else { } else {
@ -439,11 +439,11 @@ static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc DL,
Val = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, Val = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL,
PartVT, Val, DAG.getIntPtrConstant(0)); PartVT, Val, DAG.getIntPtrConstant(0));
} }
Parts[0] = Val; Parts[0] = Val;
return; return;
} }
// Handle a multi-element vector. // Handle a multi-element vector.
EVT IntermediateVT, RegisterVT; EVT IntermediateVT, RegisterVT;
unsigned NumIntermediates; unsigned NumIntermediates;
@ -451,11 +451,11 @@ static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc DL,
IntermediateVT, IntermediateVT,
NumIntermediates, RegisterVT); NumIntermediates, RegisterVT);
unsigned NumElements = ValueVT.getVectorNumElements(); unsigned NumElements = ValueVT.getVectorNumElements();
assert(NumRegs == NumParts && "Part count doesn't match vector breakdown!"); assert(NumRegs == NumParts && "Part count doesn't match vector breakdown!");
NumParts = NumRegs; // Silence a compiler warning. NumParts = NumRegs; // Silence a compiler warning.
assert(RegisterVT == PartVT && "Part type doesn't match vector breakdown!"); assert(RegisterVT == PartVT && "Part type doesn't match vector breakdown!");
// Split the vector into intermediate operands. // Split the vector into intermediate operands.
SmallVector<SDValue, 8> Ops(NumIntermediates); SmallVector<SDValue, 8> Ops(NumIntermediates);
for (unsigned i = 0; i != NumIntermediates; ++i) { for (unsigned i = 0; i != NumIntermediates; ++i) {
@ -467,7 +467,7 @@ static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc DL,
Ops[i] = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, Ops[i] = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL,
IntermediateVT, Val, DAG.getIntPtrConstant(i)); IntermediateVT, Val, DAG.getIntPtrConstant(i));
} }
// Split the intermediate operands into legal parts. // Split the intermediate operands into legal parts.
if (NumParts == NumIntermediates) { if (NumParts == NumIntermediates) {
// If the register was not expanded, promote or copy the value, // If the register was not expanded, promote or copy the value,
@ -1348,7 +1348,7 @@ SelectionDAGBuilder::ShouldEmitAsBranches(const std::vector<CaseBlock> &Cases){
if (Cases[0].CC == ISD::SETNE && Cases[0].FalseBB == Cases[1].ThisBB) if (Cases[0].CC == ISD::SETNE && Cases[0].FalseBB == Cases[1].ThisBB)
return false; return false;
} }
return true; return true;
} }
@ -2963,7 +2963,7 @@ void SelectionDAGBuilder::visitLoad(const LoadInst &I) {
PtrVT, Ptr, PtrVT, Ptr,
DAG.getConstant(Offsets[i], PtrVT)); DAG.getConstant(Offsets[i], PtrVT));
SDValue L = DAG.getLoad(ValueVTs[i], getCurDebugLoc(), Root, SDValue L = DAG.getLoad(ValueVTs[i], getCurDebugLoc(), Root,
A, MachinePointerInfo(SV, Offsets[i]), isVolatile, A, MachinePointerInfo(SV, Offsets[i]), isVolatile,
isNonTemporal, Alignment); isNonTemporal, Alignment);
Values[i] = L; Values[i] = L;
@ -3930,7 +3930,7 @@ static SDValue ExpandPowI(DebugLoc DL, SDValue LHS, SDValue RHS,
/// At the end of instruction selection, they will be inserted to the entry BB. /// At the end of instruction selection, they will be inserted to the entry BB.
bool bool
SelectionDAGBuilder::EmitFuncArgumentDbgValue(const Value *V, MDNode *Variable, SelectionDAGBuilder::EmitFuncArgumentDbgValue(const Value *V, MDNode *Variable,
int64_t Offset, int64_t Offset,
const SDValue &N) { const SDValue &N) {
const Argument *Arg = dyn_cast<Argument>(V); const Argument *Arg = dyn_cast<Argument>(V);
if (!Arg) if (!Arg)
@ -4073,7 +4073,7 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
Size = C->getZExtValue(); Size = C->getZExtValue();
if (AA->alias(I.getArgOperand(0), Size, I.getArgOperand(1), Size) == if (AA->alias(I.getArgOperand(0), Size, I.getArgOperand(1), Size) ==
AliasAnalysis::NoAlias) { AliasAnalysis::NoAlias) {
DAG.setRoot(DAG.getMemcpy(getRoot(), dl, Op1, Op2, Op3, Align, isVol, DAG.setRoot(DAG.getMemcpy(getRoot(), dl, Op1, Op2, Op3, Align, isVol,
false, MachinePointerInfo(I.getArgOperand(0)), false, MachinePointerInfo(I.getArgOperand(0)),
MachinePointerInfo(I.getArgOperand(1)))); MachinePointerInfo(I.getArgOperand(1))));
return 0; return 0;
@ -4100,7 +4100,7 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
// Check if address has undef value. // Check if address has undef value.
if (isa<UndefValue>(Address) || if (isa<UndefValue>(Address) ||
(Address->use_empty() && !isa<Argument>(Address))) { (Address->use_empty() && !isa<Argument>(Address))) {
SDDbgValue*SDV = SDDbgValue*SDV =
DAG.getDbgValue(Variable, UndefValue::get(Address->getType()), DAG.getDbgValue(Variable, UndefValue::get(Address->getType()),
0, dl, SDNodeOrder); 0, dl, SDNodeOrder);
DAG.AddDbgValue(SDV, 0, false); DAG.AddDbgValue(SDV, 0, false);
@ -4114,7 +4114,7 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
SDDbgValue *SDV; SDDbgValue *SDV;
if (N.getNode()) { if (N.getNode()) {
// Parameters are handled specially. // Parameters are handled specially.
bool isParameter = bool isParameter =
DIVariable(Variable).getTag() == dwarf::DW_TAG_arg_variable; DIVariable(Variable).getTag() == dwarf::DW_TAG_arg_variable;
if (const BitCastInst *BCI = dyn_cast<BitCastInst>(Address)) if (const BitCastInst *BCI = dyn_cast<BitCastInst>(Address))
Address = BCI->getOperand(0); Address = BCI->getOperand(0);
@ -4139,7 +4139,7 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
DAG.AddDbgValue(SDV, N.getNode(), isParameter); DAG.AddDbgValue(SDV, N.getNode(), isParameter);
} else { } else {
// If Address is an argument then try to emit its dbg value using // If Address is an argument then try to emit its dbg value using
// virtual register info from the FuncInfo.ValueMap. // virtual register info from the FuncInfo.ValueMap.
if (!EmitFuncArgumentDbgValue(Address, Variable, 0, N)) { if (!EmitFuncArgumentDbgValue(Address, Variable, 0, N)) {
// If variable is pinned by a alloca in dominating bb then // If variable is pinned by a alloca in dominating bb then
// use StaticAllocaMap. // use StaticAllocaMap.
@ -4222,7 +4222,7 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
if (SI == FuncInfo.StaticAllocaMap.end()) if (SI == FuncInfo.StaticAllocaMap.end())
return 0; // VLAs. return 0; // VLAs.
int FI = SI->second; int FI = SI->second;
MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI(); MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI();
if (!DI.getDebugLoc().isUnknown() && MMI.hasDebugInfo()) if (!DI.getDebugLoc().isUnknown() && MMI.hasDebugInfo())
MMI.setVariableDbgInfo(Variable, FI, DI.getDebugLoc()); MMI.setVariableDbgInfo(Variable, FI, DI.getDebugLoc());
@ -4810,7 +4810,7 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
SDValue Chain = DAG.getNode(ISD::TokenFactor, getCurDebugLoc(), SDValue Chain = DAG.getNode(ISD::TokenFactor, getCurDebugLoc(),
MVT::Other, &Chains[0], NumValues); MVT::Other, &Chains[0], NumValues);
PendingLoads.push_back(Chain); PendingLoads.push_back(Chain);
// Collect the legal value parts into potentially illegal values // Collect the legal value parts into potentially illegal values
// that correspond to the original function's return values. // that correspond to the original function's return values.
SmallVector<EVT, 4> RetTys; SmallVector<EVT, 4> RetTys;
@ -4823,7 +4823,7 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
EVT VT = RetTys[I]; EVT VT = RetTys[I];
EVT RegisterVT = TLI.getRegisterType(RetTy->getContext(), VT); EVT RegisterVT = TLI.getRegisterType(RetTy->getContext(), VT);
unsigned NumRegs = TLI.getNumRegisters(RetTy->getContext(), VT); unsigned NumRegs = TLI.getNumRegisters(RetTy->getContext(), VT);
SDValue ReturnValue = SDValue ReturnValue =
getCopyFromParts(DAG, getCurDebugLoc(), &Values[CurReg], NumRegs, getCopyFromParts(DAG, getCurDebugLoc(), &Values[CurReg], NumRegs,
RegisterVT, VT, AssertOp); RegisterVT, VT, AssertOp);
@ -5001,7 +5001,7 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
visitInlineAsm(&I); visitInlineAsm(&I);
return; return;
} }
const char *RenameFn = 0; const char *RenameFn = 0;
if (Function *F = I.getCalledFunction()) { if (Function *F = I.getCalledFunction()) {
if (F->isDeclaration()) { if (F->isDeclaration()) {
@ -5079,7 +5079,7 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
} }
} }
} }
SDValue Callee; SDValue Callee;
if (!RenameFn) if (!RenameFn)
Callee = getValue(I.getCalledValue()); Callee = getValue(I.getCalledValue());
@ -5168,7 +5168,7 @@ public:
return TLI.getValueType(OpTy, true); return TLI.getValueType(OpTy, true);
} }
private: private:
/// MarkRegAndAliases - Mark the specified register and all aliases in the /// MarkRegAndAliases - Mark the specified register and all aliases in the
/// specified set. /// specified set.
@ -5425,13 +5425,13 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
std::vector<TargetLowering::AsmOperandInfo> TargetConstraints = TLI.ParseConstraints(CS); std::vector<TargetLowering::AsmOperandInfo> TargetConstraints = TLI.ParseConstraints(CS);
bool hasMemory = false; bool hasMemory = false;
unsigned ArgNo = 0; // ArgNo - The argument of the CallInst. unsigned ArgNo = 0; // ArgNo - The argument of the CallInst.
unsigned ResNo = 0; // ResNo - The result number of the next output. unsigned ResNo = 0; // ResNo - The result number of the next output.
for (unsigned i = 0, e = TargetConstraints.size(); i != e; ++i) { for (unsigned i = 0, e = TargetConstraints.size(); i != e; ++i) {
ConstraintOperands.push_back(SDISelAsmOperandInfo(TargetConstraints[i])); ConstraintOperands.push_back(SDISelAsmOperandInfo(TargetConstraints[i]));
SDISelAsmOperandInfo &OpInfo = ConstraintOperands.back(); SDISelAsmOperandInfo &OpInfo = ConstraintOperands.back();
EVT OpVT = MVT::Other; EVT OpVT = MVT::Other;
// Compute the value type for each operand. // Compute the value type for each operand.
@ -5479,7 +5479,7 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
} }
OpInfo.ConstraintVT = OpVT; OpInfo.ConstraintVT = OpVT;
// Indirect operand accesses access memory. // Indirect operand accesses access memory.
if (OpInfo.isIndirect) if (OpInfo.isIndirect)
hasMemory = true; hasMemory = true;
@ -5514,7 +5514,7 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
// error. // error.
if (OpInfo.hasMatchingInput()) { if (OpInfo.hasMatchingInput()) {
SDISelAsmOperandInfo &Input = ConstraintOperands[OpInfo.MatchingInput]; SDISelAsmOperandInfo &Input = ConstraintOperands[OpInfo.MatchingInput];
if (OpInfo.ConstraintVT != Input.ConstraintVT) { if (OpInfo.ConstraintVT != Input.ConstraintVT) {
if ((OpInfo.ConstraintVT.isInteger() != if ((OpInfo.ConstraintVT.isInteger() !=
Input.ConstraintVT.isInteger()) || Input.ConstraintVT.isInteger()) ||
@ -5695,7 +5695,7 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
" don't know how to handle tied " " don't know how to handle tied "
"indirect register inputs"); "indirect register inputs");
} }
RegsForValue MatchedRegs; RegsForValue MatchedRegs;
MatchedRegs.ValueVTs.push_back(InOperandVal.getValueType()); MatchedRegs.ValueVTs.push_back(InOperandVal.getValueType());
EVT RegVT = AsmNodeOperands[CurOp+1].getValueType(); EVT RegVT = AsmNodeOperands[CurOp+1].getValueType();
@ -5714,7 +5714,7 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
DAG, AsmNodeOperands); DAG, AsmNodeOperands);
break; break;
} }
assert(InlineAsm::isMemKind(OpFlag) && "Unknown matching constraint!"); assert(InlineAsm::isMemKind(OpFlag) && "Unknown matching constraint!");
assert(InlineAsm::getNumOperandRegisters(OpFlag) == 1 && assert(InlineAsm::getNumOperandRegisters(OpFlag) == 1 &&
"Unexpected number of operands"); "Unexpected number of operands");
@ -5729,8 +5729,8 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
} }
// Treat indirect 'X' constraint as memory. // Treat indirect 'X' constraint as memory.
if (OpInfo.ConstraintType == TargetLowering::C_Other && if (OpInfo.ConstraintType == TargetLowering::C_Other &&
OpInfo.isIndirect) OpInfo.isIndirect)
OpInfo.ConstraintType = TargetLowering::C_Memory; OpInfo.ConstraintType = TargetLowering::C_Memory;
if (OpInfo.ConstraintType == TargetLowering::C_Other) { if (OpInfo.ConstraintType == TargetLowering::C_Other) {
@ -5749,7 +5749,7 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
AsmNodeOperands.insert(AsmNodeOperands.end(), Ops.begin(), Ops.end()); AsmNodeOperands.insert(AsmNodeOperands.end(), Ops.begin(), Ops.end());
break; break;
} }
if (OpInfo.ConstraintType == TargetLowering::C_Memory) { if (OpInfo.ConstraintType == TargetLowering::C_Memory) {
assert(OpInfo.isIndirect && "Operand must be indirect to be a mem!"); assert(OpInfo.isIndirect && "Operand must be indirect to be a mem!");
assert(InOperandVal.getValueType() == TLI.getPointerTy() && assert(InOperandVal.getValueType() == TLI.getPointerTy() &&
@ -6261,7 +6261,7 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
// Note down frame index for byval arguments. // Note down frame index for byval arguments.
if (I->hasByValAttr() && !ArgValues.empty()) if (I->hasByValAttr() && !ArgValues.empty())
if (FrameIndexSDNode *FI = if (FrameIndexSDNode *FI =
dyn_cast<FrameIndexSDNode>(ArgValues[0].getNode())) dyn_cast<FrameIndexSDNode>(ArgValues[0].getNode()))
FuncInfo->setByValArgumentFrameIndex(I, FI->getIndex()); FuncInfo->setByValArgumentFrameIndex(I, FI->getIndex());