From e6b26fa8adb7f932fabb9880b7a84b2ab1370b8c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 1 Dec 2015 20:11:43 +0000 Subject: [PATCH] clang-format LinkModules.cpp. Most of the file has been changed recently and was already clang-format clean. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254454 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Linker/LinkModules.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index c2f472c7e33..602d012d9df 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -34,7 +34,6 @@ #include using namespace llvm; - //===----------------------------------------------------------------------===// // TypeMap implementation. //===----------------------------------------------------------------------===// @@ -42,22 +41,22 @@ using namespace llvm; namespace { class TypeMapTy : public ValueMapTypeRemapper { /// This is a mapping from a source type to a destination type to use. - DenseMap MappedTypes; + DenseMap MappedTypes; /// When checking to see if two subgraphs are isomorphic, we speculatively /// add types to MappedTypes, but keep track of them here in case we need to /// roll back. - SmallVector SpeculativeTypes; + SmallVector SpeculativeTypes; - SmallVector SpeculativeDstOpaqueTypes; + SmallVector SpeculativeDstOpaqueTypes; /// This is a list of non-opaque structs in the source module that are mapped /// to an opaque struct in the destination module. - SmallVector SrcDefinitionsToResolve; + SmallVector SrcDefinitionsToResolve; /// This is the set of opaque types in the destination modules who are /// getting a body from the source module. - SmallPtrSet DstResolvedOpaqueTypes; + SmallPtrSet DstResolvedOpaqueTypes; public: TypeMapTy(Linker::IdentifiedStructTypeSet &DstStructTypesSet) @@ -179,7 +178,7 @@ bool TypeMapTy::areTypesIsomorphic(Type *DstTy, Type *SrcTy) { // Fail if any of the extra properties (e.g. array size) of the type disagree. if (isa(DstTy)) - return false; // bitwidth disagrees. + return false; // bitwidth disagrees. if (PointerType *PT = dyn_cast(DstTy)) { if (PT->getAddressSpace() != cast(SrcTy)->getAddressSpace()) return false; @@ -215,7 +214,7 @@ bool TypeMapTy::areTypesIsomorphic(Type *DstTy, Type *SrcTy) { } void TypeMapTy::linkDefinedTypeBodies() { - SmallVector Elements; + SmallVector Elements; for (StructType *SrcSTy : SrcDefinitionsToResolve) { StructType *DstSTy = cast(MappedTypes[SrcSTy]); assert(DstSTy->isOpaque()); @@ -596,10 +595,10 @@ static void forceRenaming(GlobalValue *GV, StringRef Name) { // If there is a conflict, rename the conflict. if (GlobalValue *ConflictGV = M->getNamedValue(Name)) { GV->takeName(ConflictGV); - ConflictGV->setName(Name); // This will cause ConflictGV to get renamed + ConflictGV->setName(Name); // This will cause ConflictGV to get renamed assert(ConflictGV->getName() != Name && "forceRenaming didn't work"); } else { - GV->setName(Name); // Force the name back + GV->setName(Name); // Force the name back } } @@ -1534,7 +1533,7 @@ bool ModuleLinker::linkFunctionBody(Function &Dst, Function &Src) { // Go through and convert function arguments over, remembering the mapping. Function::arg_iterator DI = Dst.arg_begin(); for (Argument &Arg : Src.args()) { - DI->setName(Arg.getName()); // Copy the name over. + DI->setName(Arg.getName()); // Copy the name over. // Add a mapping to our mapping. ValueMap[&Arg] = &*DI; @@ -1625,7 +1624,8 @@ void ModuleLinker::linkNamedMDNodes() { bool ModuleLinker::linkModuleFlagsMetadata() { // If the source module has no module flags, we are done. const NamedMDNode *SrcModFlags = SrcM.getModuleFlagsMetadata(); - if (!SrcModFlags) return false; + if (!SrcModFlags) + return false; // If the destination module doesn't have module flags yet, then just copy // over the source module's flags. @@ -1639,7 +1639,7 @@ bool ModuleLinker::linkModuleFlagsMetadata() { // First build a map of the existing module flags and requirements. DenseMap> Flags; - SmallSetVector Requirements; + SmallSetVector Requirements; for (unsigned I = 0, E = DstModFlags->getNumOperands(); I != E; ++I) { MDNode *Op = DstModFlags->getOperand(I); ConstantInt *Behavior = mdconst::extract(Op->getOperand(0)); @@ -1720,7 +1720,8 @@ bool ModuleLinker::linkModuleFlagsMetadata() { // Perform the merge for standard behavior types. switch (SrcBehaviorValue) { case Module::Require: - case Module::Override: llvm_unreachable("not possible"); + case Module::Override: + llvm_unreachable("not possible"); case Module::Error: { // Emit an error if the values differ. if (SrcOp->getOperand(2) != DstOp->getOperand(2)) { @@ -1783,16 +1784,15 @@ bool ModuleLinker::linkModuleFlagsMetadata() { static bool triplesMatch(const Triple &T0, const Triple &T1) { // If vendor is apple, ignore the version number. if (T0.getVendor() == Triple::Apple) - return T0.getArch() == T1.getArch() && - T0.getSubArch() == T1.getSubArch() && - T0.getVendor() == T1.getVendor() && - T0.getOS() == T1.getOS(); + return T0.getArch() == T1.getArch() && T0.getSubArch() == T1.getSubArch() && + T0.getVendor() == T1.getVendor() && T0.getOS() == T1.getOS(); return T0 == T1; } // This function returns the merged triple. -static std::string mergeTriples(const Triple &SrcTriple, const Triple &DstTriple) { +static std::string mergeTriples(const Triple &SrcTriple, + const Triple &DstTriple) { // If vendor is apple, pick the triple with the larger version number. if (SrcTriple.getVendor() == Triple::Apple) if (DstTriple.isOSVersionLT(SrcTriple)) -- 2.34.1