From xuzhongxing at gmail.com Mon Sep 6 02:04:06 2010 From: xuzhongxing at gmail.com (Zhongxing Xu) Date: Mon, 06 Sep 2010 07:04:06 -0000 Subject: [cfe-commits] r113148 - /cfe/trunk/lib/Analysis/CFG.cpp Message-ID: <20100906070406.693252A6C12C@llvm.org> Author: zhongxingxu Date: Mon Sep 6 02:04:06 2010 New Revision: 113148 URL: http://llvm.org/viewvc/llvm-project?rev=113148&view=rev Log: Simplify CFG construction: bail out early when we have a bad CFG. Modified: cfe/trunk/lib/Analysis/CFG.cpp Modified: cfe/trunk/lib/Analysis/CFG.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=113148&r1=113147&r2=113148&view=diff ============================================================================== --- cfe/trunk/lib/Analysis/CFG.cpp (original) +++ cfe/trunk/lib/Analysis/CFG.cpp Mon Sep 6 02:04:06 2010 @@ -272,58 +272,54 @@ Block = NULL; // the EXIT block is empty. Create all other blocks lazily. // Visit the statements and create the CFG. - CFGBlock* B = addStmt(Statement); + CFGBlock *B = addStmt(Statement); + + if (badCFG) + return NULL; + + if (B) + Succ = B; if (const CXXConstructorDecl *CD = dyn_cast_or_null(D)) { // FIXME: Add code for base initializers and member initializers. (void)CD; } - if (!B) - B = Succ; - if (B) { - // Finalize the last constructed block. This usually involves reversing the - // order of the statements in the block. - if (Block) FinishBlock(B); - - // Backpatch the gotos whose label -> block mappings we didn't know when we - // encountered them. - for (BackpatchBlocksTy::iterator I = BackpatchBlocks.begin(), - E = BackpatchBlocks.end(); I != E; ++I ) { - - CFGBlock* B = *I; - GotoStmt* G = cast(B->getTerminator()); - LabelMapTy::iterator LI = LabelMap.find(G->getLabel()); + // Backpatch the gotos whose label -> block mappings we didn't know when we + // encountered them. + for (BackpatchBlocksTy::iterator I = BackpatchBlocks.begin(), + E = BackpatchBlocks.end(); I != E; ++I ) { + + CFGBlock* B = *I; + GotoStmt* G = cast(B->getTerminator()); + LabelMapTy::iterator LI = LabelMap.find(G->getLabel()); + + // If there is no target for the goto, then we are looking at an + // incomplete AST. Handle this by not registering a successor. + if (LI == LabelMap.end()) continue; + + AddSuccessor(B, LI->second); + } + + // Add successors to the Indirect Goto Dispatch block (if we have one). + if (CFGBlock* B = cfg->getIndirectGotoBlock()) + for (LabelSetTy::iterator I = AddressTakenLabels.begin(), + E = AddressTakenLabels.end(); I != E; ++I ) { + + // Lookup the target block. + LabelMapTy::iterator LI = LabelMap.find(*I); - // If there is no target for the goto, then we are looking at an - // incomplete AST. Handle this by not registering a successor. + // If there is no target block that contains label, then we are looking + // at an incomplete AST. Handle this by not registering a successor. if (LI == LabelMap.end()) continue; - + AddSuccessor(B, LI->second); } - // Add successors to the Indirect Goto Dispatch block (if we have one). - if (CFGBlock* B = cfg->getIndirectGotoBlock()) - for (LabelSetTy::iterator I = AddressTakenLabels.begin(), - E = AddressTakenLabels.end(); I != E; ++I ) { - - // Lookup the target block. - LabelMapTy::iterator LI = LabelMap.find(*I); - - // If there is no target block that contains label, then we are looking - // at an incomplete AST. Handle this by not registering a successor. - if (LI == LabelMap.end()) continue; - - AddSuccessor(B, LI->second); - } - - Succ = B; - } - // Create an empty entry block that has no predecessors. cfg->setEntry(createBlock()); - return badCFG ? NULL : cfg.take(); + return cfg.take(); } /// createBlock - Used to lazily create blocks that are connected From xuzhongxing at gmail.com Mon Sep 6 02:32:31 2010 From: xuzhongxing at gmail.com (Zhongxing Xu) Date: Mon, 06 Sep 2010 07:32:31 -0000 Subject: [cfe-commits] r113149 - /cfe/trunk/lib/Analysis/CFG.cpp Message-ID: <20100906073232.33B6D2A6C12D@llvm.org> Author: zhongxingxu Date: Mon Sep 6 02:32:31 2010 New Revision: 113149 URL: http://llvm.org/viewvc/llvm-project?rev=113149&view=rev Log: FinishBlock() is essentially doing nothing except returning '!badCFG'. Modified: cfe/trunk/lib/Analysis/CFG.cpp Modified: cfe/trunk/lib/Analysis/CFG.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=113149&r1=113148&r2=113149&view=diff ============================================================================== --- cfe/trunk/lib/Analysis/CFG.cpp (original) +++ cfe/trunk/lib/Analysis/CFG.cpp Mon Sep 6 02:32:31 2010 @@ -171,7 +171,7 @@ void autoCreateBlock() { if (!Block) Block = createBlock(); } CFGBlock *createBlock(bool add_successor = true); - bool FinishBlock(CFGBlock* B); + CFGBlock *addStmt(Stmt *S) { return Visit(S, AddStmtChoice::AlwaysAdd); } @@ -331,15 +331,6 @@ return B; } -/// FinishBlock - "Finalize" the block by checking if we have a bad CFG. -bool CFGBuilder::FinishBlock(CFGBlock* B) { - if (badCFG) - return false; - - assert(B); - return true; -} - /// Visit - Walk the subtree of a statement and add extra /// blocks for ternary operators, &&, and ||. We also process "," and /// DeclStmts (which may contain nested control-flow). @@ -505,7 +496,7 @@ CFGBlock* ConfluenceBlock = Block ? Block : createBlock(); AppendStmt(ConfluenceBlock, B, asc); - if (!FinishBlock(ConfluenceBlock)) + if (badCFG) return 0; // create the block evaluating the LHS @@ -518,7 +509,7 @@ CFGBlock* RHSBlock = addStmt(B->getRHS()); if (RHSBlock) { - if (!FinishBlock(RHSBlock)) + if (badCFG) return 0; } else { @@ -576,8 +567,8 @@ CFGBlock *CFGBuilder::VisitBreakStmt(BreakStmt *B) { // "break" is a control-flow statement. Thus we stop processing the current // block. - if (Block && !FinishBlock(Block)) - return 0; + if (badCFG) + return 0; // Now create a new block that ends with the break statement. Block = createBlock(false); @@ -644,7 +635,7 @@ if (Block) { Succ = Block; - if (!FinishBlock(Block)) + if (badCFG) return 0; } @@ -670,7 +661,7 @@ AddStmtChoice asc) { CFGBlock* ConfluenceBlock = Block ? Block : createBlock(); AppendStmt(ConfluenceBlock, C, asc); - if (!FinishBlock(ConfluenceBlock)) + if (badCFG) return 0; asc = asc.asLValue() ? AddStmtChoice::AlwaysAddAsLValue @@ -679,13 +670,13 @@ Succ = ConfluenceBlock; Block = NULL; CFGBlock* LHSBlock = Visit(C->getLHS(), asc); - if (!FinishBlock(LHSBlock)) + if (badCFG) return 0; Succ = ConfluenceBlock; Block = NULL; CFGBlock* RHSBlock = Visit(C->getRHS(), asc); - if (!FinishBlock(RHSBlock)) + if (badCFG) return 0; Block = createBlock(false); @@ -725,7 +716,7 @@ // expression. CFGBlock* ConfluenceBlock = Block ? Block : createBlock(); AppendStmt(ConfluenceBlock, C, asc); - if (!FinishBlock(ConfluenceBlock)) + if (badCFG) return 0; asc = asc.asLValue() ? AddStmtChoice::AlwaysAddAsLValue @@ -740,7 +731,7 @@ CFGBlock* LHSBlock = NULL; if (C->getLHS()) { LHSBlock = Visit(C->getLHS(), asc); - if (!FinishBlock(LHSBlock)) + if (badCFG) return 0; Block = NULL; } @@ -748,7 +739,7 @@ // Create the block for the RHS expression. Succ = ConfluenceBlock; CFGBlock* RHSBlock = Visit(C->getRHS(), asc); - if (!FinishBlock(RHSBlock)) + if (badCFG) return 0; // Create the block that will contain the condition. @@ -857,7 +848,7 @@ // block. if (Block) { Succ = Block; - if (!FinishBlock(Block)) + if (badCFG) return 0; } @@ -875,7 +866,7 @@ if (!ElseBlock) // Can occur when the Else body has all NullStmts. ElseBlock = sv.get(); else if (Block) { - if (!FinishBlock(ElseBlock)) + if (badCFG) return 0; } } @@ -896,7 +887,7 @@ ThenBlock = createBlock(false); AddSuccessor(ThenBlock, sv.get()); } else if (Block) { - if (!FinishBlock(ThenBlock)) + if (badCFG) return 0; } } @@ -940,8 +931,6 @@ // code afterwards is DEAD (unreachable). We still keep a basic block // for that code; a simple "mark-and-sweep" from the entry block will be // able to report such dead blocks. - if (Block) - FinishBlock(Block); // Create the new block. Block = createBlock(false); @@ -970,7 +959,7 @@ // already processed the substatement) there is no extra control-flow to worry // about. LabelBlock->setLabel(L); - if (!FinishBlock(LabelBlock)) + if (badCFG) return 0; // We set Block to NULL to allow lazy creation of a new block (if necessary); @@ -985,8 +974,6 @@ CFGBlock* CFGBuilder::VisitGotoStmt(GotoStmt* G) { // Goto is a control-flow statement. Thus we stop processing the current // block and create a new one. - if (Block) - FinishBlock(Block); Block = createBlock(false); Block->setTerminator(G); @@ -1009,7 +996,7 @@ // "for" is a control-flow statement. Thus we stop processing the current // block. if (Block) { - if (!FinishBlock(Block)) + if (badCFG) return 0; LoopSuccessor = Block; } else @@ -1048,7 +1035,7 @@ } if (Block) { - if (!FinishBlock(EntryConditionBlock)) + if (badCFG) return 0; } } @@ -1088,7 +1075,7 @@ // Finish up the increment (or empty) block if it hasn't been already. if (Block) { assert(Block == Succ); - if (!FinishBlock(Block)) + if (badCFG) return 0; Block = 0; } @@ -1105,7 +1092,7 @@ if (!BodyBlock) BodyBlock = ContinueTargetBlock; // can happen for "for (...;...;...) ;" - else if (Block && !FinishBlock(BodyBlock)) + else if (badCFG) return 0; // This new body block is a successor to our "exit" condition block. @@ -1176,7 +1163,7 @@ CFGBlock* LoopSuccessor = 0; if (Block) { - if (!FinishBlock(Block)) + if (badCFG) return 0; LoopSuccessor = Block; Block = 0; @@ -1201,7 +1188,7 @@ // the CFG unless it contains control-flow. EntryConditionBlock = Visit(S->getElement(), AddStmtChoice::NotAlwaysAdd); if (Block) { - if (!FinishBlock(EntryConditionBlock)) + if (badCFG) return 0; Block = 0; } @@ -1224,7 +1211,7 @@ if (!BodyBlock) BodyBlock = EntryConditionBlock; // can happen for "for (X in Y) ;" else if (Block) { - if (!FinishBlock(BodyBlock)) + if (badCFG) return 0; } @@ -1250,7 +1237,7 @@ // The sync body starts its own basic block. This makes it a little easier // for diagnostic clients. if (SyncBlock) { - if (!FinishBlock(SyncBlock)) + if (badCFG) return 0; Block = 0; @@ -1272,7 +1259,7 @@ // "while" is a control-flow statement. Thus we stop processing the current // block. if (Block) { - if (!FinishBlock(Block)) + if (badCFG) return 0; LoopSuccessor = Block; } else @@ -1307,7 +1294,7 @@ } if (Block) { - if (!FinishBlock(EntryConditionBlock)) + if (badCFG) return 0; } } @@ -1348,7 +1335,7 @@ if (!BodyBlock) BodyBlock = ContinueTargetBlock; // can happen for "while(...) ;" else if (Block) { - if (!FinishBlock(BodyBlock)) + if (badCFG) return 0; } @@ -1381,7 +1368,7 @@ // statement. // If we were in the middle of a block we stop processing that block. - if (Block && !FinishBlock(Block)) + if (badCFG) return 0; // Create the new block. @@ -1397,7 +1384,7 @@ CFGBlock* CFGBuilder::VisitCXXThrowExpr(CXXThrowExpr* T) { // If we were in the middle of a block we stop processing that block. - if (Block && !FinishBlock(Block)) + if (badCFG) return 0; // Create the new block. @@ -1421,7 +1408,7 @@ // "do...while" is a control-flow statement. Thus we stop processing the // current block. if (Block) { - if (!FinishBlock(Block)) + if (badCFG) return 0; LoopSuccessor = Block; } else @@ -1442,7 +1429,7 @@ Block = ExitConditionBlock; EntryConditionBlock = addStmt(C); if (Block) { - if (!FinishBlock(EntryConditionBlock)) + if (badCFG) return 0; } } @@ -1478,7 +1465,7 @@ if (!BodyBlock) BodyBlock = EntryConditionBlock; // can happen for "do ; while(...)" else if (Block) { - if (!FinishBlock(BodyBlock)) + if (badCFG) return 0; } @@ -1516,8 +1503,8 @@ CFGBlock* CFGBuilder::VisitContinueStmt(ContinueStmt* C) { // "continue" is a control-flow statement. Thus we stop processing the // current block. - if (Block && !FinishBlock(Block)) - return 0; + if (badCFG) + return 0; // Now create a new block that ends with the continue statement. Block = createBlock(false); @@ -1567,7 +1554,7 @@ CFGBlock* SwitchSuccessor = NULL; if (Block) { - if (!FinishBlock(Block)) + if (badCFG) return 0; SwitchSuccessor = Block; } else SwitchSuccessor = Succ; @@ -1595,9 +1582,9 @@ // control-flow from the switch goes to case/default statements. assert(Terminator->getBody() && "switch must contain a non-NULL body"); Block = NULL; - CFGBlock *BodyBlock = addStmt(Terminator->getBody()); + addStmt(Terminator->getBody()); if (Block) { - if (!FinishBlock(BodyBlock)) + if (badCFG) return 0; } @@ -1660,7 +1647,7 @@ // were processing (the "case XXX:" is the label). CaseBlock->setLabel(CS); - if (!FinishBlock(CaseBlock)) + if (badCFG) return 0; // Add this block to the list of successors for the block with the switch @@ -1696,7 +1683,7 @@ // we were processing (the "default:" is the label). DefaultCaseBlock->setLabel(Terminator); - if (!FinishBlock(DefaultCaseBlock)) + if (badCFG) return 0; // Unlike case statements, we don't add the default block to the successors @@ -1720,7 +1707,7 @@ CFGBlock* TrySuccessor = NULL; if (Block) { - if (!FinishBlock(Block)) + if (badCFG) return 0; TrySuccessor = Block; } else TrySuccessor = Succ; @@ -1781,7 +1768,7 @@ CatchBlock->setLabel(CS); - if (!FinishBlock(CatchBlock)) + if (badCFG) return 0; // We set Block to NULL to allow lazy creation of a new block (if necessary) @@ -1810,7 +1797,7 @@ // IndirectGoto is a control-flow statement. Thus we stop processing the // current block and create a new one. - if (Block && !FinishBlock(Block)) + if (badCFG) return 0; Block = createBlock(false); From pichet2000 at gmail.com Mon Sep 6 02:50:54 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Mon, 6 Sep 2010 03:50:54 -0400 Subject: [cfe-commits] [PATCH][MS][Review request] - Enum forward declaration In-Reply-To: References: Message-ID: sorry the previous patch was wrong here is an updated one. On Fri, Sep 3, 2010 at 6:37 AM, Francois Pichet wrote: > Hi, > > MSVC supports enum forward declaration: > enum ENUM; > > BTW I can now commit myself . I just need approval. > -------------- next part -------------- A non-text attachment was scrubbed... Name: forward_enum_ms.patch Type: application/octet-stream Size: 1776 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/cfe-commits/attachments/20100906/de069a5b/attachment.obj From dimitry at andric.com Mon Sep 6 04:14:34 2010 From: dimitry at andric.com (Dimitry Andric) Date: Mon, 06 Sep 2010 11:14:34 +0200 Subject: [cfe-commits] [patch] Remove some UTF-8 magic quotes Message-ID: <4C84B0FA.7000502@andric.com> I got some complaints from a tagging tool about stray UTF-8 characters in the clang sources; this patch removes two instances of them. The one in tools/clang/test/CodeGen/darwin-string-literals.c looks like it is supposed to be there, but I'm not sure. :) -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: remove-magic-quotes.diff Url: http://lists.cs.uiuc.edu/pipermail/cfe-commits/attachments/20100906/36a657d8/attachment.pl From akyrtzi at gmail.com Mon Sep 6 07:00:10 2010 From: akyrtzi at gmail.com (Argyrios Kyrtzidis) Date: Mon, 06 Sep 2010 12:00:10 -0000 Subject: [cfe-commits] r113154 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/ivars.m Message-ID: <20100906120010.B85C32A6C12C@llvm.org> Author: akirtzidis Date: Mon Sep 6 07:00:10 2010 New Revision: 113154 URL: http://llvm.org/viewvc/llvm-project?rev=113154&view=rev Log: LastFieldBitfield in CGObjCCommonMac::BuildAggrIvarLayout keeps bitfields or unnamed fields but later the code assumes that it's always a bitfield. This can lead to a crash (reported at rdar://8368320). Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp cfe/trunk/test/CodeGenObjC/ivars.m Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=113154&r1=113153&r2=113154&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original) +++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Sep 6 07:00:10 2010 @@ -3586,10 +3586,10 @@ uint64_t MaxSkippedUnionIvarSize = 0; FieldDecl *MaxField = 0; FieldDecl *MaxSkippedField = 0; - FieldDecl *LastFieldBitfield = 0; + FieldDecl *LastFieldBitfieldOrUnnamed = 0; uint64_t MaxFieldOffset = 0; uint64_t MaxSkippedFieldOffset = 0; - uint64_t LastBitfieldOffset = 0; + uint64_t LastBitfieldOrUnnamedOffset = 0; if (RecFields.empty()) return; @@ -3609,12 +3609,12 @@ // Skip over unnamed or bitfields if (!Field->getIdentifier() || Field->isBitField()) { - LastFieldBitfield = Field; - LastBitfieldOffset = FieldOffset; + LastFieldBitfieldOrUnnamed = Field; + LastBitfieldOrUnnamedOffset = FieldOffset; continue; } - LastFieldBitfield = 0; + LastFieldBitfieldOrUnnamed = 0; QualType FQT = Field->getType(); if (FQT->isRecordType() || FQT->isUnionType()) { if (FQT->isUnionType()) @@ -3703,16 +3703,25 @@ } } - if (LastFieldBitfield) { - // Last field was a bitfield. Must update skip info. - Expr *BitWidth = LastFieldBitfield->getBitWidth(); - uint64_t BitFieldSize = - BitWidth->EvaluateAsInt(CGM.getContext()).getZExtValue(); - GC_IVAR skivar; - skivar.ivar_bytepos = BytePos + LastBitfieldOffset; - skivar.ivar_size = (BitFieldSize / ByteSizeInBits) - + ((BitFieldSize % ByteSizeInBits) != 0); - SkipIvars.push_back(skivar); + if (LastFieldBitfieldOrUnnamed) { + if (LastFieldBitfieldOrUnnamed->isBitField()) { + // Last field was a bitfield. Must update skip info. + Expr *BitWidth = LastFieldBitfieldOrUnnamed->getBitWidth(); + uint64_t BitFieldSize = + BitWidth->EvaluateAsInt(CGM.getContext()).getZExtValue(); + GC_IVAR skivar; + skivar.ivar_bytepos = BytePos + LastBitfieldOrUnnamedOffset; + skivar.ivar_size = (BitFieldSize / ByteSizeInBits) + + ((BitFieldSize % ByteSizeInBits) != 0); + SkipIvars.push_back(skivar); + } else { + assert(!LastFieldBitfieldOrUnnamed->getIdentifier() &&"Expected unnamed"); + // Last field was unnamed. Must update skip info. + unsigned FieldSize + = CGM.getContext().getTypeSize(LastFieldBitfieldOrUnnamed->getType()); + SkipIvars.push_back(GC_IVAR(BytePos + LastBitfieldOrUnnamedOffset, + FieldSize / ByteSizeInBits)); + } } if (MaxField) Modified: cfe/trunk/test/CodeGenObjC/ivars.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/ivars.m?rev=113154&r1=113153&r2=113154&view=diff ============================================================================== --- cfe/trunk/test/CodeGenObjC/ivars.m (original) +++ cfe/trunk/test/CodeGenObjC/ivars.m Mon Sep 6 07:00:10 2010 @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s // RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o - %s +// RUN: %clang_cc1 -fobjc-gc -emit-llvm -o - %s // rdar://6800926 @interface ITF { @@ -12,3 +13,17 @@ void foo(ITF *P) { P->boolfield = 1; } + +// rdar://8368320 + at interface R { + struct { + union { + int x; + char c; + }; + } _union; +} + at end + + at implementation R + at end From kyrtzidis at apple.com Mon Sep 6 07:05:41 2010 From: kyrtzidis at apple.com (Argyrios Kyrtzidis) Date: Mon, 6 Sep 2010 13:05:41 +0100 Subject: [cfe-commits] r113154 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/ivars.m In-Reply-To: <20100906120010.B85C32A6C12C@llvm.org> References: <20100906120010.B85C32A6C12C@llvm.org> Message-ID: <0C3D4333-0523-46C5-818D-1EF3C349A1C3@apple.com> Fariborz please review. On Sep 6, 2010, at 1:00 PM, Argyrios Kyrtzidis wrote: > Author: akirtzidis > Date: Mon Sep 6 07:00:10 2010 > New Revision: 113154 > > URL: http://llvm.org/viewvc/llvm-project?rev=113154&view=rev > Log: > LastFieldBitfield in CGObjCCommonMac::BuildAggrIvarLayout keeps bitfields or unnamed fields but later the code > assumes that it's always a bitfield. This can lead to a crash (reported at rdar://8368320). > > Modified: > cfe/trunk/lib/CodeGen/CGObjCMac.cpp > cfe/trunk/test/CodeGenObjC/ivars.m > > Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=113154&r1=113153&r2=113154&view=diff > ============================================================================== > --- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original) > +++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Sep 6 07:00:10 2010 > @@ -3586,10 +3586,10 @@ > uint64_t MaxSkippedUnionIvarSize = 0; > FieldDecl *MaxField = 0; > FieldDecl *MaxSkippedField = 0; > - FieldDecl *LastFieldBitfield = 0; > + FieldDecl *LastFieldBitfieldOrUnnamed = 0; > uint64_t MaxFieldOffset = 0; > uint64_t MaxSkippedFieldOffset = 0; > - uint64_t LastBitfieldOffset = 0; > + uint64_t LastBitfieldOrUnnamedOffset = 0; > > if (RecFields.empty()) > return; > @@ -3609,12 +3609,12 @@ > > // Skip over unnamed or bitfields > if (!Field->getIdentifier() || Field->isBitField()) { > - LastFieldBitfield = Field; > - LastBitfieldOffset = FieldOffset; > + LastFieldBitfieldOrUnnamed = Field; > + LastBitfieldOrUnnamedOffset = FieldOffset; > continue; > } > > - LastFieldBitfield = 0; > + LastFieldBitfieldOrUnnamed = 0; > QualType FQT = Field->getType(); > if (FQT->isRecordType() || FQT->isUnionType()) { > if (FQT->isUnionType()) > @@ -3703,16 +3703,25 @@ > } > } > > - if (LastFieldBitfield) { > - // Last field was a bitfield. Must update skip info. > - Expr *BitWidth = LastFieldBitfield->getBitWidth(); > - uint64_t BitFieldSize = > - BitWidth->EvaluateAsInt(CGM.getContext()).getZExtValue(); > - GC_IVAR skivar; > - skivar.ivar_bytepos = BytePos + LastBitfieldOffset; > - skivar.ivar_size = (BitFieldSize / ByteSizeInBits) > - + ((BitFieldSize % ByteSizeInBits) != 0); > - SkipIvars.push_back(skivar); > + if (LastFieldBitfieldOrUnnamed) { > + if (LastFieldBitfieldOrUnnamed->isBitField()) { > + // Last field was a bitfield. Must update skip info. > + Expr *BitWidth = LastFieldBitfieldOrUnnamed->getBitWidth(); > + uint64_t BitFieldSize = > + BitWidth->EvaluateAsInt(CGM.getContext()).getZExtValue(); > + GC_IVAR skivar; > + skivar.ivar_bytepos = BytePos + LastBitfieldOrUnnamedOffset; > + skivar.ivar_size = (BitFieldSize / ByteSizeInBits) > + + ((BitFieldSize % ByteSizeInBits) != 0); > + SkipIvars.push_back(skivar); > + } else { > + assert(!LastFieldBitfieldOrUnnamed->getIdentifier() &&"Expected unnamed"); > + // Last field was unnamed. Must update skip info. > + unsigned FieldSize > + = CGM.getContext().getTypeSize(LastFieldBitfieldOrUnnamed->getType()); > + SkipIvars.push_back(GC_IVAR(BytePos + LastBitfieldOrUnnamedOffset, > + FieldSize / ByteSizeInBits)); > + } > } > > if (MaxField) > > Modified: cfe/trunk/test/CodeGenObjC/ivars.m > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/ivars.m?rev=113154&r1=113153&r2=113154&view=diff > ============================================================================== > --- cfe/trunk/test/CodeGenObjC/ivars.m (original) > +++ cfe/trunk/test/CodeGenObjC/ivars.m Mon Sep 6 07:00:10 2010 > @@ -1,5 +1,6 @@ > // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s > // RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o - %s > +// RUN: %clang_cc1 -fobjc-gc -emit-llvm -o - %s > > // rdar://6800926 > @interface ITF { > @@ -12,3 +13,17 @@ > void foo(ITF *P) { > P->boolfield = 1; > } > + > +// rdar://8368320 > + at interface R { > + struct { > + union { > + int x; > + char c; > + }; > + } _union; > +} > + at end > + > + at implementation R > + at end > > > _______________________________________________ > cfe-commits mailing list > cfe-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits From kremenek at apple.com Mon Sep 6 12:21:52 2010 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 6 Sep 2010 10:21:52 -0700 Subject: [cfe-commits] r113149 - /cfe/trunk/lib/Analysis/CFG.cpp In-Reply-To: <20100906073232.33B6D2A6C12D@llvm.org> References: <20100906073232.33B6D2A6C12D@llvm.org> Message-ID: <9159FCF9-A36B-4DA4-80F5-8C320D2BC9F5@apple.com> Thanks for doing this. In past FinishBlock reversed the statements in a CFGBlock, but that isn't needed anymore since the iterators take care of it. On Sep 6, 2010, at 12:32 AM, Zhongxing Xu wrote: > Author: zhongxingxu > Date: Mon Sep 6 02:32:31 2010 > New Revision: 113149 > > URL: http://llvm.org/viewvc/llvm-project?rev=113149&view=rev > Log: > FinishBlock() is essentially doing nothing except returning '!badCFG'. > > Modified: > cfe/trunk/lib/Analysis/CFG.cpp > > Modified: cfe/trunk/lib/Analysis/CFG.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=113149&r1=113148&r2=113149&view=diff > ============================================================================== > --- cfe/trunk/lib/Analysis/CFG.cpp (original) > +++ cfe/trunk/lib/Analysis/CFG.cpp Mon Sep 6 02:32:31 2010 > @@ -171,7 +171,7 @@ > > void autoCreateBlock() { if (!Block) Block = createBlock(); } > CFGBlock *createBlock(bool add_successor = true); > - bool FinishBlock(CFGBlock* B); > + > CFGBlock *addStmt(Stmt *S) { > return Visit(S, AddStmtChoice::AlwaysAdd); > } > @@ -331,15 +331,6 @@ > return B; > } > > -/// FinishBlock - "Finalize" the block by checking if we have a bad CFG. > -bool CFGBuilder::FinishBlock(CFGBlock* B) { > - if (badCFG) > - return false; > - > - assert(B); > - return true; > -} > - > /// Visit - Walk the subtree of a statement and add extra > /// blocks for ternary operators, &&, and ||. We also process "," and > /// DeclStmts (which may contain nested control-flow). > @@ -505,7 +496,7 @@ > CFGBlock* ConfluenceBlock = Block ? Block : createBlock(); > AppendStmt(ConfluenceBlock, B, asc); > > - if (!FinishBlock(ConfluenceBlock)) > + if (badCFG) > return 0; > > // create the block evaluating the LHS > @@ -518,7 +509,7 @@ > CFGBlock* RHSBlock = addStmt(B->getRHS()); > > if (RHSBlock) { > - if (!FinishBlock(RHSBlock)) > + if (badCFG) > return 0; > } > else { > @@ -576,8 +567,8 @@ > CFGBlock *CFGBuilder::VisitBreakStmt(BreakStmt *B) { > // "break" is a control-flow statement. Thus we stop processing the current > // block. > - if (Block && !FinishBlock(Block)) > - return 0; > + if (badCFG) > + return 0; > > // Now create a new block that ends with the break statement. > Block = createBlock(false); > @@ -644,7 +635,7 @@ > > if (Block) { > Succ = Block; > - if (!FinishBlock(Block)) > + if (badCFG) > return 0; > } > > @@ -670,7 +661,7 @@ > AddStmtChoice asc) { > CFGBlock* ConfluenceBlock = Block ? Block : createBlock(); > AppendStmt(ConfluenceBlock, C, asc); > - if (!FinishBlock(ConfluenceBlock)) > + if (badCFG) > return 0; > > asc = asc.asLValue() ? AddStmtChoice::AlwaysAddAsLValue > @@ -679,13 +670,13 @@ > Succ = ConfluenceBlock; > Block = NULL; > CFGBlock* LHSBlock = Visit(C->getLHS(), asc); > - if (!FinishBlock(LHSBlock)) > + if (badCFG) > return 0; > > Succ = ConfluenceBlock; > Block = NULL; > CFGBlock* RHSBlock = Visit(C->getRHS(), asc); > - if (!FinishBlock(RHSBlock)) > + if (badCFG) > return 0; > > Block = createBlock(false); > @@ -725,7 +716,7 @@ > // expression. > CFGBlock* ConfluenceBlock = Block ? Block : createBlock(); > AppendStmt(ConfluenceBlock, C, asc); > - if (!FinishBlock(ConfluenceBlock)) > + if (badCFG) > return 0; > > asc = asc.asLValue() ? AddStmtChoice::AlwaysAddAsLValue > @@ -740,7 +731,7 @@ > CFGBlock* LHSBlock = NULL; > if (C->getLHS()) { > LHSBlock = Visit(C->getLHS(), asc); > - if (!FinishBlock(LHSBlock)) > + if (badCFG) > return 0; > Block = NULL; > } > @@ -748,7 +739,7 @@ > // Create the block for the RHS expression. > Succ = ConfluenceBlock; > CFGBlock* RHSBlock = Visit(C->getRHS(), asc); > - if (!FinishBlock(RHSBlock)) > + if (badCFG) > return 0; > > // Create the block that will contain the condition. > @@ -857,7 +848,7 @@ > // block. > if (Block) { > Succ = Block; > - if (!FinishBlock(Block)) > + if (badCFG) > return 0; > } > > @@ -875,7 +866,7 @@ > if (!ElseBlock) // Can occur when the Else body has all NullStmts. > ElseBlock = sv.get(); > else if (Block) { > - if (!FinishBlock(ElseBlock)) > + if (badCFG) > return 0; > } > } > @@ -896,7 +887,7 @@ > ThenBlock = createBlock(false); > AddSuccessor(ThenBlock, sv.get()); > } else if (Block) { > - if (!FinishBlock(ThenBlock)) > + if (badCFG) > return 0; > } > } > @@ -940,8 +931,6 @@ > // code afterwards is DEAD (unreachable). We still keep a basic block > // for that code; a simple "mark-and-sweep" from the entry block will be > // able to report such dead blocks. > - if (Block) > - FinishBlock(Block); > > // Create the new block. > Block = createBlock(false); > @@ -970,7 +959,7 @@ > // already processed the substatement) there is no extra control-flow to worry > // about. > LabelBlock->setLabel(L); > - if (!FinishBlock(LabelBlock)) > + if (badCFG) > return 0; > > // We set Block to NULL to allow lazy creation of a new block (if necessary); > @@ -985,8 +974,6 @@ > CFGBlock* CFGBuilder::VisitGotoStmt(GotoStmt* G) { > // Goto is a control-flow statement. Thus we stop processing the current > // block and create a new one. > - if (Block) > - FinishBlock(Block); > > Block = createBlock(false); > Block->setTerminator(G); > @@ -1009,7 +996,7 @@ > // "for" is a control-flow statement. Thus we stop processing the current > // block. > if (Block) { > - if (!FinishBlock(Block)) > + if (badCFG) > return 0; > LoopSuccessor = Block; > } else > @@ -1048,7 +1035,7 @@ > } > > if (Block) { > - if (!FinishBlock(EntryConditionBlock)) > + if (badCFG) > return 0; > } > } > @@ -1088,7 +1075,7 @@ > // Finish up the increment (or empty) block if it hasn't been already. > if (Block) { > assert(Block == Succ); > - if (!FinishBlock(Block)) > + if (badCFG) > return 0; > Block = 0; > } > @@ -1105,7 +1092,7 @@ > > if (!BodyBlock) > BodyBlock = ContinueTargetBlock; // can happen for "for (...;...;...) ;" > - else if (Block && !FinishBlock(BodyBlock)) > + else if (badCFG) > return 0; > > // This new body block is a successor to our "exit" condition block. > @@ -1176,7 +1163,7 @@ > CFGBlock* LoopSuccessor = 0; > > if (Block) { > - if (!FinishBlock(Block)) > + if (badCFG) > return 0; > LoopSuccessor = Block; > Block = 0; > @@ -1201,7 +1188,7 @@ > // the CFG unless it contains control-flow. > EntryConditionBlock = Visit(S->getElement(), AddStmtChoice::NotAlwaysAdd); > if (Block) { > - if (!FinishBlock(EntryConditionBlock)) > + if (badCFG) > return 0; > Block = 0; > } > @@ -1224,7 +1211,7 @@ > if (!BodyBlock) > BodyBlock = EntryConditionBlock; // can happen for "for (X in Y) ;" > else if (Block) { > - if (!FinishBlock(BodyBlock)) > + if (badCFG) > return 0; > } > > @@ -1250,7 +1237,7 @@ > // The sync body starts its own basic block. This makes it a little easier > // for diagnostic clients. > if (SyncBlock) { > - if (!FinishBlock(SyncBlock)) > + if (badCFG) > return 0; > > Block = 0; > @@ -1272,7 +1259,7 @@ > // "while" is a control-flow statement. Thus we stop processing the current > // block. > if (Block) { > - if (!FinishBlock(Block)) > + if (badCFG) > return 0; > LoopSuccessor = Block; > } else > @@ -1307,7 +1294,7 @@ > } > > if (Block) { > - if (!FinishBlock(EntryConditionBlock)) > + if (badCFG) > return 0; > } > } > @@ -1348,7 +1335,7 @@ > if (!BodyBlock) > BodyBlock = ContinueTargetBlock; // can happen for "while(...) ;" > else if (Block) { > - if (!FinishBlock(BodyBlock)) > + if (badCFG) > return 0; > } > > @@ -1381,7 +1368,7 @@ > // statement. > > // If we were in the middle of a block we stop processing that block. > - if (Block && !FinishBlock(Block)) > + if (badCFG) > return 0; > > // Create the new block. > @@ -1397,7 +1384,7 @@ > > CFGBlock* CFGBuilder::VisitCXXThrowExpr(CXXThrowExpr* T) { > // If we were in the middle of a block we stop processing that block. > - if (Block && !FinishBlock(Block)) > + if (badCFG) > return 0; > > // Create the new block. > @@ -1421,7 +1408,7 @@ > // "do...while" is a control-flow statement. Thus we stop processing the > // current block. > if (Block) { > - if (!FinishBlock(Block)) > + if (badCFG) > return 0; > LoopSuccessor = Block; > } else > @@ -1442,7 +1429,7 @@ > Block = ExitConditionBlock; > EntryConditionBlock = addStmt(C); > if (Block) { > - if (!FinishBlock(EntryConditionBlock)) > + if (badCFG) > return 0; > } > } > @@ -1478,7 +1465,7 @@ > if (!BodyBlock) > BodyBlock = EntryConditionBlock; // can happen for "do ; while(...)" > else if (Block) { > - if (!FinishBlock(BodyBlock)) > + if (badCFG) > return 0; > } > > @@ -1516,8 +1503,8 @@ > CFGBlock* CFGBuilder::VisitContinueStmt(ContinueStmt* C) { > // "continue" is a control-flow statement. Thus we stop processing the > // current block. > - if (Block && !FinishBlock(Block)) > - return 0; > + if (badCFG) > + return 0; > > // Now create a new block that ends with the continue statement. > Block = createBlock(false); > @@ -1567,7 +1554,7 @@ > CFGBlock* SwitchSuccessor = NULL; > > if (Block) { > - if (!FinishBlock(Block)) > + if (badCFG) > return 0; > SwitchSuccessor = Block; > } else SwitchSuccessor = Succ; > @@ -1595,9 +1582,9 @@ > // control-flow from the switch goes to case/default statements. > assert(Terminator->getBody() && "switch must contain a non-NULL body"); > Block = NULL; > - CFGBlock *BodyBlock = addStmt(Terminator->getBody()); > + addStmt(Terminator->getBody()); > if (Block) { > - if (!FinishBlock(BodyBlock)) > + if (badCFG) > return 0; > } > > @@ -1660,7 +1647,7 @@ > // were processing (the "case XXX:" is the label). > CaseBlock->setLabel(CS); > > - if (!FinishBlock(CaseBlock)) > + if (badCFG) > return 0; > > // Add this block to the list of successors for the block with the switch > @@ -1696,7 +1683,7 @@ > // we were processing (the "default:" is the label). > DefaultCaseBlock->setLabel(Terminator); > > - if (!FinishBlock(DefaultCaseBlock)) > + if (badCFG) > return 0; > > // Unlike case statements, we don't add the default block to the successors > @@ -1720,7 +1707,7 @@ > CFGBlock* TrySuccessor = NULL; > > if (Block) { > - if (!FinishBlock(Block)) > + if (badCFG) > return 0; > TrySuccessor = Block; > } else TrySuccessor = Succ; > @@ -1781,7 +1768,7 @@ > > CatchBlock->setLabel(CS); > > - if (!FinishBlock(CatchBlock)) > + if (badCFG) > return 0; > > // We set Block to NULL to allow lazy creation of a new block (if necessary) > @@ -1810,7 +1797,7 @@ > > // IndirectGoto is a control-flow statement. Thus we stop processing the > // current block and create a new one. > - if (Block && !FinishBlock(Block)) > + if (badCFG) > return 0; > > Block = createBlock(false); > > > _______________________________________________ > cfe-commits mailing list > cfe-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits From sabre at nondot.org Mon Sep 6 12:52:29 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 06 Sep 2010 17:52:29 -0000 Subject: [cfe-commits] r113156 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/CXX/temp/temp.spec/temp.explicit/p12.cpp test/SemaCXX/init-priority-attr.cpp Message-ID: <20100906175229.497742A6C12C@llvm.org> Author: lattner Date: Mon Sep 6 12:52:29 2010 New Revision: 113156 URL: http://llvm.org/viewvc/llvm-project?rev=113156&view=rev Log: remove curly quotes, patch by Dimitry Andric! Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p12.cpp cfe/trunk/test/SemaCXX/init-priority-attr.cpp Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=113156&r1=113155&r2=113156&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon Sep 6 12:52:29 2010 @@ -848,7 +848,7 @@ "init_priority attribute requires integer constant between " "101 and 65535 inclusive">; def err_init_priority_object_attr : Error< - "can only use ???init_priority??? attribute on file-scope definitions " + "can only use 'init_priority' attribute on file-scope definitions " "of objects of class type">; def err_attribute_argument_n_not_int : Error< "'%0' attribute requires parameter %1 to be an integer constant">; Modified: cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p12.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p12.cpp?rev=113156&r1=113155&r2=113156&view=diff ============================================================================== --- cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p12.cpp (original) +++ cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p12.cpp Mon Sep 6 12:52:29 2010 @@ -2,5 +2,5 @@ char* p = 0; template T g(T x = &p) { return x; } -template int g(int); // OK even though &p isn???t an int. +template int g(int); // OK even though &p isn't an int. Modified: cfe/trunk/test/SemaCXX/init-priority-attr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/init-priority-attr.cpp?rev=113156&r1=113155&r2=113156&view=diff ============================================================================== --- cfe/trunk/test/SemaCXX/init-priority-attr.cpp (original) +++ cfe/trunk/test/SemaCXX/init-priority-attr.cpp Mon Sep 6 12:52:29 2010 @@ -26,11 +26,11 @@ Two koo[4] __attribute__((init_priority(1.13))); // expected-error {{'init_priority' attribute requires integer constant}} -Two func() __attribute__((init_priority(1001))); // expected-error {{can only use ???init_priority??? attribute on file-scope definitions of objects of class type}} +Two func() __attribute__((init_priority(1001))); // expected-error {{can only use 'init_priority' attribute on file-scope definitions of objects of class type}} -int i __attribute__((init_priority(1001))); // expected-error {{can only use ???init_priority??? attribute on file-scope definitions of objects of class type}} +int i __attribute__((init_priority(1001))); // expected-error {{can only use 'init_priority' attribute on file-scope definitions of objects of class type}} int main() { - Two foo __attribute__((init_priority(1001))); // expected-error {{can only use ???init_priority??? attribute on file-scope definitions of objects of class type}} + Two foo __attribute__((init_priority(1001))); // expected-error {{can only use 'init_priority' attribute on file-scope definitions of objects of class type}} } From clattner at apple.com Mon Sep 6 12:53:48 2010 From: clattner at apple.com (Chris Lattner) Date: Mon, 6 Sep 2010 10:53:48 -0700 Subject: [cfe-commits] [patch] Remove some UTF-8 magic quotes In-Reply-To: <4C84B0FA.7000502@andric.com> References: <4C84B0FA.7000502@andric.com> Message-ID: <2B6EEA99-3198-4CD6-B31F-C9793A358569@apple.com> On Sep 6, 2010, at 2:14 AM, Dimitry Andric wrote: > I got some complaints from a tagging tool about stray UTF-8 characters > in the clang sources; this patch removes two instances of them. > > The one in tools/clang/test/CodeGen/darwin-string-literals.c looks like > it is supposed to be there, but I'm not sure. :) Nice catch, applied in r113156. Clang was actually generating the curly quotes for one of its diagnostics, which I fixed also. Thanks, -Chris From akyrtzi at gmail.com Mon Sep 6 14:04:27 2010 From: akyrtzi at gmail.com (Argyrios Kyrtzidis) Date: Mon, 06 Sep 2010 19:04:27 -0000 Subject: [cfe-commits] r113161 - in /cfe/trunk: lib/Serialization/ASTReader.cpp test/PCH/cxx-templates.cpp test/PCH/cxx-templates.h Message-ID: <20100906190427.D0A6B2A6C12C@llvm.org> Author: akirtzidis Date: Mon Sep 6 14:04:27 2010 New Revision: 113161 URL: http://llvm.org/viewvc/llvm-project?rev=113161&view=rev Log: Fix a C++ PCH problem which was exposed by r113019. CXXBaseOrMemberInitializer's IsWritten and source order is not set. Modified: cfe/trunk/lib/Serialization/ASTReader.cpp cfe/trunk/test/PCH/cxx-templates.cpp cfe/trunk/test/PCH/cxx-templates.h Modified: cfe/trunk/lib/Serialization/ASTReader.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=113161&r1=113160&r2=113161&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTReader.cpp (original) +++ cfe/trunk/lib/Serialization/ASTReader.cpp Mon Sep 6 14:04:27 2010 @@ -3872,6 +3872,8 @@ Indices.size()); } + if (IsWritten) + BOMInit->setSourceOrder(SourceOrderOrNumArrayIndices); BOMInit->setAnonUnionMember(AnonUnionMember); BaseOrMemberInitializers[i] = BOMInit; } Modified: cfe/trunk/test/PCH/cxx-templates.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx-templates.cpp?rev=113161&r1=113160&r2=113161&view=diff ============================================================================== --- cfe/trunk/test/PCH/cxx-templates.cpp (original) +++ cfe/trunk/test/PCH/cxx-templates.cpp Mon Sep 6 14:04:27 2010 @@ -30,6 +30,8 @@ S3 s3; s3.m(); + + TS5 ts(0); } template struct S4; Modified: cfe/trunk/test/PCH/cxx-templates.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx-templates.h?rev=113161&r1=113160&r2=113161&view=diff ============================================================================== --- cfe/trunk/test/PCH/cxx-templates.h (original) +++ cfe/trunk/test/PCH/cxx-templates.h Mon Sep 6 14:04:27 2010 @@ -135,3 +135,13 @@ S4 s; s.m(); } + +struct S5 { + S5(int x); +}; + +struct TS5 { + S5 s; + template + TS5(T y) : s(y) {} +}; From hhinnant at apple.com Mon Sep 6 14:10:32 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Mon, 06 Sep 2010 19:10:32 -0000 Subject: [cfe-commits] [libcxx] r113162 - in /libcxx/trunk: include/__config include/type_traits test/utilities/meta/meta.hel/integral_constant.pass.cpp test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp Message-ID: <20100906191032.16B842A6C12C@llvm.org> Author: hhinnant Date: Mon Sep 6 14:10:31 2010 New Revision: 113162 URL: http://llvm.org/viewvc/llvm-project?rev=113162&view=rev Log: Working the type_traits area: Hooked up to clang's __is_union. Got has_trivial_copy_assign working. Modified: libcxx/trunk/include/__config libcxx/trunk/include/type_traits libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp Modified: libcxx/trunk/include/__config URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=113162&r1=113161&r2=113162&view=diff ============================================================================== --- libcxx/trunk/include/__config (original) +++ libcxx/trunk/include/__config Mon Sep 6 14:10:31 2010 @@ -152,6 +152,10 @@ #define _STD std #endif // __has_feature(cxx_inline_namespaces) +#if !(__has_feature(cxx_constexpr)) +#define _LIBCPP_HAS_NO_CONSTEXPR +#endif + // end defined(__clang__) #elif defined(__GNUC__) @@ -161,6 +165,7 @@ #endif #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES +#define _LIBCPP_HAS_NO_CONSTEXPR #ifndef __GXX_EXPERIMENTAL_CXX0X__ @@ -231,4 +236,8 @@ #define decltype(x) __typeof__(x) #endif +#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#define constexpr const +#endif + #endif // _LIBCPP_CONFIG Modified: libcxx/trunk/include/type_traits URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=113162&r1=113161&r2=113162&view=diff ============================================================================== --- libcxx/trunk/include/type_traits (original) +++ libcxx/trunk/include/type_traits Mon Sep 6 14:10:31 2010 @@ -34,7 +34,6 @@ template struct is_pointer; template struct is_lvalue_reference; template struct is_rvalue_reference; - template struct is_reference; template struct is_member_object_pointer; template struct is_member_function_pointer; template struct is_enum; @@ -152,9 +151,12 @@ template struct integral_constant { - static const _Tp value = __v; + static constexpr _Tp value = __v; typedef _Tp value_type; typedef integral_constant type; +#ifndef _LIBCPP_HAS_NO_CONSTEXPR + constexpr operator value_type() {return value;} +#endif }; template @@ -258,7 +260,7 @@ // is_union -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) template struct is_union : public integral_constant {}; @@ -725,13 +727,30 @@ template struct has_copy_constructor : public true_type {}; +// has_copy_assign + +template struct has_copy_assign; + // has_trivial_copy_assign -template struct __libcpp_trivial_copy_assign : public integral_constant::value && - is_scalar<_Tp>::value> {}; +#if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + +template ::value> +struct __has_trivial_copy_assign + : public integral_constant {}; + +template struct __has_trivial_copy_assign<_Tp, true> + : public false_type {}; template struct has_trivial_copy_assign - : public __libcpp_trivial_copy_assign::type> {}; + : __has_trivial_copy_assign<_Tp> {}; + +#else + +template struct has_trivial_copy_assign + : public integral_constant::value && !is_const<_Tp>::value> {}; + +#endif // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) // has_nothrow_copy_assign Modified: libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp?rev=113162&r1=113161&r2=113162&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp Mon Sep 6 14:10:31 2010 @@ -12,6 +12,7 @@ // integral_constant #include +#include int main() { @@ -19,6 +20,7 @@ static_assert(_5::value == 5, ""); static_assert((std::is_same<_5::value_type, int>::value), ""); static_assert((std::is_same<_5::type, _5>::value), ""); + static_assert((_5() == 5), ""); static_assert(std::false_type::value == false, ""); static_assert((std::is_same::value), ""); Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp?rev=113162&r1=113161&r2=113162&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp Mon Sep 6 14:10:31 2010 @@ -15,5 +15,5 @@ int main() { -#error has_copy_assign not implemented + static_assert((std::has_copy_assign::value), ""); } Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp?rev=113162&r1=113161&r2=113162&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp Mon Sep 6 14:10:31 2010 @@ -62,9 +62,10 @@ test_has_not_trivial_assign(); test_has_not_trivial_assign(); test_has_not_trivial_assign(); + test_has_not_trivial_assign(); + test_has_not_trivial_assign(); test_has_trivial_assign(); - test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); @@ -72,6 +73,5 @@ test_has_trivial_assign(); test_has_trivial_assign(); test_has_trivial_assign(); - test_has_trivial_assign(); test_has_trivial_assign(); } From pichet2000 at gmail.com Mon Sep 6 15:13:24 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Mon, 6 Sep 2010 16:13:24 -0400 Subject: [cfe-commits] [PATCH] fix for PR8089 - clang crashes. Message-ID: Hi This is a fix for PR8089 I raised yesterday. clang was crashing on: enum E; int a = (E) a; -------------- next part -------------- A non-text attachment was scrubbed... Name: PR8089_fix.patch Type: application/octet-stream Size: 1468 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/cfe-commits/attachments/20100906/2caeb036/attachment.obj From sabre at nondot.org Mon Sep 6 17:09:28 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 06 Sep 2010 22:09:28 -0000 Subject: [cfe-commits] r113177 - /cfe/trunk/test/CodeGen/asm-errors.c Message-ID: <20100906220928.272EE2A6C12C@llvm.org> Author: lattner Date: Mon Sep 6 17:09:27 2010 New Revision: 113177 URL: http://llvm.org/viewvc/llvm-project?rev=113177&view=rev Log: Due to asmparser improvements, this error message is now better Modified: cfe/trunk/test/CodeGen/asm-errors.c Modified: cfe/trunk/test/CodeGen/asm-errors.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/asm-errors.c?rev=113177&r1=113176&r2=113177&view=diff ============================================================================== --- cfe/trunk/test/CodeGen/asm-errors.c (original) +++ cfe/trunk/test/CodeGen/asm-errors.c Mon Sep 6 17:09:27 2010 @@ -2,7 +2,7 @@ // RUN: FileCheck %s < %t int test1(int X) { -// CHECK: error: unrecognized instruction +// CHECK: error: invalid instruction mnemonic 'abc' __asm__ ("abc incl %0" : "+r" (X)); return X; } From benny.kra at googlemail.com Mon Sep 6 18:43:28 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Mon, 06 Sep 2010 23:43:28 -0000 Subject: [cfe-commits] r113185 - in /cfe/trunk/lib/Serialization: ASTReader.cpp ASTWriter.cpp Message-ID: <20100906234328.5DC8B2A6C12D@llvm.org> Author: d0k Date: Mon Sep 6 18:43:28 2010 New Revision: 113185 URL: http://llvm.org/viewvc/llvm-project?rev=113185&view=rev Log: Replace loops with SmallVector::append. Modified: cfe/trunk/lib/Serialization/ASTReader.cpp cfe/trunk/lib/Serialization/ASTWriter.cpp Modified: cfe/trunk/lib/Serialization/ASTReader.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=113185&r1=113184&r2=113185&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTReader.cpp (original) +++ cfe/trunk/lib/Serialization/ASTReader.cpp Mon Sep 6 18:43:28 2010 @@ -3545,8 +3545,7 @@ PendingIdentifierInfos.push_back(PendingIdentifierInfo()); PendingIdentifierInfo &PII = PendingIdentifierInfos.back(); PII.II = II; - for (unsigned I = 0, N = DeclIDs.size(); I != N; ++I) - PII.DeclIDs.push_back(DeclIDs[I]); + PII.DeclIDs.append(DeclIDs.begin(), DeclIDs.end()); return; } Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=113185&r1=113184&r2=113185&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTWriter.cpp (original) +++ cfe/trunk/lib/Serialization/ASTWriter.cpp Mon Sep 6 18:43:28 2010 @@ -2690,10 +2690,8 @@ void ASTWriter::AddAPInt(const llvm::APInt &Value, RecordData &Record) { Record.push_back(Value.getBitWidth()); - unsigned N = Value.getNumWords(); - const uint64_t* Words = Value.getRawData(); - for (unsigned I = 0; I != N; ++I) - Record.push_back(Words[I]); + const uint64_t *Words = Value.getRawData(); + Record.append(Words, Words + Value.getNumWords()); } void ASTWriter::AddAPSInt(const llvm::APSInt &Value, RecordData &Record) { From pichet2000 at gmail.com Mon Sep 6 23:49:40 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Tue, 7 Sep 2010 00:49:40 -0400 Subject: [cfe-commits] r113018 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaCXX/flexible-array-test.cpp In-Reply-To: <20100903215349.5DEAF2A6C12C@llvm.org> References: <20100903215349.5DEAF2A6C12C@llvm.org> Message-ID: Any reason to to disallow flexible array element in union? Both gcc 4.5 and msvc allow it. For example: struct A { int Length; union { char dataC[]; short dataS[]; long dataL[]; }; }; You see code like that in MSVC headers file. I was planning to submit a patch this week to allow such code. On Fri, Sep 3, 2010 at 5:53 PM, Anders Carlsson wrote: > Author: andersca > Date: Fri Sep ?3 16:53:49 2010 > New Revision: 113018 > > URL: http://llvm.org/viewvc/llvm-project?rev=113018&view=rev > Log: > It's OK for classes to have flexible array elements (but not unions). > > Modified: > ? ?cfe/trunk/lib/Sema/SemaDecl.cpp > ? ?cfe/trunk/test/SemaCXX/flexible-array-test.cpp > > Modified: cfe/trunk/lib/Sema/SemaDecl.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=113018&r1=113017&r2=113018&view=diff > ============================================================================== > --- cfe/trunk/lib/Sema/SemaDecl.cpp (original) > +++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Sep ?3 16:53:49 2010 > @@ -6564,7 +6564,7 @@ > ? ? ? EnclosingDecl->setInvalidDecl(); > ? ? ? continue; > ? ? } else if (FDTy->isIncompleteArrayType() && i == NumFields - 1 && > - ? ? ? ? ? ? ? Record && Record->isStruct()) { > + ? ? ? ? ? ? ? Record && !Record->isUnion()) { > ? ? ? // Flexible array member. > ? ? ? if (NumNamedMembers < 1) { > ? ? ? ? Diag(FD->getLocation(), diag::err_flexible_array_empty_struct) > > Modified: cfe/trunk/test/SemaCXX/flexible-array-test.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/flexible-array-test.cpp?rev=113018&r1=113017&r2=113018&view=diff > ============================================================================== > --- cfe/trunk/test/SemaCXX/flexible-array-test.cpp (original) > +++ cfe/trunk/test/SemaCXX/flexible-array-test.cpp Fri Sep ?3 16:53:49 2010 > @@ -43,3 +43,13 @@ > ? ?int blah; > ? ?S strings[]; ? ? ? ?// expected-error {{flexible array member 'strings' of non-POD element type 'S []'}} > ?}; > + > +class A { > + ?int s; > + ?char c[]; > +}; > + > +union B { > + ?int s; > + ?char c[]; // expected-error {{field has incomplete type 'char []'}} > +}; > > > _______________________________________________ > cfe-commits mailing list > cfe-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > From avakar at ratatanek.cz Tue Sep 7 08:07:13 2010 From: avakar at ratatanek.cz (=?UTF-8?Q?Martin_Vejn=C3=A1r?=) Date: Tue, 07 Sep 2010 15:07:13 +0200 Subject: [cfe-commits] [PATCH] Add function attributes to the output of -ast-print-xml Message-ID: <1381de5deb83bf8cf22e7ed75b59e402@technika.junior.cz> Hi, I'm attaching a patch that adds some more information to the XML-serialized AST. The attributes in question are "main", "externc", "global", "pure" and "call_conv"; all of them are added to function declarations except for the latter, which is part of the function type. -- Martin -------------- next part -------------- A non-text attachment was scrubbed... Name: ast_attrs.patch Type: application/octet-stream Size: 1605 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/cfe-commits/attachments/20100907/27716bc9/attachment.obj From dgregor at apple.com Tue Sep 7 09:35:10 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 07 Sep 2010 14:35:10 -0000 Subject: [cfe-commits] r113199 - in /cfe/trunk: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseDeclCXX.cpp test/FixIt/fixit.cpp Message-ID: <20100907143510.4837B2A6C12C@llvm.org> Author: dgregor Date: Tue Sep 7 09:35:10 2010 New Revision: 113199 URL: http://llvm.org/viewvc/llvm-project?rev=113199&view=rev Log: Improve diagnostic and recovery when missing a comma between base or member initializers in a C++ constructor. Fixes . Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td cfe/trunk/lib/Parse/ParseDeclCXX.cpp cfe/trunk/test/FixIt/fixit.cpp Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=113199&r1=113198&r2=113199&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Tue Sep 7 09:35:10 2010 @@ -364,6 +364,9 @@ "default template argument for a template template parameter must be a class " "template">; +def err_ctor_init_missing_comma : Error< + "missing ',' between base or member initializers">; + // C++ declarations def err_friend_decl_defines_class : Error< "cannot define a type in a friend declaration">; Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=113199&r1=113198&r2=113199&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original) +++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Tue Sep 7 09:35:10 2010 @@ -1735,6 +1735,12 @@ ConsumeToken(); else if (Tok.is(tok::l_brace)) break; + // If the next token looks like a base or member initializer, assume that + // we're just missing a comma. + else if (Tok.is(tok::identifier) || Tok.is(tok::coloncolon)) + Diag(Tok.getLocation(), diag::err_ctor_init_missing_comma) + << FixItHint::CreateInsertion(PP.getLocForEndOfToken(PrevTokLocation), + ", "); else { // Skip over garbage, until we get to '{'. Don't eat the '{'. Diag(Tok.getLocation(), diag::err_expected_lbrace_or_comma); Modified: cfe/trunk/test/FixIt/fixit.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/FixIt/fixit.cpp?rev=113199&r1=113198&r2=113199&view=diff ============================================================================== --- cfe/trunk/test/FixIt/fixit.cpp (original) +++ cfe/trunk/test/FixIt/fixit.cpp Tue Sep 7 09:35:10 2010 @@ -51,3 +51,12 @@ } }; } + +namespace rdar7796492 { + class A { int x, y; A(); }; + + A::A() + : x(1) y(2) { // expected-error{{missing ',' between base or member initializers}} + } + +} From dgregor at apple.com Tue Sep 7 09:51:08 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 07 Sep 2010 14:51:08 -0000 Subject: [cfe-commits] r113201 - in /cfe/trunk: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp test/FixIt/fixit.c Message-ID: <20100907145108.A1B692A6C12C@llvm.org> Author: dgregor Date: Tue Sep 7 09:51:08 2010 New Revision: 113201 URL: http://llvm.org/viewvc/llvm-project?rev=113201&view=rev Log: Improve recovery when a comma is missing between enumerators in an enumeration definition. Fixes . Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td cfe/trunk/lib/Parse/ParseDecl.cpp cfe/trunk/lib/Parse/ParseDeclCXX.cpp cfe/trunk/test/FixIt/fixit.c Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=113201&r1=113200&r2=113201&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Tue Sep 7 09:51:08 2010 @@ -55,6 +55,8 @@ def ext_enumerator_list_comma : Extension< "commas at the end of enumerator lists are a %select{C99|C++0x}0-specific " "feature">; +def err_enumerator_list_missing_comma : Error< + "missing ',' between enumerators">; def ext_gnu_indirect_goto : Extension< "use of GNU indirect-goto extension">, InGroup; Modified: cfe/trunk/lib/Parse/ParseDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=113201&r1=113200&r2=113201&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseDecl.cpp (original) +++ cfe/trunk/lib/Parse/ParseDecl.cpp Tue Sep 7 09:51:08 2010 @@ -2127,6 +2127,14 @@ EnumConstantDecls.push_back(EnumConstDecl); LastEnumConstDecl = EnumConstDecl; + if (Tok.is(tok::identifier)) { + // We're missing a comma between enumerators. + SourceLocation Loc = PP.getLocForEndOfToken(PrevTokLocation); + Diag(Loc, diag::err_enumerator_list_missing_comma) + << FixItHint::CreateInsertion(Loc, ", "); + continue; + } + if (Tok.isNot(tok::comma)) break; SourceLocation CommaLoc = ConsumeToken(); Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=113201&r1=113200&r2=113201&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original) +++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Tue Sep 7 09:51:08 2010 @@ -1737,11 +1737,11 @@ break; // If the next token looks like a base or member initializer, assume that // we're just missing a comma. - else if (Tok.is(tok::identifier) || Tok.is(tok::coloncolon)) - Diag(Tok.getLocation(), diag::err_ctor_init_missing_comma) - << FixItHint::CreateInsertion(PP.getLocForEndOfToken(PrevTokLocation), - ", "); - else { + else if (Tok.is(tok::identifier) || Tok.is(tok::coloncolon)) { + SourceLocation Loc = PP.getLocForEndOfToken(PrevTokLocation); + Diag(Loc, diag::err_ctor_init_missing_comma) + << FixItHint::CreateInsertion(Loc, ", "); + } else { // Skip over garbage, until we get to '{'. Don't eat the '{'. Diag(Tok.getLocation(), diag::err_expected_lbrace_or_comma); SkipUntil(tok::l_brace, true, true); Modified: cfe/trunk/test/FixIt/fixit.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/FixIt/fixit.c?rev=113201&r1=113200&r2=113201&view=diff ============================================================================== --- cfe/trunk/test/FixIt/fixit.c (original) +++ cfe/trunk/test/FixIt/fixit.c Tue Sep 7 09:51:08 2010 @@ -41,3 +41,10 @@ // CHECK: typedef int int_t; typedef typedef int int_t; + +// +enum Color { + Red // expected-error{{missing ',' between enumerators}} + Green = 17 // expected-error{{missing ',' between enumerators}} + Blue, +}; From dgregor at apple.com Tue Sep 7 10:23:11 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 07 Sep 2010 15:23:11 -0000 Subject: [cfe-commits] r113202 - in /cfe/trunk: include/clang/Basic/DiagnosticParseKinds.td include/clang/Parse/Parser.h lib/Parse/ParseDeclCXX.cpp lib/Parse/ParseObjc.cpp lib/Parse/ParseStmt.cpp lib/Parse/Parser.cpp test/FixIt/fixit-objc.m Message-ID: <20100907152311.C8FB22A6C12C@llvm.org> Author: dgregor Date: Tue Sep 7 10:23:11 2010 New Revision: 113202 URL: http://llvm.org/viewvc/llvm-project?rev=113202&view=rev Log: Improve recovery when there is a stray ']' or ')' before the ';' at the end of a statement. Fixes . Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td cfe/trunk/include/clang/Parse/Parser.h cfe/trunk/lib/Parse/ParseDeclCXX.cpp cfe/trunk/lib/Parse/ParseObjc.cpp cfe/trunk/lib/Parse/ParseStmt.cpp cfe/trunk/lib/Parse/Parser.cpp cfe/trunk/test/FixIt/fixit-objc.m Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=113202&r1=113201&r2=113202&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Tue Sep 7 10:23:11 2010 @@ -124,6 +124,8 @@ def err_expected_semi_after : Error<"expected ';' after %0">; def err_expected_semi_after_stmt : Error<"expected ';' after %0 statement">; def err_expected_semi_after_expr : Error<"expected ';' after expression">; +def err_extraneous_token_before_semi : Error<"extraneous '%0' before ';'">; + def err_expected_semi_after_method_proto : Error< "expected ';' after method prototype">; def err_expected_semi_after_namespace_name : Error< Modified: cfe/trunk/include/clang/Parse/Parser.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=113202&r1=113201&r2=113202&view=diff ============================================================================== --- cfe/trunk/include/clang/Parse/Parser.h (original) +++ cfe/trunk/include/clang/Parse/Parser.h Tue Sep 7 10:23:11 2010 @@ -464,6 +464,13 @@ const char *DiagMsg = "", tok::TokenKind SkipToTok = tok::unknown); + /// \brief The parser expects a semicolon and, if present, will consume it. + /// + /// If the next token is not a semicolon, this emits the specified diagnostic, + /// or, if there's just some closing-delimiter noise (e.g., ')' or ']') prior + /// to the semicolon, consumes that extra token. + bool ExpectAndConsumeSemi(unsigned DiagID); + //===--------------------------------------------------------------------===// // Scope manipulation Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=113202&r1=113201&r2=113202&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original) +++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Tue Sep 7 10:23:11 2010 @@ -313,8 +313,9 @@ // Eat ';'. DeclEnd = Tok.getLocation(); ExpectAndConsume(tok::semi, - GNUAttr ? diag::err_expected_semi_after_attribute_list : - diag::err_expected_semi_after_namespace_name, "", tok::semi); + GNUAttr ? diag::err_expected_semi_after_attribute_list + : diag::err_expected_semi_after_namespace_name, + "", tok::semi); return Actions.ActOnUsingDirective(getCurScope(), UsingLoc, NamespcLoc, SS, IdentLoc, NamespcName, Attr); @@ -422,7 +423,7 @@ MatchRHSPunctuation(tok::r_paren, LParenLoc); DeclEnd = Tok.getLocation(); - ExpectAndConsume(tok::semi, diag::err_expected_semi_after_static_assert); + ExpectAndConsumeSemi(diag::err_expected_semi_after_static_assert); return Actions.ActOnStaticAssertDeclaration(StaticAssertLoc, AssertExpr.take(), Modified: cfe/trunk/lib/Parse/ParseObjc.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=113202&r1=113201&r2=113202&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseObjc.cpp (original) +++ cfe/trunk/lib/Parse/ParseObjc.cpp Tue Sep 7 10:23:11 2010 @@ -1731,7 +1731,7 @@ } // Otherwise, eat the semicolon. - ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr); + ExpectAndConsumeSemi(diag::err_expected_semi_after_expr); return Actions.ActOnExprStmt(Actions.MakeFullExpr(Res.take())); } Modified: cfe/trunk/lib/Parse/ParseStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=113202&r1=113201&r2=113202&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseStmt.cpp (original) +++ cfe/trunk/lib/Parse/ParseStmt.cpp Tue Sep 7 10:23:11 2010 @@ -137,7 +137,7 @@ return StmtError(); } // Otherwise, eat the semicolon. - ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr); + ExpectAndConsumeSemi(diag::err_expected_semi_after_expr); return Actions.ActOnExprStmt(Actions.MakeFullExpr(Expr.get())); } @@ -507,7 +507,7 @@ // FIXME: Use attributes? // Eat the semicolon at the end of stmt and convert the expr into a // statement. - ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr); + ExpectAndConsumeSemi(diag::err_expected_semi_after_expr); R = Actions.ActOnExprStmt(Actions.MakeFullExpr(Res.get())); } } Modified: cfe/trunk/lib/Parse/Parser.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=113202&r1=113201&r2=113202&view=diff ============================================================================== --- cfe/trunk/lib/Parse/Parser.cpp (original) +++ cfe/trunk/lib/Parse/Parser.cpp Tue Sep 7 10:23:11 2010 @@ -162,6 +162,25 @@ return true; } +bool Parser::ExpectAndConsumeSemi(unsigned DiagID) { + if (Tok.is(tok::semi) || Tok.is(tok::code_completion)) { + ConsumeAnyToken(); + return false; + } + + if ((Tok.is(tok::r_paren) || Tok.is(tok::r_square)) && + NextToken().is(tok::semi)) { + Diag(Tok, diag::err_extraneous_token_before_semi) + << PP.getSpelling(Tok) + << FixItHint::CreateRemoval(Tok.getLocation()); + ConsumeAnyToken(); // The ')' or ']'. + ConsumeToken(); // The ';'. + return false; + } + + return ExpectAndConsume(tok::semi, DiagID); +} + //===----------------------------------------------------------------------===// // Error recovery. //===----------------------------------------------------------------------===// Modified: cfe/trunk/test/FixIt/fixit-objc.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/FixIt/fixit-objc.m?rev=113202&r1=113201&r2=113202&view=diff ============================================================================== --- cfe/trunk/test/FixIt/fixit-objc.m (original) +++ cfe/trunk/test/FixIt/fixit-objc.m Tue Sep 7 10:23:11 2010 @@ -1,6 +1,7 @@ +// RUN: %clang_cc1 -pedantic -verify %s // RUN: cp %s %t -// RUN: %clang_cc1 -pedantic -fixit -x objective-c %t -// RUN: %clang_cc1 -pedantic -verify -x objective-c %t +// RUN: not %clang_cc1 -pedantic -fixit -x objective-c %t +// RUN: %clang_cc1 -pedantic -Werror -x objective-c %t /* This is a test of the various code modification hints that are provided as part of warning or extension diagnostics. All of the @@ -10,28 +11,31 @@ @protocol X; void foo() { - *P; // should be fixed to 'id'. + *P; // expected-warning{{protocol qualifiers without 'id' is archaic}} } @class A; @class NSString; @interface Test -- (void)test:(NSString *)string; +- (void)test:(NSString *)string; // expected-note{{passing argument to parameter 'string' here}} @property (copy) NSString *property; @end -void g(NSString *a); -void h(id a); +void g(NSString *a); // expected-note{{passing argument to parameter 'a' here}} +void h(id a); // expected-note 2{{passing argument to parameter 'a' here}} void f(Test *t) { - NSString *a = "Foo"; - id b = "Foo"; - A* c = "Foo"; // expected-warning {{incompatible pointer types initializing 'A *' with an expression of type 'char [4]'}} - g("Foo"); - h("Foo"); - h(("Foo")); - [t test:"Foo"]; - t.property = "Foo"; + NSString *a = "Foo"; // expected-warning {{incompatible pointer types initializing 'NSString *' with an expression of type 'char [4]'}} + id b = "Foo"; // expected-warning {{incompatible pointer types initializing 'id' with an expression of type 'char [4]'}} + g("Foo"); // expected-warning{{incompatible pointer types passing 'char [4]' to parameter of type 'NSString *'}} + h("Foo"); // expected-warning{{incompatible pointer types passing 'char [4]' to parameter of type 'id'}} + h(("Foo")); // expected-warning{{incompatible pointer types passing 'char [4]' to parameter of type 'id'}} + [t test:"Foo"]; // expected-warning{{incompatible pointer types sending 'char [4]' to parameter of type 'NSString *'}} + t.property = "Foo"; // expected-warning{{incompatible pointer types assigning to 'NSString *' from 'char [4]'}} + + // + [t test:@"Foo"]]; // expected-error{{extraneous ']' before ';'}} + g(@"Foo")); // expected-error{{extraneous ')' before ';'}} } From dgregor at apple.com Tue Sep 7 10:51:01 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 07 Sep 2010 15:51:01 -0000 Subject: [cfe-commits] r113204 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp test/Sema/redefinition.c Message-ID: <20100907155101.E97F72A6C12C@llvm.org> Author: dgregor Date: Tue Sep 7 10:51:01 2010 New Revision: 113204 URL: http://llvm.org/viewvc/llvm-project?rev=113204&view=rev Log: Provide a specific diagnostic when trying to redefine an "extern inline" function outside of GNU89 mode. Fixes . Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/lib/Sema/SemaDecl.cpp cfe/trunk/test/Sema/redefinition.c Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=113204&r1=113203&r2=113204&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Sep 7 10:51:01 2010 @@ -1737,6 +1737,9 @@ def err_definition_of_implicitly_declared_member : Error< "definition of implicitly declared %select{constructor|copy constructor|" "copy assignment operator|destructor}1">; +def err_redefinition_extern_inline : Error< + "redefinition of a 'extern inline' function %0 is not supported in " + "%select{C99 mode|C++}1">; def warn_redefinition_of_typedef : Warning< "redefinition of typedef %0 is invalid in C">, Modified: cfe/trunk/lib/Sema/SemaDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=113204&r1=113203&r2=113204&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDecl.cpp (original) +++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Sep 7 10:51:01 2010 @@ -4806,7 +4806,12 @@ const FunctionDecl *Definition; if (FD->hasBody(Definition) && !canRedefineFunction(Definition, getLangOptions())) { - Diag(FD->getLocation(), diag::err_redefinition) << FD->getDeclName(); + if (getLangOptions().GNUMode && Definition->isInlineSpecified() && + Definition->getStorageClass() == SC_Extern) + Diag(FD->getLocation(), diag::err_redefinition_extern_inline) + << FD->getDeclName() << getLangOptions().CPlusPlus; + else + Diag(FD->getLocation(), diag::err_redefinition) << FD->getDeclName(); Diag(Definition->getLocation(), diag::note_previous_definition); } Modified: cfe/trunk/test/Sema/redefinition.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/redefinition.c?rev=113204&r1=113203&r2=113204&view=diff ============================================================================== --- cfe/trunk/test/Sema/redefinition.c (original) +++ cfe/trunk/test/Sema/redefinition.c Tue Sep 7 10:51:01 2010 @@ -8,3 +8,7 @@ return 0; } int x = 1; + +// +extern inline int g(void) { return 0; } // expected-note{{previous definition}} +int g(void) { return 0; } // expected-error{{redefinition of a 'extern inline' function 'g' is not supported in C99 mode}} From hhinnant at apple.com Tue Sep 7 10:53:26 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Tue, 07 Sep 2010 15:53:26 -0000 Subject: [cfe-commits] [libcxx] r113205 - in /libcxx/trunk: include/type_traits test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_default_constructor.pass.cpp Message-ID: <20100907155326.ED0B12A6C12C@llvm.org> Author: hhinnant Date: Tue Sep 7 10:53:26 2010 New Revision: 113205 URL: http://llvm.org/viewvc/llvm-project?rev=113205&view=rev Log: has_trivial_default_constructor hooked up to clang. Filed http://llvm.org/bugs/show_bug.cgi?id=8097 to take care of void and arrays of incomplete types which don't work yet. If there is some reasons we don't want to handle these types in the compiler, I can handle them in the library. Modified: libcxx/trunk/include/type_traits libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_default_constructor.pass.cpp Modified: libcxx/trunk/include/type_traits URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=113205&r1=113204&r2=113205&view=diff ============================================================================== --- libcxx/trunk/include/type_traits (original) +++ libcxx/trunk/include/type_traits Tue Sep 7 10:53:26 2010 @@ -114,7 +114,6 @@ template struct is_same; template struct is_base_of; template struct is_convertible; - template struct underlying_type; // Alignment properties and transformations: template struct alignment_of; @@ -698,11 +697,21 @@ // has_trivial_default_constructor -template struct __has_trivial_default_constructor : public integral_constant::value> {}; +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + +template struct has_trivial_default_constructor + : public integral_constant {}; + +#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + +template struct __has_trivial_default_constructor + : public integral_constant::value> {}; template struct has_trivial_default_constructor : public __has_trivial_default_constructor::type> {}; +#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + // has_nothrow_default_constructor template struct has_nothrow_default_constructor : public has_trivial_default_constructor<_Tp> {}; @@ -1493,6 +1502,11 @@ #endif // _LIBCPP_HAS_NO_VARIADICS +struct __any +{ + __any(...); +}; + #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE // template struct is_constructible; @@ -1503,11 +1517,6 @@ decltype(_STD::move(_Tp(_STD::declval<_Args>()...)), true_type()) __is_constructible_test(_Tp&&, _Args&& ...); -struct __any -{ - __any(...); -}; - template false_type __is_constructible_test(__any, _Args&& ...); Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_default_constructor.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_default_constructor.pass.cpp?rev=113205&r1=113204&r2=113205&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_default_constructor.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_default_constructor.pass.cpp Tue Sep 7 10:53:26 2010 @@ -62,16 +62,16 @@ test_has_not_trivial_default_constructor(); test_has_not_trivial_default_constructor(); test_has_not_trivial_default_constructor(); + test_has_not_trivial_default_constructor(); + test_has_not_trivial_default_constructor(); + test_has_not_trivial_default_constructor(); test_has_trivial_default_constructor(); - test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); - test_has_trivial_default_constructor(); - test_has_trivial_default_constructor(); test_has_trivial_default_constructor(); } From fjahanian at apple.com Tue Sep 7 11:37:02 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Tue, 7 Sep 2010 09:37:02 -0700 Subject: [cfe-commits] r113154 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/ivars.m In-Reply-To: <20100906120010.B85C32A6C12C@llvm.org> References: <20100906120010.B85C32A6C12C@llvm.org> Message-ID: On Sep 6, 2010, at 5:00 AM, Argyrios Kyrtzidis wrote: > Author: akirtzidis > Date: Mon Sep 6 07:00:10 2010 > New Revision: 113154 > > URL: http://llvm.org/viewvc/llvm-project?rev=113154&view=rev > Log: > LastFieldBitfield in CGObjCCommonMac::BuildAggrIvarLayout keeps > bitfields or unnamed fields but later the code > assumes that it's always a bitfield. This can lead to a crash > (reported at rdar://8368320). > > Modified: > cfe/trunk/lib/CodeGen/CGObjCMac.cpp > cfe/trunk/test/CodeGenObjC/ivars.m > > Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=113154&r1=113153&r2=113154&view=diff > = > = > = > = > = > = > = > = > ====================================================================== > --- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original) > +++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Sep 6 07:00:10 2010 > @@ -3586,10 +3586,10 @@ > uint64_t MaxSkippedUnionIvarSize = 0; > FieldDecl *MaxField = 0; > FieldDecl *MaxSkippedField = 0; > - FieldDecl *LastFieldBitfield = 0; > + FieldDecl *LastFieldBitfieldOrUnnamed = 0; > uint64_t MaxFieldOffset = 0; > uint64_t MaxSkippedFieldOffset = 0; > - uint64_t LastBitfieldOffset = 0; > + uint64_t LastBitfieldOrUnnamedOffset = 0; > > if (RecFields.empty()) > return; > @@ -3609,12 +3609,12 @@ > > // Skip over unnamed or bitfields > if (!Field->getIdentifier() || Field->isBitField()) { OK. We were keeping track of unnamed fields here but forgot about them at the end. Fariborz. > From daniel at zuster.org Tue Sep 7 12:07:49 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 07 Sep 2010 17:07:49 -0000 Subject: [cfe-commits] r113212 - /cfe/trunk/lib/Driver/Tools.cpp Message-ID: <20100907170749.6BD522A6C12C@llvm.org> Author: ddunbar Date: Tue Sep 7 12:07:49 2010 New Revision: 113212 URL: http://llvm.org/viewvc/llvm-project?rev=113212&view=rev Log: Driver/Darwin: Don't pass -demangle to the linker when we know it is going to use ld_classic. This is a temporary workaround, the linkr itself should handle this. Modified: cfe/trunk/lib/Driver/Tools.cpp Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=113212&r1=113211&r2=113212&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Tue Sep 7 12:07:49 2010 @@ -2204,7 +2204,13 @@ // Newer linkers support -demangle, pass it if supported and not disabled by // the user. if (Version[0] >= 100 && !Args.hasArg(options::OPT_Z_Xlinker__no_demangle)) { - CmdArgs.push_back("-demangle"); + // Don't pass -demangle to ld_classic. + // + // FIXME: This is a temporary workaround, ld should be handling this. + bool UsesLdClassic = (getToolChain().getArch() == llvm::Triple::x86 && + Args.hasArg(options::OPT_static)); + if (!UsesLdClassic) + CmdArgs.push_back("-demangle"); } // Derived from the "link" spec. From hhinnant at apple.com Tue Sep 7 12:15:18 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Tue, 07 Sep 2010 17:15:18 -0000 Subject: [cfe-commits] [libcxx] r113217 - in /libcxx/trunk: include/type_traits test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp Message-ID: <20100907171518.2B3312A6C12C@llvm.org> Author: hhinnant Date: Tue Sep 7 12:15:17 2010 New Revision: 113217 URL: http://llvm.org/viewvc/llvm-project?rev=113217&view=rev Log: has_nothrow_default_constructor hooked up to clang. Filed http://llvm.org/bugs/show_bug.cgi?id=8101 to take care of void, arrays of incomplete types, and classes with virtual destructors which don't work yet. If there is some reasons we don't want to handle these types in the compiler, I can handle them in the library. Modified: libcxx/trunk/include/type_traits libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp Modified: libcxx/trunk/include/type_traits URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=113217&r1=113216&r2=113217&view=diff ============================================================================== --- libcxx/trunk/include/type_traits (original) +++ libcxx/trunk/include/type_traits Tue Sep 7 12:15:17 2010 @@ -714,7 +714,17 @@ // has_nothrow_default_constructor -template struct has_nothrow_default_constructor : public has_trivial_default_constructor<_Tp> {}; +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + +template struct has_nothrow_default_constructor + : public integral_constant {}; + +#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + +template struct has_nothrow_default_constructor + : public has_trivial_default_constructor<_Tp> {}; + +#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) // has_trivial_copy_constructor Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp?rev=113217&r1=113216&r2=113217&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp Tue Sep 7 12:15:17 2010 @@ -62,16 +62,16 @@ test_has_not_nothrow_default_constructor(); test_has_not_nothrow_default_constructor(); test_has_not_nothrow_default_constructor(); + test_has_not_nothrow_default_constructor(); + test_has_not_nothrow_default_constructor(); test_has_nothrow_default_constructor(); - test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); - test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); test_has_nothrow_default_constructor(); } From hhinnant at apple.com Tue Sep 7 12:47:31 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Tue, 07 Sep 2010 17:47:31 -0000 Subject: [cfe-commits] [libcxx] r113225 - in /libcxx/trunk: include/type_traits test/utilities/meta/meta.unary/meta.unary.prop/has_default_constructor.pass.cpp test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp Message-ID: <20100907174732.02B7E2A6C12C@llvm.org> Author: hhinnant Date: Tue Sep 7 12:47:31 2010 New Revision: 113225 URL: http://llvm.org/viewvc/llvm-project?rev=113225&view=rev Log: Made a stab at has_default_constructor. Got it mostly working for g++-4.0, but only works for scalar types on clang. Ultimately this needs a compiler-supported is_constructible which clang is missing, and won't be able to use until it gets variadic templates. Modified: libcxx/trunk/include/type_traits libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_default_constructor.pass.cpp libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp Modified: libcxx/trunk/include/type_traits URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=113225&r1=113224&r2=113225&view=diff ============================================================================== --- libcxx/trunk/include/type_traits (original) +++ libcxx/trunk/include/type_traits Tue Sep 7 12:47:31 2010 @@ -1637,6 +1637,80 @@ : public false_type {}; +template +struct has_default_constructor + : public is_constructible<_Tp> + {}; + +#else // _LIBCPP_HAS_NO_ADVANCED_SFINAE + +// template struct is_constructible0; + +// main is_constructible0 test + +template +decltype((_STD::move(_Tp()), true_type())) +__is_constructible0_test(_Tp&); + +false_type +__is_constructible0_test(__any); + +template +struct __is_constructible0_imp // false, _Tp is not a scalar + : public common_type + < + decltype(__is_constructible0_test(declval<_Tp&>())) + >::type + {}; + +// handle scalars and reference types + +// Scalars are default constructible, references are not + +template +struct __is_constructible0_imp + : public is_scalar<_Tp> + {}; + +// Treat scalars and reference types separately + +template +struct __is_constructible0_void_check + : public __is_constructible0_imp::value || is_reference<_Tp>::value, + _Tp> + {}; + +// If any of T or Args is void, is_constructible should be false + +template +struct __is_constructible0_void_check + : public false_type + {}; + +// has_default_constructor entry point + +template +struct has_default_constructor + : public __is_constructible0_void_check::value + || is_abstract<_Tp>::value, + _Tp> + {}; + +// Array types are default constructible if their element type +// is default constructible + +template +struct __is_constructible0_imp + : public has_default_constructor::type> + {}; + +// Incomplete array types are not constructible + +template +struct __is_constructible0_imp + : public false_type + {}; + #endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE template struct __is_zero_default_constructible Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_default_constructor.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_default_constructor.pass.cpp?rev=113225&r1=113224&r2=113225&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_default_constructor.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_default_constructor.pass.cpp Tue Sep 7 12:47:31 2010 @@ -13,7 +13,58 @@ #include +template +void test_has_default_constructor() +{ + static_assert(std::has_default_constructor::value == Result, ""); + static_assert(std::has_default_constructor::value == Result, ""); + static_assert(std::has_default_constructor::value == Result, ""); + static_assert(std::has_default_constructor::value == Result, ""); +} + +class Empty +{ +}; + +class NotEmpty +{ +public: + virtual ~NotEmpty(); +}; + +union Union {}; + +struct bit_zero +{ + int : 0; +}; + +class Abstract +{ +public: + virtual ~Abstract() = 0; +}; + +struct A +{ + A(); +}; + int main() { -#error has_default_constructor not implemented + test_has_default_constructor(); + test_has_default_constructor(); + test_has_default_constructor(); + test_has_default_constructor(); + + test_has_default_constructor(); + test_has_default_constructor(); + test_has_default_constructor(); + test_has_default_constructor(); + test_has_default_constructor(); + test_has_default_constructor(); + test_has_default_constructor(); + test_has_default_constructor(); + test_has_default_constructor(); + test_has_default_constructor(); } Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp?rev=113225&r1=113224&r2=113225&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_default_constructor.pass.cpp Tue Sep 7 12:47:31 2010 @@ -37,6 +37,7 @@ class NotEmpty { +public: virtual ~NotEmpty(); }; @@ -49,6 +50,7 @@ class Abstract { +public: virtual ~Abstract() = 0; }; From daniel at zuster.org Tue Sep 7 12:50:41 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 07 Sep 2010 17:50:41 -0000 Subject: [cfe-commits] r113226 - /cfe/trunk/lib/Driver/Tools.cpp Message-ID: <20100907175041.8FC0F2A6C12C@llvm.org> Author: ddunbar Date: Tue Sep 7 12:50:41 2010 New Revision: 113226 URL: http://llvm.org/viewvc/llvm-project?rev=113226&view=rev Log: Driver/Darwin: Catch another case where ld ends up using ld_classic. Modified: cfe/trunk/lib/Driver/Tools.cpp Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=113226&r1=113225&r2=113226&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Tue Sep 7 12:50:41 2010 @@ -2209,6 +2209,16 @@ // FIXME: This is a temporary workaround, ld should be handling this. bool UsesLdClassic = (getToolChain().getArch() == llvm::Triple::x86 && Args.hasArg(options::OPT_static)); + if (getToolChain().getArch() == llvm::Triple::x86) { + for (arg_iterator it = Args.filtered_begin(options::OPT_Xlinker, + options::OPT_Wl_COMMA), + ie = Args.filtered_end(); it != ie; ++it) { + const Arg *A = *it; + for (unsigned i = 0, e = A->getNumValues(); i != e; ++i) + if (llvm::StringRef(A->getValue(Args, i)) == "-kext") + UsesLdClassic = true; + } + } if (!UsesLdClassic) CmdArgs.push_back("-demangle"); } From dalej at apple.com Tue Sep 7 13:11:53 2010 From: dalej at apple.com (Dale Johannesen) Date: Tue, 07 Sep 2010 18:11:53 -0000 Subject: [cfe-commits] r113234 - /cfe/trunk/test/CodeGen/palignr.c Message-ID: <20100907181153.4F9962A6C12C@llvm.org> Author: johannes Date: Tue Sep 7 13:11:53 2010 New Revision: 113234 URL: http://llvm.org/viewvc/llvm-project?rev=113234&view=rev Log: Adjust a test that's expecting optimizations to be done on MMX palignr; we don't do this for the intrinsics. Modified: cfe/trunk/test/CodeGen/palignr.c Modified: cfe/trunk/test/CodeGen/palignr.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/palignr.c?rev=113234&r1=113233&r2=113234&view=diff ============================================================================== --- cfe/trunk/test/CodeGen/palignr.c (original) +++ cfe/trunk/test/CodeGen/palignr.c Tue Sep 7 13:11:53 2010 @@ -17,13 +17,13 @@ #define _mm_alignr_pi8(a, b, n) (__builtin_ia32_palignr((a), (b), (n))) typedef __attribute__((vector_size(8))) int int2; -// CHECK-NOT: palignr +// CHECK: palignr int2 align5(int2 a, int2 b) { return _mm_alignr_pi8(a, b, 8); } -// CHECK: psrlq +// CHECK: palignr int2 align6(int2 a, int2 b) { return _mm_alignr_pi8(a, b, 9); } -// CHECK: xor +// CHECK: palignr int2 align7(int2 a, int2 b) { return _mm_alignr_pi8(a, b, 16); } // CHECK: palignr From rjmccall at apple.com Tue Sep 7 13:31:03 2010 From: rjmccall at apple.com (John McCall) Date: Tue, 07 Sep 2010 18:31:03 -0000 Subject: [cfe-commits] r113243 - in /cfe/trunk: lib/Parse/Parser.cpp test/Parser/objc-interfaces.m test/Parser/recovery.c Message-ID: <20100907183104.0C07A2A6C12C@llvm.org> Author: rjmccall Date: Tue Sep 7 13:31:03 2010 New Revision: 113243 URL: http://llvm.org/viewvc/llvm-project?rev=113243&view=rev Log: Improve error recovery when we see ':' and expect a ';'. I, at least, make this typo all the time. Modified: cfe/trunk/lib/Parse/Parser.cpp cfe/trunk/test/Parser/objc-interfaces.m cfe/trunk/test/Parser/recovery.c Modified: cfe/trunk/lib/Parse/Parser.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=113243&r1=113242&r2=113243&view=diff ============================================================================== --- cfe/trunk/lib/Parse/Parser.cpp (original) +++ cfe/trunk/lib/Parse/Parser.cpp Tue Sep 7 13:31:03 2010 @@ -133,6 +133,13 @@ return R; } +static bool IsCommonTypo(tok::TokenKind ExpectedTok, const Token &Tok) { + switch (ExpectedTok) { + case tok::semi: return Tok.is(tok::colon); // : for ; + default: return false; + } +} + /// ExpectAndConsume - The parser expects that 'ExpectedTok' is next in the /// input. If so, it is consumed and false is returned. /// @@ -146,6 +153,19 @@ return false; } + // Detect common single-character typos and resume. + if (IsCommonTypo(ExpectedTok, Tok)) { + SourceLocation Loc = Tok.getLocation(); + Diag(Loc, DiagID) + << Msg + << FixItHint::CreateReplacement(SourceRange(Loc), + getTokenSimpleSpelling(ExpectedTok)); + ConsumeAnyToken(); + + // Pretend there wasn't a problem. + return false; + } + const char *Spelling = 0; SourceLocation EndLoc = PP.getLocForEndOfToken(PrevTokLocation); if (EndLoc.isValid() && Modified: cfe/trunk/test/Parser/objc-interfaces.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/objc-interfaces.m?rev=113243&r1=113242&r2=113243&view=diff ============================================================================== --- cfe/trunk/test/Parser/objc-interfaces.m (original) +++ cfe/trunk/test/Parser/objc-interfaces.m Tue Sep 7 13:31:03 2010 @@ -3,6 +3,6 @@ // Test features and error recovery for objc interfaces. @interface INTF -- (int*) foo2 __attribute__((deprecated)) : (int) x1 __attribute__((deprecated)); // expected-error {{expected ';' after method prototype}} +- (int*) foo2 __attribute__((deprecated)) : (int) x1 __attribute__((deprecated)); // expected-error {{expected ';' after method prototype}} expected-error {{method type specifier must start with '-' or '+'}} @end Modified: cfe/trunk/test/Parser/recovery.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/recovery.c?rev=113243&r1=113242&r2=113243&view=diff ============================================================================== --- cfe/trunk/test/Parser/recovery.c (original) +++ cfe/trunk/test/Parser/recovery.c Tue Sep 7 13:31:03 2010 @@ -78,3 +78,9 @@ // rdar://7980651 typedef int intptr_t; // expected-note {{'intptr_t' declared here}} void bar(intptr y); // expected-error {{unknown type name 'intptr'; did you mean 'intptr_t'?}} + +void test1(void) { + int x = 2: // expected-error {{expected ';' at end of declaration}} + int y = x; + int z = y; +} From dalej at apple.com Tue Sep 7 13:40:41 2010 From: dalej at apple.com (Dale Johannesen) Date: Tue, 07 Sep 2010 18:40:41 -0000 Subject: [cfe-commits] r113246 - /cfe/trunk/lib/Basic/TargetInfo.cpp Message-ID: <20100907184041.5E3672A6C12C@llvm.org> Author: johannes Date: Tue Sep 7 13:40:41 2010 New Revision: 113246 URL: http://llvm.org/viewvc/llvm-project?rev=113246&view=rev Log: Allow 'o' and 'V' as constraints for output asm operands. Allow '<' and '>' as constraints for input or output. Modified: cfe/trunk/lib/Basic/TargetInfo.cpp Modified: cfe/trunk/lib/Basic/TargetInfo.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/TargetInfo.cpp?rev=113246&r1=113245&r2=113246&view=diff ============================================================================== --- cfe/trunk/lib/Basic/TargetInfo.cpp (original) +++ cfe/trunk/lib/Basic/TargetInfo.cpp Tue Sep 7 13:40:41 2010 @@ -283,6 +283,10 @@ Info.setAllowsRegister(); break; case 'm': // memory operand. + case 'o': // offsetable memory operand. + case 'V': // non-offsetable memory operand. + case '<': // autodecrement memory operand. + case '>': // autoincrement memory operand. Info.setAllowsMemory(); break; case 'g': // general register, memory operand or immediate integer. @@ -297,7 +301,7 @@ Name++; break; case '?': // Disparage slightly code. - case '!': // Disparage severly. + case '!': // Disparage severely. break; // Pass them. } @@ -384,8 +388,10 @@ Info.setAllowsRegister(); break; case 'm': // memory operand. - case 'o': // offsettable memory operand - case 'V': // non-offsettable memory operand + case 'o': // offsettable memory operand. + case 'V': // non-offsettable memory operand. + case '<': // autodecrement memory operand. + case '>': // autoincrement memory operand. Info.setAllowsMemory(); break; case 'g': // general register, memory operand or immediate integer. From fjahanian at apple.com Tue Sep 7 14:38:13 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Tue, 07 Sep 2010 19:38:13 -0000 Subject: [cfe-commits] r113253 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/CodeGen/CodeGenModule.cpp lib/Sema/SemaChecking.cpp test/CodeGen/illegal-UTF8.m test/Sema/builtins.c Message-ID: <20100907193813.5665A2A6C12D@llvm.org> Author: fjahanian Date: Tue Sep 7 14:38:13 2010 New Revision: 113253 URL: http://llvm.org/viewvc/llvm-project?rev=113253&view=rev Log: Have Sema check for validity of CGString literal instead of asserting in IRGen. Fixes radar 8390459. Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/lib/CodeGen/CodeGenModule.cpp cfe/trunk/lib/Sema/SemaChecking.cpp cfe/trunk/test/CodeGen/illegal-UTF8.m cfe/trunk/test/Sema/builtins.c Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=113253&r1=113252&r2=113253&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Sep 7 14:38:13 2010 @@ -3091,6 +3091,9 @@ "CFString literal is not a string constant">; def warn_cfstring_literal_contains_nul_character : Warning< "CFString literal contains NUL character">; +def warn_cfstring_truncated : Warning< + "input conversion stopped due to an input byte that does not " + "belong to the input codeset UTF-8">; // Statements. def err_continue_not_in_loop : Error< Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=113253&r1=113252&r2=113253&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original) +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Sep 7 14:38:13 2010 @@ -1498,15 +1498,6 @@ &ToPtr, ToPtr + NumBytes, strictConversion); - // Check for conversion failure. - if (Result != conversionOK) { - // FIXME: Have Sema::CheckObjCString() validate the UTF-8 string and remove - // this duplicate code. - assert(Result == sourceIllegal && "UTF-8 to UTF-16 conversion failed"); - StringLength = NumBytes; - return Map.GetOrCreateValue(String); - } - // ConvertUTF8toUTF16 returns the length in ToPtr. StringLength = ToPtr - &ToBuf[0]; Modified: cfe/trunk/lib/Sema/SemaChecking.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=113253&r1=113252&r2=113253&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaChecking.cpp (original) +++ cfe/trunk/lib/Sema/SemaChecking.cpp Tue Sep 7 14:38:13 2010 @@ -32,6 +32,8 @@ #include "llvm/Support/raw_ostream.h" #include "clang/Basic/TargetBuiltins.h" #include "clang/Basic/TargetInfo.h" +#include "clang/Basic/ConvertUTF.h" + #include using namespace clang; using namespace sema; @@ -581,9 +583,6 @@ /// CheckObjCString - Checks that the argument to the builtin /// CFString constructor is correct -/// FIXME: GCC currently emits the following warning: -/// "warning: input conversion stopped due to an input byte that does not -/// belong to the input codeset UTF-8" /// Note: It might also make sense to do the UTF-16 conversion here (would /// simplify the backend). bool Sema::CheckObjCString(Expr *Arg) { @@ -602,7 +601,21 @@ diag::warn_cfstring_literal_contains_nul_character) << Arg->getSourceRange(); } - + if (Literal->containsNonAsciiOrNull()) { + llvm::StringRef String = Literal->getString(); + unsigned NumBytes = String.size(); + llvm::SmallVector ToBuf(NumBytes); + const UTF8 *FromPtr = (UTF8 *)String.data(); + UTF16 *ToPtr = &ToBuf[0]; + + ConversionResult Result = ConvertUTF8toUTF16(&FromPtr, FromPtr + NumBytes, + &ToPtr, ToPtr + NumBytes, + strictConversion); + // Check for conversion failure. + if (Result != conversionOK) + Diag(Arg->getLocStart(), + diag::warn_cfstring_truncated) << Arg->getSourceRange(); + } return false; } Modified: cfe/trunk/test/CodeGen/illegal-UTF8.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/illegal-UTF8.m?rev=113253&r1=113252&r2=113253&view=diff ============================================================================== --- cfe/trunk/test/CodeGen/illegal-UTF8.m (original) +++ cfe/trunk/test/CodeGen/illegal-UTF8.m Tue Sep 7 14:38:13 2010 @@ -2,7 +2,5 @@ @class NSString; -// FIXME: GCC emits the following warning: -// CodeGen/illegal-UTF8.m:4: warning: input conversion stopped due to an input byte that does not belong to the input codeset UTF-8 -NSString *S = @"\xff\xff___WAIT___"; +NSString *S = @"\xff\xff___WAIT___"; // expected-warning {{input conversion stopped due to an input byte that does not belong to the input codeset UTF-8}} Modified: cfe/trunk/test/Sema/builtins.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/builtins.c?rev=113253&r1=113252&r2=113253&view=diff ============================================================================== --- cfe/trunk/test/Sema/builtins.c (original) +++ cfe/trunk/test/Sema/builtins.c Tue Sep 7 14:38:13 2010 @@ -26,7 +26,7 @@ #define CFSTR __builtin___CFStringMakeConstantString void test7() { const void *X; - X = CFSTR("\242"); + X = CFSTR("\242"); // expected-warning {{input conversion stopped}} X = CFSTR("\0"); // expected-warning {{ CFString literal contains NUL character }} X = CFSTR(242); // expected-error {{ CFString literal is not a string constant }} expected-warning {{incompatible integer to pointer conversion}} X = CFSTR("foo", "bar"); // expected-error {{too many arguments to function call}} From fjahanian at apple.com Tue Sep 7 14:57:04 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Tue, 07 Sep 2010 19:57:04 -0000 Subject: [cfe-commits] r113256 - /cfe/trunk/lib/CodeGen/CodeGenModule.cpp Message-ID: <20100907195704.82B102A6C12C@llvm.org> Author: fjahanian Date: Tue Sep 7 14:57:04 2010 New Revision: 113256 URL: http://llvm.org/viewvc/llvm-project?rev=113256&view=rev Log: get rid of a warning. Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=113256&r1=113255&r2=113256&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original) +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Sep 7 14:57:04 2010 @@ -1494,9 +1494,9 @@ const UTF8 *FromPtr = (UTF8 *)String.data(); UTF16 *ToPtr = &ToBuf[0]; - ConversionResult Result = ConvertUTF8toUTF16(&FromPtr, FromPtr + NumBytes, - &ToPtr, ToPtr + NumBytes, - strictConversion); + (void)ConvertUTF8toUTF16(&FromPtr, FromPtr + NumBytes, + &ToPtr, ToPtr + NumBytes, + strictConversion); // ConvertUTF8toUTF16 returns the length in ToPtr. StringLength = ToPtr - &ToBuf[0]; From dgregor at apple.com Tue Sep 7 15:01:00 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 7 Sep 2010 13:01:00 -0700 Subject: [cfe-commits] [PATCH][MS] - operator __uuidof implementation part 1 In-Reply-To: References: <1F7451DD-853D-4911-BC7B-05EB0B9B5138@apple.com> Message-ID: On Sep 5, 2010, at 1:38 PM, Francois Pichet wrote: > Hi, > > Updated patch attached. > > >> Is __uuidof only available in C++ mode, or does MSVC also allow it in C mode? > > yes __uuidof is only available in C++ mode. > >> Is there anything dynamci about __uuidof? In other words, is the result of __uuidof always a constant, or can it involve run-time computation? If it does not involve run-time computation, then you can use the Unevaluated context rather than the PotentiallyPotentiallyEvaluated context. > > No there is nothing dynamic about __uuidof. It is always resolved at > compile time. So I changed the code to use the Unevaluated context. > Not sure exactly why, I am still learning clang internal design. It's because the expression inside the __uuidof operator never actually generates any code, just like the expression inside the sizeof operator doesn't generate any code. Marking it as "Unevaluated" indicates that this is the case and, for example, suppressed the instantiation of function templates that are called inside the __uuidof expression. One more comment... Index: lib/Parse/ParseExprCXX.cpp =================================================================== --- lib/Parse/ParseExprCXX.cpp (revision 113112) +++ lib/Parse/ParseExprCXX.cpp (working copy) @@ -534,6 +534,54 @@ return move(Result); } +/// ParseCXXUuidof - This handles the Microsoft C++ __uuidof expression. +/// +/// '__uuidof' '(' expression ')' +/// '__uuidof' '(' type-id ')' +/// +ExprResult Parser::ParseCXXUuidof() { + assert(Tok.is(tok::kw___uuidof) && "Not '__uuidof'!"); + + SourceLocation OpLoc = ConsumeToken(); + SourceLocation LParenLoc = Tok.getLocation(); + SourceLocation RParenLoc; + + // __uuidof expressions are always parenthesized. + if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after, + "__uuidof")) + return ExprError(); + + ExprResult Result; + + if (isTypeIdInParens()) { + TypeResult Ty = ParseTypeName(); + + // Match the ')'. + MatchRHSPunctuation(tok::r_paren, LParenLoc); + + if (Ty.isInvalid()) + return ExprError(); + + Result = Actions.ActOnCXXUuidof(OpLoc, LParenLoc, /*isType=*/true, + Ty.get().getAsOpaquePtr(), RParenLoc); RParenLoc is never set to a location (other than its default, empty state), either on this path or on the __uuidof(expression) path. With that fix, feel free to commit! - Doug From dgregor at apple.com Tue Sep 7 15:13:57 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 7 Sep 2010 13:13:57 -0700 Subject: [cfe-commits] [PATCH][MS] - MSVC allows type definition in anonymous union and struct In-Reply-To: References: Message-ID: <96CD9D9B-1882-4BD8-BB5D-186D1B172867@apple.com> On Sep 4, 2010, at 9:12 PM, Francois Pichet wrote: > Hi > > Here is followup patch. > I added a warning as you said. To do this I created a new MSVC > DiagGroup similar to -Wgnu. > This MSVC (-Wmsvc) diagnostic group is just starting up but eventually > we'll put all MSVC extensions into it. I'd prefer that we make this -Wmicrosoft and refer to "Microsoft" extensions in diagnostics rather than using the MSVC acronym. After all, we use "GNU" rather than "GCC". With those changes, this patch looks good. Thanks! - Doug From pichet2000 at gmail.com Tue Sep 7 15:14:51 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Tue, 7 Sep 2010 16:14:51 -0400 Subject: [cfe-commits] [PATCH] fix for PR8089 - clang crashes. In-Reply-To: References: Message-ID: Hi, About this patch, another solution would be to not inject the "E" enum name into the scope after a invalid enum forward declaration. Would that be better? On Mon, Sep 6, 2010 at 4:13 PM, Francois Pichet wrote: > Hi > > This is a fix for PR8089 I raised yesterday. clang was crashing on: > enum E; > int a = (E) a; > From dgregor at apple.com Tue Sep 7 15:16:43 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 07 Sep 2010 20:16:43 -0000 Subject: [cfe-commits] r113266 - in /cfe/trunk/include/clang/Frontend: DeclXML.def TypeXML.def Message-ID: <20100907201643.47FF02A6C12C@llvm.org> Author: dgregor Date: Tue Sep 7 15:16:43 2010 New Revision: 113266 URL: http://llvm.org/viewvc/llvm-project?rev=113266&view=rev Log: Add function attributes to the output of -ast-print-xml, from Martin Vejnar! Modified: cfe/trunk/include/clang/Frontend/DeclXML.def cfe/trunk/include/clang/Frontend/TypeXML.def Modified: cfe/trunk/include/clang/Frontend/DeclXML.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/DeclXML.def?rev=113266&r1=113265&r2=113266&view=diff ============================================================================== --- cfe/trunk/include/clang/Frontend/DeclXML.def (original) +++ cfe/trunk/include/clang/Frontend/DeclXML.def Tue Sep 7 15:16:43 2010 @@ -103,6 +103,9 @@ ATTRIBUTE_OPT_XML(isInlineSpecified(), "inline") //ATTRIBUTE_OPT_XML(isVariadic(), "variadic") // in the type reference ATTRIBUTE_XML(getNumParams(), "num_args") + ATTRIBUTE_OPT_XML(isMain(), "main") + ATTRIBUTE_OPT_XML(isExternC(), "externc") + ATTRIBUTE_OPT_XML(isGlobal(), "global") SUB_NODE_SEQUENCE_XML(ParmVarDecl) SUB_NODE_FN_BODY_XML END_NODE_XML @@ -117,6 +120,7 @@ ATTRIBUTE_OPT_XML(isInlineSpecified(), "inline") ATTRIBUTE_OPT_XML(isStatic(), "static") ATTRIBUTE_OPT_XML(isVirtual(), "virtual") + ATTRIBUTE_OPT_XML(isPure(), "pure") ATTRIBUTE_ENUM_OPT_XML(getAccess(), "access") ENUM_XML(AS_none, "") ENUM_XML(AS_public, "public") Modified: cfe/trunk/include/clang/Frontend/TypeXML.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/TypeXML.def?rev=113266&r1=113265&r2=113266&view=diff ============================================================================== --- cfe/trunk/include/clang/Frontend/TypeXML.def (original) +++ cfe/trunk/include/clang/Frontend/TypeXML.def Tue Sep 7 15:16:43 2010 @@ -130,6 +130,13 @@ ID_ATTRIBUTE_XML ATTRIBUTE_XML(getResultType(), "result_type") ATTRIBUTE_OPT_XML(isVariadic(), "variadic") + ATTRIBUTE_ENUM_XML(getCallConv(), "call_conv") + ENUM_XML(CC_Default, "") + ENUM_XML(CC_C, "C") + ENUM_XML(CC_X86StdCall, "X86StdCall") + ENUM_XML(CC_X86FastCall, "X86FastCall") + ENUM_XML(CC_X86ThisCall, "X86ThisCall") + END_ENUM_XML END_NODE_XML NODE_XML(TypedefType, "Typedef") From dgregor at apple.com Tue Sep 7 15:18:09 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 7 Sep 2010 13:18:09 -0700 Subject: [cfe-commits] [PATCH] Add function attributes to the output of -ast-print-xml In-Reply-To: <1381de5deb83bf8cf22e7ed75b59e402@technika.junior.cz> References: <1381de5deb83bf8cf22e7ed75b59e402@technika.junior.cz> Message-ID: <6E7E16AE-07C4-43E7-AB0C-20523903DE9E@apple.com> On Sep 7, 2010, at 6:07 AM, Martin Vejn?r wrote: > Hi, I'm attaching a patch that adds some more information to the > XML-serialized AST. The attributes in question are "main", "externc", > "global", "pure" and "call_conv"; all of them are added to function > declarations except for the latter, which is part of the function type. Committed as r113266, thanks! - Doug From tcare at apple.com Tue Sep 7 15:27:57 2010 From: tcare at apple.com (Tom Care) Date: Tue, 07 Sep 2010 20:27:57 -0000 Subject: [cfe-commits] r113269 - in /cfe/trunk: lib/Checker/IdempotentOperationChecker.cpp test/Analysis/idempotent-operations.c Message-ID: <20100907202757.197602A6C12C@llvm.org> Author: tcare Date: Tue Sep 7 15:27:56 2010 New Revision: 113269 URL: http://llvm.org/viewvc/llvm-project?rev=113269&view=rev Log: Re-enabled truncation/extension checking in IdempotentOperationChecker and added a test case. Modified: cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp cfe/trunk/test/Analysis/idempotent-operations.c Modified: cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp?rev=113269&r1=113268&r2=113269&view=diff ============================================================================== --- cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp (original) +++ cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp Tue Sep 7 15:27:56 2010 @@ -78,8 +78,8 @@ // False positive reduction methods static bool isSelfAssign(const Expr *LHS, const Expr *RHS); static bool isUnused(const Expr *E, AnalysisContext *AC); - //static bool isTruncationExtensionAssignment(const Expr *LHS, - // const Expr *RHS); + static bool isTruncationExtensionAssignment(const Expr *LHS, + const Expr *RHS); static bool PathWasCompletelyAnalyzed(const CFG *C, const CFGBlock *CB, const GRCoreEngine &CE); @@ -196,9 +196,10 @@ case BO_Assign: // x Assign x can be used to silence unused variable warnings intentionally. // If this is a self assignment and the variable is referenced elsewhere, - // then it is a false positive. + // and the assignment is not a truncation or extension, then it is a false + // positive. if (isSelfAssign(LHS, RHS)) { - if (!isUnused(LHS, AC)) { + if (!isUnused(LHS, AC) && !isTruncationExtensionAssignment(LHS, RHS)) { UpdateAssumption(A, Equal); return; } @@ -500,7 +501,6 @@ return true; } -#if 0 // Check for self casts truncating/extending a variable bool IdempotentOperationChecker::isTruncationExtensionAssignment( const Expr *LHS, @@ -523,7 +523,6 @@ return dyn_cast(RHS->IgnoreParens()) == NULL; } -#endif // Returns false if a path to this block was not completely analyzed, or true // otherwise. Modified: cfe/trunk/test/Analysis/idempotent-operations.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/idempotent-operations.c?rev=113269&r1=113268&r2=113269&view=diff ============================================================================== --- cfe/trunk/test/Analysis/idempotent-operations.c (original) +++ cfe/trunk/test/Analysis/idempotent-operations.c Tue Sep 7 15:27:56 2010 @@ -187,3 +187,10 @@ return a; } + +// Check truncations do not flag as self-assignments +void false8() { + int a = 10000000; + a = (short)a; // no-warning + test(a); +} From hhinnant at apple.com Tue Sep 7 15:31:18 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Tue, 07 Sep 2010 20:31:18 -0000 Subject: [cfe-commits] [libcxx] r113270 - in /libcxx/trunk: include/__config include/type_traits test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_constructor.pass.cpp Message-ID: <20100907203118.792162A6C12C@llvm.org> Author: hhinnant Date: Tue Sep 7 15:31:18 2010 New Revision: 113270 URL: http://llvm.org/viewvc/llvm-project?rev=113270&view=rev Log: has_trivial_copy_constructor hooked up to clang. Filed http://llvm.org/bugs/show_bug.cgi?id=8105 to take care of void, arrays of incomplete bounds and complete bounds which don't work yet. If there is some reason we don't want to handle these types in the compiler, I can handle them in the library. Modified: libcxx/trunk/include/__config libcxx/trunk/include/type_traits libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_constructor.pass.cpp Modified: libcxx/trunk/include/__config URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=113270&r1=113269&r2=113270&view=diff ============================================================================== --- libcxx/trunk/include/__config (original) +++ libcxx/trunk/include/__config Tue Sep 7 15:31:18 2010 @@ -88,7 +88,10 @@ #define _LIBCPP_HAS_NO_ADVANCED_SFINAE #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES + +#ifndef __GXX_EXPERIMENTAL_CXX0X__ #define _LIBCPP_HAS_NO_UNICODE_CHARS +#endif #if !(__has_feature(cxx_exceptions)) #define _LIBCPP_NO_EXCEPTIONS Modified: libcxx/trunk/include/type_traits URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=113270&r1=113269&r2=113270&view=diff ============================================================================== --- libcxx/trunk/include/type_traits (original) +++ libcxx/trunk/include/type_traits Tue Sep 7 15:31:18 2010 @@ -728,11 +728,19 @@ // has_trivial_copy_constructor -template struct __has_trivial_copy_constructor : public integral_constant::value || - is_reference<_Tp>::value> {}; +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) template struct has_trivial_copy_constructor - : public __has_trivial_copy_constructor::type> {}; + : public integral_constant {}; + +#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + +template struct has_trivial_copy_constructor + : public integral_constant::value || + is_reference<_Tp>::value> {}; + + +#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) // has_nothrow_copy_constructor Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_constructor.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_constructor.pass.cpp?rev=113270&r1=113269&r2=113270&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_constructor.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_constructor.pass.cpp Tue Sep 7 15:31:18 2010 @@ -37,6 +37,7 @@ class NotEmpty { +public: virtual ~NotEmpty(); }; @@ -49,6 +50,7 @@ class Abstract { +public: virtual ~Abstract() = 0; }; @@ -61,17 +63,17 @@ { test_has_not_trivial_copy_constructor(); test_has_not_trivial_copy_constructor(); - test_has_not_trivial_copy_constructor(); + test_has_not_trivial_copy_constructor(); + test_has_not_trivial_copy_constructor(); + test_has_not_trivial_copy_constructor(); + test_has_not_trivial_copy_constructor(); + test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); - test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); - test_has_trivial_copy_constructor(); - test_has_trivial_copy_constructor(); - test_has_trivial_copy_constructor(); test_has_trivial_copy_constructor(); } From dgregor at apple.com Tue Sep 7 15:31:09 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 7 Sep 2010 13:31:09 -0700 Subject: [cfe-commits] [PATCH][MS] - Fix 6 lit tests on windows In-Reply-To: References: Message-ID: On Sep 4, 2010, at 1:06 PM, Francois Pichet wrote: > Hi, > > This patch fixes 6 failing lit tests on Windows. Someone me if this is > the right approach? > The problem is that %clang_cc1 is called instead of %clang even though > the tests depend on -fms-extensions to be there to pass on Windows. > -fms-extension must be there because the tests include some header > files containing microsoft extensions. Interesting. It's nicer to use %clang_cc1 when we can, but this patch is fine. Please go ahead and commit. - Doug From kremenek at apple.com Tue Sep 7 15:45:26 2010 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 07 Sep 2010 20:45:26 -0000 Subject: [cfe-commits] r113282 - in /cfe/trunk: lib/Checker/StreamChecker.cpp test/Analysis/stream.c Message-ID: <20100907204527.0A8AA2A6C12C@llvm.org> Author: kremenek Date: Tue Sep 7 15:45:26 2010 New Revision: 113282 URL: http://llvm.org/viewvc/llvm-project?rev=113282&view=rev Log: Fix null pointer dereference in StreamChecker::Fseek (reported in PR 8081) and simplify surrounding checking logic. Modified: cfe/trunk/lib/Checker/StreamChecker.cpp cfe/trunk/test/Analysis/stream.c Modified: cfe/trunk/lib/Checker/StreamChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/StreamChecker.cpp?rev=113282&r1=113281&r2=113282&view=diff ============================================================================== --- cfe/trunk/lib/Checker/StreamChecker.cpp (original) +++ cfe/trunk/lib/Checker/StreamChecker.cpp Tue Sep 7 15:45:26 2010 @@ -271,29 +271,24 @@ return; // Check the legality of the 'whence' argument of 'fseek'. SVal Whence = state->getSVal(CE->getArg(2)); - bool WhenceIsLegal = true; const nonloc::ConcreteInt *CI = dyn_cast(&Whence); + if (!CI) - WhenceIsLegal = false; + return; int64_t x = CI->getValue().getSExtValue(); - if (!(x == 0 || x == 1 || x == 2)) - WhenceIsLegal = false; - - if (!WhenceIsLegal) { - if (ExplodedNode *N = C.GenerateSink(state)) { - if (!BT_illegalwhence) - BT_illegalwhence = new BuiltinBug("Illegal whence argument", - "The whence argument to fseek() should be " - "SEEK_SET, SEEK_END, or SEEK_CUR."); - BugReport *R = new BugReport(*BT_illegalwhence, - BT_illegalwhence->getDescription(), N); - C.EmitReport(R); - } + if (x >= 0 && x <= 2) return; - } - C.addTransition(state); + if (ExplodedNode *N = C.GenerateNode(state)) { + if (!BT_illegalwhence) + BT_illegalwhence = new BuiltinBug("Illegal whence argument", + "The whence argument to fseek() should be " + "SEEK_SET, SEEK_END, or SEEK_CUR."); + BugReport *R = new BugReport(*BT_illegalwhence, + BT_illegalwhence->getDescription(), N); + C.EmitReport(R); + } } void StreamChecker::Ftell(CheckerContext &C, const CallExpr *CE) { Modified: cfe/trunk/test/Analysis/stream.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/stream.c?rev=113282&r1=113281&r2=113282&view=diff ============================================================================== --- cfe/trunk/test/Analysis/stream.c (original) +++ cfe/trunk/test/Analysis/stream.c Tue Sep 7 15:45:26 2010 @@ -77,3 +77,9 @@ void pr7831(FILE *fp) { fclose(fp); // no-warning } + +// PR 8081 - null pointer crash when 'whence' is not an integer constant +void pr8081(FILE *stream, long offset, int whence) { + fseek(stream, offset, whence); +} + From dgregor at apple.com Tue Sep 7 16:49:58 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 07 Sep 2010 21:49:58 -0000 Subject: [cfe-commits] r113291 - in /cfe/trunk: include/clang/AST/ExprCXX.h include/clang/AST/RecursiveASTVisitor.h include/clang/Sema/Sema.h lib/AST/ExprCXX.cpp lib/Sema/SemaExprCXX.cpp lib/Sema/TreeTransform.h lib/Serialization/ASTReaderStmt.cpp lib/Serialization/ASTWriterStmt.cpp test/Index/load-stmts.cpp tools/libclang/CIndex.cpp Message-ID: <20100907214959.2EB322A6C12C@llvm.org> Author: dgregor Date: Tue Sep 7 16:49:58 2010 New Revision: 113291 URL: http://llvm.org/viewvc/llvm-project?rev=113291&view=rev Log: Improve source-location information for CXXNewExpr, by hanging on to the TypeSourceInfo for the allocated type. Fixes PR7501. Modified: cfe/trunk/include/clang/AST/ExprCXX.h cfe/trunk/include/clang/AST/RecursiveASTVisitor.h cfe/trunk/include/clang/Sema/Sema.h cfe/trunk/lib/AST/ExprCXX.cpp cfe/trunk/lib/Sema/SemaExprCXX.cpp cfe/trunk/lib/Sema/TreeTransform.h cfe/trunk/lib/Serialization/ASTReaderStmt.cpp cfe/trunk/lib/Serialization/ASTWriterStmt.cpp cfe/trunk/test/Index/load-stmts.cpp cfe/trunk/tools/libclang/CIndex.cpp Modified: cfe/trunk/include/clang/AST/ExprCXX.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=113291&r1=113290&r2=113291&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/ExprCXX.h (original) +++ cfe/trunk/include/clang/AST/ExprCXX.h Tue Sep 7 16:49:58 2010 @@ -900,6 +900,9 @@ // Must be null for all other types. CXXConstructorDecl *Constructor; + /// \brief The allocated type-source information, as written in the source. + TypeSourceInfo *AllocatedTypeInfo; + /// \brief If the allocated type was expressed as a parenthesized type-id, /// the source range covering the parenthesized type-id. SourceRange TypeIdParens; @@ -915,6 +918,7 @@ Expr *arraySize, CXXConstructorDecl *constructor, bool initializer, Expr **constructorArgs, unsigned numConsArgs, FunctionDecl *operatorDelete, QualType ty, + TypeSourceInfo *AllocatedTypeInfo, SourceLocation startLoc, SourceLocation endLoc); explicit CXXNewExpr(EmptyShell Shell) : Expr(CXXNewExprClass, Shell), SubExprs(0) { } @@ -927,6 +931,10 @@ return getType()->getAs()->getPointeeType(); } + TypeSourceInfo *getAllocatedTypeSourceInfo() const { + return AllocatedTypeInfo; + } + FunctionDecl *getOperatorNew() const { return OperatorNew; } void setOperatorNew(FunctionDecl *D) { OperatorNew = D; } FunctionDecl *getOperatorDelete() const { return OperatorDelete; } Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=113291&r1=113290&r2=113291&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original) +++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Tue Sep 7 16:49:58 2010 @@ -1744,7 +1744,8 @@ }) DEF_TRAVERSE_STMT(CXXNewExpr, { - TRY_TO(TraverseType(S->getAllocatedType())); + // The child-iterator will pick up the other arguments. + TRY_TO(TraverseTypeLoc(S->getAllocatedTypeSourceInfo()->getTypeLoc())); }) DEF_TRAVERSE_STMT(OffsetOfExpr, { Modified: cfe/trunk/include/clang/Sema/Sema.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=113291&r1=113290&r2=113291&view=diff ============================================================================== --- cfe/trunk/include/clang/Sema/Sema.h (original) +++ cfe/trunk/include/clang/Sema/Sema.h Tue Sep 7 16:49:58 2010 @@ -2195,8 +2195,7 @@ SourceLocation PlacementRParen, SourceRange TypeIdParens, QualType AllocType, - SourceLocation TypeLoc, - SourceRange TypeRange, + TypeSourceInfo *AllocTypeInfo, Expr *ArraySize, SourceLocation ConstructorLParen, MultiExprArg ConstructorArgs, Modified: cfe/trunk/lib/AST/ExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=113291&r1=113290&r2=113291&view=diff ============================================================================== --- cfe/trunk/lib/AST/ExprCXX.cpp (original) +++ cfe/trunk/lib/AST/ExprCXX.cpp Tue Sep 7 16:49:58 2010 @@ -89,12 +89,14 @@ CXXConstructorDecl *constructor, bool initializer, Expr **constructorArgs, unsigned numConsArgs, FunctionDecl *operatorDelete, QualType ty, + TypeSourceInfo *AllocatedTypeInfo, SourceLocation startLoc, SourceLocation endLoc) : Expr(CXXNewExprClass, ty, ty->isDependentType(), ty->isDependentType()), GlobalNew(globalNew), Initializer(initializer), SubExprs(0), OperatorNew(operatorNew), OperatorDelete(operatorDelete), Constructor(constructor), - TypeIdParens(TypeIdParens), StartLoc(startLoc), EndLoc(endLoc) { + AllocatedTypeInfo(AllocatedTypeInfo), TypeIdParens(TypeIdParens), + StartLoc(startLoc), EndLoc(endLoc) { AllocateArgsArray(C, arraySize != 0, numPlaceArgs, numConsArgs); unsigned i = 0; Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=113291&r1=113290&r2=113291&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Tue Sep 7 16:49:58 2010 @@ -630,12 +630,14 @@ } } - //FIXME: Store TypeSourceInfo in CXXNew expression. TypeSourceInfo *TInfo = GetTypeForDeclarator(D, /*Scope=*/0); QualType AllocType = TInfo->getType(); if (D.isInvalidType()) return ExprError(); + if (!TInfo) + TInfo = Context.getTrivialTypeSourceInfo(AllocType); + SourceRange R = TInfo->getTypeLoc().getSourceRange(); return BuildCXXNew(StartLoc, UseGlobal, PlacementLParen, @@ -643,8 +645,7 @@ PlacementRParen, TypeIdParens, AllocType, - D.getSourceRange().getBegin(), - R, + TInfo, ArraySize, ConstructorLParen, move(ConstructorArgs), @@ -658,13 +659,13 @@ SourceLocation PlacementRParen, SourceRange TypeIdParens, QualType AllocType, - SourceLocation TypeLoc, - SourceRange TypeRange, + TypeSourceInfo *AllocTypeInfo, Expr *ArraySize, SourceLocation ConstructorLParen, MultiExprArg ConstructorArgs, SourceLocation ConstructorRParen) { - if (CheckAllocatedType(AllocType, TypeLoc, TypeRange)) + SourceRange TypeRange = AllocTypeInfo->getTypeLoc().getSourceRange(); + if (CheckAllocatedType(AllocType, TypeRange.getBegin(), TypeRange)) return ExprError(); // Per C++0x [expr.new]p5, the type being constructed may be a @@ -800,10 +801,10 @@ // - If the new-initializer is omitted, the object is default- // initialized (8.5); if no initialization is performed, // the object has indeterminate value - = !Init? InitializationKind::CreateDefault(TypeLoc) + = !Init? InitializationKind::CreateDefault(TypeRange.getBegin()) // - Otherwise, the new-initializer is interpreted according to the // initialization rules of 8.5 for direct-initialization. - : InitializationKind::CreateDirect(TypeLoc, + : InitializationKind::CreateDirect(TypeRange.getBegin(), ConstructorLParen, ConstructorRParen); @@ -852,12 +853,12 @@ PlacementArgs.release(); ConstructorArgs.release(); - // FIXME: The TypeSourceInfo should also be included in CXXNewExpr. return Owned(new (Context) CXXNewExpr(Context, UseGlobal, OperatorNew, PlaceArgs, NumPlaceArgs, TypeIdParens, ArraySize, Constructor, Init, ConsArgs, NumConsArgs, OperatorDelete, - ResultType, StartLoc, + ResultType, AllocTypeInfo, + StartLoc, Init ? ConstructorRParen : TypeRange.getEnd())); } Modified: cfe/trunk/lib/Sema/TreeTransform.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=113291&r1=113290&r2=113291&view=diff ============================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h (original) +++ cfe/trunk/lib/Sema/TreeTransform.h Tue Sep 7 16:49:58 2010 @@ -1580,26 +1580,24 @@ /// By default, performs semantic analysis to build the new expression. /// Subclasses may override this routine to provide different behavior. ExprResult RebuildCXXNewExpr(SourceLocation StartLoc, - bool UseGlobal, - SourceLocation PlacementLParen, - MultiExprArg PlacementArgs, - SourceLocation PlacementRParen, - SourceRange TypeIdParens, - QualType AllocType, - SourceLocation TypeLoc, - SourceRange TypeRange, - Expr *ArraySize, - SourceLocation ConstructorLParen, - MultiExprArg ConstructorArgs, - SourceLocation ConstructorRParen) { + bool UseGlobal, + SourceLocation PlacementLParen, + MultiExprArg PlacementArgs, + SourceLocation PlacementRParen, + SourceRange TypeIdParens, + QualType AllocatedType, + TypeSourceInfo *AllocatedTypeInfo, + Expr *ArraySize, + SourceLocation ConstructorLParen, + MultiExprArg ConstructorArgs, + SourceLocation ConstructorRParen) { return getSema().BuildCXXNew(StartLoc, UseGlobal, PlacementLParen, move(PlacementArgs), PlacementRParen, TypeIdParens, - AllocType, - TypeLoc, - TypeRange, + AllocatedType, + AllocatedTypeInfo, ArraySize, ConstructorLParen, move(ConstructorArgs), @@ -5245,9 +5243,9 @@ ExprResult TreeTransform::TransformCXXNewExpr(CXXNewExpr *E) { // Transform the type that we're allocating - TemporaryBase Rebase(*this, E->getLocStart(), DeclarationName()); - QualType AllocType = getDerived().TransformType(E->getAllocatedType()); - if (AllocType.isNull()) + TypeSourceInfo *AllocTypeInfo + = getDerived().TransformType(E->getAllocatedTypeSourceInfo()); + if (!AllocTypeInfo) return ExprError(); // Transform the size of the array we're allocating (if any). @@ -5310,7 +5308,7 @@ } if (!getDerived().AlwaysRebuild() && - AllocType == E->getAllocatedType() && + AllocTypeInfo == E->getAllocatedTypeSourceInfo() && ArraySize.get() == E->getArraySize() && Constructor == E->getConstructor() && OperatorNew == E->getOperatorNew() && @@ -5327,6 +5325,7 @@ return SemaRef.Owned(E->Retain()); } + QualType AllocType = AllocTypeInfo->getType(); if (!ArraySize.get()) { // If no array size was specified, but the new expression was // instantiated with an array type (e.g., "new T" where T is @@ -5352,6 +5351,7 @@ } } } + return getDerived().RebuildCXXNewExpr(E->getLocStart(), E->isGlobalNew(), /*FIXME:*/E->getLocStart(), @@ -5359,8 +5359,7 @@ /*FIXME:*/E->getLocStart(), E->getTypeIdParens(), AllocType, - /*FIXME:*/E->getLocStart(), - /*FIXME:*/SourceRange(), + AllocTypeInfo, ArraySize.get(), /*FIXME:*/E->getLocStart(), move_arg(ConstructorArgs), Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=113291&r1=113290&r2=113291&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original) +++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Tue Sep 7 16:49:58 2010 @@ -1074,6 +1074,7 @@ cast_or_null(Reader.GetDecl(Record[Idx++]))); E->setConstructor( cast_or_null(Reader.GetDecl(Record[Idx++]))); + E->AllocatedTypeInfo = Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx); SourceRange TypeIdParens; TypeIdParens.setBegin(SourceLocation::getFromRawEncoding(Record[Idx++])); TypeIdParens.setEnd(SourceLocation::getFromRawEncoding(Record[Idx++])); Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=113291&r1=113290&r2=113291&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original) +++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Tue Sep 7 16:49:58 2010 @@ -1091,6 +1091,7 @@ Writer.AddDeclRef(E->getOperatorNew(), Record); Writer.AddDeclRef(E->getOperatorDelete(), Record); Writer.AddDeclRef(E->getConstructor(), Record); + Writer.AddTypeSourceInfo(E->getAllocatedTypeSourceInfo(), Record); Writer.AddSourceRange(E->getTypeIdParens(), Record); Writer.AddSourceLocation(E->getStartLoc(), Record); Writer.AddSourceLocation(E->getEndLoc(), Record); Modified: cfe/trunk/test/Index/load-stmts.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/load-stmts.cpp?rev=113291&r1=113290&r2=113291&view=diff ============================================================================== --- cfe/trunk/test/Index/load-stmts.cpp (original) +++ cfe/trunk/test/Index/load-stmts.cpp Tue Sep 7 16:49:58 2010 @@ -70,6 +70,16 @@ y.g(t); } +struct Pair { + Pair(int, int); +}; + +void *operator new(__SIZE_TYPE__, void*) throw(); + +void test_more_exprs(void *mem, int i, int j) { + new (mem) Pair(i, j); +} + // RUN: c-index-test -test-load-source all %s | FileCheck %s // CHECK: load-stmts.cpp:1:13: TypedefDecl=T:1:13 (Definition) Extent=[1:13 - 1:14] // CHECK: load-stmts.cpp:2:8: StructDecl=X:2:8 (Definition) Extent=[2:1 - 2:23] @@ -160,3 +170,8 @@ // CHECK: load-stmts.cpp:70:3: DeclRefExpr=y:67:39 Extent=[70:3 - 70:4] // CHECK: load-stmts.cpp:70:7: TypeRef=type:69:13 Extent=[70:7 - 70:11] // CHECK: load-stmts.cpp:70:13: DeclRefExpr=t:67:34 Extent=[70:13 - 70:14] +// CHECK: load-stmts.cpp:79:6: FunctionDecl=test_more_exprs:79:6 (Definition) +// CHECK: load-stmts.cpp:80:8: DeclRefExpr=mem:79:28 Extent=[80:8 - 80:11] +// CHECK: load-stmts.cpp:80:13: TypeRef=struct Pair:73:8 Extent=[80:13 - 80:17] +// CHECK: load-stmts.cpp:80:18: DeclRefExpr=i:79:37 Extent=[80:18 - 80:19] +// CHECK: load-stmts.cpp:80:21: DeclRefExpr=j:79:44 Extent=[80:21 - 80:22] Modified: cfe/trunk/tools/libclang/CIndex.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=113291&r1=113290&r2=113291&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CIndex.cpp (original) +++ cfe/trunk/tools/libclang/CIndex.cpp Tue Sep 7 16:49:58 2010 @@ -388,7 +388,7 @@ bool VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) { return false; } // FIXME: CXXTemporaryObjectExpr has poor source-location information. // FIXME: CXXScalarValueInitExpr has poor source-location information. - // FIXME: CXXNewExpr has poor source-location information + bool VisitCXXNewExpr(CXXNewExpr *E); bool VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E); // FIXME: UnaryTypeTraitExpr has poor source-location information. bool VisitOverloadExpr(OverloadExpr *E); @@ -1590,6 +1590,29 @@ return VisitExpr(E); } +bool CursorVisitor::VisitCXXNewExpr(CXXNewExpr *E) { + // Visit placement arguments. + for (unsigned I = 0, N = E->getNumPlacementArgs(); I != N; ++I) + if (Visit(MakeCXCursor(E->getPlacementArg(I), StmtParent, TU))) + return true; + + // Visit the allocated type. + if (TypeSourceInfo *TSInfo = E->getAllocatedTypeSourceInfo()) + if (Visit(TSInfo->getTypeLoc())) + return true; + + // Visit the array size, if any. + if (E->isArray() && Visit(MakeCXCursor(E->getArraySize(), StmtParent, TU))) + return true; + + // Visit the initializer or constructor arguments. + for (unsigned I = 0, N = E->getNumConstructorArgs(); I != N; ++I) + if (Visit(MakeCXCursor(E->getConstructorArg(I), StmtParent, TU))) + return true; + + return false; +} + bool CursorVisitor::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) { // Visit base expression. if (Visit(MakeCXCursor(E->getBase(), StmtParent, TU))) From hhinnant at apple.com Tue Sep 7 17:09:07 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Tue, 07 Sep 2010 22:09:07 -0000 Subject: [cfe-commits] [libcxx] r113294 - in /libcxx/trunk: include/type_traits test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp Message-ID: <20100907220907.397172A6C12D@llvm.org> Author: hhinnant Date: Tue Sep 7 17:09:07 2010 New Revision: 113294 URL: http://llvm.org/viewvc/llvm-project?rev=113294&view=rev Log: has_nothrow_copy_constructor hooked up to clang. Filed http://llvm.org/bugs/show_bug.cgi?id=8107 to take care of several types which don't work yet. If there is some reason we don't want to handle these types in the compiler, I can handle most of them in the library. Modified: libcxx/trunk/include/type_traits libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp Modified: libcxx/trunk/include/type_traits URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=113294&r1=113293&r2=113294&view=diff ============================================================================== --- libcxx/trunk/include/type_traits (original) +++ libcxx/trunk/include/type_traits Tue Sep 7 17:09:07 2010 @@ -744,7 +744,18 @@ // has_nothrow_copy_constructor -template struct has_nothrow_copy_constructor : public has_trivial_copy_constructor<_Tp> {}; +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + +template struct has_nothrow_copy_constructor + : public integral_constant {}; + +#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + +template struct has_nothrow_copy_constructor + : public has_trivial_copy_constructor<_Tp> {}; + +#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + // has_nothrow_move_constructor Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp?rev=113294&r1=113293&r2=113294&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp Tue Sep 7 17:09:07 2010 @@ -37,6 +37,7 @@ class NotEmpty { +public: virtual ~NotEmpty(); }; @@ -49,6 +50,7 @@ class Abstract { +public: virtual ~Abstract() = 0; }; @@ -59,19 +61,19 @@ int main() { - test_has_not_nothrow_copy_constructor(); +// test_has_not_nothrow_copy_constructor(); test_has_not_nothrow_copy_constructor(); - test_has_not_nothrow_copy_constructor(); + test_has_not_nothrow_copy_constructor(); +// test_has_not_nothrow_copy_constructor(); +// test_has_not_nothrow_copy_constructor(); + test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); - test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); - test_has_nothrow_copy_constructor(); - test_has_nothrow_copy_constructor(); - test_has_nothrow_copy_constructor(); +// test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); } From ggreif at gmail.com Tue Sep 7 17:17:13 2010 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 07 Sep 2010 22:17:13 -0000 Subject: [cfe-commits] r113295 - /cfe/trunk/include/clang/AST/TypeLoc.h Message-ID: <20100907221713.281492A6C12C@llvm.org> Author: ggreif Date: Tue Sep 7 17:17:12 2010 New Revision: 113295 URL: http://llvm.org/viewvc/llvm-project?rev=113295&view=rev Log: typo Modified: cfe/trunk/include/clang/AST/TypeLoc.h Modified: cfe/trunk/include/clang/AST/TypeLoc.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=113295&r1=113294&r2=113295&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/TypeLoc.h (original) +++ cfe/trunk/include/clang/AST/TypeLoc.h Tue Sep 7 17:17:12 2010 @@ -146,7 +146,7 @@ } /// \brief Wrapper of type source information for a type with -/// no direct quqlaifiers. +/// no direct qualifiers. class UnqualTypeLoc : public TypeLoc { public: UnqualTypeLoc() {} From kremenek at apple.com Tue Sep 7 17:21:59 2010 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 07 Sep 2010 22:21:59 -0000 Subject: [cfe-commits] r113296 - /cfe/trunk/lib/AST/DeclPrinter.cpp Message-ID: <20100907222159.E60192A6C12C@llvm.org> Author: kremenek Date: Tue Sep 7 17:21:59 2010 New Revision: 113296 URL: http://llvm.org/viewvc/llvm-project?rev=113296&view=rev Log: Fix DeclPrinter to not include '=' in printing when no initializer is provided for a VarDecl. Patch by Jim Goodnow II! Modified: cfe/trunk/lib/AST/DeclPrinter.cpp Modified: cfe/trunk/lib/AST/DeclPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=113296&r1=113295&r2=113296&view=diff ============================================================================== --- cfe/trunk/lib/AST/DeclPrinter.cpp (original) +++ cfe/trunk/lib/AST/DeclPrinter.cpp Tue Sep 7 17:21:59 2010 @@ -518,12 +518,12 @@ T = Parm->getOriginalType(); T.getAsStringInternal(Name, Policy); Out << Name; - if (D->getInit()) { + if (Expr *Init = D->getInit()) { if (D->hasCXXDirectInitializer()) Out << "("; - else + else if (!dyn_cast(Init)) Out << " = "; - D->getInit()->printPretty(Out, Context, 0, Policy, Indentation); + Init->printPretty(Out, Context, 0, Policy, Indentation); if (D->hasCXXDirectInitializer()) Out << ")"; } From kremenek at apple.com Tue Sep 7 17:23:07 2010 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 7 Sep 2010 15:23:07 -0700 Subject: [cfe-commits] [PATCH][Review Request] - AST Print Problem with Constructor Initializer(version2) In-Reply-To: <201009031834.o83IYFpw005006@relay07.cites.uiuc.edu> References: <201009031834.o83IYFpw005006@relay07.cites.uiuc.edu> Message-ID: Hi Jim, This looks good to me. I have one nit below. On Sep 3, 2010, at 11:34 AM, Jim Goodnow II wrote: > Didn't quite get it right the first time, but there is still a problem with arguments not being printed. Will look into it. > > - jim > > Index: lib/AST/DeclPrinter.cpp > =================================================================== > --- lib/AST/DeclPrinter.cpp (revision 112954) > +++ lib/AST/DeclPrinter.cpp (working copy) > @@ -518,12 +518,13 @@ > T = Parm->getOriginalType(); > T.getAsStringInternal(Name, Policy); > Out << Name; > - if (D->getInit()) { > + Expr *Init = D->getInit(); > + if (Init) { Since 'Init' is only used within the body of the conditional, I typically prefer: if (Expr *Init = D->getInit()) instead of: Expr *Init = D->getInit(); if (Init) { The former restricts the scope of the 'Init' to where it is intended, making it impossible to use afterwards. > if (D->hasCXXDirectInitializer()) > Out << "("; > - else > + else if (!dyn_cast(Init)) > Out << " = "; > - D->getInit()->printPretty(Out, Context, 0, Policy, Indentation); > + Init->printPretty(Out, Context, 0, Policy, Indentation); > if (D->hasCXXDirectInitializer()) > Out << ")"; > }_______________________________________________ I've gone ahead and applied this patch (with my suggested change) in r113296. Cheers, Ted From daniel at zuster.org Tue Sep 7 17:54:28 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 07 Sep 2010 22:54:28 -0000 Subject: [cfe-commits] r113301 - in /cfe/trunk/test: Analysis/complex.c Lexer/digraph.c Misc/predefines.c Preprocessor/objc-pp.m Sema/const-ptr-int-ptr-cast.c Sema/init.c SemaCXX/nullptr.cpp SemaCXX/reinterpret-cast.cpp Message-ID: <20100907225428.EDE412A6C12C@llvm.org> Author: ddunbar Date: Tue Sep 7 17:54:28 2010 New Revision: 113301 URL: http://llvm.org/viewvc/llvm-project?rev=113301&view=rev Log: tests: Use -ffreestanding when including stdint.h, to avoid platform dependencies. Modified: cfe/trunk/test/Analysis/complex.c cfe/trunk/test/Lexer/digraph.c cfe/trunk/test/Misc/predefines.c cfe/trunk/test/Preprocessor/objc-pp.m cfe/trunk/test/Sema/const-ptr-int-ptr-cast.c cfe/trunk/test/Sema/init.c cfe/trunk/test/SemaCXX/nullptr.cpp cfe/trunk/test/SemaCXX/reinterpret-cast.cpp Modified: cfe/trunk/test/Analysis/complex.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/complex.c?rev=113301&r1=113300&r2=113301&view=diff ============================================================================== --- cfe/trunk/test/Analysis/complex.c (original) +++ cfe/trunk/test/Analysis/complex.c Tue Sep 7 17:54:28 2010 @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=basic -analyzer-constraints=basic -verify -Wno-unreachable-code %s -// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=basic -analyzer-constraints=range -verify -Wno-unreachable-code %s -// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=region -analyzer-constraints=basic -verify -Wno-unreachable-code %s -// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=region -analyzer-constraints=range -verify -Wno-unreachable-code %s +// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=basic -analyzer-constraints=basic -verify -Wno-unreachable-code -ffreestanding %s +// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=basic -analyzer-constraints=range -verify -Wno-unreachable-code -ffreestanding %s +// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=region -analyzer-constraints=basic -verify -Wno-unreachable-code -ffreestanding %s +// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=region -analyzer-constraints=range -verify -Wno-unreachable-code -ffreestanding %s #include Modified: cfe/trunk/test/Lexer/digraph.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/digraph.c?rev=113301&r1=113300&r2=113301&view=diff ============================================================================== --- cfe/trunk/test/Lexer/digraph.c (original) +++ cfe/trunk/test/Lexer/digraph.c Tue Sep 7 17:54:28 2010 @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify < %s +// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding %s %:include Modified: cfe/trunk/test/Misc/predefines.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/predefines.c?rev=113301&r1=113300&r2=113301&view=diff ============================================================================== --- cfe/trunk/test/Misc/predefines.c (original) +++ cfe/trunk/test/Misc/predefines.c Tue Sep 7 17:54:28 2010 @@ -1,4 +1,4 @@ -/* RUN: %clang_cc1 -fsyntax-only -verify -std=c89 -pedantic-errors %s +/* RUN: %clang_cc1 -fsyntax-only -verify -std=c89 -ffreestanding -pedantic-errors %s * rdar://6814950 */ #include Modified: cfe/trunk/test/Preprocessor/objc-pp.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/objc-pp.m?rev=113301&r1=113300&r2=113301&view=diff ============================================================================== --- cfe/trunk/test/Preprocessor/objc-pp.m (original) +++ cfe/trunk/test/Preprocessor/objc-pp.m Tue Sep 7 17:54:28 2010 @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic +// RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic -ffreestanding #import // no warning on #import in objc mode. Modified: cfe/trunk/test/Sema/const-ptr-int-ptr-cast.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/const-ptr-int-ptr-cast.c?rev=113301&r1=113300&r2=113301&view=diff ============================================================================== --- cfe/trunk/test/Sema/const-ptr-int-ptr-cast.c (original) +++ cfe/trunk/test/Sema/const-ptr-int-ptr-cast.c Tue Sep 7 17:54:28 2010 @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding %s #include Modified: cfe/trunk/test/Sema/init.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/init.c?rev=113301&r1=113300&r2=113301&view=diff ============================================================================== --- cfe/trunk/test/Sema/init.c (original) +++ cfe/trunk/test/Sema/init.c Tue Sep 7 17:54:28 2010 @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -verify -fsyntax-only +// RUN: %clang_cc1 %s -verify -fsyntax-only -ffreestanding #include #include Modified: cfe/trunk/test/SemaCXX/nullptr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/nullptr.cpp?rev=113301&r1=113300&r2=113301&view=diff ============================================================================== --- cfe/trunk/test/SemaCXX/nullptr.cpp (original) +++ cfe/trunk/test/SemaCXX/nullptr.cpp Tue Sep 7 17:54:28 2010 @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x -ffreestanding %s #include // Don't have decltype yet. Modified: cfe/trunk/test/SemaCXX/reinterpret-cast.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/reinterpret-cast.cpp?rev=113301&r1=113300&r2=113301&view=diff ============================================================================== --- cfe/trunk/test/SemaCXX/reinterpret-cast.cpp (original) +++ cfe/trunk/test/SemaCXX/reinterpret-cast.cpp Tue Sep 7 17:54:28 2010 @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding %s #include From hhinnant at apple.com Tue Sep 7 18:11:28 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Tue, 07 Sep 2010 23:11:28 -0000 Subject: [cfe-commits] [libcxx] r113304 - in /libcxx/trunk: include/type_traits test/utilities/meta/meta.unary/meta.unary.prop/has_copy_constructor.pass.cpp test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp Message-ID: <20100907231128.A122C2A6C12C@llvm.org> Author: hhinnant Date: Tue Sep 7 18:11:28 2010 New Revision: 113304 URL: http://llvm.org/viewvc/llvm-project?rev=113304&view=rev Log: Made a stab at has_copy_constructor. Got it mostly working for g++-4.0, but only works for scalar types on clang. Ultimately this needs a compiler-supported is_constructible which clang is missing, and won't be able to use until it gets variadic templates. Modified: libcxx/trunk/include/type_traits libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_constructor.pass.cpp libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp Modified: libcxx/trunk/include/type_traits URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=113304&r1=113303&r2=113304&view=diff ============================================================================== --- libcxx/trunk/include/type_traits (original) +++ libcxx/trunk/include/type_traits Tue Sep 7 18:11:28 2010 @@ -761,10 +761,6 @@ template struct has_nothrow_move_constructor : public has_nothrow_copy_constructor<_Tp> {}; -// has_copy_constructor - -template struct has_copy_constructor : public true_type {}; - // has_copy_assign template struct has_copy_assign; @@ -1732,6 +1728,24 @@ #endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE +// has_copy_constructor + +#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE + +template +struct has_copy_constructor + : public is_constructible<_Tp, typename add_lvalue_reference::type> + {}; + +#else // _LIBCPP_HAS_NO_ADVANCED_SFINAE + +template +struct has_copy_constructor + : public has_nothrow_copy_constructor<_Tp> + {}; + +#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE + template struct __is_zero_default_constructible : public integral_constant::value || is_empty<_Tp>::value> {}; Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_constructor.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_constructor.pass.cpp?rev=113304&r1=113303&r2=113304&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_constructor.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_constructor.pass.cpp Tue Sep 7 18:11:28 2010 @@ -13,7 +13,55 @@ #include +template +void test_has_copy_constructor() +{ + static_assert(std::has_copy_constructor::value == Result, ""); +} + +class Empty +{ +}; + +class NotEmpty +{ +public: + virtual ~NotEmpty(); +}; + +union Union {}; + +struct bit_zero +{ + int : 0; +}; + +class Abstract +{ +public: + virtual ~Abstract() = 0; +}; + +struct A +{ + A(const A&); +}; + int main() { -#error has_copy_constructor not implemented + test_has_copy_constructor(); + test_has_copy_constructor(); + test_has_copy_constructor(); + test_has_copy_constructor(); + + test_has_copy_constructor(); + test_has_copy_constructor(); + test_has_copy_constructor(); + test_has_copy_constructor(); + test_has_copy_constructor(); + test_has_copy_constructor(); + test_has_copy_constructor(); + test_has_copy_constructor(); + test_has_copy_constructor(); + test_has_copy_constructor(); } Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp?rev=113304&r1=113303&r2=113304&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_constructor.pass.cpp Tue Sep 7 18:11:28 2010 @@ -61,11 +61,11 @@ int main() { -// test_has_not_nothrow_copy_constructor(); + test_has_not_nothrow_copy_constructor(); test_has_not_nothrow_copy_constructor(); test_has_not_nothrow_copy_constructor(); -// test_has_not_nothrow_copy_constructor(); -// test_has_not_nothrow_copy_constructor(); + test_has_not_nothrow_copy_constructor(); + test_has_not_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); @@ -74,6 +74,6 @@ test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); -// test_has_nothrow_copy_constructor(); + test_has_nothrow_copy_constructor(); test_has_nothrow_copy_constructor(); } From fjahanian at apple.com Tue Sep 7 18:26:17 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Tue, 07 Sep 2010 23:26:17 -0000 Subject: [cfe-commits] r113307 - in /cfe/trunk: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp test/CodeGenObjC/local-static-block.m Message-ID: <20100907232617.9FFCF2A6C12C@llvm.org> Author: fjahanian Date: Tue Sep 7 18:26:17 2010 New Revision: 113307 URL: http://llvm.org/viewvc/llvm-project?rev=113307&view=rev Log: Local static block variable referecned in its block-literal initializer expression causes IRgen to crash. This patch fixes by saving it in StaticLocalDecl map already used for such purposes. (radar 8390455). Added: cfe/trunk/test/CodeGenObjC/local-static-block.m Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp cfe/trunk/lib/CodeGen/CGExpr.cpp Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=113307&r1=113306&r2=113307&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGDecl.cpp (original) +++ cfe/trunk/lib/CodeGen/CGDecl.cpp Tue Sep 7 18:26:17 2010 @@ -244,6 +244,10 @@ // Make sure to evaluate VLA bounds now so that we have them for later. if (D.getType()->isVariablyModifiedType()) EmitVLASize(D.getType()); + + // Local static block variables must be treated as globals as they may be + // referenced in their RHS initializer block-literal expresion. + CGM.setStaticLocalDeclAddress(&D, GV); // If this value has an initializer, emit it. if (D.getInit()) @@ -266,9 +270,6 @@ if (D.hasAttr()) CGM.AddUsedGlobal(GV); - if (getContext().getLangOptions().CPlusPlus) - CGM.setStaticLocalDeclAddress(&D, GV); - // We may have to cast the constant because of the initializer // mismatch above. // Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=113307&r1=113306&r2=113307&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGExpr.cpp (original) +++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue Sep 7 18:26:17 2010 @@ -1152,8 +1152,7 @@ bool NonGCable = VD->hasLocalStorage() && !VD->hasAttr(); llvm::Value *V = LocalDeclMap[VD]; - if (!V && getContext().getLangOptions().CPlusPlus && - VD->isStaticLocal()) + if (!V && VD->isStaticLocal()) V = CGM.getStaticLocalDeclAddress(VD); assert(V && "DeclRefExpr not entered in LocalDeclMap?"); Added: cfe/trunk/test/CodeGenObjC/local-static-block.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/local-static-block.m?rev=113307&view=auto ============================================================================== --- cfe/trunk/test/CodeGenObjC/local-static-block.m (added) +++ cfe/trunk/test/CodeGenObjC/local-static-block.m Tue Sep 7 18:26:17 2010 @@ -0,0 +1,57 @@ +// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -emit-llvm %s -o %t-64.ll +// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.ll %s +// rdar: // 8390455 + + at class NSArray; + +static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) { + + for(id rawAddress in addresses) + { + NSArray *separatedAddresses = ((NSArray*)0); + separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1); + } + return (NSArray *)0; +}; + +void FUNC() +{ + static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) { + + for(id rawAddress in addresses) + { + NSArray *separatedAddresses = ((NSArray*)0); + separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1); + } + return (NSArray *)0; + }; + + if (ArrayRecurs) { + static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) { + + for(id rawAddress in addresses) + { + NSArray *separatedAddresses = ((NSArray*)0); + separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1); + } + return (NSArray *)0; + }; + } +} + +void FUNC1() +{ + static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) { + + for(id rawAddress in addresses) + { + NSArray *separatedAddresses = ((NSArray*)0); + separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1); + } + return (NSArray *)0; + }; +} +// CHECK-LP64: @ArrayRecurs = internal global +// CHECK-LP64: @FUNC.ArrayRecurs = internal global +// CHECK-LP64: @FUNC.ArrayRecurs3 = internal global +// CHECK-LP64: @FUNC1.ArrayRecurs = internal global From daniel at zuster.org Tue Sep 7 18:29:53 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 7 Sep 2010 16:29:53 -0700 Subject: [cfe-commits] [PATCH][MS] - Fix 6 lit tests on windows In-Reply-To: References: Message-ID: Hi Francois, I didn't see this email, but I just applied a different fix which uses -ffreestanding instead, which avoids introducing a platform specific dependency. This resolved all the test failures on VS10, at least for me. - Daniel On Sat, Sep 4, 2010 at 1:06 PM, Francois Pichet wrote: > Hi, > > This patch fixes 6 failing lit tests on Windows. Someone me if this is > the right approach? > The problem is that %clang_cc1 is called instead of %clang even though > the tests depend on -fms-extensions to be there to pass on Windows. > -fms-extension must be there because the tests include some header > files containing microsoft extensions. > > > I'll look at the remaining tests failing on windows later: > Failing Tests (10): > ? ?Clang :: Driver/darwin-ld.c > ? ?Clang :: Index/complete-exprs.c > ? ?Clang :: Index/complete-hiding.c > ? ?Clang :: Index/complete-macros.c > ? ?Clang :: Index/complete-natural.m > ? ?Clang :: Index/complete-preprocessor.m > ? ?Clang :: Index/preamble-reparse.c > ? ?Clang :: Index/preamble.c > ? ?Clang :: SemaCXX/nullptr.cpp > ? ?Clang :: SemaCXX/reinterpret-cast.cpp > > _______________________________________________ > cfe-commits mailing list > cfe-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > > From hhinnant at apple.com Tue Sep 7 18:38:59 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Tue, 07 Sep 2010 23:38:59 -0000 Subject: [cfe-commits] [libcxx] r113312 - in /libcxx/trunk: include/type_traits test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp Message-ID: <20100907233859.AF6562A6C12C@llvm.org> Author: hhinnant Date: Tue Sep 7 18:38:59 2010 New Revision: 113312 URL: http://llvm.org/viewvc/llvm-project?rev=113312&view=rev Log: has_trivial_copy_assign hooked up to clang (without workarounds). Filed http://llvm.org/bugs/show_bug.cgi?id=8109 to take care of several types which don't work yet. If there is some reason we don't want to handle these types in the compiler, I can handle most of them in the library. Modified: libcxx/trunk/include/type_traits libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp Modified: libcxx/trunk/include/type_traits URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=113312&r1=113311&r2=113312&view=diff ============================================================================== --- libcxx/trunk/include/type_traits (original) +++ libcxx/trunk/include/type_traits Tue Sep 7 18:38:59 2010 @@ -769,20 +769,14 @@ #if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) -template ::value> -struct __has_trivial_copy_assign - : public integral_constant {}; - -template struct __has_trivial_copy_assign<_Tp, true> - : public false_type {}; - template struct has_trivial_copy_assign - : __has_trivial_copy_assign<_Tp> {}; + : public integral_constant {}; #else template struct has_trivial_copy_assign - : public integral_constant::value && !is_const<_Tp>::value> {}; + : public integral_constant::value && + !is_const<_Tp>::value> {}; #endif // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp?rev=113312&r1=113311&r2=113312&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_trivial_copy_assign.pass.cpp Tue Sep 7 18:38:59 2010 @@ -13,22 +13,10 @@ #include -template +template void test_has_trivial_assign() { - static_assert( std::has_trivial_copy_assign::value, ""); - static_assert(!std::has_trivial_copy_assign::value, ""); - static_assert( std::has_trivial_copy_assign::value, ""); - static_assert(!std::has_trivial_copy_assign::value, ""); -} - -template -void test_has_not_trivial_assign() -{ - static_assert(!std::has_trivial_copy_assign::value, ""); - static_assert(!std::has_trivial_copy_assign::value, ""); - static_assert(!std::has_trivial_copy_assign::value, ""); - static_assert(!std::has_trivial_copy_assign::value, ""); + static_assert(std::has_trivial_copy_assign::value == Result, ""); } class Empty @@ -59,19 +47,20 @@ int main() { - test_has_not_trivial_assign(); - test_has_not_trivial_assign(); - test_has_not_trivial_assign(); - test_has_not_trivial_assign(); - test_has_not_trivial_assign(); - - test_has_trivial_assign(); - test_has_trivial_assign(); - test_has_trivial_assign(); - test_has_trivial_assign(); - test_has_trivial_assign(); - test_has_trivial_assign(); - test_has_trivial_assign(); - test_has_trivial_assign(); - test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); + + test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); + test_has_trivial_assign(); } From pichet2000 at gmail.com Tue Sep 7 18:52:28 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Tue, 7 Sep 2010 19:52:28 -0400 Subject: [cfe-commits] [PATCH][MS] - Fix 6 lit tests on windows In-Reply-To: References: Message-ID: On Tue, Sep 7, 2010 at 7:29 PM, Daniel Dunbar wrote: > Hi Francois, > > I didn't see this email, but I just applied a different fix which uses > -ffreestanding instead, which avoids introducing a platform specific > dependency. This resolved all the test failures on VS10, at least for > me. Great this fix 8 tests. I am still getting some tests failing using VS 2008 and Windows 7 x64 + about 4 popups with c-index-test.exe crashing. Failing Tests (8): Clang :: Driver/darwin-ld.c Clang :: Index/complete-exprs.c Clang :: Index/complete-hiding.c Clang :: Index/complete-macros.c Clang :: Index/complete-natural.m Clang :: Index/complete-preprocessor.m Clang :: Index/preamble-reparse.c Clang :: Index/preamble.c Expected Passes : 2489 Expected Failures : 27 Unsupported Tests : 3 Unexpected Failures: 8 From dgregor at apple.com Tue Sep 7 18:57:26 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 7 Sep 2010 16:57:26 -0700 Subject: [cfe-commits] [PATCH][MS] - Fix 6 lit tests on windows In-Reply-To: References: Message-ID: <4BEA1589-EC2B-4260-BD19-84E1C02B1EAB@apple.com> On Sep 7, 2010, at 4:52 PM, Francois Pichet wrote: > On Tue, Sep 7, 2010 at 7:29 PM, Daniel Dunbar wrote: >> Hi Francois, >> >> I didn't see this email, but I just applied a different fix which uses >> -ffreestanding instead, which avoids introducing a platform specific >> dependency. This resolved all the test failures on VS10, at least for >> me. > > Great this fix 8 tests. > I am still getting some tests failing using VS 2008 and Windows 7 x64 > + about 4 popups with c-index-test.exe crashing. > > Failing Tests (8): > Clang :: Driver/darwin-ld.c > Clang :: Index/complete-exprs.c > Clang :: Index/complete-hiding.c > Clang :: Index/complete-macros.c > Clang :: Index/complete-natural.m > Clang :: Index/complete-preprocessor.m > Clang :: Index/preamble-reparse.c > Clang :: Index/preamble.c The code-completion failures seem to be due to a bogus partial ordering in the clang::operator< in lib/Sema/CodeCompleteConsumer.cpp, but (from inspection) I don't see any problems there. Very annoying! - Doug From dgregor at apple.com Tue Sep 7 19:15:04 2010 From: dgregor at apple.com (Douglas Gregor) Date: Wed, 08 Sep 2010 00:15:04 -0000 Subject: [cfe-commits] r113319 - in /cfe/trunk: include/clang/AST/ExprCXX.h include/clang/AST/RecursiveASTVisitor.h include/clang/Sema/Initialization.h include/clang/Sema/Sema.h lib/AST/ExprCXX.cpp lib/AST/StmtPrinter.cpp lib/Parse/ParseExprCXX.cpp lib/Sema/SemaExprCXX.cpp lib/Sema/SemaInit.cpp lib/Sema/TreeTransform.h lib/Serialization/ASTReaderStmt.cpp lib/Serialization/ASTWriterStmt.cpp test/Index/load-stmts.cpp tools/libclang/CIndex.cpp Message-ID: <20100908001504.B176F2A6C12C@llvm.org> Author: dgregor Date: Tue Sep 7 19:15:04 2010 New Revision: 113319 URL: http://llvm.org/viewvc/llvm-project?rev=113319&view=rev Log: Provide proper type-source location information for CXXTemporaryObjectExpr, CXXScalarValueInitExpr, and CXXUnresolvedConstructExpr, getting rid of a bunch of FIXMEs in the process. Modified: cfe/trunk/include/clang/AST/ExprCXX.h cfe/trunk/include/clang/AST/RecursiveASTVisitor.h cfe/trunk/include/clang/Sema/Initialization.h cfe/trunk/include/clang/Sema/Sema.h cfe/trunk/lib/AST/ExprCXX.cpp cfe/trunk/lib/AST/StmtPrinter.cpp cfe/trunk/lib/Parse/ParseExprCXX.cpp cfe/trunk/lib/Sema/SemaExprCXX.cpp cfe/trunk/lib/Sema/SemaInit.cpp cfe/trunk/lib/Sema/TreeTransform.h cfe/trunk/lib/Serialization/ASTReaderStmt.cpp cfe/trunk/lib/Serialization/ASTWriterStmt.cpp cfe/trunk/test/Index/load-stmts.cpp cfe/trunk/tools/libclang/CIndex.cpp Modified: cfe/trunk/include/clang/AST/ExprCXX.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/ExprCXX.h (original) +++ cfe/trunk/include/clang/AST/ExprCXX.h Tue Sep 7 19:15:04 2010 @@ -804,24 +804,23 @@ /// }; /// @endcode class CXXTemporaryObjectExpr : public CXXConstructExpr { - SourceLocation TyBeginLoc; SourceLocation RParenLoc; + TypeSourceInfo *Type; public: CXXTemporaryObjectExpr(ASTContext &C, CXXConstructorDecl *Cons, - QualType writtenTy, SourceLocation tyBeginLoc, + TypeSourceInfo *Type, Expr **Args,unsigned NumArgs, SourceLocation rParenLoc, bool ZeroInitialization = false); explicit CXXTemporaryObjectExpr(EmptyShell Empty) - : CXXConstructExpr(CXXTemporaryObjectExprClass, Empty) { } + : CXXConstructExpr(CXXTemporaryObjectExprClass, Empty), Type() { } - SourceLocation getTypeBeginLoc() const { return TyBeginLoc; } + TypeSourceInfo *getTypeSourceInfo() const { return Type; } SourceLocation getRParenLoc() const { return RParenLoc; } - virtual SourceRange getSourceRange() const { - return SourceRange(TyBeginLoc, RParenLoc); - } + virtual SourceRange getSourceRange() const; + static bool classof(const Stmt *T) { return T->getStmtClass() == CXXTemporaryObjectExprClass; } @@ -835,32 +834,30 @@ /// T, which is a non-class type. /// class CXXScalarValueInitExpr : public Expr { - SourceLocation TyBeginLoc; SourceLocation RParenLoc; + TypeSourceInfo *TypeInfo; + friend class ASTStmtReader; + public: - CXXScalarValueInitExpr(QualType ty, SourceLocation tyBeginLoc, - SourceLocation rParenLoc ) : - Expr(CXXScalarValueInitExprClass, ty, false, false), - TyBeginLoc(tyBeginLoc), RParenLoc(rParenLoc) {} + /// \brief Create an explicitly-written scalar-value initialization + /// expression. + CXXScalarValueInitExpr(QualType Type, + TypeSourceInfo *TypeInfo, + SourceLocation rParenLoc ) : + Expr(CXXScalarValueInitExprClass, Type, false, false), + RParenLoc(rParenLoc), TypeInfo(TypeInfo) {} + explicit CXXScalarValueInitExpr(EmptyShell Shell) : Expr(CXXScalarValueInitExprClass, Shell) { } - SourceLocation getTypeBeginLoc() const { return TyBeginLoc; } - SourceLocation getRParenLoc() const { return RParenLoc; } - - void setTypeBeginLoc(SourceLocation L) { TyBeginLoc = L; } - void setRParenLoc(SourceLocation L) { RParenLoc = L; } - - /// @brief Whether this initialization expression was - /// implicitly-generated. - bool isImplicit() const { - return TyBeginLoc.isInvalid() && RParenLoc.isInvalid(); + TypeSourceInfo *getTypeSourceInfo() const { + return TypeInfo; } + + SourceLocation getRParenLoc() const { return RParenLoc; } - virtual SourceRange getSourceRange() const { - return SourceRange(TyBeginLoc, RParenLoc); - } + virtual SourceRange getSourceRange() const; static bool classof(const Stmt *T) { return T->getStmtClass() == CXXScalarValueInitExprClass; @@ -1838,12 +1835,9 @@ /// constructor call, conversion function call, or some kind of type /// conversion. class CXXUnresolvedConstructExpr : public Expr { - /// \brief The starting location of the type - SourceLocation TyBeginLoc; - /// \brief The type being constructed. - QualType Type; - + TypeSourceInfo *Type; + /// \brief The location of the left parentheses ('('). SourceLocation LParenLoc; @@ -1853,20 +1847,20 @@ /// \brief The number of arguments used to construct the type. unsigned NumArgs; - CXXUnresolvedConstructExpr(SourceLocation TyBegin, - QualType T, + CXXUnresolvedConstructExpr(TypeSourceInfo *Type, SourceLocation LParenLoc, Expr **Args, unsigned NumArgs, SourceLocation RParenLoc); CXXUnresolvedConstructExpr(EmptyShell Empty, unsigned NumArgs) - : Expr(CXXUnresolvedConstructExprClass, Empty), NumArgs(NumArgs) { } + : Expr(CXXUnresolvedConstructExprClass, Empty), Type(), NumArgs(NumArgs) { } + friend class ASTStmtReader; + public: static CXXUnresolvedConstructExpr *Create(ASTContext &C, - SourceLocation TyBegin, - QualType T, + TypeSourceInfo *Type, SourceLocation LParenLoc, Expr **Args, unsigned NumArgs, @@ -1875,15 +1869,14 @@ static CXXUnresolvedConstructExpr *CreateEmpty(ASTContext &C, unsigned NumArgs); - /// \brief Retrieve the source location where the type begins. - SourceLocation getTypeBeginLoc() const { return TyBeginLoc; } - void setTypeBeginLoc(SourceLocation L) { TyBeginLoc = L; } - /// \brief Retrieve the type that is being constructed, as specified /// in the source code. - QualType getTypeAsWritten() const { return Type; } - void setTypeAsWritten(QualType T) { Type = T; } + QualType getTypeAsWritten() const { return Type->getType(); } + /// \brief Retrieve the type source information for the type being + /// constructed. + TypeSourceInfo *getTypeSourceInfo() const { return Type; } + /// \brief Retrieve the location of the left parentheses ('(') that /// precedes the argument list. SourceLocation getLParenLoc() const { return LParenLoc; } @@ -1924,9 +1917,8 @@ *(arg_begin() + I) = E; } - virtual SourceRange getSourceRange() const { - return SourceRange(TyBeginLoc, RParenLoc); - } + virtual SourceRange getSourceRange() const; + static bool classof(const Stmt *T) { return T->getStmtClass() == CXXUnresolvedConstructExprClass; } Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original) +++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Tue Sep 7 19:15:04 2010 @@ -1739,8 +1739,7 @@ DEF_TRAVERSE_STMT(CXXScalarValueInitExpr, { // This is called for code like 'return T()' where T is a built-in // (i.e. non-class) type. - if (!S->isImplicit()) - TRY_TO(TraverseType(S->getType())); + TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc())); }) DEF_TRAVERSE_STMT(CXXNewExpr, { Modified: cfe/trunk/include/clang/Sema/Initialization.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Initialization.h?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/include/clang/Sema/Initialization.h (original) +++ cfe/trunk/include/clang/Sema/Initialization.h Tue Sep 7 19:15:04 2010 @@ -88,6 +88,10 @@ /// the VarDecl, ParmVarDecl, or FieldDecl, respectively. DeclaratorDecl *VariableOrMember; + /// \brief When Kind == EK_Temporary, the type source information for + /// the temporary. + TypeSourceInfo *TypeInfo; + struct { /// \brief When Kind == EK_Result, EK_Exception, or EK_New, the /// location of the 'return', 'throw', or 'new' keyword, @@ -189,7 +193,15 @@ static InitializedEntity InitializeTemporary(QualType Type) { return InitializedEntity(EK_Temporary, SourceLocation(), Type); } - + + /// \brief Create the initialization entity for a temporary. + static InitializedEntity InitializeTemporary(TypeSourceInfo *TypeInfo) { + InitializedEntity Result(EK_Temporary, SourceLocation(), + TypeInfo->getType()); + Result.TypeInfo = TypeInfo; + return Result; + } + /// \brief Create the initialization entity for a base class subobject. static InitializedEntity InitializeBase(ASTContext &Context, CXXBaseSpecifier *Base, @@ -219,6 +231,15 @@ /// \brief Retrieve type being initialized. QualType getType() const { return Type; } + /// \brief Retrieve complete type-source information for the object being + /// constructed, if known. + TypeSourceInfo *getTypeSourceInfo() const { + if (Kind == EK_Temporary) + return TypeInfo; + + return 0; + } + /// \brief Retrieve the name of the entity being initialized. DeclarationName getName() const; Modified: cfe/trunk/include/clang/Sema/Sema.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/include/clang/Sema/Sema.h (original) +++ cfe/trunk/include/clang/Sema/Sema.h Tue Sep 7 19:15:04 2010 @@ -2173,13 +2173,17 @@ /// Can be interpreted either as function-style casting ("int(x)") /// or class type construction ("ClassType(x,y,z)") /// or creation of a value-initialized type ("int()"). - ExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange, - ParsedType TypeRep, + ExprResult ActOnCXXTypeConstructExpr(ParsedType TypeRep, SourceLocation LParenLoc, MultiExprArg Exprs, SourceLocation *CommaLocs, SourceLocation RParenLoc); + ExprResult BuildCXXTypeConstructExpr(TypeSourceInfo *Type, + SourceLocation LParenLoc, + MultiExprArg Exprs, + SourceLocation RParenLoc); + /// ActOnCXXNew - Parsed a C++ 'new' expression. ExprResult ActOnCXXNew(SourceLocation StartLoc, bool UseGlobal, SourceLocation PlacementLParen, Modified: cfe/trunk/lib/AST/ExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/lib/AST/ExprCXX.cpp (original) +++ cfe/trunk/lib/AST/ExprCXX.cpp Tue Sep 7 19:15:04 2010 @@ -75,6 +75,13 @@ } // CXXScalarValueInitExpr +SourceRange CXXScalarValueInitExpr::getSourceRange() const { + SourceLocation Start = RParenLoc; + if (TypeInfo) + Start = TypeInfo->getTypeLoc().getBeginLoc(); + return SourceRange(Start, RParenLoc); +} + Stmt::child_iterator CXXScalarValueInitExpr::child_begin() { return child_iterator(); } @@ -691,15 +698,20 @@ CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(ASTContext &C, CXXConstructorDecl *Cons, - QualType writtenTy, - SourceLocation tyBeginLoc, + TypeSourceInfo *Type, Expr **Args, unsigned NumArgs, SourceLocation rParenLoc, bool ZeroInitialization) - : CXXConstructExpr(C, CXXTemporaryObjectExprClass, writtenTy, tyBeginLoc, + : CXXConstructExpr(C, CXXTemporaryObjectExprClass, + Type->getType().getNonReferenceType(), + Type->getTypeLoc().getBeginLoc(), Cons, false, Args, NumArgs, ZeroInitialization), - TyBeginLoc(tyBeginLoc), RParenLoc(rParenLoc) { + RParenLoc(rParenLoc), Type(Type) { +} + +SourceRange CXXTemporaryObjectExpr::getSourceRange() const { + return SourceRange(Type->getTypeLoc().getBeginLoc(), RParenLoc); } CXXConstructExpr *CXXConstructExpr::Create(ASTContext &C, QualType T, @@ -791,17 +803,15 @@ return &SubExpr + 1; } -CXXUnresolvedConstructExpr::CXXUnresolvedConstructExpr( - SourceLocation TyBeginLoc, - QualType T, +CXXUnresolvedConstructExpr::CXXUnresolvedConstructExpr(TypeSourceInfo *Type, SourceLocation LParenLoc, Expr **Args, unsigned NumArgs, SourceLocation RParenLoc) - : Expr(CXXUnresolvedConstructExprClass, T.getNonReferenceType(), - T->isDependentType(), true), - TyBeginLoc(TyBeginLoc), - Type(T), + : Expr(CXXUnresolvedConstructExprClass, + Type->getType().getNonReferenceType(), + Type->getType()->isDependentType(), true), + Type(Type), LParenLoc(LParenLoc), RParenLoc(RParenLoc), NumArgs(NumArgs) { @@ -811,15 +821,14 @@ CXXUnresolvedConstructExpr * CXXUnresolvedConstructExpr::Create(ASTContext &C, - SourceLocation TyBegin, - QualType T, + TypeSourceInfo *Type, SourceLocation LParenLoc, Expr **Args, unsigned NumArgs, SourceLocation RParenLoc) { void *Mem = C.Allocate(sizeof(CXXUnresolvedConstructExpr) + sizeof(Expr *) * NumArgs); - return new (Mem) CXXUnresolvedConstructExpr(TyBegin, T, LParenLoc, + return new (Mem) CXXUnresolvedConstructExpr(Type, LParenLoc, Args, NumArgs, RParenLoc); } @@ -831,6 +840,10 @@ return new (Mem) CXXUnresolvedConstructExpr(Empty, NumArgs); } +SourceRange CXXUnresolvedConstructExpr::getSourceRange() const { + return SourceRange(Type->getTypeLoc().getBeginLoc(), RParenLoc); +} + Stmt::child_iterator CXXUnresolvedConstructExpr::child_begin() { return child_iterator(reinterpret_cast(this + 1)); } Modified: cfe/trunk/lib/AST/StmtPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/lib/AST/StmtPrinter.cpp (original) +++ cfe/trunk/lib/AST/StmtPrinter.cpp Tue Sep 7 19:15:04 2010 @@ -18,6 +18,7 @@ #include "clang/AST/PrettyPrinter.h" #include "llvm/Support/Format.h" #include "clang/AST/Expr.h" +#include "clang/AST/ExprCXX.h" using namespace clang; //===----------------------------------------------------------------------===// @@ -1051,7 +1052,10 @@ } void StmtPrinter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *Node) { - OS << Node->getType().getAsString(Policy) << "()"; + if (TypeSourceInfo *TSInfo = Node->getTypeSourceInfo()) + OS << TSInfo->getType().getAsString(Policy) << "()"; + else + OS << Node->getType().getAsString(Policy) << "()"; } void StmtPrinter::VisitCXXNewExpr(CXXNewExpr *E) { Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original) +++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Tue Sep 7 19:15:04 2010 @@ -691,8 +691,7 @@ assert((Exprs.size() == 0 || Exprs.size()-1 == CommaLocs.size())&& "Unexpected number of commas!"); - return Actions.ActOnCXXTypeConstructExpr(DS.getSourceRange(), TypeRep, - LParenLoc, move_arg(Exprs), + return Actions.ActOnCXXTypeConstructExpr(TypeRep, LParenLoc, move_arg(Exprs), CommaLocs.data(), RParenLoc); } Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Tue Sep 7 19:15:04 2010 @@ -481,34 +481,43 @@ return ExprError(Diag(ThisLoc, diag::err_invalid_this_use)); } -/// ActOnCXXTypeConstructExpr - Parse construction of a specified type. -/// Can be interpreted either as function-style casting ("int(x)") -/// or class type construction ("ClassType(x,y,z)") -/// or creation of a value-initialized type ("int()"). ExprResult -Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, ParsedType TypeRep, +Sema::ActOnCXXTypeConstructExpr(ParsedType TypeRep, SourceLocation LParenLoc, MultiExprArg exprs, SourceLocation *CommaLocs, SourceLocation RParenLoc) { if (!TypeRep) return ExprError(); - + TypeSourceInfo *TInfo; QualType Ty = GetTypeFromParser(TypeRep, &TInfo); if (!TInfo) TInfo = Context.getTrivialTypeSourceInfo(Ty, SourceLocation()); + + return BuildCXXTypeConstructExpr(TInfo, LParenLoc, exprs, RParenLoc); +} + +/// ActOnCXXTypeConstructExpr - Parse construction of a specified type. +/// Can be interpreted either as function-style casting ("int(x)") +/// or class type construction ("ClassType(x,y,z)") +/// or creation of a value-initialized type ("int()"). +ExprResult +Sema::BuildCXXTypeConstructExpr(TypeSourceInfo *TInfo, + SourceLocation LParenLoc, + MultiExprArg exprs, + SourceLocation RParenLoc) { + QualType Ty = TInfo->getType(); unsigned NumExprs = exprs.size(); Expr **Exprs = (Expr**)exprs.get(); - SourceLocation TyBeginLoc = TypeRange.getBegin(); + SourceLocation TyBeginLoc = TInfo->getTypeLoc().getBeginLoc(); SourceRange FullRange = SourceRange(TyBeginLoc, RParenLoc); if (Ty->isDependentType() || CallExpr::hasAnyTypeDependentArguments(Exprs, NumExprs)) { exprs.release(); - return Owned(CXXUnresolvedConstructExpr::Create(Context, - TypeRange.getBegin(), Ty, + return Owned(CXXUnresolvedConstructExpr::Create(Context, TInfo, LParenLoc, Exprs, NumExprs, RParenLoc)); @@ -536,29 +545,29 @@ if (NumExprs == 1) { CastKind Kind = CK_Unknown; CXXCastPath BasePath; - if (CheckCastTypes(TypeRange, Ty, Exprs[0], Kind, BasePath, + if (CheckCastTypes(TInfo->getTypeLoc().getSourceRange(), Ty, Exprs[0], + Kind, BasePath, /*FunctionalStyle=*/true)) return ExprError(); exprs.release(); return Owned(CXXFunctionalCastExpr::Create(Context, - Ty.getNonLValueExprType(Context), + Ty.getNonLValueExprType(Context), TInfo, TyBeginLoc, Kind, Exprs[0], &BasePath, RParenLoc)); } if (Ty->isRecordType()) { - InitializedEntity Entity = InitializedEntity::InitializeTemporary(Ty); + InitializedEntity Entity = InitializedEntity::InitializeTemporary(TInfo); InitializationKind Kind - = NumExprs ? InitializationKind::CreateDirect(TypeRange.getBegin(), + = NumExprs ? InitializationKind::CreateDirect(TyBeginLoc, LParenLoc, RParenLoc) - : InitializationKind::CreateValue(TypeRange.getBegin(), + : InitializationKind::CreateValue(TyBeginLoc, LParenLoc, RParenLoc); InitializationSequence InitSeq(*this, Entity, Kind, Exprs, NumExprs); - ExprResult Result = InitSeq.Perform(*this, Entity, Kind, - move(exprs)); + ExprResult Result = InitSeq.Perform(*this, Entity, Kind, move(exprs)); // FIXME: Improve AST representation? return move(Result); @@ -569,18 +578,22 @@ // be a class with a suitably declared constructor. // if (NumExprs > 1) - return ExprError(Diag(CommaLocs[0], + return ExprError(Diag(PP.getLocForEndOfToken(Exprs[0]->getLocEnd()), diag::err_builtin_func_cast_more_than_one_arg) << FullRange); assert(NumExprs == 0 && "Expected 0 expressions"); + // FIXME: Why doesn't this go through the new-initialization code? + // C++ [expr.type.conv]p2: // The expression T(), where T is a simple-type-specifier for a non-array // complete object type or the (possibly cv-qualified) void type, creates an // rvalue of the specified type, which is value-initialized. // exprs.release(); - return Owned(new (Context) CXXScalarValueInitExpr(Ty, TyBeginLoc, RParenLoc)); + return Owned(new (Context) CXXScalarValueInitExpr( + TInfo->getType().getNonLValueExprType(Context), + TInfo, RParenLoc)); } Modified: cfe/trunk/lib/Sema/SemaInit.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaInit.cpp (original) +++ cfe/trunk/lib/Sema/SemaInit.cpp Tue Sep 7 19:15:04 2010 @@ -3843,10 +3843,14 @@ unsigned NumExprs = ConstructorArgs.size(); Expr **Exprs = (Expr **)ConstructorArgs.take(); S.MarkDeclarationReferenced(Loc, Constructor); + + TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); + if (!TSInfo) + TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc); + CurInit = S.Owned(new (S.Context) CXXTemporaryObjectExpr(S.Context, Constructor, - Entity.getType(), - Loc, + TSInfo, Exprs, NumExprs, Kind.getParenRange().getEnd(), @@ -3901,8 +3905,14 @@ } else if (Kind.getKind() == InitializationKind::IK_Value && S.getLangOptions().CPlusPlus && !Kind.isImplicitValueInit()) { - CurInit = S.Owned(new (S.Context) CXXScalarValueInitExpr(Step->Type, - Kind.getRange().getBegin(), + TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); + if (!TSInfo) + TSInfo = S.Context.getTrivialTypeSourceInfo(Step->Type, + Kind.getRange().getBegin()); + + CurInit = S.Owned(new (S.Context) CXXScalarValueInitExpr( + TSInfo->getType().getNonLValueExprType(S.Context), + TSInfo, Kind.getRange().getEnd())); } else { CurInit = S.Owned(new (S.Context) ImplicitValueInitExpr(Step->Type)); Modified: cfe/trunk/lib/Sema/TreeTransform.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h (original) +++ cfe/trunk/lib/Sema/TreeTransform.h Tue Sep 7 19:15:04 2010 @@ -1492,16 +1492,12 @@ /// /// By default, performs semantic analysis to build the new expression. /// Subclasses may override this routine to provide different behavior. - ExprResult RebuildCXXFunctionalCastExpr(SourceRange TypeRange, - TypeSourceInfo *TInfo, - SourceLocation LParenLoc, - Expr *Sub, - SourceLocation RParenLoc) { - return getSema().ActOnCXXTypeConstructExpr(TypeRange, - ParsedType::make(TInfo->getType()), - LParenLoc, + ExprResult RebuildCXXFunctionalCastExpr(TypeSourceInfo *TInfo, + SourceLocation LParenLoc, + Expr *Sub, + SourceLocation RParenLoc) { + return getSema().BuildCXXTypeConstructExpr(TInfo, LParenLoc, MultiExprArg(&Sub, 1), - /*CommaLocs=*/0, RParenLoc); } @@ -1565,14 +1561,12 @@ /// /// By default, performs semantic analysis to build the new expression. /// Subclasses may override this routine to provide different behavior. - ExprResult RebuildCXXScalarValueInitExpr(SourceLocation TypeStartLoc, - SourceLocation LParenLoc, - QualType T, - SourceLocation RParenLoc) { - return getSema().ActOnCXXTypeConstructExpr(SourceRange(TypeStartLoc), - ParsedType::make(T), LParenLoc, + ExprResult RebuildCXXScalarValueInitExpr(TypeSourceInfo *TSInfo, + SourceLocation LParenLoc, + SourceLocation RParenLoc) { + return getSema().BuildCXXTypeConstructExpr(TSInfo, LParenLoc, MultiExprArg(getSema(), 0, 0), - 0, RParenLoc); + RParenLoc); } /// \brief Build a new C++ "new" expression. @@ -1685,17 +1679,13 @@ /// /// By default, performs semantic analysis to build the new expression. /// Subclasses may override this routine to provide different behavior. - ExprResult RebuildCXXTemporaryObjectExpr(SourceLocation TypeBeginLoc, - QualType T, - SourceLocation LParenLoc, - MultiExprArg Args, - SourceLocation *Commas, - SourceLocation RParenLoc) { - return getSema().ActOnCXXTypeConstructExpr(SourceRange(TypeBeginLoc), - ParsedType::make(T), + ExprResult RebuildCXXTemporaryObjectExpr(TypeSourceInfo *TSInfo, + SourceLocation LParenLoc, + MultiExprArg Args, + SourceLocation RParenLoc) { + return getSema().BuildCXXTypeConstructExpr(TSInfo, LParenLoc, move(Args), - Commas, RParenLoc); } @@ -1703,18 +1693,13 @@ /// /// By default, performs semantic analysis to build the new expression. /// Subclasses may override this routine to provide different behavior. - ExprResult RebuildCXXUnresolvedConstructExpr(SourceLocation TypeBeginLoc, - QualType T, - SourceLocation LParenLoc, - MultiExprArg Args, - SourceLocation *Commas, - SourceLocation RParenLoc) { - return getSema().ActOnCXXTypeConstructExpr(SourceRange(TypeBeginLoc, - /*FIXME*/LParenLoc), - ParsedType::make(T), + ExprResult RebuildCXXUnresolvedConstructExpr(TypeSourceInfo *TSInfo, + SourceLocation LParenLoc, + MultiExprArg Args, + SourceLocation RParenLoc) { + return getSema().BuildCXXTypeConstructExpr(TSInfo, LParenLoc, move(Args), - Commas, RParenLoc); } @@ -5113,10 +5098,7 @@ SubExpr.get() == E->getSubExpr()) return SemaRef.Owned(E->Retain()); - // FIXME: The end of the type's source range is wrong - return getDerived().RebuildCXXFunctionalCastExpr( - /*FIXME:*/SourceRange(E->getTypeBeginLoc()), - NewT, + return getDerived().RebuildCXXFunctionalCastExpr(NewT, /*FIXME:*/E->getSubExpr()->getLocStart(), SubExpr.get(), E->getRParenLoc()); @@ -5222,20 +5204,18 @@ template ExprResult -TreeTransform::TransformCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) { - TemporaryBase Rebase(*this, E->getTypeBeginLoc(), DeclarationName()); - - QualType T = getDerived().TransformType(E->getType()); - if (T.isNull()) +TreeTransform::TransformCXXScalarValueInitExpr( + CXXScalarValueInitExpr *E) { + TypeSourceInfo *T = getDerived().TransformType(E->getTypeSourceInfo()); + if (!T) return ExprError(); - + if (!getDerived().AlwaysRebuild() && - T == E->getType()) + T == E->getTypeSourceInfo()) return SemaRef.Owned(E->Retain()); - return getDerived().RebuildCXXScalarValueInitExpr(E->getTypeBeginLoc(), - /*FIXME:*/E->getTypeBeginLoc(), - T, + return getDerived().RebuildCXXScalarValueInitExpr(T, + /*FIXME:*/T->getTypeLoc().getEndLoc(), E->getRParenLoc()); } @@ -5709,10 +5689,9 @@ template ExprResult TreeTransform::TransformCXXTemporaryObjectExpr( - CXXTemporaryObjectExpr *E) { - TemporaryBase Rebase(*this, E->getTypeBeginLoc(), DeclarationName()); - QualType T = getDerived().TransformType(E->getType()); - if (T.isNull()) + CXXTemporaryObjectExpr *E) { + TypeSourceInfo *T = getDerived().TransformType(E->getTypeSourceInfo()); + if (!T) return ExprError(); CXXConstructorDecl *Constructor @@ -5742,26 +5721,17 @@ } if (!getDerived().AlwaysRebuild() && - T == E->getType() && + T == E->getTypeSourceInfo() && Constructor == E->getConstructor() && !ArgumentChanged) { // FIXME: Instantiation-specific - SemaRef.MarkDeclarationReferenced(E->getTypeBeginLoc(), Constructor); + SemaRef.MarkDeclarationReferenced(E->getLocStart(), Constructor); return SemaRef.MaybeBindToTemporary(E->Retain()); } - - // FIXME: Bogus location information - SourceLocation CommaLoc; - if (Args.size() > 1) { - Expr *First = (Expr *)Args[0]; - CommaLoc - = SemaRef.PP.getLocForEndOfToken(First->getSourceRange().getEnd()); - } - return getDerived().RebuildCXXTemporaryObjectExpr(E->getTypeBeginLoc(), - T, - /*FIXME:*/E->getTypeBeginLoc(), + + return getDerived().RebuildCXXTemporaryObjectExpr(T, + /*FIXME:*/T->getTypeLoc().getEndLoc(), move_arg(Args), - &CommaLoc, E->getLocEnd()); } @@ -5769,14 +5739,12 @@ ExprResult TreeTransform::TransformCXXUnresolvedConstructExpr( CXXUnresolvedConstructExpr *E) { - TemporaryBase Rebase(*this, E->getTypeBeginLoc(), DeclarationName()); - QualType T = getDerived().TransformType(E->getTypeAsWritten()); - if (T.isNull()) + TypeSourceInfo *T = getDerived().TransformType(E->getTypeSourceInfo()); + if (!T) return ExprError(); bool ArgumentChanged = false; ASTOwningVector Args(SemaRef); - llvm::SmallVector FakeCommaLocs; for (CXXUnresolvedConstructExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end(); Arg != ArgEnd; ++Arg) { @@ -5785,22 +5753,18 @@ return ExprError(); ArgumentChanged = ArgumentChanged || TransArg.get() != *Arg; - FakeCommaLocs.push_back( - SemaRef.PP.getLocForEndOfToken((*Arg)->getLocEnd())); Args.push_back(TransArg.get()); } if (!getDerived().AlwaysRebuild() && - T == E->getTypeAsWritten() && + T == E->getTypeSourceInfo() && !ArgumentChanged) return SemaRef.Owned(E->Retain()); // FIXME: we're faking the locations of the commas - return getDerived().RebuildCXXUnresolvedConstructExpr(E->getTypeBeginLoc(), - T, + return getDerived().RebuildCXXUnresolvedConstructExpr(T, E->getLParenLoc(), move_arg(Args), - FakeCommaLocs.data(), E->getRParenLoc()); } Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original) +++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Tue Sep 7 19:15:04 2010 @@ -974,7 +974,7 @@ void ASTStmtReader::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) { VisitCXXConstructExpr(E); - E->TyBeginLoc = Reader.ReadSourceLocation(Record, Idx); + E->Type = Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx); E->RParenLoc = Reader.ReadSourceLocation(Record, Idx); } @@ -1058,8 +1058,8 @@ void ASTStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) { VisitExpr(E); - E->setTypeBeginLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); - E->setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + E->TypeInfo = Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx); + E->RParenLoc = SourceLocation::getFromRawEncoding(Record[Idx++]); } void ASTStmtReader::VisitCXXNewExpr(CXXNewExpr *E) { @@ -1180,8 +1180,7 @@ ++Idx; // NumArgs; for (unsigned I = 0, N = E->arg_size(); I != N; ++I) E->setArg(I, Reader.ReadSubExpr()); - E->setTypeBeginLoc(Reader.ReadSourceLocation(Record, Idx)); - E->setTypeAsWritten(Reader.GetType(Record[Idx++])); + E->Type = Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx); E->setLParenLoc(Reader.ReadSourceLocation(Record, Idx)); E->setRParenLoc(Reader.ReadSourceLocation(Record, Idx)); } Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original) +++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Tue Sep 7 19:15:04 2010 @@ -977,7 +977,7 @@ void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) { VisitCXXConstructExpr(E); - Writer.AddSourceLocation(E->getTypeBeginLoc(), Record); + Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record); Writer.AddSourceLocation(E->getRParenLoc(), Record); Code = serialization::EXPR_CXX_TEMPORARY_OBJECT; } @@ -1076,7 +1076,7 @@ void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) { VisitExpr(E); - Writer.AddSourceLocation(E->getTypeBeginLoc(), Record); + Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record); Writer.AddSourceLocation(E->getRParenLoc(), Record); Code = serialization::EXPR_CXX_SCALAR_VALUE_INIT; } @@ -1208,8 +1208,7 @@ for (CXXUnresolvedConstructExpr::arg_iterator ArgI = E->arg_begin(), ArgE = E->arg_end(); ArgI != ArgE; ++ArgI) Writer.AddStmt(*ArgI); - Writer.AddSourceLocation(E->getTypeBeginLoc(), Record); - Writer.AddTypeRef(E->getTypeAsWritten(), Record); + Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record); Writer.AddSourceLocation(E->getLParenLoc(), Record); Writer.AddSourceLocation(E->getRParenLoc(), Record); Code = serialization::EXPR_CXX_UNRESOLVED_CONSTRUCT; Modified: cfe/trunk/test/Index/load-stmts.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/load-stmts.cpp?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/test/Index/load-stmts.cpp (original) +++ cfe/trunk/test/Index/load-stmts.cpp Tue Sep 7 19:15:04 2010 @@ -78,6 +78,16 @@ void test_more_exprs(void *mem, int i, int j) { new (mem) Pair(i, j); + typedef int Integer; + (void)Integer(i); + (Integer)i; + Integer(); +} + +template +void test_even_more_dependent_exprs(T t, Y y) { + typedef T type; + (void)type(t, y); } // RUN: c-index-test -test-load-source all %s | FileCheck %s @@ -175,3 +185,13 @@ // CHECK: load-stmts.cpp:80:13: TypeRef=struct Pair:73:8 Extent=[80:13 - 80:17] // CHECK: load-stmts.cpp:80:18: DeclRefExpr=i:79:37 Extent=[80:18 - 80:19] // CHECK: load-stmts.cpp:80:21: DeclRefExpr=j:79:44 Extent=[80:21 - 80:22] +// CHECK: load-stmts.cpp:82:9: TypeRef=Integer:81:15 Extent=[82:9 - 82:16] +// CHECK: load-stmts.cpp:82:17: DeclRefExpr=i:79:37 Extent=[82:17 - 82:18] +// CHECK: load-stmts.cpp:83:3: UnexposedExpr=i:79:37 Extent=[83:3 - 83:13] +// CHECK: load-stmts.cpp:83:4: TypeRef=Integer:81:15 Extent=[83:4 - 83:11] +// CHECK: load-stmts.cpp:83:12: DeclRefExpr=i:79:37 Extent=[83:12 - 83:13] +// CHECK: load-stmts.cpp:84:3: UnexposedExpr= Extent=[84:3 - 84:12] +// CHECK: load-stmts.cpp:84:3: TypeRef=Integer:81:15 Extent=[84:3 - 84:10] +// CHECK: load-stmts.cpp:90:9: TypeRef=type:89:13 Extent=[90:9 - 90:13] +// CHECK: load-stmts.cpp:90:14: DeclRefExpr=t:88:39 Extent=[90:14 - 90:15] +// CHECK: load-stmts.cpp:90:17: DeclRefExpr=y:88:44 Extent=[90:17 - 90:18] Modified: cfe/trunk/tools/libclang/CIndex.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=113319&r1=113318&r2=113319&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CIndex.cpp (original) +++ cfe/trunk/tools/libclang/CIndex.cpp Tue Sep 7 19:15:04 2010 @@ -386,14 +386,14 @@ // FIXME: DesignatedInitExpr bool VisitCXXTypeidExpr(CXXTypeidExpr *E); bool VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) { return false; } - // FIXME: CXXTemporaryObjectExpr has poor source-location information. - // FIXME: CXXScalarValueInitExpr has poor source-location information. + bool VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E); + bool VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E); bool VisitCXXNewExpr(CXXNewExpr *E); bool VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E); // FIXME: UnaryTypeTraitExpr has poor source-location information. bool VisitOverloadExpr(OverloadExpr *E); bool VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E); - // FIXME: CXXUnresolvedConstructExpr has poor source-location information. + bool VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E); bool VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E); bool VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E); }; @@ -1590,6 +1590,20 @@ return VisitExpr(E); } +bool CursorVisitor::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) { + if (TypeSourceInfo *TSInfo = E->getTypeSourceInfo()) + return Visit(TSInfo->getTypeLoc()); + + return VisitExpr(E); +} + +bool CursorVisitor::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) { + if (TypeSourceInfo *TSInfo = E->getTypeSourceInfo()) + return Visit(TSInfo->getTypeLoc()); + + return false; +} + bool CursorVisitor::VisitCXXNewExpr(CXXNewExpr *E) { // Visit placement arguments. for (unsigned I = 0, N = E->getNumPlacementArgs(); I != N; ++I) @@ -1688,6 +1702,15 @@ return false; } +bool CursorVisitor::VisitCXXUnresolvedConstructExpr( + CXXUnresolvedConstructExpr *E) { + if (TypeSourceInfo *TSInfo = E->getTypeSourceInfo()) + if (Visit(TSInfo->getTypeLoc())) + return true; + + return VisitExpr(E); +} + bool CursorVisitor::VisitCXXDependentScopeMemberExpr( CXXDependentScopeMemberExpr *E) { // Visit the base expression, if there is one. From ggreif at gmail.com Tue Sep 7 19:31:13 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 08 Sep 2010 00:31:13 -0000 Subject: [cfe-commits] r113324 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/FixIt/fixit.cpp Message-ID: <20100908003113.A24B82A6C12C@llvm.org> Author: ggreif Date: Tue Sep 7 19:31:13 2010 New Revision: 113324 URL: http://llvm.org/viewvc/llvm-project?rev=113324&view=rev Log: add a fixit when 'main' does ot return 'int'; review welcome Modified: cfe/trunk/lib/Sema/SemaDecl.cpp cfe/trunk/test/FixIt/fixit.cpp Modified: cfe/trunk/lib/Sema/SemaDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=113324&r1=113323&r2=113324&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDecl.cpp (original) +++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Sep 7 19:31:13 2010 @@ -3171,7 +3171,7 @@ SC = SC_Static; break; } - case DeclSpec::SCS_private_extern: SC = SC_PrivateExtern;break; + case DeclSpec::SCS_private_extern: SC = SC_PrivateExtern; break; } if (D.getDeclSpec().isThreadSpecified()) @@ -3976,8 +3976,14 @@ const FunctionType* FT = T->getAs(); if (!Context.hasSameUnqualifiedType(FT->getResultType(), Context.IntTy)) { - // TODO: add a replacement fixit to turn the return type into 'int'. - Diag(FD->getTypeSpecStartLoc(), diag::err_main_returns_nonint); + TypeSourceInfo *TSI = FD->getTypeSourceInfo(); + TypeLoc TL = TSI->getTypeLoc(); + const SemaDiagnosticBuilder& D = Diag(FD->getTypeSpecStartLoc(), + diag::err_main_returns_nonint); + if (FunctionTypeLoc* PTL = dyn_cast(&TL)) { + D << FixItHint::CreateReplacement(PTL->getResultLoc().getSourceRange(), + "int"); + } FD->setInvalidDecl(true); } Modified: cfe/trunk/test/FixIt/fixit.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/FixIt/fixit.cpp?rev=113324&r1=113323&r2=113324&view=diff ============================================================================== --- cfe/trunk/test/FixIt/fixit.cpp (original) +++ cfe/trunk/test/FixIt/fixit.cpp Tue Sep 7 19:31:13 2010 @@ -60,3 +60,9 @@ } } + +CT<1> main(void); // expected-error{{'main' must return 'int'}} + +// typedef CT<1> mainT(void); +// mainT main; // TODO + From sebastian.redl at getdesigned.at Tue Sep 7 19:48:43 2010 From: sebastian.redl at getdesigned.at (Sebastian Redl) Date: Wed, 08 Sep 2010 00:48:43 -0000 Subject: [cfe-commits] r113326 - in /cfe/trunk: lib/AST/Type.cpp lib/Sema/SemaExprCXX.cpp test/SemaCXX/type-traits-incomplete.cpp test/SemaCXX/type-traits.cpp Message-ID: <20100908004843.3E0B12A6C12C@llvm.org> Author: cornedbee Date: Tue Sep 7 19:48:43 2010 New Revision: 113326 URL: http://llvm.org/viewvc/llvm-project?rev=113326&view=rev Log: Allow (cv) void and incomplete arrays to be passed to the type traits. Fixes PR8110, and thus PR8109, PR8097, and parts of PR8101, PR8105 and PR8107. Only a few traits have tests for incomplete arrays, since I'm not yet clear what the result for them should be; Howards wants to file a DR to change the standard. Modified: cfe/trunk/lib/AST/Type.cpp cfe/trunk/lib/Sema/SemaExprCXX.cpp cfe/trunk/test/SemaCXX/type-traits-incomplete.cpp cfe/trunk/test/SemaCXX/type-traits.cpp Modified: cfe/trunk/lib/AST/Type.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=113326&r1=113325&r2=113326&view=diff ============================================================================== --- cfe/trunk/lib/AST/Type.cpp (original) +++ cfe/trunk/lib/AST/Type.cpp Tue Sep 7 19:48:43 2010 @@ -678,7 +678,11 @@ /// isPODType - Return true if this is a plain-old-data type (C++ 3.9p10) bool Type::isPODType() const { // The compiler shouldn't query this for incomplete types, but the user might. - // We return false for that case. + // We return false for that case. Except for incomplete arrays of PODs, which + // are PODs according to the standard. + if (isIncompleteArrayType() && + cast(CanonicalType)->getElementType()->isPODType()) + return true; if (isIncompleteType()) return false; @@ -687,7 +691,7 @@ default: return false; case VariableArray: case ConstantArray: - // IncompleteArray is caught by isIncompleteType() above. + // IncompleteArray is handled above. return cast(CanonicalType)->getElementType()->isPODType(); case Builtin: Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=113326&r1=113325&r2=113326&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Tue Sep 7 19:48:43 2010 @@ -1956,9 +1956,13 @@ // According to http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html // all traits except __is_class, __is_enum and __is_union require a the type - // to be complete. + // to be complete, an array of unknown bound, or void. if (OTT != UTT_IsClass && OTT != UTT_IsEnum && OTT != UTT_IsUnion) { - if (RequireCompleteType(KWLoc, T, + QualType E = T; + if (T->isIncompleteArrayType()) + E = Context.getAsArrayType(T)->getElementType(); + if (!T->isVoidType() && + RequireCompleteType(KWLoc, E, diag::err_incomplete_type_used_in_type_trait_expr)) return ExprError(); } Modified: cfe/trunk/test/SemaCXX/type-traits-incomplete.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/type-traits-incomplete.cpp?rev=113326&r1=113325&r2=113326&view=diff ============================================================================== --- cfe/trunk/test/SemaCXX/type-traits-incomplete.cpp (original) +++ cfe/trunk/test/SemaCXX/type-traits-incomplete.cpp Tue Sep 7 19:48:43 2010 @@ -1,7 +1,8 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -struct S; // expected-note{{forward declaration of 'S'}} +struct S; // expected-note 2 {{forward declaration of 'S'}} void f() { __is_pod(S); // expected-error{{incomplete type 'S' used in type trait expression}} + __is_pod(S[]); // expected-error{{incomplete type 'S' used in type trait expression}} } Modified: cfe/trunk/test/SemaCXX/type-traits.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/type-traits.cpp?rev=113326&r1=113325&r2=113326&view=diff ============================================================================== --- cfe/trunk/test/SemaCXX/type-traits.cpp (original) +++ cfe/trunk/test/SemaCXX/type-traits.cpp Tue Sep 7 19:48:43 2010 @@ -11,6 +11,7 @@ typedef Empty EmptyAr[10]; typedef int Int; typedef Int IntAr[10]; +typedef Int IntArNB[]; class Statics { static int priv; static NonPOD np; }; union EmptyUnion {}; union Union { int i; float f; }; @@ -20,6 +21,7 @@ struct HasAssign { void operator =(int); }; // Not PODs +typedef const void cvoid; struct Derives : POD {}; struct DerivesEmpty : Empty {}; struct HasCons { HasCons(int); }; @@ -32,6 +34,7 @@ struct HasVirt { virtual void Virt() {}; }; typedef Derives NonPODAr[10]; typedef HasVirt VirtAr[10]; +typedef HasCons NonPODArNB[]; union NonPODUnion { int i; Derives n; }; struct HasNoThrowCopyAssign { @@ -80,6 +83,7 @@ int t11[T(__is_pod(HasOp))]; int t12[T(__is_pod(HasConv))]; int t13[T(__is_pod(HasAssign))]; + int t14[T(__is_pod(IntArNB))]; int t21[F(__is_pod(Derives))]; int t22[F(__is_pod(HasCons))]; @@ -92,6 +96,9 @@ int t29[F(__is_pod(HasVirt))]; int t30[F(__is_pod(NonPODAr))]; int t31[F(__is_pod(DerivesEmpty))]; + int t32[F(__is_pod(void))]; + int t33[F(__is_pod(cvoid))]; + int t34[F(__is_pod(NonPODArNB))]; // int t32[F(__is_pod(NonPODUnion))]; } @@ -122,6 +129,8 @@ int t25[F(__is_empty(HasRef))]; int t26[F(__is_empty(HasVirt))]; int t27[F(__is_empty(BitOnly))]; + int t28[F(__is_empty(void))]; + int t29[F(__is_empty(IntArNB))]; // int t27[F(__is_empty(DerivesVirt))]; } @@ -139,6 +148,8 @@ int t14[F(__is_class(IntAr))]; int t15[F(__is_class(NonPODAr))]; int t16[F(__is_class(Union))]; + int t17[F(__is_class(cvoid))]; + int t18[F(__is_class(IntArNB))]; } typedef Union UnionAr[10]; @@ -154,6 +165,8 @@ int t13[F(__is_union(Int))]; int t14[F(__is_union(IntAr))]; int t15[F(__is_union(UnionAr))]; + int t16[F(__is_union(cvoid))]; + int t17[F(__is_union(IntArNB))]; } typedef Enum EnumType; @@ -170,6 +183,8 @@ int t15[F(__is_enum(UnionAr))]; int t16[F(__is_enum(Derives))]; int t17[F(__is_enum(ClassType))]; + int t18[F(__is_enum(cvoid))]; + int t19[F(__is_enum(IntArNB))]; } typedef HasVirt Polymorph; @@ -188,6 +203,8 @@ int t16[F(__is_polymorphic(Derives))]; int t17[F(__is_polymorphic(ClassType))]; int t18[F(__is_polymorphic(Enum))]; + int t19[F(__is_polymorphic(cvoid))]; + int t20[F(__is_polymorphic(IntArNB))]; } typedef Int& IntRef; @@ -217,6 +234,8 @@ int t16[T(__has_trivial_constructor(const Int))]; int t17[T(__has_trivial_constructor(NonPODAr))]; int t18[F(__has_trivial_constructor(VirtAr))]; + int t19[F(__has_trivial_constructor(void))]; + int t20[F(__has_trivial_constructor(cvoid))]; } void has_trivial_copy_constructor() { @@ -238,6 +257,8 @@ int t16[T(__has_trivial_copy(const Int))]; int t17[F(__has_trivial_copy(NonPODAr))]; int t18[F(__has_trivial_copy(VirtAr))]; + int t19[F(__has_trivial_copy(void))]; + int t20[F(__has_trivial_copy(cvoid))]; } void has_trivial_copy_assignment() { @@ -259,6 +280,8 @@ int t16[F(__has_trivial_assign(const Int))]; int t17[F(__has_trivial_assign(NonPODAr))]; int t18[F(__has_trivial_assign(VirtAr))]; + int t19[F(__has_trivial_assign(void))]; + int t20[F(__has_trivial_assign(cvoid))]; } void has_trivial_destructor() { @@ -280,14 +303,16 @@ int t16[T(__has_trivial_destructor(const Int))]; int t17[T(__has_trivial_destructor(NonPODAr))]; int t18[T(__has_trivial_destructor(VirtAr))]; + int t19[F(__has_trivial_destructor(void))]; + int t20[F(__has_trivial_destructor(cvoid))]; } struct A { ~A() {} }; template struct B : A { }; void f() { - int t01[T(!__has_trivial_destructor(A))]; - int t02[T(!__has_trivial_destructor(B))]; + int t01[F(__has_trivial_destructor(A))]; + int t02[F(__has_trivial_destructor(B))]; } void has_nothrow_assign() { @@ -309,10 +334,11 @@ int t16[F(__has_nothrow_assign(const Int))]; int t17[F(__has_nothrow_assign(NonPODAr))]; int t18[F(__has_nothrow_assign(VirtAr))]; - int t19[T(__has_nothrow_assign(HasNoThrowCopyAssign))]; int t20[F(__has_nothrow_assign(HasMultipleCopyAssign))]; int t21[T(__has_nothrow_assign(HasMultipleNoThrowCopyAssign))]; + int t22[F(__has_nothrow_assign(void))]; + int t23[F(__has_nothrow_assign(cvoid))]; } void has_nothrow_copy() { @@ -338,6 +364,8 @@ int t19[T(__has_nothrow_copy(HasNoThrowCopy))]; int t20[F(__has_nothrow_copy(HasMultipleCopy))]; int t21[T(__has_nothrow_copy(HasMultipleNoThrowCopy))]; + int t22[F(__has_nothrow_copy(void))]; + int t23[F(__has_nothrow_copy(cvoid))]; } void has_nothrow_constructor() { @@ -362,6 +390,8 @@ int t19[T(__has_nothrow_constructor(HasNoThrowConstructor))]; int t20[F(__has_nothrow_constructor(HasNoThrowConstructorWithArgs))]; + int t21[F(__has_nothrow_constructor(void))]; + int t22[F(__has_nothrow_constructor(cvoid))]; } void has_virtual_destructor() { @@ -387,4 +417,6 @@ int t19[T(__has_virtual_destructor(HasVirtDest))]; int t20[T(__has_virtual_destructor(DerivedVirtDest))]; int t21[F(__has_virtual_destructor(VirtDestAr))]; + int t22[F(__has_virtual_destructor(void))]; + int t23[F(__has_virtual_destructor(cvoid))]; } From hhinnant at apple.com Tue Sep 7 19:57:35 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Tue, 7 Sep 2010 20:57:35 -0400 Subject: [cfe-commits] r113326 - in /cfe/trunk: lib/AST/Type.cpp lib/Sema/SemaExprCXX.cpp test/SemaCXX/type-traits-incomplete.cpp test/SemaCXX/type-traits.cpp In-Reply-To: <20100908004843.3E0B12A6C12C@llvm.org> References: <20100908004843.3E0B12A6C12C@llvm.org> Message-ID: Much thanks Sebastian! -Howard On Sep 7, 2010, at 8:48 PM, Sebastian Redl wrote: > Author: cornedbee > Date: Tue Sep 7 19:48:43 2010 > New Revision: 113326 > > URL: http://llvm.org/viewvc/llvm-project?rev=113326&view=rev > Log: > Allow (cv) void and incomplete arrays to be passed to the type traits. > > Fixes PR8110, and thus PR8109, PR8097, and parts of PR8101, PR8105 and PR8107. Only a few traits have tests for incomplete arrays, since I'm not yet clear what the result for them should be; Howards wants to file a DR to change the standard. > > Modified: > cfe/trunk/lib/AST/Type.cpp > cfe/trunk/lib/Sema/SemaExprCXX.cpp > cfe/trunk/test/SemaCXX/type-traits-incomplete.cpp > cfe/trunk/test/SemaCXX/type-traits.cpp > > Modified: cfe/trunk/lib/AST/Type.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=113326&r1=113325&r2=113326&view=diff > ============================================================================== > --- cfe/trunk/lib/AST/Type.cpp (original) > +++ cfe/trunk/lib/AST/Type.cpp Tue Sep 7 19:48:43 2010 > @@ -678,7 +678,11 @@ > /// isPODType - Return true if this is a plain-old-data type (C++ 3.9p10) > bool Type::isPODType() const { > // The compiler shouldn't query this for incomplete types, but the user might. > - // We return false for that case. > + // We return false for that case. Except for incomplete arrays of PODs, which > + // are PODs according to the standard. > + if (isIncompleteArrayType() && > + cast(CanonicalType)->getElementType()->isPODType()) > + return true; > if (isIncompleteType()) > return false; > > @@ -687,7 +691,7 @@ > default: return false; > case VariableArray: > case ConstantArray: > - // IncompleteArray is caught by isIncompleteType() above. > + // IncompleteArray is handled above. > return cast(CanonicalType)->getElementType()->isPODType(); > > case Builtin: > > Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=113326&r1=113325&r2=113326&view=diff > ============================================================================== > --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original) > +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Tue Sep 7 19:48:43 2010 > @@ -1956,9 +1956,13 @@ > > // According to http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html > // all traits except __is_class, __is_enum and __is_union require a the type > - // to be complete. > + // to be complete, an array of unknown bound, or void. > if (OTT != UTT_IsClass && OTT != UTT_IsEnum && OTT != UTT_IsUnion) { > - if (RequireCompleteType(KWLoc, T, > + QualType E = T; > + if (T->isIncompleteArrayType()) > + E = Context.getAsArrayType(T)->getElementType(); > + if (!T->isVoidType() && > + RequireCompleteType(KWLoc, E, > diag::err_incomplete_type_used_in_type_trait_expr)) > return ExprError(); > } > > Modified: cfe/trunk/test/SemaCXX/type-traits-incomplete.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/type-traits-incomplete.cpp?rev=113326&r1=113325&r2=113326&view=diff > ============================================================================== > --- cfe/trunk/test/SemaCXX/type-traits-incomplete.cpp (original) > +++ cfe/trunk/test/SemaCXX/type-traits-incomplete.cpp Tue Sep 7 19:48:43 2010 > @@ -1,7 +1,8 @@ > // RUN: %clang_cc1 -fsyntax-only -verify %s > > -struct S; // expected-note{{forward declaration of 'S'}} > +struct S; // expected-note 2 {{forward declaration of 'S'}} > > void f() { > __is_pod(S); // expected-error{{incomplete type 'S' used in type trait expression}} > + __is_pod(S[]); // expected-error{{incomplete type 'S' used in type trait expression}} > } > > Modified: cfe/trunk/test/SemaCXX/type-traits.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/type-traits.cpp?rev=113326&r1=113325&r2=113326&view=diff > ============================================================================== > --- cfe/trunk/test/SemaCXX/type-traits.cpp (original) > +++ cfe/trunk/test/SemaCXX/type-traits.cpp Tue Sep 7 19:48:43 2010 > @@ -11,6 +11,7 @@ > typedef Empty EmptyAr[10]; > typedef int Int; > typedef Int IntAr[10]; > +typedef Int IntArNB[]; > class Statics { static int priv; static NonPOD np; }; > union EmptyUnion {}; > union Union { int i; float f; }; > @@ -20,6 +21,7 @@ > struct HasAssign { void operator =(int); }; > > // Not PODs > +typedef const void cvoid; > struct Derives : POD {}; > struct DerivesEmpty : Empty {}; > struct HasCons { HasCons(int); }; > @@ -32,6 +34,7 @@ > struct HasVirt { virtual void Virt() {}; }; > typedef Derives NonPODAr[10]; > typedef HasVirt VirtAr[10]; > +typedef HasCons NonPODArNB[]; > union NonPODUnion { int i; Derives n; }; > > struct HasNoThrowCopyAssign { > @@ -80,6 +83,7 @@ > int t11[T(__is_pod(HasOp))]; > int t12[T(__is_pod(HasConv))]; > int t13[T(__is_pod(HasAssign))]; > + int t14[T(__is_pod(IntArNB))]; > > int t21[F(__is_pod(Derives))]; > int t22[F(__is_pod(HasCons))]; > @@ -92,6 +96,9 @@ > int t29[F(__is_pod(HasVirt))]; > int t30[F(__is_pod(NonPODAr))]; > int t31[F(__is_pod(DerivesEmpty))]; > + int t32[F(__is_pod(void))]; > + int t33[F(__is_pod(cvoid))]; > + int t34[F(__is_pod(NonPODArNB))]; > // int t32[F(__is_pod(NonPODUnion))]; > } > > @@ -122,6 +129,8 @@ > int t25[F(__is_empty(HasRef))]; > int t26[F(__is_empty(HasVirt))]; > int t27[F(__is_empty(BitOnly))]; > + int t28[F(__is_empty(void))]; > + int t29[F(__is_empty(IntArNB))]; > // int t27[F(__is_empty(DerivesVirt))]; > } > > @@ -139,6 +148,8 @@ > int t14[F(__is_class(IntAr))]; > int t15[F(__is_class(NonPODAr))]; > int t16[F(__is_class(Union))]; > + int t17[F(__is_class(cvoid))]; > + int t18[F(__is_class(IntArNB))]; > } > > typedef Union UnionAr[10]; > @@ -154,6 +165,8 @@ > int t13[F(__is_union(Int))]; > int t14[F(__is_union(IntAr))]; > int t15[F(__is_union(UnionAr))]; > + int t16[F(__is_union(cvoid))]; > + int t17[F(__is_union(IntArNB))]; > } > > typedef Enum EnumType; > @@ -170,6 +183,8 @@ > int t15[F(__is_enum(UnionAr))]; > int t16[F(__is_enum(Derives))]; > int t17[F(__is_enum(ClassType))]; > + int t18[F(__is_enum(cvoid))]; > + int t19[F(__is_enum(IntArNB))]; > } > > typedef HasVirt Polymorph; > @@ -188,6 +203,8 @@ > int t16[F(__is_polymorphic(Derives))]; > int t17[F(__is_polymorphic(ClassType))]; > int t18[F(__is_polymorphic(Enum))]; > + int t19[F(__is_polymorphic(cvoid))]; > + int t20[F(__is_polymorphic(IntArNB))]; > } > > typedef Int& IntRef; > @@ -217,6 +234,8 @@ > int t16[T(__has_trivial_constructor(const Int))]; > int t17[T(__has_trivial_constructor(NonPODAr))]; > int t18[F(__has_trivial_constructor(VirtAr))]; > + int t19[F(__has_trivial_constructor(void))]; > + int t20[F(__has_trivial_constructor(cvoid))]; > } > > void has_trivial_copy_constructor() { > @@ -238,6 +257,8 @@ > int t16[T(__has_trivial_copy(const Int))]; > int t17[F(__has_trivial_copy(NonPODAr))]; > int t18[F(__has_trivial_copy(VirtAr))]; > + int t19[F(__has_trivial_copy(void))]; > + int t20[F(__has_trivial_copy(cvoid))]; > } > > void has_trivial_copy_assignment() { > @@ -259,6 +280,8 @@ > int t16[F(__has_trivial_assign(const Int))]; > int t17[F(__has_trivial_assign(NonPODAr))]; > int t18[F(__has_trivial_assign(VirtAr))]; > + int t19[F(__has_trivial_assign(void))]; > + int t20[F(__has_trivial_assign(cvoid))]; > } > > void has_trivial_destructor() { > @@ -280,14 +303,16 @@ > int t16[T(__has_trivial_destructor(const Int))]; > int t17[T(__has_trivial_destructor(NonPODAr))]; > int t18[T(__has_trivial_destructor(VirtAr))]; > + int t19[F(__has_trivial_destructor(void))]; > + int t20[F(__has_trivial_destructor(cvoid))]; > } > > struct A { ~A() {} }; > template struct B : A { }; > > void f() { > - int t01[T(!__has_trivial_destructor(A))]; > - int t02[T(!__has_trivial_destructor(B))]; > + int t01[F(__has_trivial_destructor(A))]; > + int t02[F(__has_trivial_destructor(B))]; > } > > void has_nothrow_assign() { > @@ -309,10 +334,11 @@ > int t16[F(__has_nothrow_assign(const Int))]; > int t17[F(__has_nothrow_assign(NonPODAr))]; > int t18[F(__has_nothrow_assign(VirtAr))]; > - > int t19[T(__has_nothrow_assign(HasNoThrowCopyAssign))]; > int t20[F(__has_nothrow_assign(HasMultipleCopyAssign))]; > int t21[T(__has_nothrow_assign(HasMultipleNoThrowCopyAssign))]; > + int t22[F(__has_nothrow_assign(void))]; > + int t23[F(__has_nothrow_assign(cvoid))]; > } > > void has_nothrow_copy() { > @@ -338,6 +364,8 @@ > int t19[T(__has_nothrow_copy(HasNoThrowCopy))]; > int t20[F(__has_nothrow_copy(HasMultipleCopy))]; > int t21[T(__has_nothrow_copy(HasMultipleNoThrowCopy))]; > + int t22[F(__has_nothrow_copy(void))]; > + int t23[F(__has_nothrow_copy(cvoid))]; > } > > void has_nothrow_constructor() { > @@ -362,6 +390,8 @@ > > int t19[T(__has_nothrow_constructor(HasNoThrowConstructor))]; > int t20[F(__has_nothrow_constructor(HasNoThrowConstructorWithArgs))]; > + int t21[F(__has_nothrow_constructor(void))]; > + int t22[F(__has_nothrow_constructor(cvoid))]; > } > > void has_virtual_destructor() { > @@ -387,4 +417,6 @@ > int t19[T(__has_virtual_destructor(HasVirtDest))]; > int t20[T(__has_virtual_destructor(DerivedVirtDest))]; > int t21[F(__has_virtual_destructor(VirtDestAr))]; > + int t22[F(__has_virtual_destructor(void))]; > + int t23[F(__has_virtual_destructor(cvoid))]; > } > > > _______________________________________________ > cfe-commits mailing list > cfe-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits From dawn at burble.org Tue Sep 7 20:03:51 2010 From: dawn at burble.org (dawn at burble.org) Date: Tue, 7 Sep 2010 18:03:51 -0700 Subject: [cfe-commits] r111983 - in /cfe/trunk: include/clang/Driver/CC1Options.td include/clang/Frontend/PreprocessorOutputOptions.h lib/Driver/Tools.cpp lib/Frontend/CompilerInvocation.cpp lib/Frontend/PrintPreprocessedOutput.cpp test/Frontend/Inputs/ t In-Reply-To: References: Message-ID: <20100908010351.GA18753@bloodbath.burble.org> I would like to see a more general solution that all of clang can beneefit from. Are we planning to live with llvm::errs()'s "horrible buffering behavior" forever? If not, it would be good to encapsulate work-arounds like this SmallString use so that all parts of the compiler will benefit, and it will be easy to undo later. At a minimum, I would like to see a comment explaining why the SmallString buffer was used here. Thanks! -Dawn On Sat, Sep 04, 2010 at 01:57:46PM -0700, Daniel Dunbar wrote: > On Fri, Sep 3, 2010 at 9:49 AM, Chris Lattner wrote: > > > > On Aug 24, 2010, at 3:44 PM, Daniel Dunbar wrote: > > > >> + ?// Dump the header include information, if enabled and we are past the > >> + ?// predefines buffer. > >> + ?if (DumpHeaderIncludes && HasProcessedPredefines && > >> + ? ? ?Reason == PPCallbacks::EnterFile) { > >> + ? ?llvm::SmallString<256> Msg; > >> + ? ?llvm::raw_svector_ostream OS(Msg); > >> + ? ?for (unsigned i = 0; i != CurrentIncludeDepth; ++i) > >> + ? ? ?OS << '.'; > >> + ? ?OS << ' ' << CurFilename << '\n'; > >> + ? ?llvm::errs() << OS.str(); > > > > Why the temporary SmallString? > > It writes on llvm::errs() directly, which has horrible buffering > behavior. I didn't want to be flushing out one character at a time. A > generally solution to this problem would make more sense, but there > aren't so many places that output substantial text to stderr. > > - Daniel > > > -Chris > > > > > > _______________________________________________ > cfe-commits mailing list > cfe-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits From rjmccall at apple.com Tue Sep 7 20:44:27 2010 From: rjmccall at apple.com (John McCall) Date: Wed, 08 Sep 2010 01:44:27 -0000 Subject: [cfe-commits] r113330 - in /cfe/trunk: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGCXXABI.h lib/CodeGen/CGDecl.cpp lib/CodeGen/CGDeclCXX.cpp lib/CodeGen/CodeGenFunction.h lib/CodeGen/ItaniumCXXABI.cpp lib/CodeGen/Mangle.cpp lib/CodeGen/Mangle.h lib/CodeGen/MicrosoftCXXABI.cpp test/CodeGenCXX/arm.cpp test/CodeGenCXX/static-init.cpp test/CodeGenCXX/threadsafe-statics-exceptions.cpp Message-ID: <20100908014428.1F3FB2A6C12C@llvm.org> Author: rjmccall Date: Tue Sep 7 20:44:27 2010 New Revision: 113330 URL: http://llvm.org/viewvc/llvm-project?rev=113330&view=rev Log: Implement ARM static local initialization guards, which are more compact than Itanium guards and use a slightly different compiled-in API. Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp cfe/trunk/lib/CodeGen/CGCXXABI.h cfe/trunk/lib/CodeGen/CGDecl.cpp cfe/trunk/lib/CodeGen/CGDeclCXX.cpp cfe/trunk/lib/CodeGen/CodeGenFunction.h cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp cfe/trunk/lib/CodeGen/Mangle.cpp cfe/trunk/lib/CodeGen/Mangle.h cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp cfe/trunk/test/CodeGenCXX/arm.cpp cfe/trunk/test/CodeGenCXX/static-init.cpp cfe/trunk/test/CodeGenCXX/threadsafe-statics-exceptions.cpp Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGCXX.cpp (original) +++ cfe/trunk/lib/CodeGen/CGCXX.cpp Tue Sep 7 20:44:27 2010 @@ -321,7 +321,7 @@ /// Implementation for CGCXXABI. Possibly this should be moved into /// the incomplete ABI implementations? -CGCXXABI::~CGCXXABI() {} +void CGCXXABI::_anchor() {} static void ErrorUnsupportedABI(CodeGenFunction &CGF, llvm::StringRef S) { @@ -469,3 +469,9 @@ AllocPtr = llvm::Constant::getNullValue(CGF.Builder.getInt8PtrTy()); CookieSize = CharUnits::Zero(); } + +void CGCXXABI::EmitStaticLocalInit(CodeGenFunction &CGF, + const VarDecl &D, + llvm::GlobalVariable *GV) { + ErrorUnsupportedABI(CGF, "static local variable initialization"); +} Modified: cfe/trunk/lib/CodeGen/CGCXXABI.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXXABI.h?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGCXXABI.h (original) +++ cfe/trunk/lib/CodeGen/CGCXXABI.h Tue Sep 7 20:44:27 2010 @@ -69,9 +69,11 @@ ASTContext &getContext() const { return CGM.getContext(); } + virtual void _anchor(); + public: - virtual ~CGCXXABI(); + virtual ~CGCXXABI() {} /// Gets the mangle context. virtual MangleContext &getMangleContext() = 0; @@ -217,6 +219,14 @@ QualType ElementType, llvm::Value *&NumElements, llvm::Value *&AllocPtr, CharUnits &CookieSize); + /*************************** Static local guards ****************************/ + + /// Emits the initializer and destructor setup for the given static + /// local variable, given that it's reachable and couldn't be + /// emitted as a constant. + virtual void EmitStaticLocalInit(CodeGenFunction &CGF, const VarDecl &D, + llvm::GlobalVariable *DeclPtr); + }; /// Creates an instance of a C++ ABI class. Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGDecl.cpp (original) +++ cfe/trunk/lib/CodeGen/CGDecl.cpp Tue Sep 7 20:44:27 2010 @@ -189,12 +189,12 @@ if (!Init) { if (!getContext().getLangOptions().CPlusPlus) CGM.ErrorUnsupported(D.getInit(), "constant l-value expression"); - else { + else if (Builder.GetInsertBlock()) { // Since we have a static initializer, this global variable can't // be constant. GV->setConstant(false); - - EmitStaticCXXBlockVarDeclInit(D, GV); + + EmitCXXStaticLocalInit(D, GV); } return GV; } Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original) +++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Tue Sep 7 20:44:27 2010 @@ -42,6 +42,8 @@ } } +/// Emit code to cause the destruction of the given variable with +/// static storage duration. static void EmitDeclDestroy(CodeGenFunction &CGF, const VarDecl &D, llvm::Constant *DeclPtr) { CodeGenModule &CGM = CGF.CGM; @@ -138,6 +140,11 @@ Builder.CreateCall(AtExitFn, &Args[0], llvm::array_endof(Args)); } +void CodeGenFunction::EmitCXXStaticLocalInit(const VarDecl &D, + llvm::GlobalVariable *DeclPtr) { + CGM.getCXXABI().EmitStaticLocalInit(*this, D, DeclPtr); +} + static llvm::Function * CreateGlobalInitOrDestructFunction(CodeGenModule &CGM, const llvm::FunctionType *FTy, @@ -283,143 +290,6 @@ FinishFunction(); } -static llvm::Constant *getGuardAcquireFn(CodeGenFunction &CGF) { - // int __cxa_guard_acquire(__int64_t *guard_object); - - const llvm::Type *Int64PtrTy = - llvm::Type::getInt64PtrTy(CGF.getLLVMContext()); - - std::vector Args(1, Int64PtrTy); - - const llvm::FunctionType *FTy = - llvm::FunctionType::get(CGF.ConvertType(CGF.getContext().IntTy), - Args, /*isVarArg=*/false); - - return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_guard_acquire"); -} - -static llvm::Constant *getGuardReleaseFn(CodeGenFunction &CGF) { - // void __cxa_guard_release(__int64_t *guard_object); - - const llvm::Type *Int64PtrTy = - llvm::Type::getInt64PtrTy(CGF.getLLVMContext()); - - std::vector Args(1, Int64PtrTy); - - const llvm::FunctionType *FTy = - llvm::FunctionType::get(llvm::Type::getVoidTy(CGF.getLLVMContext()), - Args, /*isVarArg=*/false); - - return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_guard_release"); -} - -static llvm::Constant *getGuardAbortFn(CodeGenFunction &CGF) { - // void __cxa_guard_abort(__int64_t *guard_object); - - const llvm::Type *Int64PtrTy = - llvm::Type::getInt64PtrTy(CGF.getLLVMContext()); - - std::vector Args(1, Int64PtrTy); - - const llvm::FunctionType *FTy = - llvm::FunctionType::get(llvm::Type::getVoidTy(CGF.getLLVMContext()), - Args, /*isVarArg=*/false); - - return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_guard_abort"); -} - -namespace { - struct CallGuardAbort : EHScopeStack::Cleanup { - llvm::GlobalVariable *Guard; - CallGuardAbort(llvm::GlobalVariable *Guard) : Guard(Guard) {} - - void Emit(CodeGenFunction &CGF, bool IsForEH) { - // It shouldn't be possible for this to throw, but if it can, - // this should allow for the possibility of an invoke. - CGF.Builder.CreateCall(getGuardAbortFn(CGF), Guard) - ->setDoesNotThrow(); - } - }; -} - -void -CodeGenFunction::EmitStaticCXXBlockVarDeclInit(const VarDecl &D, - llvm::GlobalVariable *GV) { - // Bail out early if this initializer isn't reachable. - if (!Builder.GetInsertBlock()) return; - - bool ThreadsafeStatics = getContext().getLangOptions().ThreadsafeStatics; - - llvm::SmallString<256> GuardVName; - CGM.getCXXABI().getMangleContext().mangleGuardVariable(&D, GuardVName); - - // Create the guard variable. - llvm::GlobalVariable *GuardVariable = - new llvm::GlobalVariable(CGM.getModule(), Int64Ty, - false, GV->getLinkage(), - llvm::Constant::getNullValue(Int64Ty), - GuardVName.str()); - - // Load the first byte of the guard variable. - const llvm::Type *PtrTy - = llvm::PointerType::get(llvm::Type::getInt8Ty(VMContext), 0); - llvm::Value *V = - Builder.CreateLoad(Builder.CreateBitCast(GuardVariable, PtrTy), "tmp"); - - llvm::BasicBlock *InitCheckBlock = createBasicBlock("init.check"); - llvm::BasicBlock *EndBlock = createBasicBlock("init.end"); - - // Check if the first byte of the guard variable is zero. - Builder.CreateCondBr(Builder.CreateIsNull(V, "tobool"), - InitCheckBlock, EndBlock); - - EmitBlock(InitCheckBlock); - - // Variables used when coping with thread-safe statics and exceptions. - if (ThreadsafeStatics) { - // Call __cxa_guard_acquire. - V = Builder.CreateCall(getGuardAcquireFn(*this), GuardVariable); - - llvm::BasicBlock *InitBlock = createBasicBlock("init"); - - Builder.CreateCondBr(Builder.CreateIsNotNull(V, "tobool"), - InitBlock, EndBlock); - - // Call __cxa_guard_abort along the exceptional edge. - if (Exceptions) - EHStack.pushCleanup(EHCleanup, GuardVariable); - - EmitBlock(InitBlock); - } - - if (D.getType()->isReferenceType()) { - unsigned Alignment = getContext().getDeclAlign(&D).getQuantity(); - QualType T = D.getType(); - RValue RV = EmitReferenceBindingToExpr(D.getInit(), &D); - EmitStoreOfScalar(RV.getScalarVal(), GV, /*Volatile=*/false, Alignment, T); - } else - EmitDeclInit(*this, D, GV); - - if (ThreadsafeStatics) { - // Pop the guard-abort cleanup if we pushed one. - if (Exceptions) - PopCleanupBlock(); - - // Call __cxa_guard_release. This cannot throw. - Builder.CreateCall(getGuardReleaseFn(*this), GuardVariable); - } else { - llvm::Value *One = - llvm::ConstantInt::get(llvm::Type::getInt8Ty(VMContext), 1); - Builder.CreateStore(One, Builder.CreateBitCast(GuardVariable, PtrTy)); - } - - // Register the call to the destructor. - if (!D.getType()->isReferenceType()) - EmitDeclDestroy(*this, D, GV); - - EmitBlock(EndBlock); -} - /// GenerateCXXAggrDestructorHelper - Generates a helper function which when /// invoked, calls the default destructor on array elements in reverse order of /// construction. Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original) +++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Tue Sep 7 20:44:27 2010 @@ -1565,11 +1565,6 @@ llvm::GlobalVariable *GV); - /// EmitStaticCXXBlockVarDeclInit - Create the initializer for a C++ runtime - /// initialized static block var decl. - void EmitStaticCXXBlockVarDeclInit(const VarDecl &D, - llvm::GlobalVariable *GV); - /// EmitCXXGlobalVarDeclInit - Create the initializer for a C++ /// variable with global storage. void EmitCXXGlobalVarDeclInit(const VarDecl &D, llvm::Constant *DeclPtr); @@ -1579,6 +1574,8 @@ void EmitCXXGlobalDtorRegistration(llvm::Constant *DtorFn, llvm::Constant *DeclPtr); + void EmitCXXStaticLocalInit(const VarDecl &D, llvm::GlobalVariable *DeclPtr); + /// GenerateCXXGlobalInitFunc - Generates code for initializing global /// variables. void GenerateCXXGlobalInitFunc(llvm::Function *Fn, Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp (original) +++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp Tue Sep 7 20:44:27 2010 @@ -119,6 +119,9 @@ void ReadArrayCookie(CodeGenFunction &CGF, llvm::Value *Ptr, QualType ElementType, llvm::Value *&NumElements, llvm::Value *&AllocPtr, CharUnits &CookieSize); + + void EmitStaticLocalInit(CodeGenFunction &CGF, const VarDecl &D, + llvm::GlobalVariable *DeclPtr); }; class ARMCXXABI : public ItaniumCXXABI { @@ -1021,3 +1024,159 @@ NumElements = CGF.Builder.CreateLoad(NumElementsPtr); } +/*********************** Static local initialization **************************/ + +static llvm::Constant *getGuardAcquireFn(CodeGenModule &CGM, + const llvm::PointerType *GuardPtrTy) { + // int __cxa_guard_acquire(__guard *guard_object); + + std::vector Args(1, GuardPtrTy); + const llvm::FunctionType *FTy = + llvm::FunctionType::get(CGM.getTypes().ConvertType(CGM.getContext().IntTy), + Args, /*isVarArg=*/false); + + return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_acquire"); +} + +static llvm::Constant *getGuardReleaseFn(CodeGenModule &CGM, + const llvm::PointerType *GuardPtrTy) { + // void __cxa_guard_release(__guard *guard_object); + + std::vector Args(1, GuardPtrTy); + + const llvm::FunctionType *FTy = + llvm::FunctionType::get(llvm::Type::getVoidTy(CGM.getLLVMContext()), + Args, /*isVarArg=*/false); + + return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_release"); +} + +static llvm::Constant *getGuardAbortFn(CodeGenModule &CGM, + const llvm::PointerType *GuardPtrTy) { + // void __cxa_guard_abort(__guard *guard_object); + + std::vector Args(1, GuardPtrTy); + + const llvm::FunctionType *FTy = + llvm::FunctionType::get(llvm::Type::getVoidTy(CGM.getLLVMContext()), + Args, /*isVarArg=*/false); + + return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_abort"); +} + +namespace { + struct CallGuardAbort : EHScopeStack::Cleanup { + llvm::GlobalVariable *Guard; + CallGuardAbort(llvm::GlobalVariable *Guard) : Guard(Guard) {} + + void Emit(CodeGenFunction &CGF, bool IsForEH) { + CGF.Builder.CreateCall(getGuardAbortFn(CGF.CGM, Guard->getType()), Guard) + ->setDoesNotThrow(); + } + }; +} + +/// The ARM code here follows the Itanium code closely enough that we +/// just special-case it at particular places. +void ItaniumCXXABI::EmitStaticLocalInit(CodeGenFunction &CGF, + const VarDecl &D, + llvm::GlobalVariable *GV) { + CGBuilderTy &Builder = CGF.Builder; + bool ThreadsafeStatics = getContext().getLangOptions().ThreadsafeStatics; + + // Guard variables are 64 bits in the generic ABI and 32 bits on ARM. + const llvm::IntegerType *GuardTy + = (IsARM ? Builder.getInt32Ty() : Builder.getInt64Ty()); + const llvm::PointerType *GuardPtrTy = GuardTy->getPointerTo(); + + // Create the guard variable. + llvm::SmallString<256> GuardVName; + getMangleContext().mangleItaniumGuardVariable(&D, GuardVName); + llvm::GlobalVariable *GuardVariable = + new llvm::GlobalVariable(CGM.getModule(), GuardTy, + false, GV->getLinkage(), + llvm::ConstantInt::get(GuardTy, 0), + GuardVName.str()); + + // Test whether the variable has completed initialization. + llvm::Value *IsInitialized; + + // ARM C++ ABI 3.2.3.1: + // To support the potential use of initialization guard variables + // as semaphores that are the target of ARM SWP and LDREX/STREX + // synchronizing instructions we define a static initialization + // guard variable to be a 4-byte aligned, 4- byte word with the + // following inline access protocol. + // #define INITIALIZED 1 + // if ((obj_guard & INITIALIZED) != INITIALIZED) { + // if (__cxa_guard_acquire(&obj_guard)) + // ... + // } + if (IsARM) { + llvm::Value *V = Builder.CreateLoad(GuardVariable); + V = Builder.CreateAnd(V, Builder.getInt32(1)); + IsInitialized = Builder.CreateIsNull(V, "guard.uninitialized"); + + // Itanium C++ ABI 3.3.2: + // The following is pseudo-code showing how these functions can be used: + // if (obj_guard.first_byte == 0) { + // if ( __cxa_guard_acquire (&obj_guard) ) { + // try { + // ... initialize the object ...; + // } catch (...) { + // __cxa_guard_abort (&obj_guard); + // throw; + // } + // ... queue object destructor with __cxa_atexit() ...; + // __cxa_guard_release (&obj_guard); + // } + // } + } else { + // Load the first byte of the guard variable. + const llvm::Type *PtrTy = Builder.getInt8PtrTy(); + llvm::Value *V = + Builder.CreateLoad(Builder.CreateBitCast(GuardVariable, PtrTy), "tmp"); + + IsInitialized = Builder.CreateIsNull(V, "guard.uninitialized"); + } + + llvm::BasicBlock *InitCheckBlock = CGF.createBasicBlock("init.check"); + llvm::BasicBlock *EndBlock = CGF.createBasicBlock("init.end"); + + // Check if the first byte of the guard variable is zero. + Builder.CreateCondBr(IsInitialized, InitCheckBlock, EndBlock); + + CGF.EmitBlock(InitCheckBlock); + + // Variables used when coping with thread-safe statics and exceptions. + if (ThreadsafeStatics) { + // Call __cxa_guard_acquire. + llvm::Value *V + = Builder.CreateCall(getGuardAcquireFn(CGM, GuardPtrTy), GuardVariable); + + llvm::BasicBlock *InitBlock = CGF.createBasicBlock("init"); + + Builder.CreateCondBr(Builder.CreateIsNotNull(V, "tobool"), + InitBlock, EndBlock); + + // Call __cxa_guard_abort along the exceptional edge. + CGF.EHStack.pushCleanup(EHCleanup, GuardVariable); + + CGF.EmitBlock(InitBlock); + } + + // Emit the initializer and add a global destructor if appropriate. + CGF.EmitCXXGlobalVarDeclInit(D, GV); + + if (ThreadsafeStatics) { + // Pop the guard-abort cleanup if we pushed one. + CGF.PopCleanupBlock(); + + // Call __cxa_guard_release. This cannot throw. + Builder.CreateCall(getGuardReleaseFn(CGM, GuardPtrTy), GuardVariable); + } else { + Builder.CreateStore(llvm::ConstantInt::get(GuardTy, 1), GuardVariable); + } + + CGF.EmitBlock(EndBlock); +} Modified: cfe/trunk/lib/CodeGen/Mangle.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/Mangle.cpp (original) +++ cfe/trunk/lib/CodeGen/Mangle.cpp Tue Sep 7 20:44:27 2010 @@ -2451,8 +2451,8 @@ /// mangleGuardVariable - Returns the mangled name for a guard variable /// for the passed in VarDecl. -void MangleContext::mangleGuardVariable(const VarDecl *D, - llvm::SmallVectorImpl &Res) { +void MangleContext::mangleItaniumGuardVariable(const VarDecl *D, + llvm::SmallVectorImpl &Res) { // ::= GV # Guard variable for one-time // # initialization CXXNameMangler Mangler(*this, Res); Modified: cfe/trunk/lib/CodeGen/Mangle.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.h?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/Mangle.h (original) +++ cfe/trunk/lib/CodeGen/Mangle.h Tue Sep 7 20:44:27 2010 @@ -119,8 +119,6 @@ virtual void mangleCXXDtorThunk(const CXXDestructorDecl *DD, CXXDtorType Type, const ThisAdjustment &ThisAdjustment, llvm::SmallVectorImpl &); - virtual void mangleGuardVariable(const VarDecl *D, - llvm::SmallVectorImpl &); virtual void mangleReferenceTemporary(const VarDecl *D, llvm::SmallVectorImpl &); virtual void mangleCXXVTable(const CXXRecordDecl *RD, @@ -139,6 +137,10 @@ void mangleBlock(GlobalDecl GD, const BlockDecl *BD, llvm::SmallVectorImpl &); + // This is pretty lame. + void mangleItaniumGuardVariable(const VarDecl *D, + llvm::SmallVectorImpl &); + void mangleInitDiscriminator() { Discriminator = 0; } Modified: cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp (original) +++ cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp Tue Sep 7 20:44:27 2010 @@ -91,8 +91,6 @@ virtual void mangleCXXDtorThunk(const CXXDestructorDecl *DD, CXXDtorType Type, const ThisAdjustment &ThisAdjustment, llvm::SmallVectorImpl &); - virtual void mangleGuardVariable(const VarDecl *D, - llvm::SmallVectorImpl &); virtual void mangleCXXVTable(const CXXRecordDecl *RD, llvm::SmallVectorImpl &); virtual void mangleCXXVTT(const CXXRecordDecl *RD, @@ -1175,10 +1173,6 @@ llvm::SmallVectorImpl &) { assert(false && "Can't yet mangle destructor thunks!"); } -void MicrosoftMangleContext::mangleGuardVariable(const VarDecl *D, - llvm::SmallVectorImpl &) { - assert(false && "Can't yet mangle guard variables!"); -} void MicrosoftMangleContext::mangleCXXVTable(const CXXRecordDecl *RD, llvm::SmallVectorImpl &) { assert(false && "Can't yet mangle virtual tables!"); Modified: cfe/trunk/test/CodeGenCXX/arm.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/arm.cpp?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/test/CodeGenCXX/arm.cpp (original) +++ cfe/trunk/test/CodeGenCXX/arm.cpp Tue Sep 7 20:44:27 2010 @@ -1,5 +1,10 @@ // RUN: %clang_cc1 %s -triple=thumbv7-apple-darwin3.0.0-iphoneos -fno-use-cxa-atexit -target-abi apcs-gnu -emit-llvm -o - -fexceptions | FileCheck %s +// CHECK: @_ZZN5test74testEvE1x = internal global i32 0, align 4 +// CHECK: @_ZGVZN5test74testEvE1x = internal global i32 0 +// CHECK: @_ZZN5test84testEvE1x = internal global [[TEST8A:.*]] zeroinitializer, align 1 +// CHECK: @_ZGVZN5test84testEvE1x = internal global i32 0 + typedef typeof(sizeof(int)) size_t; class foo { @@ -277,6 +282,76 @@ } } +namespace test7 { + int foo(); + + // Static and guard tested at top of file + + // CHECK: define void @_ZN5test74testEv() + void test() { + // CHECK: [[T0:%.*]] = load i32* @_ZGVZN5test74testEvE1x + // CHECK-NEXT: [[T1:%.*]] = and i32 [[T0]], 1 + // CHECK-NEXT: [[T2:%.*]] = icmp eq i32 [[T1]], 0 + // CHECK-NEXT: br i1 [[T2]] + // -> fallthrough, end + // CHECK: [[T3:%.*]] = call i32 @__cxa_guard_acquire(i32* @_ZGVZN5test74testEvE1x) + // CHECK-NEXT: [[T4:%.*]] = icmp ne i32 [[T3]], 0 + // CHECK-NEXT: br i1 [[T4]] + // -> fallthrough, end + // CHECK: [[INIT:%.*]] = invoke i32 @_ZN5test73fooEv() + // CHECK: store i32 [[INIT]], i32* @_ZZN5test74testEvE1x, align 4 + // CHECK-NEXT: call void @__cxa_guard_release(i32* @_ZGVZN5test74testEvE1x) + // CHECK-NEXT: br label + // -> end + // end: + // CHECK: ret void + static int x = foo(); + + // CHECK: call i8* @llvm.eh.exception() + // CHECK: call void @__cxa_guard_abort(i32* @_ZGVZN5test74testEvE1x) + // CHECK: call void @_Unwind_Resume_or_Rethrow + } +} + +namespace test8 { + struct A { + A(); + ~A(); + }; + + // Static and guard tested at top of file + + // CHECK: define void @_ZN5test84testEv() + void test() { + // CHECK: [[T0:%.*]] = load i32* @_ZGVZN5test84testEvE1x + // CHECK-NEXT: [[T1:%.*]] = and i32 [[T0]], 1 + // CHECK-NEXT: [[T2:%.*]] = icmp eq i32 [[T1]], 0 + // CHECK-NEXT: br i1 [[T2]] + // -> fallthrough, end + // CHECK: [[T3:%.*]] = call i32 @__cxa_guard_acquire(i32* @_ZGVZN5test84testEvE1x) + // CHECK-NEXT: [[T4:%.*]] = icmp ne i32 [[T3]], 0 + // CHECK-NEXT: br i1 [[T4]] + // -> fallthrough, end + // CHECK: [[INIT:%.*]] = invoke [[TEST8A]]* @_ZN5test81AC1Ev([[TEST8A]]* @_ZZN5test84testEvE1x) + + // FIXME: Here we register a global destructor that + // unconditionally calls the destructor. That's what we've always + // done for -fno-use-cxa-atexit here, but that's really not + // semantically correct at all. + + // CHECK: call void @__cxa_guard_release(i32* @_ZGVZN5test84testEvE1x) + // CHECK-NEXT: br label + // -> end + // end: + // CHECK: ret void + static A x; + + // CHECK: call i8* @llvm.eh.exception() + // CHECK: call void @__cxa_guard_abort(i32* @_ZGVZN5test84testEvE1x) + // CHECK: call void @_Unwind_Resume_or_Rethrow + } +} + // CHECK: define linkonce_odr [[C:%.*]]* @_ZTv0_n12_N5test21CD1Ev( // CHECK: call [[C]]* @_ZN5test21CD1Ev( // CHECK: ret [[C]]* undef Modified: cfe/trunk/test/CodeGenCXX/static-init.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/static-init.cpp?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/test/CodeGenCXX/static-init.cpp (original) +++ cfe/trunk/test/CodeGenCXX/static-init.cpp Tue Sep 7 20:44:27 2010 @@ -14,8 +14,8 @@ void f() { // CHECK: call i32 @__cxa_guard_acquire // CHECK: call void @_ZN1AC1Ev - // CHECK: call void @__cxa_guard_release // CHECK: call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.A*)* @_ZN1AD1Ev to void (i8*)*), i8* getelementptr inbounds (%struct.A* @_ZZ1fvE1a, i32 0, i32 0), i8* bitcast (i8** @__dso_handle to i8*)) + // CHECK: call void @__cxa_guard_release static A a; } Modified: cfe/trunk/test/CodeGenCXX/threadsafe-statics-exceptions.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/threadsafe-statics-exceptions.cpp?rev=113330&r1=113329&r2=113330&view=diff ============================================================================== --- cfe/trunk/test/CodeGenCXX/threadsafe-statics-exceptions.cpp (original) +++ cfe/trunk/test/CodeGenCXX/threadsafe-statics-exceptions.cpp Tue Sep 7 20:44:27 2010 @@ -11,8 +11,8 @@ void f() { // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZ1fvE1x) // CHECK: invoke void @_ZN1XC1Ev - // CHECK: call void @__cxa_guard_release(i64* @_ZGVZ1fvE1x) - // CHECK-NEXT: call i32 @__cxa_atexit + // CHECK: call i32 @__cxa_atexit + // CHECK-NEXT: call void @__cxa_guard_release(i64* @_ZGVZ1fvE1x) // CHECK: br static X x; From rjmccall at apple.com Tue Sep 7 21:01:27 2010 From: rjmccall at apple.com (John McCall) Date: Wed, 08 Sep 2010 02:01:27 -0000 Subject: [cfe-commits] r113334 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td test/Analysis/additive-folding.c test/Analysis/null-deref-ps.c Message-ID: <20100908020127.6225F2A6C12C@llvm.org> Author: rjmccall Date: Tue Sep 7 21:01:27 2010 New Revision: 113334 URL: http://llvm.org/viewvc/llvm-project?rev=113334&view=rev Log: Put the tautological-comparison-of-unsigned-against-zero warnings in -Wtautological-compare instead of -Wsign-compare, which also implies turning them on by default. Restoration of r112877. Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/test/Analysis/additive-folding.c cfe/trunk/test/Analysis/null-deref-ps.c Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=113334&r1=113333&r2=113334&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Tue Sep 7 21:01:27 2010 @@ -101,6 +101,7 @@ def : DiagGroup<"stack-protector">; def : DiagGroup<"switch-default">; def : DiagGroup<"synth">; +def TautologicalCompare : DiagGroup<"tautological-compare">; // Preprocessor warnings. def : DiagGroup<"builtin-macro-redefined">; Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=113334&r1=113333&r2=113334&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Sep 7 21:01:27 2010 @@ -2204,10 +2204,10 @@ InGroup, DefaultIgnore; def warn_lunsigned_always_true_comparison : Warning< "comparison of unsigned expression %0 is always %1">, - InGroup, DefaultIgnore; + InGroup; def warn_runsigned_always_true_comparison : Warning< "comparison of %0 unsigned expression is always %1">, - InGroup, DefaultIgnore; + InGroup; def err_invalid_this_use : Error< "invalid use of 'this' outside of a nonstatic member function">; @@ -3068,7 +3068,7 @@ // Array comparisons have similar warnings def warn_comparison_always : Warning< "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">, - InGroup>; + InGroup; def warn_stringcompare : Warning< "result of comparison against %select{a string literal|@encode}0 is " Modified: cfe/trunk/test/Analysis/additive-folding.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/additive-folding.c?rev=113334&r1=113333&r2=113334&view=diff ============================================================================== --- cfe/trunk/test/Analysis/additive-folding.c (original) +++ cfe/trunk/test/Analysis/additive-folding.c Tue Sep 7 21:01:27 2010 @@ -183,14 +183,14 @@ void tautologyGE (unsigned a) { char* b = malloc(1); - if (a >= 0) + if (a >= 0) // expected-warning{{always true}} free(b); return; // no-warning } void tautologyLT (unsigned a) { char* b = malloc(1); - if (a < 0) + if (a < 0) // expected-warning{{always false}} return; // expected-warning{{never executed}} free(b); } Modified: cfe/trunk/test/Analysis/null-deref-ps.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/null-deref-ps.c?rev=113334&r1=113333&r2=113334&view=diff ============================================================================== --- cfe/trunk/test/Analysis/null-deref-ps.c (original) +++ cfe/trunk/test/Analysis/null-deref-ps.c Tue Sep 7 21:01:27 2010 @@ -237,7 +237,7 @@ // Test case from void f11(unsigned i) { int *x = 0; - if (i >= 0) { + if (i >= 0) { // expected-warning{{always true}} // always true } else { *x = 42; // no-warning From sebastian.redl at getdesigned.at Tue Sep 7 23:46:20 2010 From: sebastian.redl at getdesigned.at (Sebastian Redl) Date: Wed, 08 Sep 2010 04:46:20 -0000 Subject: [cfe-commits] r113344 - in /cfe/trunk: lib/Sema/SemaDeclCXX.cpp test/SemaCXX/warn-global-constructors.cpp Message-ID: <20100908044620.172132A6C12C@llvm.org> Author: cornedbee Date: Tue Sep 7 23:46:19 2010 New Revision: 113344 URL: http://llvm.org/viewvc/llvm-project?rev=113344&view=rev Log: Don't give 'global constructor' warnings for function statics, even if they have a direct initializer. Fixes PR8095. Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp cfe/trunk/test/SemaCXX/warn-global-constructors.cpp Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=113344&r1=113343&r2=113344&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Tue Sep 7 23:46:19 2010 @@ -5622,7 +5622,7 @@ if (!VDecl->isInvalidDecl() && !VDecl->getDeclContext()->isDependentContext() && - VDecl->hasGlobalStorage() && + VDecl->hasGlobalStorage() && !VDecl->isStaticLocal() && !VDecl->getInit()->isConstantInitializer(Context, VDecl->getType()->isReferenceType())) Diag(VDecl->getLocation(), diag::warn_global_constructor) Modified: cfe/trunk/test/SemaCXX/warn-global-constructors.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-global-constructors.cpp?rev=113344&r1=113343&r2=113344&view=diff ============================================================================== --- cfe/trunk/test/SemaCXX/warn-global-constructors.cpp (original) +++ cfe/trunk/test/SemaCXX/warn-global-constructors.cpp Tue Sep 7 23:46:19 2010 @@ -77,5 +77,15 @@ void f2() { static A& a = *new A; } +} -} \ No newline at end of file +namespace pr8095 { + struct Foo { + int x; + Foo(int x1) : x(x1) {} + }; + + void bar() { + static Foo a(0); + } +} From pichet2000 at gmail.com Wed Sep 8 06:32:25 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Wed, 08 Sep 2010 11:32:25 -0000 Subject: [cfe-commits] r113354 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp test/SemaCXX/MicrosoftExtensions.cpp Message-ID: <20100908113226.128312A6C12C@llvm.org> Author: fpichet Date: Wed Sep 8 06:32:25 2010 New Revision: 113354 URL: http://llvm.org/viewvc/llvm-project?rev=113354&view=rev Log: Allow type definitions inside anonymous struct/union in Microsoft mode. Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/lib/Sema/SemaDecl.cpp cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=113354&r1=113353&r2=113354&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Wed Sep 8 06:32:25 2010 @@ -227,3 +227,6 @@ // A warning group for warnings about GCC extensions. def GNU : DiagGroup<"gnu", [GNUDesignator, VLA]>; + +// A warning group for warnings about Microsoft extensions. +def Microsoft : DiagGroup<"microsoft">; Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=113354&r1=113353&r2=113354&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Sep 8 06:32:25 2010 @@ -2850,6 +2850,9 @@ "member of anonymous struct redeclares %0">; def err_anonymous_record_with_type : Error< "types cannot be declared in an anonymous %select{struct|union}0">; +def ext_anonymous_record_with_type : Extension< + "types declared in an anonymous %select{struct|union}0 are a Microsoft extension">, + InGroup; def err_anonymous_record_with_function : Error< "functions cannot be declared in an anonymous %select{struct|union}0">; def err_anonymous_record_with_static : Error< Modified: cfe/trunk/lib/Sema/SemaDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=113354&r1=113353&r2=113354&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDecl.cpp (original) +++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Sep 8 06:32:25 2010 @@ -1898,10 +1898,16 @@ } else if (RecordDecl *MemRecord = dyn_cast(*Mem)) { if (!MemRecord->isAnonymousStructOrUnion() && MemRecord->getDeclName()) { - // This is a nested type declaration. - Diag(MemRecord->getLocation(), diag::err_anonymous_record_with_type) - << (int)Record->isUnion(); - Invalid = true; + // Visual C++ allows type definition in anonymous struct or union. + if (getLangOptions().Microsoft) + Diag(MemRecord->getLocation(), diag::ext_anonymous_record_with_type) + << (int)Record->isUnion(); + else { + // This is a nested type declaration. + Diag(MemRecord->getLocation(), diag::err_anonymous_record_with_type) + << (int)Record->isUnion(); + Invalid = true; + } } } else if (isa(*Mem)) { // Any access specifier is fine. @@ -1915,9 +1921,17 @@ DK = diag::err_anonymous_record_with_function; else if (isa(*Mem)) DK = diag::err_anonymous_record_with_static; - Diag((*Mem)->getLocation(), DK) + + // Visual C++ allows type definition in anonymous struct or union. + if (getLangOptions().Microsoft && + DK == diag::err_anonymous_record_with_type) + Diag((*Mem)->getLocation(), diag::ext_anonymous_record_with_type) << (int)Record->isUnion(); + else { + Diag((*Mem)->getLocation(), DK) + << (int)Record->isUnion(); Invalid = true; + } } } } Modified: cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp?rev=113354&r1=113353&r2=113354&view=diff ============================================================================== --- cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp (original) +++ cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp Wed Sep 8 06:32:25 2010 @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-extensions -fexceptions +// RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions -fexceptions // ::type_info is predeclared with forward class declartion @@ -30,6 +30,48 @@ virtual void f3(); }; + +// MSVC allows type definition in anonymous union and struct +struct A +{ + union + { + int a; + struct B // expected-warning {{types declared in an anonymous union are a Microsoft extension}} + { + int c; + } d; + + union C // expected-warning {{types declared in an anonymous union are a Microsoft extension}} + { + int e; + int ee; + } f; + + typedef int D; // expected-warning {{types declared in an anonymous union are a Microsoft extension}} + struct F; // expected-warning {{types declared in an anonymous union are a Microsoft extension}} + }; + + struct + { + int a2; + + struct B2 // expected-warning {{types declared in an anonymous struct are a Microsoft extension}} + { + int c2; + } d2; + + union C2 // expected-warning {{types declared in an anonymous struct are a Microsoft extension}} + { + int e2; + int ee2; + } f2; + + typedef int D2; // expected-warning {{types declared in an anonymous struct are a Microsoft extension}} + struct F2; // expected-warning {{types declared in an anonymous struct are a Microsoft extension}} + }; +}; + // __stdcall handling struct M { int __stdcall addP(); From pichet2000 at gmail.com Wed Sep 8 07:20:18 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Wed, 08 Sep 2010 12:20:18 -0000 Subject: [cfe-commits] r113356 - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ include/clang/Parse/ include/clang/Sema/ include/clang/Serialization/ lib/AST/ lib/Parse/ lib/Sema/ lib/Serialization/ test/Parser/ Message-ID: <20100908122018.D763C2A6C12C@llvm.org> Author: fpichet Date: Wed Sep 8 07:20:18 2010 New Revision: 113356 URL: http://llvm.org/viewvc/llvm-project?rev=113356&view=rev Log: Microsoft's __uuidof operator implementation part 1. Modified: cfe/trunk/include/clang/AST/ExprCXX.h cfe/trunk/include/clang/AST/RecursiveASTVisitor.h cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/include/clang/Basic/StmtNodes.td cfe/trunk/include/clang/Basic/TokenKinds.def cfe/trunk/include/clang/Parse/Parser.h cfe/trunk/include/clang/Sema/Sema.h cfe/trunk/include/clang/Serialization/ASTBitCodes.h cfe/trunk/lib/AST/ExprCXX.cpp cfe/trunk/lib/AST/StmtPrinter.cpp cfe/trunk/lib/AST/StmtProfile.cpp cfe/trunk/lib/Parse/ParseExpr.cpp cfe/trunk/lib/Parse/ParseExprCXX.cpp cfe/trunk/lib/Sema/Sema.cpp cfe/trunk/lib/Sema/SemaExprCXX.cpp cfe/trunk/lib/Sema/TreeTransform.h cfe/trunk/lib/Serialization/ASTReaderStmt.cpp cfe/trunk/lib/Serialization/ASTWriterStmt.cpp cfe/trunk/test/Parser/MicrosoftExtensions.c Modified: cfe/trunk/include/clang/AST/ExprCXX.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/ExprCXX.h (original) +++ cfe/trunk/include/clang/AST/ExprCXX.h Wed Sep 8 07:20:18 2010 @@ -396,6 +396,74 @@ virtual child_iterator child_end(); }; +/// CXXUuidofExpr - A microsoft C++ @c __uuidof expression, which gets +/// the _GUID that corresponds to the supplied type or expression. +/// +/// This represents code like @c __uuidof(COMTYPE) or @c __uuidof(*comPtr) +class CXXUuidofExpr : public Expr { +private: + llvm::PointerUnion Operand; + SourceRange Range; + +public: + CXXUuidofExpr(QualType Ty, TypeSourceInfo *Operand, SourceRange R) + : Expr(CXXUuidofExprClass, Ty, + false, Operand->getType()->isDependentType()), + Operand(Operand), Range(R) { } + + CXXUuidofExpr(QualType Ty, Expr *Operand, SourceRange R) + : Expr(CXXUuidofExprClass, Ty, + false, Operand->isTypeDependent()), + Operand(Operand), Range(R) { } + + CXXUuidofExpr(EmptyShell Empty, bool isExpr) + : Expr(CXXUuidofExprClass, Empty) { + if (isExpr) + Operand = (Expr*)0; + else + Operand = (TypeSourceInfo*)0; + } + + bool isTypeOperand() const { return Operand.is(); } + + /// \brief Retrieves the type operand of this __uuidof() expression after + /// various required adjustments (removing reference types, cv-qualifiers). + QualType getTypeOperand() const; + + /// \brief Retrieve source information for the type operand. + TypeSourceInfo *getTypeOperandSourceInfo() const { + assert(isTypeOperand() && "Cannot call getTypeOperand for __uuidof(expr)"); + return Operand.get(); + } + + void setTypeOperandSourceInfo(TypeSourceInfo *TSI) { + assert(isTypeOperand() && "Cannot call getTypeOperand for __uuidof(expr)"); + Operand = TSI; + } + + Expr *getExprOperand() const { + assert(!isTypeOperand() && "Cannot call getExprOperand for __uuidof(type)"); + return static_cast(Operand.get()); + } + + void setExprOperand(Expr *E) { + assert(!isTypeOperand() && "Cannot call getExprOperand for __uuidof(type)"); + Operand = E; + } + + virtual SourceRange getSourceRange() const { return Range; } + void setSourceRange(SourceRange R) { Range = R; } + + static bool classof(const Stmt *T) { + return T->getStmtClass() == CXXUuidofExprClass; + } + static bool classof(const CXXUuidofExpr *) { return true; } + + // Iterators + virtual child_iterator child_begin(); + virtual child_iterator child_end(); +}; + /// CXXThisExpr - Represents the "this" expression in C++, which is a /// pointer to the object on which the current member function is /// executing (C++ [expr.prim]p3). Example: Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original) +++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Wed Sep 8 07:20:18 2010 @@ -1769,6 +1769,13 @@ TRY_TO(TraverseTypeLoc(S->getTypeOperandSourceInfo()->getTypeLoc())); }) +DEF_TRAVERSE_STMT(CXXUuidofExpr, { + // The child-iterator will pick up the arg if it's an expression, + // but not if it's a type. + if (S->isTypeOperand()) + TRY_TO(TraverseTypeLoc(S->getTypeOperandSourceInfo()->getTypeLoc())); + }) + DEF_TRAVERSE_STMT(TypesCompatibleExpr, { TRY_TO(TraverseTypeLoc(S->getArgTInfo1()->getTypeLoc())); TRY_TO(TraverseTypeLoc(S->getArgTInfo2()->getTypeLoc())); Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Sep 8 07:20:18 2010 @@ -2392,6 +2392,8 @@ // Other C++ expressions def err_need_header_before_typeid : Error< "you need to include before using the 'typeid' operator">; +def err_need_header_before_ms_uuidof : Error< + "you need to include before using the '__uuidof' operator">; def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">; def err_static_illegal_in_new : Error< "the 'static' modifier for the array size is not legal in new expressions">; Modified: cfe/trunk/include/clang/Basic/StmtNodes.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/StmtNodes.td?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/StmtNodes.td (original) +++ cfe/trunk/include/clang/Basic/StmtNodes.td Wed Sep 8 07:20:18 2010 @@ -127,3 +127,7 @@ def ShuffleVectorExpr : DStmt; def BlockExpr : DStmt; def BlockDeclRefExpr : DStmt; + +// Microsoft Extensions. +def CXXUuidofExpr : DStmt; + Modified: cfe/trunk/include/clang/Basic/TokenKinds.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/TokenKinds.def (original) +++ cfe/trunk/include/clang/Basic/TokenKinds.def Wed Sep 8 07:20:18 2010 @@ -369,11 +369,13 @@ // Microsoft extensions which should be disabled in strict conformance mode KEYWORD(__ptr64 , KEYMS) KEYWORD(__w64 , KEYMS) +KEYWORD(__uuidof , KEYMS) ALIAS("_asm" , asm , KEYMS) ALIAS("_cdecl" , __cdecl , KEYMS) ALIAS("_fastcall" , __fastcall , KEYMS) ALIAS("_stdcall" , __stdcall , KEYMS) ALIAS("_thiscall" , __thiscall , KEYMS) +ALIAS("_uuidof" ,__uuidof , KEYMS) // Borland Extensions which should be disabled in strict conformance mode. ALIAS("_pascal" , __pascal , KEYBORLAND) Modified: cfe/trunk/include/clang/Parse/Parser.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/include/clang/Parse/Parser.h (original) +++ cfe/trunk/include/clang/Parse/Parser.h Wed Sep 8 07:20:18 2010 @@ -1029,6 +1029,10 @@ ExprResult ParseCXXTypeid(); //===--------------------------------------------------------------------===// + // C++ : Microsoft __uuidof Expression + ExprResult ParseCXXUuidof(); + + //===--------------------------------------------------------------------===// // C++ 5.2.4: C++ Pseudo-Destructor Expressions ExprResult ParseCXXPseudoDestructor(ExprArg Base, SourceLocation OpLoc, tok::TokenKind OpKind, Modified: cfe/trunk/include/clang/Sema/Sema.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/include/clang/Sema/Sema.h (original) +++ cfe/trunk/include/clang/Sema/Sema.h Wed Sep 8 07:20:18 2010 @@ -365,6 +365,9 @@ /// standard library. LazyDeclPtr StdBadAlloc; + /// \brief The MSVC "_GUID" struct, which is defined in MSVC header files. + RecordDecl *MSVCGuidDecl; + /// A flag to remember whether the implicit forms of operator new and delete /// have been declared. bool GlobalNewDeleteDeclared; @@ -2156,6 +2159,22 @@ void *TyOrExpr, SourceLocation RParenLoc); + ExprResult BuildCXXUuidof(QualType TypeInfoType, + SourceLocation TypeidLoc, + TypeSourceInfo *Operand, + SourceLocation RParenLoc); + ExprResult BuildCXXUuidof(QualType TypeInfoType, + SourceLocation TypeidLoc, + Expr *Operand, + SourceLocation RParenLoc); + + /// ActOnCXXUuidof - Parse __uuidof( something ). + virtual ExprResult ActOnCXXUuidof(SourceLocation OpLoc, + SourceLocation LParenLoc, bool isType, + void *TyOrExpr, + SourceLocation RParenLoc); + + //// ActOnCXXThis - Parse 'this' pointer. ExprResult ActOnCXXThis(SourceLocation ThisLoc); Modified: cfe/trunk/include/clang/Serialization/ASTBitCodes.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/include/clang/Serialization/ASTBitCodes.h (original) +++ cfe/trunk/include/clang/Serialization/ASTBitCodes.h Wed Sep 8 07:20:18 2010 @@ -875,6 +875,8 @@ EXPR_CXX_NULL_PTR_LITERAL, // CXXNullPtrLiteralExpr EXPR_CXX_TYPEID_EXPR, // CXXTypeidExpr (of expr). EXPR_CXX_TYPEID_TYPE, // CXXTypeidExpr (of type). + EXPR_CXX_UUIDOF_EXPR, // CXXUuidofExpr (of expr). + EXPR_CXX_UUIDOF_TYPE, // CXXUuidofExpr (of type). EXPR_CXX_THIS, // CXXThisExpr EXPR_CXX_THROW, // CXXThrowExpr EXPR_CXX_DEFAULT_ARG, // CXXDefaultArgExpr Modified: cfe/trunk/lib/AST/ExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/lib/AST/ExprCXX.cpp (original) +++ cfe/trunk/lib/AST/ExprCXX.cpp Wed Sep 8 07:20:18 2010 @@ -39,6 +39,22 @@ : reinterpret_cast(&Operand) + 1; } +QualType CXXUuidofExpr::getTypeOperand() const { + assert(isTypeOperand() && "Cannot call getTypeOperand for __uuidof(expr)"); + return Operand.get()->getType().getNonReferenceType() + .getUnqualifiedType(); +} + +// CXXUuidofExpr - has child iterators if the operand is an expression +Stmt::child_iterator CXXUuidofExpr::child_begin() { + return isTypeOperand() ? child_iterator() + : reinterpret_cast(&Operand); +} +Stmt::child_iterator CXXUuidofExpr::child_end() { + return isTypeOperand() ? child_iterator() + : reinterpret_cast(&Operand) + 1; +} + // CXXBoolLiteralExpr Stmt::child_iterator CXXBoolLiteralExpr::child_begin() { return child_iterator(); Modified: cfe/trunk/lib/AST/StmtPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/lib/AST/StmtPrinter.cpp (original) +++ cfe/trunk/lib/AST/StmtPrinter.cpp Wed Sep 8 07:20:18 2010 @@ -1002,6 +1002,16 @@ OS << ")"; } +void StmtPrinter::VisitCXXUuidofExpr(CXXUuidofExpr *Node) { + OS << "__uuidof("; + if (Node->isTypeOperand()) { + OS << Node->getTypeOperand().getAsString(Policy); + } else { + PrintExpr(Node->getExprOperand()); + } + OS << ")"; +} + void StmtPrinter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *Node) { OS << (Node->getValue() ? "true" : "false"); } Modified: cfe/trunk/lib/AST/StmtProfile.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/lib/AST/StmtProfile.cpp (original) +++ cfe/trunk/lib/AST/StmtProfile.cpp Wed Sep 8 07:20:18 2010 @@ -687,6 +687,12 @@ VisitType(S->getTypeOperand()); } +void StmtProfiler::VisitCXXUuidofExpr(CXXUuidofExpr *S) { + VisitExpr(S); + if (S->isTypeOperand()) + VisitType(S->getTypeOperand()); +} + void StmtProfiler::VisitCXXThisExpr(CXXThisExpr *S) { VisitExpr(S); } Modified: cfe/trunk/lib/Parse/ParseExpr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseExpr.cpp (original) +++ cfe/trunk/lib/Parse/ParseExpr.cpp Wed Sep 8 07:20:18 2010 @@ -768,6 +768,9 @@ case tok::kw_typeid: Res = ParseCXXTypeid(); break; + case tok::kw___uuidof: + Res = ParseCXXUuidof(); + break; case tok::kw_this: Res = ParseCXXThis(); break; Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original) +++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Wed Sep 8 07:20:18 2010 @@ -534,6 +534,54 @@ return move(Result); } +/// ParseCXXUuidof - This handles the Microsoft C++ __uuidof expression. +/// +/// '__uuidof' '(' expression ')' +/// '__uuidof' '(' type-id ')' +/// +ExprResult Parser::ParseCXXUuidof() { + assert(Tok.is(tok::kw___uuidof) && "Not '__uuidof'!"); + + SourceLocation OpLoc = ConsumeToken(); + SourceLocation LParenLoc = Tok.getLocation(); + SourceLocation RParenLoc; + + // __uuidof expressions are always parenthesized. + if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after, + "__uuidof")) + return ExprError(); + + ExprResult Result; + + if (isTypeIdInParens()) { + TypeResult Ty = ParseTypeName(); + + // Match the ')'. + RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc); + + if (Ty.isInvalid()) + return ExprError(); + + Result = Actions.ActOnCXXUuidof(OpLoc, LParenLoc, /*isType=*/true, + Ty.get().getAsOpaquePtr(), RParenLoc); + } else { + EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated); + Result = ParseExpression(); + + // Match the ')'. + if (Result.isInvalid()) + SkipUntil(tok::r_paren); + else { + RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc); + + Result = Actions.ActOnCXXUuidof(OpLoc, LParenLoc, /*isType=*/false, + Result.release(), RParenLoc); + } + } + + return move(Result); +} + /// \brief Parse a C++ pseudo-destructor expression after the base, /// . or -> operator, and nested-name-specifier have already been /// parsed. Modified: cfe/trunk/lib/Sema/Sema.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/lib/Sema/Sema.cpp (original) +++ cfe/trunk/lib/Sema/Sema.cpp Wed Sep 8 07:20:18 2010 @@ -138,7 +138,7 @@ CompleteTranslationUnit(CompleteTranslationUnit), NumSFINAEErrors(0), SuppressAccessChecking(false), NonInstantiationEntries(0), CurrentInstantiationScope(0), TyposCorrected(0), - AnalysisWarnings(*this) + AnalysisWarnings(*this), MSVCGuidDecl(0) { TUScope = 0; if (getLangOptions().CPlusPlus) Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Sep 8 07:20:18 2010 @@ -370,6 +370,62 @@ return BuildCXXTypeId(TypeInfoType, OpLoc, (Expr*)TyOrExpr, RParenLoc); } +/// \brief Build a Microsoft __uuidof expression with a type operand. +ExprResult Sema::BuildCXXUuidof(QualType TypeInfoType, + SourceLocation TypeidLoc, + TypeSourceInfo *Operand, + SourceLocation RParenLoc) { + // FIXME: add __uuidof semantic analysis for type operand. + return Owned(new (Context) CXXUuidofExpr(TypeInfoType.withConst(), + Operand, + SourceRange(TypeidLoc, RParenLoc))); +} + +/// \brief Build a Microsoft __uuidof expression with an expression operand. +ExprResult Sema::BuildCXXUuidof(QualType TypeInfoType, + SourceLocation TypeidLoc, + Expr *E, + SourceLocation RParenLoc) { + // FIXME: add __uuidof semantic analysis for expr operand. + return Owned(new (Context) CXXUuidofExpr(TypeInfoType.withConst(), + E, + SourceRange(TypeidLoc, RParenLoc))); +} + +/// ActOnCXXUuidof - Parse __uuidof( type-id ) or __uuidof (expression); +ExprResult +Sema::ActOnCXXUuidof(SourceLocation OpLoc, SourceLocation LParenLoc, + bool isType, void *TyOrExpr, SourceLocation RParenLoc) { + // If MSVCGuidDecl has not been cached, do the lookup. + if (!MSVCGuidDecl) { + IdentifierInfo *GuidII = &PP.getIdentifierTable().get("_GUID"); + LookupResult R(*this, GuidII, SourceLocation(), LookupTagName); + LookupQualifiedName(R, Context.getTranslationUnitDecl()); + MSVCGuidDecl = R.getAsSingle(); + if (!MSVCGuidDecl) + return ExprError(Diag(OpLoc, diag::err_need_header_before_ms_uuidof)); + } + + QualType GuidType = Context.getTypeDeclType(MSVCGuidDecl); + + if (isType) { + // The operand is a type; handle it as such. + TypeSourceInfo *TInfo = 0; + QualType T = GetTypeFromParser(ParsedType::getFromOpaquePtr(TyOrExpr), + &TInfo); + if (T.isNull()) + return ExprError(); + + if (!TInfo) + TInfo = Context.getTrivialTypeSourceInfo(T, OpLoc); + + return BuildCXXUuidof(GuidType, OpLoc, TInfo, RParenLoc); + } + + // The operand is an expression. + return BuildCXXUuidof(GuidType, OpLoc, (Expr*)TyOrExpr, RParenLoc); +} + /// ActOnCXXBoolLiteral - Parse {true,false} literals. ExprResult Sema::ActOnCXXBoolLiteral(SourceLocation OpLoc, tok::TokenKind Kind) { Modified: cfe/trunk/lib/Sema/TreeTransform.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h (original) +++ cfe/trunk/lib/Sema/TreeTransform.h Wed Sep 8 07:20:18 2010 @@ -1513,6 +1513,7 @@ RParenLoc); } + /// \brief Build a new C++ typeid(expr) expression. /// /// By default, performs semantic analysis to build the new expression. @@ -1525,6 +1526,30 @@ RParenLoc); } + /// \brief Build a new C++ __uuidof(type) expression. + /// + /// By default, performs semantic analysis to build the new expression. + /// Subclasses may override this routine to provide different behavior. + ExprResult RebuildCXXUuidofExpr(QualType TypeInfoType, + SourceLocation TypeidLoc, + TypeSourceInfo *Operand, + SourceLocation RParenLoc) { + return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand, + RParenLoc); + } + + /// \brief Build a new C++ __uuidof(expr) expression. + /// + /// By default, performs semantic analysis to build the new expression. + /// Subclasses may override this routine to provide different behavior. + ExprResult RebuildCXXUuidofExpr(QualType TypeInfoType, + SourceLocation TypeidLoc, + Expr *Operand, + SourceLocation RParenLoc) { + return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand, + RParenLoc); + } + /// \brief Build a new C++ "this" expression. /// /// By default, builds a new "this" expression without performing any @@ -5145,6 +5170,44 @@ template ExprResult +TreeTransform::TransformCXXUuidofExpr(CXXUuidofExpr *E) { + if (E->isTypeOperand()) { + TypeSourceInfo *TInfo + = getDerived().TransformType(E->getTypeOperandSourceInfo()); + if (!TInfo) + return ExprError(); + + if (!getDerived().AlwaysRebuild() && + TInfo == E->getTypeOperandSourceInfo()) + return SemaRef.Owned(E->Retain()); + + return getDerived().RebuildCXXTypeidExpr(E->getType(), + E->getLocStart(), + TInfo, + E->getLocEnd()); + } + + // We don't know whether the expression is potentially evaluated until + // after we perform semantic analysis, so the expression is potentially + // potentially evaluated. + EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated); + + ExprResult SubExpr = getDerived().TransformExpr(E->getExprOperand()); + if (SubExpr.isInvalid()) + return ExprError(); + + if (!getDerived().AlwaysRebuild() && + SubExpr.get() == E->getExprOperand()) + return SemaRef.Owned(E->Retain()); + + return getDerived().RebuildCXXUuidofExpr(E->getType(), + E->getLocStart(), + SubExpr.get(), + E->getLocEnd()); +} + +template +ExprResult TreeTransform::TransformCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) { return SemaRef.Owned(E->Retain()); } Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original) +++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Wed Sep 8 07:20:18 2010 @@ -134,6 +134,7 @@ void VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E); void VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E); void VisitCXXTypeidExpr(CXXTypeidExpr *E); + void VisitCXXUuidofExpr(CXXUuidofExpr *E); void VisitCXXThisExpr(CXXThisExpr *E); void VisitCXXThrowExpr(CXXThrowExpr *E); void VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E); @@ -1028,6 +1029,18 @@ // typeid(42+2) E->setExprOperand(Reader.ReadSubExpr()); } +void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) { + VisitExpr(E); + E->setSourceRange(Reader.ReadSourceRange(Record, Idx)); + if (E->isTypeOperand()) { // __uuidof(ComType) + E->setTypeOperandSourceInfo( + Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); + return; + } + + // __uuidof(expr) + E->setExprOperand(Reader.ReadSubExpr()); +} void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) { VisitExpr(E); @@ -1678,6 +1691,12 @@ case EXPR_CXX_TYPEID_TYPE: S = new (Context) CXXTypeidExpr(Empty, false); break; + case EXPR_CXX_UUIDOF_EXPR: + S = new (Context) CXXUuidofExpr(Empty, true); + break; + case EXPR_CXX_UUIDOF_TYPE: + S = new (Context) CXXUuidofExpr(Empty, false); + break; case EXPR_CXX_THIS: S = new (Context) CXXThisExpr(Empty); break; Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original) +++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Wed Sep 8 07:20:18 2010 @@ -131,6 +131,7 @@ void VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E); void VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E); void VisitCXXTypeidExpr(CXXTypeidExpr *E); + void VisitCXXUuidofExpr(CXXUuidofExpr *E); void VisitCXXThisExpr(CXXThisExpr *E); void VisitCXXThrowExpr(CXXThrowExpr *E); void VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E); @@ -1039,6 +1040,18 @@ } } +void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) { + VisitExpr(E); + Writer.AddSourceRange(E->getSourceRange(), Record); + if (E->isTypeOperand()) { + Writer.AddTypeSourceInfo(E->getTypeOperandSourceInfo(), Record); + Code = serialization::EXPR_CXX_UUIDOF_TYPE; + } else { + Writer.AddStmt(E->getExprOperand()); + Code = serialization::EXPR_CXX_UUIDOF_EXPR; + } +} + void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) { VisitExpr(E); Writer.AddSourceLocation(E->getLocation(), Record); Modified: cfe/trunk/test/Parser/MicrosoftExtensions.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.c?rev=113356&r1=113355&r2=113356&view=diff ============================================================================== --- cfe/trunk/test/Parser/MicrosoftExtensions.c (original) +++ cfe/trunk/test/Parser/MicrosoftExtensions.c Wed Sep 8 07:20:18 2010 @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions -Wno-missing-declarations -x objective-c++ %s +// RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions -Wno-unused-value -Wno-missing-declarations -x objective-c++ %s __stdcall int func0(); int __stdcall func(); typedef int (__cdecl *tptr)(); @@ -36,3 +36,40 @@ char x = FOO(a); typedef enum E { e1 }; + + +void uuidof_test1() +{ + __uuidof(0); // expected-error {{you need to include before using the '__uuidof' operator}} +} + +typedef struct _GUID +{ + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; +} GUID; +struct __declspec(uuid("00000000-0000-0000-3231-000000000046")) A { }; +struct __declspec(uuid("00000000-0000-0000-1234-000000000047")) B { }; +class C {}; + +void uuidof_test2() +{ + A* a = new A; + B b; + __uuidof(A); + __uuidof(*a); + __uuidof(B); + __uuidof(&b); + _uuidof(0); + + // FIXME, this must not compile + _uuidof(1); + // FIXME, this must not compile + _uuidof(C); + + C c; + // FIXME, this must not compile + _uuidof(c); +} From pichet2000 at gmail.com Wed Sep 8 10:54:22 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Wed, 8 Sep 2010 11:54:22 -0400 Subject: [cfe-commits] [PATCH][MS] - operator __uuidof implementation part 1 In-Reply-To: References: <1F7451DD-853D-4911-BC7B-05EB0B9B5138@apple.com> Message-ID: > > RParenLoc is never set to a location (other than its default, empty state), either on this path or on the __uuidof(expression) path. > The same problem occurs for the typeid operator. Also since you asked me to cache the lookup of _GUID I assume it would be a good idea to also cache the lookup of type_info. It is currently not cached. From hhinnant at apple.com Wed Sep 8 11:39:18 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Wed, 08 Sep 2010 16:39:18 -0000 Subject: [cfe-commits] [libcxx] r113364 - /libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp Message-ID: <20100908163918.6A8E92A6C12D@llvm.org> Author: hhinnant Date: Wed Sep 8 11:39:18 2010 New Revision: 113364 URL: http://llvm.org/viewvc/llvm-project?rev=113364&view=rev Log: has_nothrow_copy_assign hooked up to clang Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp?rev=113364&r1=113363&r2=113364&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp Wed Sep 8 11:39:18 2010 @@ -13,29 +13,17 @@ #include -template +template void test_has_nothrow_assign() { - static_assert( std::has_nothrow_copy_assign::value, ""); - static_assert(!std::has_nothrow_copy_assign::value, ""); - static_assert( std::has_nothrow_copy_assign::value, ""); - static_assert(!std::has_nothrow_copy_assign::value, ""); -} - -template -void test_has_not_nothrow_assign() -{ - static_assert(!std::has_nothrow_copy_assign::value, ""); - static_assert(!std::has_nothrow_copy_assign::value, ""); - static_assert(!std::has_nothrow_copy_assign::value, ""); - static_assert(!std::has_nothrow_copy_assign::value, ""); + static_assert(std::has_nothrow_copy_assign::value == Result, ""); } class Empty { }; -class NotEmpty +struct NotEmpty { virtual ~NotEmpty(); }; @@ -47,7 +35,7 @@ int : 0; }; -class Abstract +struct Abstract { virtual ~Abstract() = 0; }; @@ -59,19 +47,19 @@ int main() { - test_has_not_nothrow_assign(); - test_has_not_nothrow_assign(); - test_has_not_nothrow_assign(); - - test_has_nothrow_assign(); - test_has_nothrow_assign(); - test_has_nothrow_assign(); - test_has_nothrow_assign(); - test_has_nothrow_assign(); - test_has_nothrow_assign(); - test_has_nothrow_assign(); - test_has_nothrow_assign(); - test_has_nothrow_assign(); - test_has_nothrow_assign(); - test_has_nothrow_assign(); + test_has_nothrow_assign(); + test_has_nothrow_assign(); + test_has_nothrow_assign(); + test_has_nothrow_assign(); + test_has_nothrow_assign(); + test_has_nothrow_assign(); + + test_has_nothrow_assign(); + test_has_nothrow_assign(); + test_has_nothrow_assign(); + test_has_nothrow_assign(); + test_has_nothrow_assign(); + test_has_nothrow_assign(); + test_has_nothrow_assign(); + test_has_nothrow_assign(); } From hhinnant at apple.com Wed Sep 8 12:55:32 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Wed, 08 Sep 2010 17:55:32 -0000 Subject: [cfe-commits] [libcxx] r113373 - in /libcxx/trunk: include/type_traits test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp Message-ID: <20100908175532.C7EAF2A6C12C@llvm.org> Author: hhinnant Date: Wed Sep 8 12:55:32 2010 New Revision: 113373 URL: http://llvm.org/viewvc/llvm-project?rev=113373&view=rev Log: Hooked the following up to clang: is_class, is_enum, has_nothrow_copy_assign, has_trivial_destructor, has_virtual_destructor, is_pod. Implemented has_copy_assign. Modified: libcxx/trunk/include/type_traits libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp Modified: libcxx/trunk/include/type_traits URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=113373&r1=113372&r2=113373&view=diff ============================================================================== --- libcxx/trunk/include/type_traits (original) +++ libcxx/trunk/include/type_traits Wed Sep 8 12:55:32 2010 @@ -90,24 +90,31 @@ template struct is_empty; template struct is_polymorphic; template struct is_abstract; + template struct is_constructible; template struct is_nothrow_constructible; - template struct has_default_constructor; - template struct has_copy_constructor; - template struct has_move_constructor; - template struct has_copy_assign; - template struct has_move_assign; + template struct has_trivial_default_constructor - template struct has_trivial_copy_constructor; - template struct has_trivial_move_constructor; - template struct has_trivial_copy_assign; - template struct has_trivial_move_assign; - template struct has_trivial_destructor; template struct has_nothrow_default_constructor; + template struct has_default_constructor; + + template struct has_trivial_copy_constructor; template struct has_nothrow_copy_constructor; + template struct has_copy_constructor; + + template struct has_trivial_move_constructor; template struct has_nothrow_move_constructor; + template struct has_move_constructor; + + template struct has_trivial_copy_assign; template struct has_nothrow_copy_assign; + template struct has_copy_assign; + + template struct has_trivial_move_assign; template struct has_nothrow_move_assign; + template struct has_move_assign; + + template struct has_trivial_destructor; template struct has_virtual_destructor; // Relationships between types: @@ -261,17 +268,25 @@ #if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) -template struct is_union : public integral_constant {}; +template struct is_union + : public integral_constant {}; -#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 +#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) template struct __libcpp_union : public false_type {}; template struct is_union : public __libcpp_union::type> {}; -#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 +#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) // is_class +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + +template struct is_class + : public integral_constant {}; + +#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + namespace __is_class_imp { template char __test(int _Tp::*); @@ -281,6 +296,8 @@ template struct is_class : public integral_constant(0)) == 1 && !is_union<_Tp>::value> {}; +#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + // is_function namespace __is_function_imp @@ -325,6 +342,13 @@ // is_enum +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + +template struct is_enum + : public integral_constant {}; + +#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + template struct is_enum : public integral_constant::value && !is_integral<_Tp>::value && @@ -337,6 +361,8 @@ !is_class<_Tp>::value && !is_function<_Tp>::value > {}; +#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) + // is_arithmetic template struct is_arithmetic @@ -424,6 +450,25 @@ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + +template +typename add_rvalue_reference<_Tp>::type +declval(); + +#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES + +template +typename add_lvalue_reference<_Tp>::type +declval(); + +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + +struct __any +{ + __any(...); +}; + // remove_pointer template struct remove_pointer {typedef _Tp type;}; @@ -761,10 +806,6 @@ template struct has_nothrow_move_constructor : public has_nothrow_copy_constructor<_Tp> {}; -// has_copy_assign - -template struct has_copy_assign; - // has_trivial_copy_assign #if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) @@ -782,27 +823,65 @@ // has_nothrow_copy_assign -template struct has_nothrow_copy_assign: public has_trivial_copy_assign<_Tp> {}; +#if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + +template struct has_nothrow_copy_assign + : public integral_constant {}; + +#else // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + +template struct has_nothrow_copy_assign + : public has_trivial_copy_assign<_Tp> {}; + +#endif // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) // has_trivial_destructor -template struct __libcpp_trivial_destructor : public integral_constant::value || - is_reference<_Tp>::value> {}; +#if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + +template struct has_trivial_destructor + : public integral_constant {}; + +#else // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + +template struct __libcpp_trivial_destructor + : public integral_constant::value || + is_reference<_Tp>::value> {}; template struct has_trivial_destructor : public __libcpp_trivial_destructor::type> {}; +#endif // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + // has_virtual_destructor +#if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + +template struct has_virtual_destructor + : public integral_constant {}; + +#else // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + template struct has_virtual_destructor : public false_type {}; +#endif // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + // is_pod +#if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + +template struct is_pod + : public integral_constant {}; + +#else // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + template struct is_pod : public integral_constant::value && has_trivial_copy_constructor<_Tp>::value && has_trivial_copy_assign<_Tp>::value && has_trivial_destructor<_Tp>::value> {}; +#endif // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) + // alignment_of template struct __alignment_of {_Tp _;}; @@ -1171,6 +1250,44 @@ #endif // _LIBCPP_HAS_NO_VARIADICS +template +decltype((_STD::declval<_Tp>() = _STD::declval<_Arg>(), true_type())) +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +__is_assignable_test(_Tp&&, _Arg&&); +#else +__is_assignable_test(_Tp&, _Arg&); +#endif + +template +false_type +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +__is_assignable_test(__any, _Arg&&); +#else +__is_assignable_test(__any, _Arg&); +#endif + +template +struct __is_assignable_imp + : public common_type + < + decltype(__is_assignable_test(declval<_Tp>(), declval<_Arg>())) + >::type {}; + +template +struct __is_assignable + : public __is_assignable_imp<_Tp, _Arg> {}; + +// has_copy_assign + +template struct has_copy_assign + : public __is_assignable<_Tp&, const _Tp&> {}; + +template struct has_copy_assign<_Tp[]> + : public false_type {}; + +template struct has_copy_assign<_Tp&> + : public false_type {}; + // move #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES @@ -1313,20 +1430,6 @@ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - -template -typename add_rvalue_reference<_Tp>::type -declval(); - -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -template -typename add_lvalue_reference<_Tp>::type -declval(); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template struct decay { @@ -1521,11 +1624,6 @@ #endif // _LIBCPP_HAS_NO_VARIADICS -struct __any -{ - __any(...); -}; - #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE // template struct is_constructible; Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp?rev=113373&r1=113372&r2=113373&view=diff ============================================================================== --- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp (original) +++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/has_copy_assign.pass.cpp Wed Sep 8 12:55:32 2010 @@ -13,7 +13,38 @@ #include +class Empty +{ +}; + +class NotEmpty +{ +public: + virtual ~NotEmpty(); +}; + +union Union {}; + +struct bit_zero +{ + int : 0; +}; + +struct A +{ + A(); +}; + int main() { - static_assert((std::has_copy_assign::value), ""); + static_assert(( std::has_copy_assign::value), ""); + static_assert((!std::has_copy_assign::value), ""); + static_assert((!std::has_copy_assign::value), ""); + static_assert((!std::has_copy_assign::value), ""); + static_assert((!std::has_copy_assign::value), ""); + static_assert(( std::has_copy_assign::value), ""); + static_assert(( std::has_copy_assign::value), ""); + static_assert(( std::has_copy_assign::value), ""); + static_assert(( std::has_copy_assign::value), ""); + static_assert(( std::has_copy_assign::value), ""); } From daniel at zuster.org Wed Sep 8 13:19:55 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 08 Sep 2010 18:19:55 -0000 Subject: [cfe-commits] r113379 - /cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp Message-ID: <20100908181955.C6EE72A6C12C@llvm.org> Author: ddunbar Date: Wed Sep 8 13:19:55 2010 New Revision: 113379 URL: http://llvm.org/viewvc/llvm-project?rev=113379&view=rev Log: Frontend/-H: Add comment on why I used a temporary string here. Modified: cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp Modified: cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp?rev=113379&r1=113378&r2=113379&view=diff ============================================================================== --- cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp (original) +++ cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp Wed Sep 8 13:19:55 2010 @@ -263,6 +263,7 @@ // predefines buffer. if (DumpHeaderIncludes && HasProcessedPredefines && Reason == PPCallbacks::EnterFile) { + // Write to a temporary string to avoid unnecessary flushing on errs(). llvm::SmallString<256> Msg; llvm::raw_svector_ostream OS(Msg); for (unsigned i = 0; i != CurrentIncludeDepth; ++i) From daniel at zuster.org Wed Sep 8 13:21:25 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 8 Sep 2010 11:21:25 -0700 Subject: [cfe-commits] r111983 - in /cfe/trunk: include/clang/Driver/CC1Options.td include/clang/Frontend/PreprocessorOutputOptions.h lib/Driver/Tools.cpp lib/Frontend/CompilerInvocation.cpp lib/Frontend/PrintPreprocessedOutput.cpp test/Frontend/Inputs/ t In-Reply-To: <67FFA630-F53E-41A0-9F13-DB1C3BAB94C0@apple.com> References: <67FFA630-F53E-41A0-9F13-DB1C3BAB94C0@apple.com> Message-ID: On Sat, Sep 4, 2010 at 3:24 PM, Chris Lattner wrote: > > On Sep 4, 2010, at 1:57 PM, Daniel Dunbar wrote: > >>>> >>>> + ?// Dump the header include information, if enabled and we are past the >>>> + ?// predefines buffer. >>>> + ?if (DumpHeaderIncludes && HasProcessedPredefines && >>>> + ? ? ?Reason == PPCallbacks::EnterFile) { >>>> + ? ?llvm::SmallString<256> Msg; >>>> + ? ?llvm::raw_svector_ostream OS(Msg); >>>> + ? ?for (unsigned i = 0; i != CurrentIncludeDepth; ++i) >>>> + ? ? ?OS << '.'; >>>> + ? ?OS << ' ' << CurFilename << '\n'; >>>> + ? ?llvm::errs() << OS.str(); >>> >>> Why the temporary SmallString? >> >> It writes on llvm::errs() directly, which has horrible buffering >> behavior. I didn't want to be flushing out one character at a time. A >> generally solution to this problem would make more sense, but there >> aren't so many places that output substantial text to stderr. > > Alrighty. ?If you wanted to simplify the code, you don't actually need raw_svector_ostream. ?Msg.push_back and Msg.append should suffice for the operations you're doing. I know that, but I find raw_ostream more readable / consistent in general. - Daniel > > -Chris From daniel at zuster.org Wed Sep 8 13:21:44 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 8 Sep 2010 11:21:44 -0700 Subject: [cfe-commits] r111983 - in /cfe/trunk: include/clang/Driver/CC1Options.td include/clang/Frontend/PreprocessorOutputOptions.h lib/Driver/Tools.cpp lib/Frontend/CompilerInvocation.cpp lib/Frontend/PrintPreprocessedOutput.cpp test/Frontend/Inputs/ t In-Reply-To: <20100908010351.GA18753@bloodbath.burble.org> References: <20100908010351.GA18753@bloodbath.burble.org> Message-ID: On Tue, Sep 7, 2010 at 6:03 PM, wrote: > I would like to see a more general solution that all of clang can > beneefit from. ?Are we planning to live with llvm::errs()'s "horrible > buffering behavior" forever? ?If not, it would be good to encapsulate > work-arounds like this SmallString use so that all parts of the compiler > will benefit, and it will be easy to undo later. ?At a minimum, I would like > to see a comment explaining why the SmallString buffer was used here. Added a comment in r113379. - Daniel > Thanks! > -Dawn > > On Sat, Sep 04, 2010 at 01:57:46PM -0700, Daniel Dunbar wrote: >> On Fri, Sep 3, 2010 at 9:49 AM, Chris Lattner wrote: >> > >> > On Aug 24, 2010, at 3:44 PM, Daniel Dunbar wrote: >> > >> >> + ?// Dump the header include information, if enabled and we are past the >> >> + ?// predefines buffer. >> >> + ?if (DumpHeaderIncludes && HasProcessedPredefines && >> >> + ? ? ?Reason == PPCallbacks::EnterFile) { >> >> + ? ?llvm::SmallString<256> Msg; >> >> + ? ?llvm::raw_svector_ostream OS(Msg); >> >> + ? ?for (unsigned i = 0; i != CurrentIncludeDepth; ++i) >> >> + ? ? ?OS << '.'; >> >> + ? ?OS << ' ' << CurFilename << '\n'; >> >> + ? ?llvm::errs() << OS.str(); >> > >> > Why the temporary SmallString? >> >> It writes on llvm::errs() directly, which has horrible buffering >> behavior. I didn't want to be flushing out one character at a time. A >> generally solution to this problem would make more sense, but there >> aren't so many places that output substantial text to stderr. >> >> ?- Daniel >> >> > -Chris >> > >> > >> >> _______________________________________________ >> cfe-commits mailing list >> cfe-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > From daniel at zuster.org Wed Sep 8 14:02:14 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 8 Sep 2010 12:02:14 -0700 Subject: [cfe-commits] r113356 - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ include/clang/Parse/ include/clang/Sema/ include/clang/Serialization/ lib/AST/ lib/Parse/ lib/Sema/ lib/Serialization/ test/Parser/ In-Reply-To: <20100908122018.D763C2A6C12C@llvm.org> References: <20100908122018.D763C2A6C12C@llvm.org> Message-ID: FYI: -- /Volumes/Data/Users/ddunbar/llvm/tools/clang/tools/libclang/CXCursor.cpp:60:11: warning: enumeration value 'CXXUuidofExprClass' not handled in switch [-Wswitch-enum] switch (S->getStmtClass()) { ^ 1 warning generated. -- - Daniel On Wed, Sep 8, 2010 at 5:20 AM, Francois Pichet wrote: > Author: fpichet > Date: Wed Sep ?8 07:20:18 2010 > New Revision: 113356 > > URL: http://llvm.org/viewvc/llvm-project?rev=113356&view=rev > Log: > Microsoft's __uuidof operator implementation part 1. > > Modified: > ? ?cfe/trunk/include/clang/AST/ExprCXX.h > ? ?cfe/trunk/include/clang/AST/RecursiveASTVisitor.h > ? ?cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td > ? ?cfe/trunk/include/clang/Basic/StmtNodes.td > ? ?cfe/trunk/include/clang/Basic/TokenKinds.def > ? ?cfe/trunk/include/clang/Parse/Parser.h > ? ?cfe/trunk/include/clang/Sema/Sema.h > ? ?cfe/trunk/include/clang/Serialization/ASTBitCodes.h > ? ?cfe/trunk/lib/AST/ExprCXX.cpp > ? ?cfe/trunk/lib/AST/StmtPrinter.cpp > ? ?cfe/trunk/lib/AST/StmtProfile.cpp > ? ?cfe/trunk/lib/Parse/ParseExpr.cpp > ? ?cfe/trunk/lib/Parse/ParseExprCXX.cpp > ? ?cfe/trunk/lib/Sema/Sema.cpp > ? ?cfe/trunk/lib/Sema/SemaExprCXX.cpp > ? ?cfe/trunk/lib/Sema/TreeTransform.h > ? ?cfe/trunk/lib/Serialization/ASTReaderStmt.cpp > ? ?cfe/trunk/lib/Serialization/ASTWriterStmt.cpp > ? ?cfe/trunk/test/Parser/MicrosoftExtensions.c > > Modified: cfe/trunk/include/clang/AST/ExprCXX.h > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/include/clang/AST/ExprCXX.h (original) > +++ cfe/trunk/include/clang/AST/ExprCXX.h Wed Sep ?8 07:20:18 2010 > @@ -396,6 +396,74 @@ > ? virtual child_iterator child_end(); > ?}; > > +/// CXXUuidofExpr - A microsoft C++ @c __uuidof expression, which gets > +/// the _GUID that corresponds to the supplied type or expression. > +/// > +/// This represents code like @c __uuidof(COMTYPE) or @c __uuidof(*comPtr) > +class CXXUuidofExpr : public Expr { > +private: > + ?llvm::PointerUnion Operand; > + ?SourceRange Range; > + > +public: > + ?CXXUuidofExpr(QualType Ty, TypeSourceInfo *Operand, SourceRange R) > + ? ?: Expr(CXXUuidofExprClass, Ty, > + ? ? ? ?false, Operand->getType()->isDependentType()), > + ? ? ?Operand(Operand), Range(R) { } > + > + ?CXXUuidofExpr(QualType Ty, Expr *Operand, SourceRange R) > + ? ?: Expr(CXXUuidofExprClass, Ty, > + ? ? ? ?false, Operand->isTypeDependent()), > + ? ? ?Operand(Operand), Range(R) { } > + > + ?CXXUuidofExpr(EmptyShell Empty, bool isExpr) > + ? ?: Expr(CXXUuidofExprClass, Empty) { > + ? ?if (isExpr) > + ? ? ?Operand = (Expr*)0; > + ? ?else > + ? ? ?Operand = (TypeSourceInfo*)0; > + ?} > + > + ?bool isTypeOperand() const { return Operand.is(); } > + > + ?/// \brief Retrieves the type operand of this __uuidof() expression after > + ?/// various required adjustments (removing reference types, cv-qualifiers). > + ?QualType getTypeOperand() const; > + > + ?/// \brief Retrieve source information for the type operand. > + ?TypeSourceInfo *getTypeOperandSourceInfo() const { > + ? ?assert(isTypeOperand() && "Cannot call getTypeOperand for __uuidof(expr)"); > + ? ?return Operand.get(); > + ?} > + > + ?void setTypeOperandSourceInfo(TypeSourceInfo *TSI) { > + ? ?assert(isTypeOperand() && "Cannot call getTypeOperand for __uuidof(expr)"); > + ? ?Operand = TSI; > + ?} > + > + ?Expr *getExprOperand() const { > + ? ?assert(!isTypeOperand() && "Cannot call getExprOperand for __uuidof(type)"); > + ? ?return static_cast(Operand.get()); > + ?} > + > + ?void setExprOperand(Expr *E) { > + ? ?assert(!isTypeOperand() && "Cannot call getExprOperand for __uuidof(type)"); > + ? ?Operand = E; > + ?} > + > + ?virtual SourceRange getSourceRange() const { return Range; } > + ?void setSourceRange(SourceRange R) { Range = R; } > + > + ?static bool classof(const Stmt *T) { > + ? ?return T->getStmtClass() == CXXUuidofExprClass; > + ?} > + ?static bool classof(const CXXUuidofExpr *) { return true; } > + > + ?// Iterators > + ?virtual child_iterator child_begin(); > + ?virtual child_iterator child_end(); > +}; > + > ?/// CXXThisExpr - Represents the "this" expression in C++, which is a > ?/// pointer to the object on which the current member function is > ?/// executing (C++ [expr.prim]p3). Example: > > Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original) > +++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Wed Sep ?8 07:20:18 2010 > @@ -1769,6 +1769,13 @@ > ? ? ? TRY_TO(TraverseTypeLoc(S->getTypeOperandSourceInfo()->getTypeLoc())); > ? }) > > +DEF_TRAVERSE_STMT(CXXUuidofExpr, { > + ? ?// The child-iterator will pick up the arg if it's an expression, > + ? ?// but not if it's a type. > + ? ?if (S->isTypeOperand()) > + ? ? ?TRY_TO(TraverseTypeLoc(S->getTypeOperandSourceInfo()->getTypeLoc())); > + ?}) > + > ?DEF_TRAVERSE_STMT(TypesCompatibleExpr, { > ? ? TRY_TO(TraverseTypeLoc(S->getArgTInfo1()->getTypeLoc())); > ? ? TRY_TO(TraverseTypeLoc(S->getArgTInfo2()->getTypeLoc())); > > Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) > +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Sep ?8 07:20:18 2010 > @@ -2392,6 +2392,8 @@ > ?// Other C++ expressions > ?def err_need_header_before_typeid : Error< > ? "you need to include before using the 'typeid' operator">; > +def err_need_header_before_ms_uuidof : Error< > + ?"you need to include before using the '__uuidof' operator">; > ?def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">; > ?def err_static_illegal_in_new : Error< > ? "the 'static' modifier for the array size is not legal in new expressions">; > > Modified: cfe/trunk/include/clang/Basic/StmtNodes.td > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/StmtNodes.td?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/include/clang/Basic/StmtNodes.td (original) > +++ cfe/trunk/include/clang/Basic/StmtNodes.td Wed Sep ?8 07:20:18 2010 > @@ -127,3 +127,7 @@ > ?def ShuffleVectorExpr : DStmt; > ?def BlockExpr : DStmt; > ?def BlockDeclRefExpr : DStmt; > + > +// Microsoft Extensions. > +def CXXUuidofExpr : DStmt; > + > > Modified: cfe/trunk/include/clang/Basic/TokenKinds.def > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/include/clang/Basic/TokenKinds.def (original) > +++ cfe/trunk/include/clang/Basic/TokenKinds.def Wed Sep ?8 07:20:18 2010 > @@ -369,11 +369,13 @@ > ?// Microsoft extensions which should be disabled in strict conformance mode > ?KEYWORD(__ptr64 ? ? ? ? ? ? ? ? ? , KEYMS) > ?KEYWORD(__w64 ? ? ? ? ? ? ? ? ? ? , KEYMS) > +KEYWORD(__uuidof ? ? ? ? ? ? ? ? ?, KEYMS) > ?ALIAS("_asm" ? ? ? ? , asm ? ? ? ?, KEYMS) > ?ALIAS("_cdecl" ? ? ? , __cdecl ? ?, KEYMS) > ?ALIAS("_fastcall" ? ?, __fastcall , KEYMS) > ?ALIAS("_stdcall" ? ? , __stdcall ?, KEYMS) > ?ALIAS("_thiscall" ? ?, __thiscall , KEYMS) > +ALIAS("_uuidof" ? ? ?,__uuidof ? ?, KEYMS) > > ?// Borland Extensions which should be disabled in strict conformance mode. > ?ALIAS("_pascal" ? ? ?, __pascal ? , KEYBORLAND) > > Modified: cfe/trunk/include/clang/Parse/Parser.h > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/include/clang/Parse/Parser.h (original) > +++ cfe/trunk/include/clang/Parse/Parser.h Wed Sep ?8 07:20:18 2010 > @@ -1029,6 +1029,10 @@ > ? ExprResult ParseCXXTypeid(); > > ? //===--------------------------------------------------------------------===// > + ?// ?C++ : Microsoft __uuidof Expression > + ?ExprResult ParseCXXUuidof(); > + > + ?//===--------------------------------------------------------------------===// > ? // C++ 5.2.4: C++ Pseudo-Destructor Expressions > ? ExprResult ParseCXXPseudoDestructor(ExprArg Base, SourceLocation OpLoc, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? tok::TokenKind OpKind, > > Modified: cfe/trunk/include/clang/Sema/Sema.h > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/include/clang/Sema/Sema.h (original) > +++ cfe/trunk/include/clang/Sema/Sema.h Wed Sep ?8 07:20:18 2010 > @@ -365,6 +365,9 @@ > ? /// standard library. > ? LazyDeclPtr StdBadAlloc; > > + ?/// \brief The MSVC "_GUID" struct, which is defined in MSVC header files. > + ?RecordDecl *MSVCGuidDecl; > + > ? /// A flag to remember whether the implicit forms of operator new and delete > ? /// have been declared. > ? bool GlobalNewDeleteDeclared; > @@ -2156,6 +2159,22 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? void *TyOrExpr, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? SourceLocation RParenLoc); > > + ?ExprResult BuildCXXUuidof(QualType TypeInfoType, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation TypeidLoc, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ?TypeSourceInfo *Operand, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation RParenLoc); > + ?ExprResult BuildCXXUuidof(QualType TypeInfoType, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation TypeidLoc, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ?Expr *Operand, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation RParenLoc); > + > + ?/// ActOnCXXUuidof - Parse __uuidof( something ). > + ?virtual ExprResult ActOnCXXUuidof(SourceLocation OpLoc, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation LParenLoc, bool isType, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?void *TyOrExpr, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation RParenLoc); > + > + > ? //// ActOnCXXThis - ?Parse 'this' pointer. > ? ExprResult ActOnCXXThis(SourceLocation ThisLoc); > > > Modified: cfe/trunk/include/clang/Serialization/ASTBitCodes.h > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/include/clang/Serialization/ASTBitCodes.h (original) > +++ cfe/trunk/include/clang/Serialization/ASTBitCodes.h Wed Sep ?8 07:20:18 2010 > @@ -875,6 +875,8 @@ > ? ? ? EXPR_CXX_NULL_PTR_LITERAL, ?// CXXNullPtrLiteralExpr > ? ? ? EXPR_CXX_TYPEID_EXPR, ? ? ? // CXXTypeidExpr (of expr). > ? ? ? EXPR_CXX_TYPEID_TYPE, ? ? ? // CXXTypeidExpr (of type). > + ? ? ?EXPR_CXX_UUIDOF_EXPR, ? ? ? // CXXUuidofExpr (of expr). > + ? ? ?EXPR_CXX_UUIDOF_TYPE, ? ? ? // CXXUuidofExpr (of type). > ? ? ? EXPR_CXX_THIS, ? ? ? ? ? ? ?// CXXThisExpr > ? ? ? EXPR_CXX_THROW, ? ? ? ? ? ? // CXXThrowExpr > ? ? ? EXPR_CXX_DEFAULT_ARG, ? ? ? // CXXDefaultArgExpr > > Modified: cfe/trunk/lib/AST/ExprCXX.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/lib/AST/ExprCXX.cpp (original) > +++ cfe/trunk/lib/AST/ExprCXX.cpp Wed Sep ?8 07:20:18 2010 > @@ -39,6 +39,22 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ?: reinterpret_cast(&Operand) + 1; > ?} > > +QualType CXXUuidofExpr::getTypeOperand() const { > + ?assert(isTypeOperand() && "Cannot call getTypeOperand for __uuidof(expr)"); > + ?return Operand.get()->getType().getNonReferenceType() > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.getUnqualifiedType(); > +} > + > +// CXXUuidofExpr - has child iterators if the operand is an expression > +Stmt::child_iterator CXXUuidofExpr::child_begin() { > + ?return isTypeOperand() ? child_iterator() > + ? ? ? ? ? ? ? ? ? ? ? ? : reinterpret_cast(&Operand); > +} > +Stmt::child_iterator CXXUuidofExpr::child_end() { > + ?return isTypeOperand() ? child_iterator() > + ? ? ? ? ? ? ? ? ? ? ? ? : reinterpret_cast(&Operand) + 1; > +} > + > ?// CXXBoolLiteralExpr > ?Stmt::child_iterator CXXBoolLiteralExpr::child_begin() { > ? return child_iterator(); > > Modified: cfe/trunk/lib/AST/StmtPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/lib/AST/StmtPrinter.cpp (original) > +++ cfe/trunk/lib/AST/StmtPrinter.cpp Wed Sep ?8 07:20:18 2010 > @@ -1002,6 +1002,16 @@ > ? OS << ")"; > ?} > > +void StmtPrinter::VisitCXXUuidofExpr(CXXUuidofExpr *Node) { > + ?OS << "__uuidof("; > + ?if (Node->isTypeOperand()) { > + ? ?OS << Node->getTypeOperand().getAsString(Policy); > + ?} else { > + ? ?PrintExpr(Node->getExprOperand()); > + ?} > + ?OS << ")"; > +} > + > ?void StmtPrinter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *Node) { > ? OS << (Node->getValue() ? "true" : "false"); > ?} > > Modified: cfe/trunk/lib/AST/StmtProfile.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/lib/AST/StmtProfile.cpp (original) > +++ cfe/trunk/lib/AST/StmtProfile.cpp Wed Sep ?8 07:20:18 2010 > @@ -687,6 +687,12 @@ > ? ? VisitType(S->getTypeOperand()); > ?} > > +void StmtProfiler::VisitCXXUuidofExpr(CXXUuidofExpr *S) { > + ?VisitExpr(S); > + ?if (S->isTypeOperand()) > + ? ?VisitType(S->getTypeOperand()); > +} > + > ?void StmtProfiler::VisitCXXThisExpr(CXXThisExpr *S) { > ? VisitExpr(S); > ?} > > Modified: cfe/trunk/lib/Parse/ParseExpr.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/lib/Parse/ParseExpr.cpp (original) > +++ cfe/trunk/lib/Parse/ParseExpr.cpp Wed Sep ?8 07:20:18 2010 > @@ -768,6 +768,9 @@ > ? case tok::kw_typeid: > ? ? Res = ParseCXXTypeid(); > ? ? break; > + ?case tok::kw___uuidof: > + ? ?Res = ParseCXXUuidof(); > + ? ?break; > ? case tok::kw_this: > ? ? Res = ParseCXXThis(); > ? ? break; > > Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original) > +++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Wed Sep ?8 07:20:18 2010 > @@ -534,6 +534,54 @@ > ? return move(Result); > ?} > > +/// ParseCXXUuidof - This handles the Microsoft C++ __uuidof expression. > +/// > +/// ? ? ? ? '__uuidof' '(' expression ')' > +/// ? ? ? ? '__uuidof' '(' type-id ')' > +/// > +ExprResult Parser::ParseCXXUuidof() { > + ?assert(Tok.is(tok::kw___uuidof) && "Not '__uuidof'!"); > + > + ?SourceLocation OpLoc = ConsumeToken(); > + ?SourceLocation LParenLoc = Tok.getLocation(); > + ?SourceLocation RParenLoc; > + > + ?// __uuidof expressions are always parenthesized. > + ?if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after, > + ? ? ?"__uuidof")) > + ? ?return ExprError(); > + > + ?ExprResult Result; > + > + ?if (isTypeIdInParens()) { > + ? ?TypeResult Ty = ParseTypeName(); > + > + ? ?// Match the ')'. > + ? ?RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc); > + > + ? ?if (Ty.isInvalid()) > + ? ? ?return ExprError(); > + > + ? ?Result = Actions.ActOnCXXUuidof(OpLoc, LParenLoc, /*isType=*/true, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Ty.get().getAsOpaquePtr(), RParenLoc); > + ?} else { > + ? ?EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated); > + ? ?Result = ParseExpression(); > + > + ? ?// Match the ')'. > + ? ?if (Result.isInvalid()) > + ? ? ?SkipUntil(tok::r_paren); > + ? ?else { > + ? ? ?RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc); > + > + ? ? ?Result = Actions.ActOnCXXUuidof(OpLoc, LParenLoc, /*isType=*/false, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Result.release(), RParenLoc); > + ? ?} > + ?} > + > + ?return move(Result); > +} > + > ?/// \brief Parse a C++ pseudo-destructor expression after the base, > ?/// . or -> operator, and nested-name-specifier have already been > ?/// parsed. > > Modified: cfe/trunk/lib/Sema/Sema.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/lib/Sema/Sema.cpp (original) > +++ cfe/trunk/lib/Sema/Sema.cpp Wed Sep ?8 07:20:18 2010 > @@ -138,7 +138,7 @@ > ? ? CompleteTranslationUnit(CompleteTranslationUnit), > ? ? NumSFINAEErrors(0), SuppressAccessChecking(false), > ? ? NonInstantiationEntries(0), CurrentInstantiationScope(0), TyposCorrected(0), > - ? ?AnalysisWarnings(*this) > + ? ?AnalysisWarnings(*this), MSVCGuidDecl(0) > ?{ > ? TUScope = 0; > ? if (getLangOptions().CPlusPlus) > > Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original) > +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Sep ?8 07:20:18 2010 > @@ -370,6 +370,62 @@ > ? return BuildCXXTypeId(TypeInfoType, OpLoc, (Expr*)TyOrExpr, RParenLoc); > ?} > > +/// \brief Build a Microsoft __uuidof expression with a type operand. > +ExprResult Sema::BuildCXXUuidof(QualType TypeInfoType, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation TypeidLoc, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?TypeSourceInfo *Operand, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation RParenLoc) { > + ?// FIXME: add __uuidof semantic analysis for type operand. > + ?return Owned(new (Context) CXXUuidofExpr(TypeInfoType.withConst(), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Operand, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SourceRange(TypeidLoc, RParenLoc))); > +} > + > +/// \brief Build a Microsoft __uuidof expression with an expression operand. > +ExprResult Sema::BuildCXXUuidof(QualType TypeInfoType, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation TypeidLoc, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Expr *E, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation RParenLoc) { > + ?// FIXME: add __uuidof semantic analysis for expr operand. > + ?return Owned(new (Context) CXXUuidofExpr(TypeInfoType.withConst(), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? E, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SourceRange(TypeidLoc, RParenLoc))); > +} > + > +/// ActOnCXXUuidof - Parse __uuidof( type-id ) or __uuidof (expression); > +ExprResult > +Sema::ActOnCXXUuidof(SourceLocation OpLoc, SourceLocation LParenLoc, > + ? ? ? ? ? ? ? ? ? ? bool isType, void *TyOrExpr, SourceLocation RParenLoc) { > + ?// If MSVCGuidDecl has not been cached, do the lookup. > + ?if (!MSVCGuidDecl) { > + ? ?IdentifierInfo *GuidII = &PP.getIdentifierTable().get("_GUID"); > + ? ?LookupResult R(*this, GuidII, SourceLocation(), LookupTagName); > + ? ?LookupQualifiedName(R, Context.getTranslationUnitDecl()); > + ? ?MSVCGuidDecl = R.getAsSingle(); > + ? ?if (!MSVCGuidDecl) > + ? ? ?return ExprError(Diag(OpLoc, diag::err_need_header_before_ms_uuidof)); > + ?} > + > + ?QualType GuidType = Context.getTypeDeclType(MSVCGuidDecl); > + > + ?if (isType) { > + ? ?// The operand is a type; handle it as such. > + ? ?TypeSourceInfo *TInfo = 0; > + ? ?QualType T = GetTypeFromParser(ParsedType::getFromOpaquePtr(TyOrExpr), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? &TInfo); > + ? ?if (T.isNull()) > + ? ? ?return ExprError(); > + > + ? ?if (!TInfo) > + ? ? ?TInfo = Context.getTrivialTypeSourceInfo(T, OpLoc); > + > + ? ?return BuildCXXUuidof(GuidType, OpLoc, TInfo, RParenLoc); > + ?} > + > + ?// The operand is an expression. > + ?return BuildCXXUuidof(GuidType, OpLoc, (Expr*)TyOrExpr, RParenLoc); > +} > + > ?/// ActOnCXXBoolLiteral - Parse {true,false} literals. > ?ExprResult > ?Sema::ActOnCXXBoolLiteral(SourceLocation OpLoc, tok::TokenKind Kind) { > > Modified: cfe/trunk/lib/Sema/TreeTransform.h > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/lib/Sema/TreeTransform.h (original) > +++ cfe/trunk/lib/Sema/TreeTransform.h Wed Sep ?8 07:20:18 2010 > @@ -1513,6 +1513,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? RParenLoc); > ? } > > + > ? /// \brief Build a new C++ typeid(expr) expression. > ? /// > ? /// By default, performs semantic analysis to build the new expression. > @@ -1525,6 +1526,30 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? RParenLoc); > ? } > > + ?/// \brief Build a new C++ __uuidof(type) expression. > + ?/// > + ?/// By default, performs semantic analysis to build the new expression. > + ?/// Subclasses may override this routine to provide different behavior. > + ?ExprResult RebuildCXXUuidofExpr(QualType TypeInfoType, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation TypeidLoc, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?TypeSourceInfo *Operand, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation RParenLoc) { > + ? ?return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?RParenLoc); > + ?} > + > + ?/// \brief Build a new C++ __uuidof(expr) expression. > + ?/// > + ?/// By default, performs semantic analysis to build the new expression. > + ?/// Subclasses may override this routine to provide different behavior. > + ?ExprResult RebuildCXXUuidofExpr(QualType TypeInfoType, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation TypeidLoc, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Expr *Operand, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SourceLocation RParenLoc) { > + ? ?return getSema().BuildCXXUuidof(TypeInfoType, TypeidLoc, Operand, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?RParenLoc); > + ?} > + > ? /// \brief Build a new C++ "this" expression. > ? /// > ? /// By default, builds a new "this" expression without performing any > @@ -5145,6 +5170,44 @@ > > ?template > ?ExprResult > +TreeTransform::TransformCXXUuidofExpr(CXXUuidofExpr *E) { > + ?if (E->isTypeOperand()) { > + ? ?TypeSourceInfo *TInfo > + ? ? ?= getDerived().TransformType(E->getTypeOperandSourceInfo()); > + ? ?if (!TInfo) > + ? ? ?return ExprError(); > + > + ? ?if (!getDerived().AlwaysRebuild() && > + ? ? ? ?TInfo == E->getTypeOperandSourceInfo()) > + ? ? ?return SemaRef.Owned(E->Retain()); > + > + ? ?return getDerived().RebuildCXXTypeidExpr(E->getType(), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? E->getLocStart(), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TInfo, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? E->getLocEnd()); > + ?} > + > + ?// We don't know whether the expression is potentially evaluated until > + ?// after we perform semantic analysis, so the expression is potentially > + ?// potentially evaluated. > + ?EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated); > + > + ?ExprResult SubExpr = getDerived().TransformExpr(E->getExprOperand()); > + ?if (SubExpr.isInvalid()) > + ? ?return ExprError(); > + > + ?if (!getDerived().AlwaysRebuild() && > + ? ? ?SubExpr.get() == E->getExprOperand()) > + ? ?return SemaRef.Owned(E->Retain()); > + > + ?return getDerived().RebuildCXXUuidofExpr(E->getType(), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? E->getLocStart(), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SubExpr.get(), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? E->getLocEnd()); > +} > + > +template > +ExprResult > ?TreeTransform::TransformCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) { > ? return SemaRef.Owned(E->Retain()); > ?} > > Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original) > +++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Wed Sep ?8 07:20:18 2010 > @@ -134,6 +134,7 @@ > ? ? void VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E); > ? ? void VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E); > ? ? void VisitCXXTypeidExpr(CXXTypeidExpr *E); > + ? ?void VisitCXXUuidofExpr(CXXUuidofExpr *E); > ? ? void VisitCXXThisExpr(CXXThisExpr *E); > ? ? void VisitCXXThrowExpr(CXXThrowExpr *E); > ? ? void VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E); > @@ -1028,6 +1029,18 @@ > ? // typeid(42+2) > ? E->setExprOperand(Reader.ReadSubExpr()); > ?} > +void ASTStmtReader::VisitCXXUuidofExpr(CXXUuidofExpr *E) { > + ?VisitExpr(E); > + ?E->setSourceRange(Reader.ReadSourceRange(Record, Idx)); > + ?if (E->isTypeOperand()) { // __uuidof(ComType) > + ? ?E->setTypeOperandSourceInfo( > + ? ? ? ?Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx)); > + ? ?return; > + ?} > + > + ?// __uuidof(expr) > + ?E->setExprOperand(Reader.ReadSubExpr()); > +} > > ?void ASTStmtReader::VisitCXXThisExpr(CXXThisExpr *E) { > ? VisitExpr(E); > @@ -1678,6 +1691,12 @@ > ? ? case EXPR_CXX_TYPEID_TYPE: > ? ? ? S = new (Context) CXXTypeidExpr(Empty, false); > ? ? ? break; > + ? ?case EXPR_CXX_UUIDOF_EXPR: > + ? ? ?S = new (Context) CXXUuidofExpr(Empty, true); > + ? ? ?break; > + ? ?case EXPR_CXX_UUIDOF_TYPE: > + ? ? ?S = new (Context) CXXUuidofExpr(Empty, false); > + ? ? ?break; > ? ? case EXPR_CXX_THIS: > ? ? ? S = new (Context) CXXThisExpr(Empty); > ? ? ? break; > > Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original) > +++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Wed Sep ?8 07:20:18 2010 > @@ -131,6 +131,7 @@ > ? ? void VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E); > ? ? void VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E); > ? ? void VisitCXXTypeidExpr(CXXTypeidExpr *E); > + ? ?void VisitCXXUuidofExpr(CXXUuidofExpr *E); > ? ? void VisitCXXThisExpr(CXXThisExpr *E); > ? ? void VisitCXXThrowExpr(CXXThrowExpr *E); > ? ? void VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E); > @@ -1039,6 +1040,18 @@ > ? } > ?} > > +void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) { > + ?VisitExpr(E); > + ?Writer.AddSourceRange(E->getSourceRange(), Record); > + ?if (E->isTypeOperand()) { > + ? ?Writer.AddTypeSourceInfo(E->getTypeOperandSourceInfo(), Record); > + ? ?Code = serialization::EXPR_CXX_UUIDOF_TYPE; > + ?} else { > + ? ?Writer.AddStmt(E->getExprOperand()); > + ? ?Code = serialization::EXPR_CXX_UUIDOF_EXPR; > + ?} > +} > + > ?void ASTStmtWriter::VisitCXXThisExpr(CXXThisExpr *E) { > ? VisitExpr(E); > ? Writer.AddSourceLocation(E->getLocation(), Record); > > Modified: cfe/trunk/test/Parser/MicrosoftExtensions.c > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.c?rev=113356&r1=113355&r2=113356&view=diff > ============================================================================== > --- cfe/trunk/test/Parser/MicrosoftExtensions.c (original) > +++ cfe/trunk/test/Parser/MicrosoftExtensions.c Wed Sep ?8 07:20:18 2010 > @@ -1,4 +1,4 @@ > -// RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions -Wno-missing-declarations -x objective-c++ %s > +// RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions -Wno-unused-value -Wno-missing-declarations -x objective-c++ %s > ?__stdcall int func0(); > ?int __stdcall func(); > ?typedef int (__cdecl *tptr)(); > @@ -36,3 +36,40 @@ > ?char x = FOO(a); > > ?typedef enum E { e1 }; > + > + > +void uuidof_test1() > +{ > + ?__uuidof(0); ?// expected-error {{you need to include before using the '__uuidof' operator}} > +} > + > +typedef struct _GUID > +{ > + ? ?unsigned long ?Data1; > + ? ?unsigned short Data2; > + ? ?unsigned short Data3; > + ? ?unsigned char ?Data4[8]; > +} GUID; > +struct __declspec(uuid("00000000-0000-0000-3231-000000000046")) A { }; > +struct __declspec(uuid("00000000-0000-0000-1234-000000000047")) B { }; > +class C {}; > + > +void uuidof_test2() > +{ > + ?A* a = new A; > + ?B b; > + ?__uuidof(A); > + ?__uuidof(*a); > + ?__uuidof(B); > + ?__uuidof(&b); > + ?_uuidof(0); > + > + ? // FIXME, this must not compile > + ?_uuidof(1); > + ? // FIXME, this must not compile > + ?_uuidof(C); > + > + ? C c; > + ? // FIXME, this must not compile > + ?_uuidof(c); > +} > > > _______________________________________________ > cfe-commits mailing list > cfe-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > From akyrtzi at gmail.com Wed Sep 8 14:31:22 2010 From: akyrtzi at gmail.com (Argyrios Kyrtzidis) Date: Wed, 08 Sep 2010 19:31:22 -0000 Subject: [cfe-commits] r113391 - in /cfe/trunk: include/clang/AST/Decl.h include/clang/AST/DeclTemplate.h lib/AST/Decl.cpp lib/AST/DeclTemplate.cpp lib/AST/TemplateName.cpp lib/Serialization/ASTReaderDecl.cpp lib/Serialization/ASTWriterDecl.cpp Message-ID: <20100908193122.678BC2A6C12C@llvm.org> Author: akirtzidis Date: Wed Sep 8 14:31:22 2010 New Revision: 113391 URL: http://llvm.org/viewvc/llvm-project?rev=113391&view=rev Log: Fix C++ PCH issues. PCH got a severe beating by the boost-using test case reported here: http://llvm.org/PR8099 Fix issues like: -When PCH reading, make sure Decl's getASTContext() doesn't get called since a Decl in the parent hierarchy may be initializing. -In ASTDeclReader::VisitFunctionDecl VisitRedeclarable should be called before using FunctionDecl's isCanonicalDecl() -In ASTDeclReader::VisitRedeclarableTemplateDecl CommonOrPrev must be initialized before anything else. Modified: cfe/trunk/include/clang/AST/Decl.h cfe/trunk/include/clang/AST/DeclTemplate.h cfe/trunk/lib/AST/Decl.cpp cfe/trunk/lib/AST/DeclTemplate.cpp cfe/trunk/lib/AST/TemplateName.cpp cfe/trunk/lib/Serialization/ASTReaderDecl.cpp cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Modified: cfe/trunk/include/clang/AST/Decl.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=113391&r1=113390&r2=113391&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/Decl.h (original) +++ cfe/trunk/include/clang/AST/Decl.h Wed Sep 8 14:31:22 2010 @@ -1136,6 +1136,42 @@ /// declaration name embedded in the DeclaratorDecl base class. DeclarationNameLoc DNLoc; + /// \brief Specify that this function declaration is actually a function + /// template specialization. + /// + /// \param C the ASTContext. + /// + /// \param Template the function template that this function template + /// specialization specializes. + /// + /// \param TemplateArgs the template arguments that produced this + /// function template specialization from the template. + /// + /// \param InsertPos If non-NULL, the position in the function template + /// specialization set where the function template specialization data will + /// be inserted. + /// + /// \param TSK the kind of template specialization this is. + /// + /// \param TemplateArgsAsWritten location info of template arguments. + /// + /// \param PointOfInstantiation point at which the function template + /// specialization was first instantiated. + void setFunctionTemplateSpecialization(ASTContext &C, + FunctionTemplateDecl *Template, + const TemplateArgumentList *TemplateArgs, + void *InsertPos, + TemplateSpecializationKind TSK, + const TemplateArgumentListInfo *TemplateArgsAsWritten, + SourceLocation PointOfInstantiation); + + /// \brief Specify that this record is an instantiation of the + /// member function FD. + void setInstantiationOfMemberFunction(ASTContext &C, FunctionDecl *FD, + TemplateSpecializationKind TSK); + + void setParams(ASTContext &C, ParmVarDecl **NewParamInfo, unsigned NumParams); + protected: FunctionDecl(Kind DK, DeclContext *DC, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, @@ -1343,7 +1379,9 @@ assert(i < getNumParams() && "Illegal param #"); return ParamInfo[i]; } - void setParams(ParmVarDecl **NewParamInfo, unsigned NumParams); + void setParams(ParmVarDecl **NewParamInfo, unsigned NumParams) { + setParams(getASTContext(), NewParamInfo, NumParams); + } /// getMinRequiredArguments - Returns the minimum number of arguments /// needed to call this function. This may be fewer than the number of @@ -1432,7 +1470,9 @@ /// \brief Specify that this record is an instantiation of the /// member function FD. void setInstantiationOfMemberFunction(FunctionDecl *FD, - TemplateSpecializationKind TSK); + TemplateSpecializationKind TSK) { + setInstantiationOfMemberFunction(getASTContext(), FD, TSK); + } /// \brief Retrieves the function template that is described by this /// function declaration. @@ -1526,43 +1566,11 @@ void *InsertPos, TemplateSpecializationKind TSK = TSK_ImplicitInstantiation, const TemplateArgumentListInfo *TemplateArgsAsWritten = 0, - SourceLocation PointOfInstantiation = SourceLocation()); - - /// \brief Specify that this function declaration is actually a function - /// template specialization. - /// - /// \param Template the function template that this function template - /// specialization specializes. - /// - /// \param NumTemplateArgs number of template arguments that produced this - /// function template specialization from the template. - /// - /// \param TemplateArgs array of template arguments that produced this - /// function template specialization from the template. - /// - /// \param TSK the kind of template specialization this is. - /// - /// \param NumTemplateArgsAsWritten number of template arguments that produced - /// this function template specialization from the template. - /// - /// \param TemplateArgsAsWritten array of location info for the template - /// arguments. - /// - /// \param LAngleLoc location of left angle token. - /// - /// \param RAngleLoc location of right angle token. - /// - /// \param PointOfInstantiation point at which the function template - /// specialization was first instantiated. - void setFunctionTemplateSpecialization(FunctionTemplateDecl *Template, - unsigned NumTemplateArgs, - const TemplateArgument *TemplateArgs, - TemplateSpecializationKind TSK, - unsigned NumTemplateArgsAsWritten, - TemplateArgumentLoc *TemplateArgsAsWritten, - SourceLocation LAngleLoc, - SourceLocation RAngleLoc, - SourceLocation PointOfInstantiation); + SourceLocation PointOfInstantiation = SourceLocation()) { + setFunctionTemplateSpecialization(getASTContext(), Template, TemplateArgs, + InsertPos, TSK, TemplateArgsAsWritten, + PointOfInstantiation); + } /// \brief Specifies that this function declaration is actually a /// dependent function template specialization. Modified: cfe/trunk/include/clang/AST/DeclTemplate.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclTemplate.h?rev=113391&r1=113390&r2=113391&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/DeclTemplate.h (original) +++ cfe/trunk/include/clang/AST/DeclTemplate.h Wed Sep 8 14:31:22 2010 @@ -584,7 +584,7 @@ /// for the common pointer. CommonBase *getCommonPtr(); - virtual CommonBase *newCommon() = 0; + virtual CommonBase *newCommon(ASTContext &C) = 0; // Construct a template decl with name, parameters, and templated element. RedeclarableTemplateDecl(Kind DK, DeclContext *DC, SourceLocation L, @@ -789,19 +789,13 @@ TemplateParameterList *Params, NamedDecl *Decl) : RedeclarableTemplateDecl(FunctionTemplate, DC, L, Name, Params, Decl) { } - CommonBase *newCommon(); + CommonBase *newCommon(ASTContext &C); Common *getCommonPtr() { return static_cast(RedeclarableTemplateDecl::getCommonPtr()); } - friend void FunctionDecl::setFunctionTemplateSpecialization( - FunctionTemplateDecl *Template, - const TemplateArgumentList *TemplateArgs, - void *InsertPos, - TemplateSpecializationKind TSK, - const TemplateArgumentListInfo *TemplateArgsAsWritten, - SourceLocation PointOfInstantiation); + friend class FunctionDecl; /// \brief Retrieve the set of function template specializations of this /// function template. @@ -1659,7 +1653,7 @@ TemplateParameterList *Params, NamedDecl *Decl) : RedeclarableTemplateDecl(ClassTemplate, DC, L, Name, Params, Decl) { } - CommonBase *newCommon(); + CommonBase *newCommon(ASTContext &C); Common *getCommonPtr() { return static_cast(RedeclarableTemplateDecl::getCommonPtr()); Modified: cfe/trunk/lib/AST/Decl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=113391&r1=113390&r2=113391&view=diff ============================================================================== --- cfe/trunk/lib/AST/Decl.cpp (original) +++ cfe/trunk/lib/AST/Decl.cpp Wed Sep 8 14:31:22 2010 @@ -1093,13 +1093,14 @@ } -void FunctionDecl::setParams(ParmVarDecl **NewParamInfo, unsigned NumParams) { +void FunctionDecl::setParams(ASTContext &C, + ParmVarDecl **NewParamInfo, unsigned NumParams) { assert(ParamInfo == 0 && "Already has param info!"); assert(NumParams == getNumParams() && "Parameter count mismatch!"); // Zero params -> null pointer. if (NumParams) { - void *Mem = getASTContext().Allocate(sizeof(ParmVarDecl*)*NumParams); + void *Mem = C.Allocate(sizeof(ParmVarDecl*)*NumParams); ParamInfo = new (Mem) ParmVarDecl*[NumParams]; memcpy(ParamInfo, NewParamInfo, sizeof(ParmVarDecl*)*NumParams); @@ -1271,12 +1272,13 @@ } void -FunctionDecl::setInstantiationOfMemberFunction(FunctionDecl *FD, +FunctionDecl::setInstantiationOfMemberFunction(ASTContext &C, + FunctionDecl *FD, TemplateSpecializationKind TSK) { assert(TemplateOrSpecialization.isNull() && "Member function is already a specialization"); MemberSpecializationInfo *Info - = new (getASTContext()) MemberSpecializationInfo(FD, TSK); + = new (C) MemberSpecializationInfo(FD, TSK); TemplateOrSpecialization = Info; } @@ -1362,7 +1364,8 @@ } void -FunctionDecl::setFunctionTemplateSpecialization(FunctionTemplateDecl *Template, +FunctionDecl::setFunctionTemplateSpecialization(ASTContext &C, + FunctionTemplateDecl *Template, const TemplateArgumentList *TemplateArgs, void *InsertPos, TemplateSpecializationKind TSK, @@ -1373,7 +1376,7 @@ FunctionTemplateSpecializationInfo *Info = TemplateOrSpecialization.dyn_cast(); if (!Info) - Info = new (getASTContext()) FunctionTemplateSpecializationInfo; + Info = new (C) FunctionTemplateSpecializationInfo; Info->Function = this; Info->Template.setPointer(Template); @@ -1401,28 +1404,6 @@ } void -FunctionDecl::setFunctionTemplateSpecialization(FunctionTemplateDecl *Template, - unsigned NumTemplateArgs, - const TemplateArgument *TemplateArgs, - TemplateSpecializationKind TSK, - unsigned NumTemplateArgsAsWritten, - TemplateArgumentLoc *TemplateArgsAsWritten, - SourceLocation LAngleLoc, - SourceLocation RAngleLoc, - SourceLocation PointOfInstantiation) { - ASTContext &Ctx = getASTContext(); - TemplateArgumentList *TemplArgs - = new (Ctx) TemplateArgumentList(Ctx, TemplateArgs, NumTemplateArgs); - TemplateArgumentListInfo *TemplArgsInfo - = new (Ctx) TemplateArgumentListInfo(LAngleLoc, RAngleLoc); - for (unsigned i=0; i != NumTemplateArgsAsWritten; ++i) - TemplArgsInfo->addArgument(TemplateArgsAsWritten[i]); - - setFunctionTemplateSpecialization(Template, TemplArgs, /*InsertPos=*/0, TSK, - TemplArgsInfo, PointOfInstantiation); -} - -void FunctionDecl::setDependentTemplateSpecialization(ASTContext &Context, const UnresolvedSetImpl &Templates, const TemplateArgumentListInfo &TemplateArgs) { Modified: cfe/trunk/lib/AST/DeclTemplate.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclTemplate.cpp?rev=113391&r1=113390&r2=113391&view=diff ============================================================================== --- cfe/trunk/lib/AST/DeclTemplate.cpp (original) +++ cfe/trunk/lib/AST/DeclTemplate.cpp Wed Sep 8 14:31:22 2010 @@ -92,7 +92,7 @@ RedeclarableTemplateDecl *First = getCanonicalDecl(); if (First->CommonOrPrev.isNull()) { - CommonBase *CommonPtr = First->newCommon(); + CommonBase *CommonPtr = First->newCommon(getASTContext()); First->CommonOrPrev = CommonPtr; CommonPtr->Latest = First; } @@ -156,9 +156,10 @@ return new (C) FunctionTemplateDecl(DC, L, Name, Params, Decl); } -RedeclarableTemplateDecl::CommonBase *FunctionTemplateDecl::newCommon() { - Common *CommonPtr = new (getASTContext()) Common; - getASTContext().AddDeallocation(DeallocateCommon, CommonPtr); +RedeclarableTemplateDecl::CommonBase * +FunctionTemplateDecl::newCommon(ASTContext &C) { + Common *CommonPtr = new (C) Common; + C.AddDeallocation(DeallocateCommon, CommonPtr); return CommonPtr; } @@ -188,9 +189,10 @@ return New; } -RedeclarableTemplateDecl::CommonBase *ClassTemplateDecl::newCommon() { - Common *CommonPtr = new (getASTContext()) Common; - getASTContext().AddDeallocation(DeallocateCommon, CommonPtr); +RedeclarableTemplateDecl::CommonBase * +ClassTemplateDecl::newCommon(ASTContext &C) { + Common *CommonPtr = new (C) Common; + C.AddDeallocation(DeallocateCommon, CommonPtr); return CommonPtr; } Modified: cfe/trunk/lib/AST/TemplateName.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TemplateName.cpp?rev=113391&r1=113390&r2=113391&view=diff ============================================================================== --- cfe/trunk/lib/AST/TemplateName.cpp (original) +++ cfe/trunk/lib/AST/TemplateName.cpp Wed Sep 8 14:31:22 2010 @@ -44,8 +44,14 @@ bool TemplateName::isDependent() const { if (TemplateDecl *Template = getAsTemplateDecl()) { - return isa(Template) || - Template->getDeclContext()->isDependentContext(); + if (isa(Template)) + return true; + // FIXME: Hack, getDeclContext() can be null if Template is still + // initializing due to PCH reading, so we check it before using it. + // Should probably modify TemplateSpecializationType to allow constructing + // it without the isDependent() checking. + return Template->getDeclContext() && + Template->getDeclContext()->isDependentContext(); } assert(!getAsOverloadedTemplate() && Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=113391&r1=113390&r2=113391&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original) +++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Wed Sep 8 14:31:22 2010 @@ -183,8 +183,8 @@ void ASTDeclReader::VisitTagDecl(TagDecl *TD) { VisitTypeDecl(TD); - TD->IdentifierNamespace = Record[Idx++]; VisitRedeclarable(TD); + TD->IdentifierNamespace = Record[Idx++]; TD->setTagKind((TagDecl::TagKind)Record[Idx++]); TD->setDefinition(Record[Idx++]); TD->setEmbeddedInDeclarator(Record[Idx++]); @@ -234,6 +234,7 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { VisitDeclaratorDecl(FD); + VisitRedeclarable(FD); // FIXME: read DeclarationNameLoc. FD->IdentifierNamespace = Record[Idx++]; @@ -250,7 +251,7 @@ FunctionDecl *InstFD = cast(Reader.GetDecl(Record[Idx++])); TemplateSpecializationKind TSK = (TemplateSpecializationKind)Record[Idx++]; SourceLocation POI = Reader.ReadSourceLocation(Record, Idx); - FD->setInstantiationOfMemberFunction(InstFD, TSK); + FD->setInstantiationOfMemberFunction(*Reader.getContext(), InstFD, TSK); FD->getMemberSpecializationInfo()->setPointOfInstantiation(POI); break; } @@ -279,12 +280,26 @@ SourceLocation POI = Reader.ReadSourceLocation(Record, Idx); - if (FD->isCanonicalDecl()) // if canonical add to template's set. - FD->setFunctionTemplateSpecialization(Template, TemplArgs.size(), - TemplArgs.data(), TSK, - TemplArgLocs.size(), - TemplArgLocs.data(), - LAngleLoc, RAngleLoc, POI); + if (FD->isCanonicalDecl()) { // if canonical add to template's set. + ASTContext &C = *Reader.getContext(); + TemplateArgumentList *TemplArgList + = new (C) TemplateArgumentList(C, TemplArgs.data(), TemplArgs.size()); + TemplateArgumentListInfo *TemplArgsInfo + = new (C) TemplateArgumentListInfo(LAngleLoc, RAngleLoc); + for (unsigned i=0, e = TemplArgLocs.size(); i != e; ++i) + TemplArgsInfo->addArgument(TemplArgLocs[i]); + + llvm::FoldingSetNodeID ID; + FunctionTemplateSpecializationInfo::Profile(ID, TemplArgs.data(), + TemplArgs.size(), C); + void *InsertPos = 0; + FunctionTemplateSpecializationInfo *PrevFTInfo = + Template->getSpecializations().FindNodeOrInsertPos(ID, InsertPos); + (void)PrevFTInfo; + assert(!PrevFTInfo && "Another specialization already inserted!"); + FD->setFunctionTemplateSpecialization(C, Template, TemplArgList, InsertPos, + TSK, TemplArgsInfo, POI); + } break; } case FunctionDecl::TK_DependentFunctionTemplateSpecialization: { @@ -311,7 +326,6 @@ // FunctionDecl's body is handled last at ASTDeclReader::Visit, // after everything else is read. - VisitRedeclarable(FD); FD->setStorageClass((StorageClass)Record[Idx++]); FD->setStorageClassAsWritten((StorageClass)Record[Idx++]); FD->setInlineSpecified(Record[Idx++]); @@ -331,7 +345,7 @@ Params.reserve(NumParams); for (unsigned I = 0; I != NumParams; ++I) Params.push_back(cast(Reader.GetDecl(Record[Idx++]))); - FD->setParams(Params.data(), NumParams); + FD->setParams(*Reader.getContext(), Params.data(), NumParams); } void ASTDeclReader::VisitObjCMethodDecl(ObjCMethodDecl *MD) { @@ -567,13 +581,13 @@ void ASTDeclReader::VisitVarDecl(VarDecl *VD) { VisitDeclaratorDecl(VD); + VisitRedeclarable(VD); VD->setStorageClass((StorageClass)Record[Idx++]); VD->setStorageClassAsWritten((StorageClass)Record[Idx++]); VD->setThreadSpecified(Record[Idx++]); VD->setCXXDirectInitializer(Record[Idx++]); VD->setExceptionVariable(Record[Idx++]); VD->setNRVOVariable(Record[Idx++]); - VisitRedeclarable(VD); if (Record[Idx++]) VD->setInit(Reader.ReadExpr(Cursor)); @@ -864,9 +878,10 @@ } void ASTDeclReader::VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D) { - VisitTemplateDecl(D); + // Initialize CommonOrPrev before VisitTemplateDecl so that getCommonPtr() + // can be used while this is still initializing. - D->IdentifierNamespace = Record[Idx++]; + assert(D->CommonOrPrev.isNull() && "getCommonPtr was called earlier on this"); RedeclarableTemplateDecl *PrevDecl = cast_or_null(Reader.GetDecl(Record[Idx++])); assert((PrevDecl == 0 || PrevDecl->getKind() == D->getKind()) && @@ -874,6 +889,7 @@ if (PrevDecl) D->CommonOrPrev = PrevDecl; if (PrevDecl == 0) { + D->CommonOrPrev = D->newCommon(*Reader.getContext()); if (RedeclarableTemplateDecl *RTD = cast_or_null(Reader.GetDecl(Record[Idx++]))) { assert(RTD->getKind() == D->getKind() && @@ -907,6 +923,9 @@ assert(LatestDecl->getKind() == D->getKind() && "Latest kind mismatch"); D->getCommonPtr()->Latest = LatestDecl; } + + VisitTemplateDecl(D); + D->IdentifierNamespace = Record[Idx++]; } void ASTDeclReader::VisitClassTemplateDecl(ClassTemplateDecl *D) { Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=113391&r1=113390&r2=113391&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original) +++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Wed Sep 8 14:31:22 2010 @@ -163,8 +163,8 @@ void ASTDeclWriter::VisitTagDecl(TagDecl *D) { VisitTypeDecl(D); - Record.push_back(D->getIdentifierNamespace()); VisitRedeclarable(D); + Record.push_back(D->getIdentifierNamespace()); Record.push_back((unsigned)D->getTagKind()); // FIXME: stable encoding Record.push_back(D->isDefinition()); Record.push_back(D->isEmbeddedInDeclarator()); @@ -214,6 +214,7 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { VisitDeclaratorDecl(D); + VisitRedeclarable(D); // FIXME: write DeclarationNameLoc. Record.push_back(D->getIdentifierNamespace()); @@ -281,7 +282,6 @@ // FunctionDecl's body is handled last at ASTWriterDecl::Visit, // after everything else is written. - VisitRedeclarable(D); Record.push_back(D->getStorageClass()); // FIXME: stable encoding Record.push_back(D->getStorageClassAsWritten()); Record.push_back(D->isInlineSpecified()); @@ -513,13 +513,13 @@ void ASTDeclWriter::VisitVarDecl(VarDecl *D) { VisitDeclaratorDecl(D); + VisitRedeclarable(D); Record.push_back(D->getStorageClass()); // FIXME: stable encoding Record.push_back(D->getStorageClassAsWritten()); Record.push_back(D->isThreadSpecified()); Record.push_back(D->hasCXXDirectInitializer()); Record.push_back(D->isExceptionVariable()); Record.push_back(D->isNRVOVariable()); - VisitRedeclarable(D); Record.push_back(D->getInit() ? 1 : 0); if (D->getInit()) Writer.AddStmt(D->getInit()); @@ -840,9 +840,9 @@ } void ASTDeclWriter::VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D) { - VisitTemplateDecl(D); + // Emit data to initialize CommonOrPrev before VisitTemplateDecl so that + // getCommonPtr() can be used while this is still initializing. - Record.push_back(D->getIdentifierNamespace()); Writer.AddDeclRef(D->getPreviousDeclaration(), Record); if (D->getPreviousDeclaration() == 0) { // This TemplateDecl owns the CommonPtr; write it. @@ -866,6 +866,9 @@ Writer.FirstLatestDecls[First] = D; } } + + VisitTemplateDecl(D); + Record.push_back(D->getIdentifierNamespace()); } void ASTDeclWriter::VisitClassTemplateDecl(ClassTemplateDecl *D) { From fjahanian at apple.com Wed Sep 8 15:08:18 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Wed, 08 Sep 2010 20:08:18 -0000 Subject: [cfe-commits] r113397 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaType.cpp test/SemaObjC/legacy-objc-types.m test/SemaObjCXX/legacy-objc-types.mm Message-ID: <20100908200819.0D2FB2A6C12C@llvm.org> Author: fjahanian Date: Wed Sep 8 15:08:18 2010 New Revision: 113397 URL: http://llvm.org/viewvc/llvm-project?rev=113397&view=rev Log: Fix a crash when overloading id with objc_object*. Radar 8400356. Added: cfe/trunk/test/SemaObjC/legacy-objc-types.m cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm Modified: cfe/trunk/include/clang/AST/Type.h cfe/trunk/lib/AST/Type.cpp cfe/trunk/lib/Sema/SemaType.cpp Modified: cfe/trunk/include/clang/AST/Type.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=113397&r1=113396&r2=113397&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/Type.h (original) +++ cfe/trunk/include/clang/AST/Type.h Wed Sep 8 15:08:18 2010 @@ -932,7 +932,9 @@ bool isObjCQualifiedClassType() const; // Class bool isObjCObjectOrInterfaceType() const; bool isObjCIdType() const; // id + bool isLegacyObjCIdType(ASTContext &) const; // struct_object * bool isObjCClassType() const; // Class + bool isLegacyObjCClassType(ASTContext &) const; // struct_class * bool isObjCSelType() const; // Class bool isObjCBuiltinType() const; // 'id' or 'Class' bool isTemplateTypeParmType() const; // C++ template type parameter Modified: cfe/trunk/lib/AST/Type.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=113397&r1=113396&r2=113397&view=diff ============================================================================== --- cfe/trunk/lib/AST/Type.cpp (original) +++ cfe/trunk/lib/AST/Type.cpp Wed Sep 8 15:08:18 2010 @@ -470,6 +470,24 @@ return false; } +bool Type::isLegacyObjCIdType(ASTContext &Ctx) const { + if (const PointerType *PTTo = getAs()) { + QualType PointeeTy = PTTo->getPointeeType(); + if (const RecordType *RTy = PointeeTy->getAs()) + return RTy->getDecl()->getIdentifier() == &Ctx.Idents.get("objc_object"); + } + return false; +} + +bool Type::isLegacyObjCClassType(ASTContext &Ctx) const { + if (const PointerType *PTTo = getAs()) { + QualType PointeeTy = PTTo->getPointeeType(); + if (const RecordType *RTy = PointeeTy->getAs()) + return RTy->getDecl()->getIdentifier() == &Ctx.Idents.get("objc_class"); + } + return false; +} + bool Type::isEnumeralType() const { if (const TagType *TT = dyn_cast(CanonicalType)) return TT->getDecl()->isEnum(); Modified: cfe/trunk/lib/Sema/SemaType.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=113397&r1=113396&r2=113397&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaType.cpp (original) +++ cfe/trunk/lib/Sema/SemaType.cpp Wed Sep 8 15:08:18 2010 @@ -1274,8 +1274,12 @@ if (BTy->getKind() == BuiltinType::Float) ArgTy = Context.DoubleTy; } + } else if (getLangOptions().ObjC1) { + if (ArgTy->isLegacyObjCIdType(Context)) + ArgTy = Context.getObjCIdType(); + else if (ArgTy->isLegacyObjCClassType(Context)) + ArgTy = Context.getObjCClassType(); } - ArgTys.push_back(ArgTy); } Added: cfe/trunk/test/SemaObjC/legacy-objc-types.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/legacy-objc-types.m?rev=113397&view=auto ============================================================================== --- cfe/trunk/test/SemaObjC/legacy-objc-types.m (added) +++ cfe/trunk/test/SemaObjC/legacy-objc-types.m Wed Sep 8 15:08:18 2010 @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// rdar:// 8400356 + +struct objc_object; + +void f(id ptr) { } // expected-note {{previous definition is here}} +void f(struct objc_object* ptr) { } // expected-error {{redefinition of 'f'}} + +struct objc_class; + +void g(Class ptr) {} // expected-note {{previous definition is here}} +void g(struct objc_class* ptr) { } // expected-error {{redefinition of 'g'}} + +void h(Class ptr, struct objc_object* ptr1) {} // expected-note {{previous definition is here}} +void h(struct objc_class* ptr, id ptr1) {} // expected-error {{redefinition of 'h'}} + +void i(Class ptr, struct objc_object* ptr1); +void i(struct objc_class* ptr, id ptr1) {} +void i(struct objc_class* ptr, struct objc_object* ptr1); + Added: cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm?rev=113397&view=auto ============================================================================== --- cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm (added) +++ cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm Wed Sep 8 15:08:18 2010 @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// rdar:// 8400356 + +struct objc_object; + +void f(id ptr) { } // expected-note {{previous definition is here}} +void f(objc_object* ptr) { } // expected-error {{redefinition of 'f'}} + +struct objc_class; + +void g(Class ptr) {} // expected-note {{previous definition is here}} +void g(objc_class* ptr) { } // expected-error {{redefinition of 'g'}} + +void h(Class ptr, objc_object* ptr1) {} // expected-note {{previous definition is here}} +void h(objc_class* ptr, id ptr1) {} // expected-error {{redefinition of 'h'}} + +void i(Class ptr, objc_object* ptr1); +void i(objc_class* ptr, id ptr1) {} +void i(objc_class* ptr, objc_object* ptr1); + From hhinnant at apple.com Wed Sep 8 15:31:42 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Wed, 08 Sep 2010 20:31:42 -0000 Subject: [cfe-commits] [libcxx] r113403 - in /libcxx/trunk: test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ test/containers/container.adaptors/priority.queue/priqueue.cons/ test/containers/container.adaptors/priority.queue/priqueue.members/ test/containers/container.adaptors/queue/queue.cons.alloc/ test/containers/container.adaptors/queue/queue.cons/ test/containers/container.adaptors/queue/queue.defn/ test/containers/container.adaptors/stack/stack.cons.alloc/ test/containers/container.adaptors/stack/sta... Message-ID: <20100908203142.8BEE42A6C12D@llvm.org> Author: hhinnant Date: Wed Sep 8 15:31:42 2010 New Revision: 113403 URL: http://llvm.org/viewvc/llvm-project?rev=113403&view=rev Log: Updated by-chapter-summary with weekly test results, and fixed up some bad paths in some tests caused by aligning the test suite with N3126. Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_cont_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_rcont_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_copy_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_default.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_queue_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_default.pass.cpp libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_copy_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_default.pass.cpp libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp libcxx/trunk/www/libcxx_by_chapter.pdf Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,7 +15,7 @@ #include #include -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" template struct test Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,7 +15,7 @@ #include #include -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" template struct test Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_cont_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_cont_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_cont_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_cont_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -16,7 +16,7 @@ #include #include -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" template C Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_rcont_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_rcont_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_rcont_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_rcont_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -16,7 +16,7 @@ #include #include -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" template C Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_copy_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_copy_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_copy_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_copy_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -25,7 +25,7 @@ return c; } -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" template struct test Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,7 +15,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES @@ -29,7 +29,7 @@ return c; } -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" template struct test Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../stack_allocator.h" +#include "../../../stack_allocator.h" int main() { Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_default.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_default.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_default.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_default.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../stack_allocator.h" +#include "../../../stack_allocator.h" int main() { Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp Wed Sep 8 15:31:42 2010 @@ -16,7 +16,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" int main() { Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp Wed Sep 8 15:31:42 2010 @@ -16,7 +16,7 @@ #include #include -#include "../../../../Emplaceable.h" +#include "../../../Emplaceable.h" int main() { Modified: libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp Wed Sep 8 15:31:42 2010 @@ -16,7 +16,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" int main() { Modified: libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,7 +15,7 @@ #include #include -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" struct test : private std::queue > > Modified: libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,7 +15,7 @@ #include #include -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" template C Modified: libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_queue_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_queue_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_queue_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_queue_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,7 +15,7 @@ #include #include -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" template C Modified: libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,8 +15,8 @@ #include #include -#include "../../../../test_allocator.h" -#include "../../../../MoveOnly.h" +#include "../../../test_allocator.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,8 +15,8 @@ #include #include -#include "../../../../test_allocator.h" -#include "../../../../MoveOnly.h" +#include "../../../test_allocator.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_default.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_default.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_default.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_default.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../stack_allocator.h" +#include "../../../stack_allocator.h" int main() { Modified: libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../Emplaceable.h" +#include "../../../Emplaceable.h" int main() { Modified: libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" int main() { Modified: libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,7 +15,7 @@ #include #include -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" struct test : private std::stack > > Modified: libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,7 +15,7 @@ #include #include -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" template C Modified: libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_copy_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_copy_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_copy_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_copy_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,7 +15,7 @@ #include #include -#include "../../../../test_allocator.h" +#include "../../../test_allocator.h" template C Modified: libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,8 +15,8 @@ #include #include -#include "../../../../test_allocator.h" -#include "../../../../MoveOnly.h" +#include "../../../test_allocator.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,8 +15,8 @@ #include #include -#include "../../../../test_allocator.h" -#include "../../../../MoveOnly.h" +#include "../../../test_allocator.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_default.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_default.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_default.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_default.pass.cpp Wed Sep 8 15:31:42 2010 @@ -15,7 +15,7 @@ #include #include -#include "../../../../stack_allocator.h" +#include "../../../stack_allocator.h" int main() { Modified: libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES Modified: libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../Emplaceable.h" +#include "../../../Emplaceable.h" int main() { Modified: libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== --- libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp (original) +++ libcxx/trunk/test/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp Wed Sep 8 15:31:42 2010 @@ -14,7 +14,7 @@ #include #include -#include "../../../../MoveOnly.h" +#include "../../../MoveOnly.h" int main() { Modified: libcxx/trunk/www/libcxx_by_chapter.pdf URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/libcxx_by_chapter.pdf?rev=113403&r1=113402&r2=113403&view=diff ============================================================================== Binary files - no diff available. From rjmccall at apple.com Wed Sep 8 16:04:05 2010 From: rjmccall at apple.com (John McCall) Date: Wed, 8 Sep 2010 14:04:05 -0700 Subject: [cfe-commits] r113397 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaType.cpp test/SemaObjC/legacy-objc-types.m test/SemaObjCXX/legacy-objc-types.mm In-Reply-To: <20100908200819.0D2FB2A6C12C@llvm.org> References: <20100908200819.0D2FB2A6C12C@llvm.org> Message-ID: On Sep 8, 2010, at 1:08 PM, Fariborz Jahanian wrote: > Author: fjahanian > Date: Wed Sep 8 15:08:18 2010 > New Revision: 113397 > > URL: http://llvm.org/viewvc/llvm-project?rev=113397&view=rev > Log: > Fix a crash when overloading id with objc_object*. > Radar 8400356. > > > Added: > cfe/trunk/test/SemaObjC/legacy-objc-types.m > cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm > Modified: > cfe/trunk/include/clang/AST/Type.h > cfe/trunk/lib/AST/Type.cpp > cfe/trunk/lib/Sema/SemaType.cpp > > Modified: cfe/trunk/include/clang/AST/Type.h > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=113397&r1=113396&r2=113397&view=diff > ============================================================================== > --- cfe/trunk/include/clang/AST/Type.h (original) > +++ cfe/trunk/include/clang/AST/Type.h Wed Sep 8 15:08:18 2010 > @@ -932,7 +932,9 @@ > bool isObjCQualifiedClassType() const; // Class > bool isObjCObjectOrInterfaceType() const; > bool isObjCIdType() const; // id > + bool isLegacyObjCIdType(ASTContext &) const; // struct_object * > bool isObjCClassType() const; // Class > + bool isLegacyObjCClassType(ASTContext &) const; // struct_class * > bool isObjCSelType() const; // Class > bool isObjCBuiltinType() const; // 'id' or 'Class' > bool isTemplateTypeParmType() const; // C++ template type parameter > > Modified: cfe/trunk/lib/AST/Type.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=113397&r1=113396&r2=113397&view=diff > ============================================================================== > --- cfe/trunk/lib/AST/Type.cpp (original) > +++ cfe/trunk/lib/AST/Type.cpp Wed Sep 8 15:08:18 2010 > @@ -470,6 +470,24 @@ > return false; > } > > +bool Type::isLegacyObjCIdType(ASTContext &Ctx) const { > + if (const PointerType *PTTo = getAs()) { > + QualType PointeeTy = PTTo->getPointeeType(); > + if (const RecordType *RTy = PointeeTy->getAs()) > + return RTy->getDecl()->getIdentifier() == &Ctx.Idents.get("objc_object"); > + } > + return false; > +} > + > +bool Type::isLegacyObjCClassType(ASTContext &Ctx) const { > + if (const PointerType *PTTo = getAs()) { > + QualType PointeeTy = PTTo->getPointeeType(); > + if (const RecordType *RTy = PointeeTy->getAs()) > + return RTy->getDecl()->getIdentifier() == &Ctx.Idents.get("objc_class"); > + } > + return false; > +} > + > bool Type::isEnumeralType() const { > if (const TagType *TT = dyn_cast(CanonicalType)) > return TT->getDecl()->isEnum(); > > Modified: cfe/trunk/lib/Sema/SemaType.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=113397&r1=113396&r2=113397&view=diff > ============================================================================== > --- cfe/trunk/lib/Sema/SemaType.cpp (original) > +++ cfe/trunk/lib/Sema/SemaType.cpp Wed Sep 8 15:08:18 2010 > @@ -1274,8 +1274,12 @@ > if (BTy->getKind() == BuiltinType::Float) > ArgTy = Context.DoubleTy; > } > + } else if (getLangOptions().ObjC1) { > + if (ArgTy->isLegacyObjCIdType(Context)) > + ArgTy = Context.getObjCIdType(); > + else if (ArgTy->isLegacyObjCClassType(Context)) > + ArgTy = Context.getObjCClassType(); > } > - > ArgTys.push_back(ArgTy); > } If I understand this patch correctly, there's a crash arising from invalid redeclarations of functions. If that's true, this is almost certainly a workaround rather than a fix, because it's just making the redeclaration valid. Please fix the underlying crash rather than working around it like this. Also, there are several problems with this pattern of recognizing 'struct objc_object' and 'struct objc_class'. 1) This is a significant change in behavior; previously we intentionally never recognized these types as being their respective builtin types. I'm actually ambivalent about that ? we should probably recognize this, at the very least to give an error about it ? but we shouldn't change the design lightly just to fix a crash. 2) If we do want to recognize these structs as the builtin types, we should do consistently, not just for parameters, and not just for the exact case of pointers to the type. The cleanest way to do that is in ConvertDeclSpecToType. 3) The logic to recognize these structs should respect context; only structs in global scope are the builtins, i.e. if getDeclContext()->getRedeclContext()->isTranslationUnit() (there might be a convenience function for that somewhere). John. From dawn at burble.org Wed Sep 8 16:07:07 2010 From: dawn at burble.org (dawn at burble.org) Date: Wed, 8 Sep 2010 14:07:07 -0700 Subject: [cfe-commits] [PATCH][Borland] - enable some MS keywords which are shared with Borland extensions Message-ID: <20100908210707.GA5576@bloodbath.burble.org> There are several MS extensions supported by the Borland compiler. This adds support for a few of those (with more soon to come). Please review. Thanks, -Dawn -------------- next part -------------- Index: test/SemaCXX/borland-extensions.cpp =================================================================== --- test/SemaCXX/borland-extensions.cpp (revision 113394) +++ test/SemaCXX/borland-extensions.cpp (working copy) @@ -24,3 +24,29 @@ i = h2(&M::addP); f = h2(&M::subtractP); } + +// 3. test other calling conventions +int _cdecl fa3(); +int _fastcall fc3(); +int _stdcall fd3(); + +// 4. test __uuidof() +typedef struct _GUID { + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[ 8 ]; +} GUID; + +struct __declspec(uuid("{12345678-1234-1234-1234-123456789abc}")) Foo; +struct Data { + GUID const* Guid; +}; + +void t4() { + unsigned long data; + + const GUID guid_inl = __uuidof(Foo); + Data ata1 = { &guid_inl}; + data = ata1.Guid->Data1; +} Index: include/clang/Basic/TokenKinds.def =================================================================== --- include/clang/Basic/TokenKinds.def (revision 113394) +++ include/clang/Basic/TokenKinds.def (working copy) @@ -336,7 +336,7 @@ KEYWORD(__thiscall , KEYALL) KEYWORD(__forceinline , KEYALL) -// Borland Extension. +// Borland Extensions. KEYWORD(__pascal , KEYALL) // Altivec Extension. @@ -369,13 +369,13 @@ // Microsoft extensions which should be disabled in strict conformance mode KEYWORD(__ptr64 , KEYMS) KEYWORD(__w64 , KEYMS) -KEYWORD(__uuidof , KEYMS) +KEYWORD(__uuidof , KEYMS | KEYBORLAND) ALIAS("_asm" , asm , KEYMS) -ALIAS("_cdecl" , __cdecl , KEYMS) -ALIAS("_fastcall" , __fastcall , KEYMS) -ALIAS("_stdcall" , __stdcall , KEYMS) +ALIAS("_cdecl" , __cdecl , KEYMS | KEYBORLAND) +ALIAS("_fastcall" , __fastcall , KEYMS | KEYBORLAND) +ALIAS("_stdcall" , __stdcall , KEYMS | KEYBORLAND) ALIAS("_thiscall" , __thiscall , KEYMS) -ALIAS("_uuidof" ,__uuidof , KEYMS) +ALIAS("_uuidof" , __uuidof , KEYMS | KEYBORLAND) // Borland Extensions which should be disabled in strict conformance mode. ALIAS("_pascal" , __pascal , KEYBORLAND) From pichet2000 at gmail.com Wed Sep 8 16:21:28 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Wed, 8 Sep 2010 17:21:28 -0400 Subject: [cfe-commits] [PATCH][Borland] - enable some MS keywords which are shared with Borland extensions In-Reply-To: <20100908210707.GA5576@bloodbath.burble.org> References: <20100908210707.GA5576@bloodbath.burble.org> Message-ID: Hi .. Are you planning to actually implement Microsoft extensions? If so that's great but we should make sure not to duplicate work Here is the tasks on my list: 1. flexible array member in union example: typedef struct _PROPERTYINSTEX { WORD Length; union { BYTE Byte[]; WORD Word[]; DWORD Dword[]; LARGE_INTEGER LargeInt[]; SYSTEMTIME SysTime[]; }; } PROPERTYINSTEX; 2. clang must parse this: (superfluous A::) class A { int A::f() { return 0; } }; 3. microsoft enum support: -clang must parse this: enum FOO { a = (FOO) 3 }; - forward enum must have an underlying type. (int) - support enum FOO : int {}; 4. MSVC Compiler Intrinsics ex: __noop On Wed, Sep 8, 2010 at 5:07 PM, wrote: > > There are several MS extensions supported by the Borland compiler. ?This > adds support for a few of those (with more soon to come). ?Please review. > > Thanks, > -Dawn > > _______________________________________________ > cfe-commits mailing list > cfe-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > > From fjahanian at apple.com Wed Sep 8 16:30:52 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Wed, 8 Sep 2010 14:30:52 -0700 Subject: [cfe-commits] r113397 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaType.cpp test/SemaObjC/legacy-objc-types.m test/SemaObjCXX/legacy-objc-types.mm In-Reply-To: References: <20100908200819.0D2FB2A6C12C@llvm.org> Message-ID: On Sep 8, 2010, at 2:04 PM, John McCall wrote: > On Sep 8, 2010, at 1:08 PM, Fariborz Jahanian wrote: >> Author: fjahanian >> Date: Wed Sep 8 15:08:18 2010 >> New Revision: 113397 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=113397&view=rev >> Log: >> Fix a crash when overloading id with objc_object*. >> Radar 8400356. >> >> >> Added: >> cfe/trunk/test/SemaObjC/legacy-objc-types.m >> cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm >> Modified: >> cfe/trunk/include/clang/AST/Type.h >> cfe/trunk/lib/AST/Type.cpp >> cfe/trunk/lib/Sema/SemaType.cpp >> >> Modified: cfe/trunk/include/clang/AST/Type.h >> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=113397&r1=113396&r2=113397&view=diff >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- cfe/trunk/include/clang/AST/Type.h (original) >> +++ cfe/trunk/include/clang/AST/Type.h Wed Sep 8 15:08:18 2010 >> @@ -932,7 +932,9 @@ >> bool isObjCQualifiedClassType() const; // Class >> bool isObjCObjectOrInterfaceType() const; >> bool isObjCIdType() const; // id >> + bool isLegacyObjCIdType(ASTContext &) const; // struct_object * >> bool isObjCClassType() const; // Class >> + bool isLegacyObjCClassType(ASTContext &) const; // struct_class * >> bool isObjCSelType() const; // Class >> bool isObjCBuiltinType() const; // 'id' or 'Class' >> bool isTemplateTypeParmType() const; // C++ template type >> parameter >> >> Modified: cfe/trunk/lib/AST/Type.cpp >> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=113397&r1=113396&r2=113397&view=diff >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- cfe/trunk/lib/AST/Type.cpp (original) >> +++ cfe/trunk/lib/AST/Type.cpp Wed Sep 8 15:08:18 2010 >> @@ -470,6 +470,24 @@ >> return false; >> } >> >> +bool Type::isLegacyObjCIdType(ASTContext &Ctx) const { >> + if (const PointerType *PTTo = getAs()) { >> + QualType PointeeTy = PTTo->getPointeeType(); >> + if (const RecordType *RTy = PointeeTy->getAs()) >> + return RTy->getDecl()->getIdentifier() == >> &Ctx.Idents.get("objc_object"); >> + } >> + return false; >> +} >> + >> +bool Type::isLegacyObjCClassType(ASTContext &Ctx) const { >> + if (const PointerType *PTTo = getAs()) { >> + QualType PointeeTy = PTTo->getPointeeType(); >> + if (const RecordType *RTy = PointeeTy->getAs()) >> + return RTy->getDecl()->getIdentifier() == >> &Ctx.Idents.get("objc_class"); >> + } >> + return false; >> +} >> + >> bool Type::isEnumeralType() const { >> if (const TagType *TT = dyn_cast(CanonicalType)) >> return TT->getDecl()->isEnum(); >> >> Modified: cfe/trunk/lib/Sema/SemaType.cpp >> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=113397&r1=113396&r2=113397&view=diff >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- cfe/trunk/lib/Sema/SemaType.cpp (original) >> +++ cfe/trunk/lib/Sema/SemaType.cpp Wed Sep 8 15:08:18 2010 >> @@ -1274,8 +1274,12 @@ >> if (BTy->getKind() == BuiltinType::Float) >> ArgTy = Context.DoubleTy; >> } >> + } else if (getLangOptions().ObjC1) { >> + if (ArgTy->isLegacyObjCIdType(Context)) >> + ArgTy = Context.getObjCIdType(); >> + else if (ArgTy->isLegacyObjCClassType(Context)) >> + ArgTy = Context.getObjCClassType(); >> } >> - >> ArgTys.push_back(ArgTy); >> } > > > If I understand this patch correctly, there's a crash arising from > invalid redeclarations of functions. If that's true, this is almost > certainly a workaround rather than a fix, because it's just making > the redeclaration valid. Please fix the underlying crash rather > than working around it like this. Underlying crash is in IRgen because we do not catch such duplicate function definitions. This patch makes the re-declaration identical to previous one and forces error in Sema. > > > Also, there are several problems with this pattern of recognizing > 'struct objc_object' and 'struct objc_class'. > 1) This is a significant change in behavior; previously we > intentionally never recognized these types as being their respective > builtin types. I'm actually ambivalent about that ? we should > probably recognize this, at the very least to give an error about it > ? but we shouldn't change the design lightly just to fix a crash. I am open to issuing error on use of such types. But there could be many situations which previous gcc compiled code will break. > > 2) If we do want to recognize these structs as the builtin types, > we should do consistently, not just for parameters, and not just for > the exact case of pointers to the type. The cleanest way to do that > is in ConvertDeclSpecToType. I thought about this at first. But we don't want to encourage use of these types and make them work silently. I rather let compiler issues error to discourage their use. > > 3) The logic to recognize these structs should respect context; > only structs in global scope are the builtins, i.e. if > getDeclContext()->getRedeclContext()->isTranslationUnit() (there > might be a convenience function for that somewhere). I agree on this point. I can tighten up the type checking. In any case, point of this patch was to fix the crash in a limited case and not treat 'struct objc_object' as a replacement for 'id' everywhere. So, these are alternatives. 1. Do nothing and let the test case crash ( I think it was a manufactured test ). 2. Accept the alternative 'struct ...' as builtin type everywhere. 3. Issue error if it is used anywhere. 4.??? - fariborz > > > John. From isanbard at gmail.com Wed Sep 8 16:30:17 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 08 Sep 2010 21:30:17 -0000 Subject: [cfe-commits] r113412 - /cfe/trunk/lib/Sema/Sema.cpp Message-ID: <20100908213017.170BB2A6C12C@llvm.org> Author: void Date: Wed Sep 8 16:30:16 2010 New Revision: 113412 URL: http://llvm.org/viewvc/llvm-project?rev=113412&view=rev Log: Initialize the MSVCGuidDecl variable in the correct order. Modified: cfe/trunk/lib/Sema/Sema.cpp Modified: cfe/trunk/lib/Sema/Sema.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=113412&r1=113411&r2=113412&view=diff ============================================================================== --- cfe/trunk/lib/Sema/Sema.cpp (original) +++ cfe/trunk/lib/Sema/Sema.cpp Wed Sep 8 16:30:16 2010 @@ -134,11 +134,12 @@ Diags(PP.getDiagnostics()), SourceMgr(PP.getSourceManager()), ExternalSource(0), CodeCompleter(CodeCompleter), CurContext(0), PackContext(0), VisContext(0), ParsingDeclDepth(0), - IdResolver(pp.getLangOptions()), GlobalNewDeleteDeclared(false), + IdResolver(pp.getLangOptions()), MSVCGuidDecl(0), + GlobalNewDeleteDeclared(false), CompleteTranslationUnit(CompleteTranslationUnit), NumSFINAEErrors(0), SuppressAccessChecking(false), NonInstantiationEntries(0), CurrentInstantiationScope(0), TyposCorrected(0), - AnalysisWarnings(*this), MSVCGuidDecl(0) + AnalysisWarnings(*this) { TUScope = 0; if (getLangOptions().CPlusPlus) From akyrtzi at gmail.com Wed Sep 8 16:32:35 2010 From: akyrtzi at gmail.com (Argyrios Kyrtzidis) Date: Wed, 08 Sep 2010 21:32:35 -0000 Subject: [cfe-commits] r113413 - in /cfe/trunk: include/clang/AST/DeclCXX.h lib/AST/DeclBase.cpp lib/Serialization/ASTReaderDecl.cpp Message-ID: <20100908213235.EF69E2A6C12C@llvm.org> Author: akirtzidis Date: Wed Sep 8 16:32:35 2010 New Revision: 113413 URL: http://llvm.org/viewvc/llvm-project?rev=113413&view=rev Log: Re-enable CheckAccessDeclContext and make sure it doesn't trigger assertions. Modified: cfe/trunk/include/clang/AST/DeclCXX.h cfe/trunk/lib/AST/DeclBase.cpp cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Modified: cfe/trunk/include/clang/AST/DeclCXX.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=113413&r1=113412&r2=113413&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/DeclCXX.h (original) +++ cfe/trunk/include/clang/AST/DeclCXX.h Wed Sep 8 16:32:35 2010 @@ -112,6 +112,8 @@ : Decl(AccessSpec, DC, ASLoc), ColonLoc(ColonLoc) { setAccess(AS); } + AccessSpecDecl(EmptyShell Empty) + : Decl(AccessSpec, Empty) { } public: /// getAccessSpecifierLoc - The location of the access specifier. SourceLocation getAccessSpecifierLoc() const { return getLocation(); } @@ -132,6 +134,9 @@ SourceLocation ColonLoc) { return new (C) AccessSpecDecl(AS, DC, ASLoc, ColonLoc); } + static AccessSpecDecl *Create(ASTContext &C, EmptyShell Empty) { + return new (C) AccessSpecDecl(Empty); + } // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return classofKind(D->getKind()); } Modified: cfe/trunk/lib/AST/DeclBase.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=113413&r1=113412&r2=113413&view=diff ============================================================================== --- cfe/trunk/lib/AST/DeclBase.cpp (original) +++ cfe/trunk/lib/AST/DeclBase.cpp Wed Sep 8 16:32:35 2010 @@ -418,18 +418,20 @@ #ifndef NDEBUG void Decl::CheckAccessDeclContext() const { - // FIXME: Disable this until rdar://8146294 "access specifier for inner class - // templates is not set or checked" is fixed. - return; // Suppress this check if any of the following hold: // 1. this is the translation unit (and thus has no parent) // 2. this is a template parameter (and thus doesn't belong to its context) // 3. the context is not a record // 4. it's invalid + // 5. it's a C++0x static_assert. if (isa(this) || isa(this) || !isa(getDeclContext()) || - isInvalidDecl()) + isInvalidDecl() || + isa(this) || + // FIXME: a ParmVarDecl can have ClassTemplateSpecialization + // as DeclContext (?). + isa(this)) return; assert(Access != AS_none && Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=113413&r1=113412&r2=113413&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original) +++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Wed Sep 8 16:32:35 2010 @@ -1308,8 +1308,7 @@ D = CXXConversionDecl::Create(*Context, Decl::EmptyShell()); break; case DECL_ACCESS_SPEC: - D = AccessSpecDecl::Create(*Context, AS_none, 0, SourceLocation(), - SourceLocation()); + D = AccessSpecDecl::Create(*Context, Decl::EmptyShell()); break; case DECL_FRIEND: D = FriendDecl::Create(*Context, Decl::EmptyShell()); From dgregor at apple.com Wed Sep 8 16:31:48 2010 From: dgregor at apple.com (Douglas Gregor) Date: Wed, 8 Sep 2010 14:31:48 -0700 Subject: [cfe-commits] [PATCH][Borland] - enable some MS keywords which are shared with Borland extensions In-Reply-To: References: <20100908210707.GA5576@bloodbath.burble.org> Message-ID: On Sep 8, 2010, at 2:21 PM, Francois Pichet wrote: > Hi .. Are you planning to actually implement Microsoft extensions? > If so that's great but we should make sure not to duplicate work > > > Here is the tasks on my list: > > 2. clang must parse this: (superfluous A::) > class A { > int A::f() { return 0; } > }; This would be a great ExtWarn + Fix-it, since it's a common mistake. > > 3. microsoft enum support: > -clang must parse this: > enum FOO { > a = (FOO) 3 > }; > - forward enum must have an underlying type. (int) > - support enum FOO : int {}; This last bit is C++0x syntax, FWIW. - Doug From fjahanian at apple.com Wed Sep 8 16:36:35 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Wed, 08 Sep 2010 21:36:35 -0000 Subject: [cfe-commits] r113414 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaType.cpp test/SemaObjCXX/legacy-objc-types.mm Message-ID: <20100908213635.DEEE12A6C12C@llvm.org> Author: fjahanian Date: Wed Sep 8 16:36:35 2010 New Revision: 113414 URL: http://llvm.org/viewvc/llvm-project?rev=113414&view=rev Log: Reverse r113397 until we decide what to do with use of 'struct objc_object*' for 'is' (and others) in clang. Modified: cfe/trunk/include/clang/AST/Type.h cfe/trunk/lib/AST/Type.cpp cfe/trunk/lib/Sema/SemaType.cpp cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm Modified: cfe/trunk/include/clang/AST/Type.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=113414&r1=113413&r2=113414&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/Type.h (original) +++ cfe/trunk/include/clang/AST/Type.h Wed Sep 8 16:36:35 2010 @@ -932,9 +932,7 @@ bool isObjCQualifiedClassType() const; // Class bool isObjCObjectOrInterfaceType() const; bool isObjCIdType() const; // id - bool isLegacyObjCIdType(ASTContext &) const; // struct_object * bool isObjCClassType() const; // Class - bool isLegacyObjCClassType(ASTContext &) const; // struct_class * bool isObjCSelType() const; // Class bool isObjCBuiltinType() const; // 'id' or 'Class' bool isTemplateTypeParmType() const; // C++ template type parameter Modified: cfe/trunk/lib/AST/Type.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=113414&r1=113413&r2=113414&view=diff ============================================================================== --- cfe/trunk/lib/AST/Type.cpp (original) +++ cfe/trunk/lib/AST/Type.cpp Wed Sep 8 16:36:35 2010 @@ -470,24 +470,6 @@ return false; } -bool Type::isLegacyObjCIdType(ASTContext &Ctx) const { - if (const PointerType *PTTo = getAs()) { - QualType PointeeTy = PTTo->getPointeeType(); - if (const RecordType *RTy = PointeeTy->getAs()) - return RTy->getDecl()->getIdentifier() == &Ctx.Idents.get("objc_object"); - } - return false; -} - -bool Type::isLegacyObjCClassType(ASTContext &Ctx) const { - if (const PointerType *PTTo = getAs()) { - QualType PointeeTy = PTTo->getPointeeType(); - if (const RecordType *RTy = PointeeTy->getAs()) - return RTy->getDecl()->getIdentifier() == &Ctx.Idents.get("objc_class"); - } - return false; -} - bool Type::isEnumeralType() const { if (const TagType *TT = dyn_cast(CanonicalType)) return TT->getDecl()->isEnum(); Modified: cfe/trunk/lib/Sema/SemaType.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=113414&r1=113413&r2=113414&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaType.cpp (original) +++ cfe/trunk/lib/Sema/SemaType.cpp Wed Sep 8 16:36:35 2010 @@ -1274,12 +1274,8 @@ if (BTy->getKind() == BuiltinType::Float) ArgTy = Context.DoubleTy; } - } else if (getLangOptions().ObjC1) { - if (ArgTy->isLegacyObjCIdType(Context)) - ArgTy = Context.getObjCIdType(); - else if (ArgTy->isLegacyObjCClassType(Context)) - ArgTy = Context.getObjCClassType(); } + ArgTys.push_back(ArgTy); } Modified: cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm?rev=113414&r1=113413&r2=113414&view=diff ============================================================================== --- cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm (original) +++ cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm Wed Sep 8 16:36:35 2010 @@ -1,20 +0,0 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -// rdar:// 8400356 - -struct objc_object; - -void f(id ptr) { } // expected-note {{previous definition is here}} -void f(objc_object* ptr) { } // expected-error {{redefinition of 'f'}} - -struct objc_class; - -void g(Class ptr) {} // expected-note {{previous definition is here}} -void g(objc_class* ptr) { } // expected-error {{redefinition of 'g'}} - -void h(Class ptr, objc_object* ptr1) {} // expected-note {{previous definition is here}} -void h(objc_class* ptr, id ptr1) {} // expected-error {{redefinition of 'h'}} - -void i(Class ptr, objc_object* ptr1); -void i(objc_class* ptr, id ptr1) {} -void i(objc_class* ptr, objc_object* ptr1); - From dgregor at apple.com Wed Sep 8 16:40:08 2010 From: dgregor at apple.com (Douglas Gregor) Date: Wed, 08 Sep 2010 21:40:08 -0000 Subject: [cfe-commits] r113415 - in /cfe/trunk: lib/Sema/SemaExprCXX.cpp lib/Sema/SemaInit.cpp test/SemaCXX/decl-expr-ambiguity.cpp test/SemaCXX/functional-cast.cpp test/SemaCXX/qualified-id-lookup.cpp test/SemaCXX/type-convert-construct.cpp Message-ID: <20100908214008.AE2CA2A6C12C@llvm.org> Author: dgregor Date: Wed Sep 8 16:40:08 2010 New Revision: 113415 URL: http://llvm.org/viewvc/llvm-project?rev=113415&view=rev Log: Use the new-initialization code for initializing scalars with a function-style cast. Previously, we had a (redundant, incorrect) semantic-checking path for non-class types, which allowed value-initialization of a reference type and then crashed. Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp cfe/trunk/lib/Sema/SemaInit.cpp cfe/trunk/test/SemaCXX/decl-expr-ambiguity.cpp cfe/trunk/test/SemaCXX/functional-cast.cpp cfe/trunk/test/SemaCXX/qualified-id-lookup.cpp cfe/trunk/test/SemaCXX/type-convert-construct.cpp Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=113415&r1=113414&r2=113415&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Sep 8 16:40:08 2010 @@ -615,41 +615,17 @@ RParenLoc)); } - if (Ty->isRecordType()) { - InitializedEntity Entity = InitializedEntity::InitializeTemporary(TInfo); - InitializationKind Kind - = NumExprs ? InitializationKind::CreateDirect(TyBeginLoc, - LParenLoc, RParenLoc) - : InitializationKind::CreateValue(TyBeginLoc, - LParenLoc, RParenLoc); - InitializationSequence InitSeq(*this, Entity, Kind, Exprs, NumExprs); - ExprResult Result = InitSeq.Perform(*this, Entity, Kind, move(exprs)); - - // FIXME: Improve AST representation? - return move(Result); - } + InitializedEntity Entity = InitializedEntity::InitializeTemporary(TInfo); + InitializationKind Kind + = NumExprs ? InitializationKind::CreateDirect(TyBeginLoc, + LParenLoc, RParenLoc) + : InitializationKind::CreateValue(TyBeginLoc, + LParenLoc, RParenLoc); + InitializationSequence InitSeq(*this, Entity, Kind, Exprs, NumExprs); + ExprResult Result = InitSeq.Perform(*this, Entity, Kind, move(exprs)); - // C++ [expr.type.conv]p1: - // If the expression list specifies more than a single value, the type shall - // be a class with a suitably declared constructor. - // - if (NumExprs > 1) - return ExprError(Diag(PP.getLocForEndOfToken(Exprs[0]->getLocEnd()), - diag::err_builtin_func_cast_more_than_one_arg) - << FullRange); - - assert(NumExprs == 0 && "Expected 0 expressions"); - // FIXME: Why doesn't this go through the new-initialization code? - - // C++ [expr.type.conv]p2: - // The expression T(), where T is a simple-type-specifier for a non-array - // complete object type or the (possibly cv-qualified) void type, creates an - // rvalue of the specified type, which is value-initialized. - // - exprs.release(); - return Owned(new (Context) CXXScalarValueInitExpr( - TInfo->getType().getNonLValueExprType(Context), - TInfo, RParenLoc)); + // FIXME: Improve AST representation? + return move(Result); } Modified: cfe/trunk/lib/Sema/SemaInit.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=113415&r1=113414&r2=113415&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaInit.cpp (original) +++ cfe/trunk/lib/Sema/SemaInit.cpp Wed Sep 8 16:40:08 2010 @@ -4094,13 +4094,18 @@ SourceRange R; if (InitListExpr *InitList = dyn_cast(Args[0])) - R = SourceRange(InitList->getInit(1)->getLocStart(), + R = SourceRange(InitList->getInit(0)->getLocEnd(), InitList->getLocEnd()); - else - R = SourceRange(Args[0]->getLocStart(), Args[NumArgs - 1]->getLocEnd()); + else + R = SourceRange(Args[0]->getLocEnd(), Args[NumArgs - 1]->getLocEnd()); - S.Diag(Kind.getLocation(), diag::err_excess_initializers) - << /*scalar=*/2 << R; + R.setBegin(S.PP.getLocForEndOfToken(R.getBegin())); + if (Kind.isCStyleOrFunctionalCast()) + S.Diag(Kind.getLocation(), diag::err_builtin_func_cast_more_than_one_arg) + << R; + else + S.Diag(Kind.getLocation(), diag::err_excess_initializers) + << /*scalar=*/2 << R; break; } Modified: cfe/trunk/test/SemaCXX/decl-expr-ambiguity.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/decl-expr-ambiguity.cpp?rev=113415&r1=113414&r2=113415&view=diff ============================================================================== --- cfe/trunk/test/SemaCXX/decl-expr-ambiguity.cpp (original) +++ cfe/trunk/test/SemaCXX/decl-expr-ambiguity.cpp Wed Sep 8 16:40:08 2010 @@ -9,7 +9,7 @@ T(a)->m = 7; int(a)++; // expected-error {{expression is not assignable}} __extension__ int(a)++; // expected-error {{expression is not assignable}} - __typeof(int)(a,5)< Author: dgregor Date: Wed Sep 8 16:40:53 2010 New Revision: 113416 URL: http://llvm.org/viewvc/llvm-project?rev=113416&view=rev Log: Clean up some of the CMake dependencies Modified: cfe/trunk/lib/AST/CMakeLists.txt cfe/trunk/lib/Frontend/CMakeLists.txt cfe/trunk/lib/Index/CMakeLists.txt cfe/trunk/lib/Lex/CMakeLists.txt cfe/trunk/lib/Parse/CMakeLists.txt cfe/trunk/lib/Rewrite/CMakeLists.txt cfe/trunk/lib/Sema/CMakeLists.txt Modified: cfe/trunk/lib/AST/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CMakeLists.txt?rev=113416&r1=113415&r2=113416&view=diff ============================================================================== --- cfe/trunk/lib/AST/CMakeLists.txt (original) +++ cfe/trunk/lib/AST/CMakeLists.txt Wed Sep 8 16:40:53 2010 @@ -1,5 +1,7 @@ set(LLVM_NO_RTTI 1) +set(LLVM_USED_LIBS clangBasic) + add_clang_library(clangAST APValue.cpp ASTConsumer.cpp Modified: cfe/trunk/lib/Frontend/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CMakeLists.txt?rev=113416&r1=113415&r2=113416&view=diff ============================================================================== --- cfe/trunk/lib/Frontend/CMakeLists.txt (original) +++ cfe/trunk/lib/Frontend/CMakeLists.txt Wed Sep 8 16:40:53 2010 @@ -1,5 +1,19 @@ set(LLVM_NO_RTTI 1) +set( LLVM_USED_LIBS + clangSerialization + clangCodeGen + clangParse + clangSema + clangChecker + clangAnalysis + clangIndex + clangRewrite + clangAST + clangLex + clangBasic + ) + add_clang_library(clangFrontend ASTConsumers.cpp ASTMerge.cpp Modified: cfe/trunk/lib/Index/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/CMakeLists.txt?rev=113416&r1=113415&r2=113416&view=diff ============================================================================== --- cfe/trunk/lib/Index/CMakeLists.txt (original) +++ cfe/trunk/lib/Index/CMakeLists.txt Wed Sep 8 16:40:53 2010 @@ -1,5 +1,19 @@ set(LLVM_NO_RTTI 1) +set( LLVM_USED_LIBS + clangSerialization + clangFrontend + clangParse + clangSema + clangChecker + clangAnalysis + clangIndex + clangRewrite + clangAST + clangLex + clangBasic + ) + add_clang_library(clangIndex ASTLocation.cpp Analyzer.cpp Modified: cfe/trunk/lib/Lex/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/CMakeLists.txt?rev=113416&r1=113415&r2=113416&view=diff ============================================================================== --- cfe/trunk/lib/Lex/CMakeLists.txt (original) +++ cfe/trunk/lib/Lex/CMakeLists.txt Wed Sep 8 16:40:53 2010 @@ -2,6 +2,8 @@ # TODO: Add -maltivec when ARCH is PowerPC. +set(LLVM_USED_LIBS clangBasic) + add_clang_library(clangLex HeaderMap.cpp HeaderSearch.cpp Modified: cfe/trunk/lib/Parse/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/CMakeLists.txt?rev=113416&r1=113415&r2=113416&view=diff ============================================================================== --- cfe/trunk/lib/Parse/CMakeLists.txt (original) +++ cfe/trunk/lib/Parse/CMakeLists.txt Wed Sep 8 16:40:53 2010 @@ -1,5 +1,7 @@ set(LLVM_NO_RTTI 1) +set(LLVM_USED_LIBS clangBasic clangAST clangLex clangSema) + add_clang_library(clangParse ParseAST.cpp ParseCXXInlineMethods.cpp Modified: cfe/trunk/lib/Rewrite/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/CMakeLists.txt?rev=113416&r1=113415&r2=113416&view=diff ============================================================================== --- cfe/trunk/lib/Rewrite/CMakeLists.txt (original) +++ cfe/trunk/lib/Rewrite/CMakeLists.txt Wed Sep 8 16:40:53 2010 @@ -1,5 +1,7 @@ set(LLVM_NO_RTTI 1) +set(LLVM_USED_LIBS clangBasic) + add_clang_library(clangRewrite DeltaTree.cpp FixItRewriter.cpp @@ -14,7 +16,7 @@ TokenRewriter.cpp ) -add_dependencies(clangBasic +add_dependencies(clangRewrite ClangAttrClasses ClangAttrList ClangDeclNodes Modified: cfe/trunk/lib/Sema/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/CMakeLists.txt?rev=113416&r1=113415&r2=113416&view=diff ============================================================================== --- cfe/trunk/lib/Sema/CMakeLists.txt (original) +++ cfe/trunk/lib/Sema/CMakeLists.txt Wed Sep 8 16:40:53 2010 @@ -1,5 +1,7 @@ set(LLVM_NO_RTTI 1) +set(LLVM_USED_LIBS clangBasic clangAST clangLex clangAnalysis) + add_clang_library(clangSema AnalysisBasedWarnings.cpp AttributeList.cpp From fjahanian at apple.com Wed Sep 8 16:55:57 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Wed, 08 Sep 2010 21:55:57 -0000 Subject: [cfe-commits] r113418 - /cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm Message-ID: <20100908215557.7B12F2A6C12C@llvm.org> Author: fjahanian Date: Wed Sep 8 16:55:57 2010 New Revision: 113418 URL: http://llvm.org/viewvc/llvm-project?rev=113418&view=rev Log: Removed test case. Removed: cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm Removed: cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm?rev=113417&view=auto ============================================================================== (empty) From rjmccall at apple.com Wed Sep 8 16:59:18 2010 From: rjmccall at apple.com (John McCall) Date: Wed, 8 Sep 2010 14:59:18 -0700 Subject: [cfe-commits] r113397 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaType.cpp test/SemaObjC/legacy-objc-types.m test/SemaObjCXX/legacy-objc-types.mm In-Reply-To: References: <20100908200819.0D2FB2A6C12C@llvm.org> Message-ID: On Sep 8, 2010, at 2:30 PM, Fariborz Jahanian wrote: > On Sep 8, 2010, at 2:04 PM, John McCall wrote: >> If I understand this patch correctly, there's a crash arising from invalid redeclarations of functions. If that's true, this is almost certainly a workaround rather than a fix, because it's just making the redeclaration valid. Please fix the underlying crash rather than working around it like this. > > Underlying crash is in IRgen because we do not catch such duplicate function definitions. This patch makes the re-declaration identical to previous one and forces error in Sema. Oh, I see, because they mangle the same way. I think the appropriate place to make this change is in Sema::FunctionArgTypesAreEqual, in SemaOverload.cpp. We already have similar logic for redeclaring functions with different protocol-qualified types. >> Also, there are several problems with this pattern of recognizing 'struct objc_object' and 'struct objc_class'. >> 1) This is a significant change in behavior; previously we intentionally never recognized these types as being their respective builtin types. I'm actually ambivalent about that ? we should probably recognize this, at the very least to give an error about it ? but we shouldn't change the design lightly just to fix a crash. > > I am open to issuing error on use of such types. But there could be many situations which previous gcc compiled code will break. Yeah, that's certainly possible. >> 2) If we do want to recognize these structs as the builtin types, we should do consistently, not just for parameters, and not just for the exact case of pointers to the type. The cleanest way to do that is in ConvertDeclSpecToType. > > I thought about this at first. But we don't want to encourage use of these types and make them work silently. I rather let compiler issues error to discourage their use. Right, but since this logic isn't constrained to just redeclaration checks, it's already going to do that. >> 3) The logic to recognize these structs should respect context; only structs in global scope are the builtins, i.e. if getDeclContext()->getRedeclContext()->isTranslationUnit() (there might be a convenience function for that somewhere). > > I agree on this point. I can tighten up the type checking. > In any case, point of this patch was to fix the crash in a limited case and not treat 'struct objc_object' as a replacement for 'id' everywhere. > So, these are alternatives. > > 1. Do nothing and let the test case crash ( I think it was a manufactured test ). > 2. Accept the alternative 'struct ...' as builtin type everywhere. > 3. Issue error if it is used anywhere. > 4.??? Personally I like #3 because ObjC code using 'struct objc_object' is very likely to either not compile or have really unfortunate behavioral changes ? I think Argyrios recently hunted down something in the latter category ? but that's the sort of problem we can only suss out with SWBs. For the immediate problem, changing FunctionArgTypesAreEqual should be enough. John. From akyrtzi at gmail.com Wed Sep 8 16:58:42 2010 From: akyrtzi at gmail.com (Argyrios Kyrtzidis) Date: Wed, 08 Sep 2010 21:58:42 -0000 Subject: [cfe-commits] r113419 - /cfe/trunk/lib/AST/DeclBase.cpp Message-ID: <20100908215842.5E0752A6C12C@llvm.org> Author: akirtzidis Date: Wed Sep 8 16:58:42 2010 New Revision: 113419 URL: http://llvm.org/viewvc/llvm-project?rev=113419&view=rev Log: Decl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases. Modified: cfe/trunk/lib/AST/DeclBase.cpp Modified: cfe/trunk/lib/AST/DeclBase.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=113419&r1=113418&r2=113419&view=diff ============================================================================== --- cfe/trunk/lib/AST/DeclBase.cpp (original) +++ cfe/trunk/lib/AST/DeclBase.cpp Wed Sep 8 16:58:42 2010 @@ -421,17 +421,22 @@ // Suppress this check if any of the following hold: // 1. this is the translation unit (and thus has no parent) // 2. this is a template parameter (and thus doesn't belong to its context) - // 3. the context is not a record - // 4. it's invalid - // 5. it's a C++0x static_assert. + // 3. this is a non-type template parameter + // 4. the context is not a record + // 5. it's invalid + // 6. it's a C++0x static_assert. if (isa(this) || isa(this) || + isa(this) || !isa(getDeclContext()) || isInvalidDecl() || isa(this) || // FIXME: a ParmVarDecl can have ClassTemplateSpecialization // as DeclContext (?). - isa(this)) + isa(this) || + // FIXME: a ClassTemplateSpecialization or CXXRecordDecl can have + // AS_none as access specifier. + isa(this)) return; assert(Access != AS_none && From fjahanian at apple.com Wed Sep 8 17:10:20 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Wed, 8 Sep 2010 15:10:20 -0700 Subject: [cfe-commits] r113397 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaType.cpp test/SemaObjC/legacy-objc-types.m test/SemaObjCXX/legacy-objc-types.mm In-Reply-To: References: <20100908200819.0D2FB2A6C12C@llvm.org> Message-ID: <72897555-5D09-4835-8A98-8E8772DA31CD@apple.com> On Sep 8, 2010, at 2:59 PM, John McCall wrote: > On Sep 8, 2010, at 2:30 PM, Fariborz Jahanian wrote: >> On Sep 8, 2010, at 2:04 PM, John McCall wrote: >>> If I understand this patch correctly, there's a crash arising from >>> invalid redeclarations of functions. If that's true, this is >>> almost certainly a workaround rather than a fix, because it's just >>> making the redeclaration valid. Please fix the underlying crash >>> rather than working around it like this. >> >> Underlying crash is in IRgen because we do not catch such duplicate >> function definitions. This patch makes the re-declaration >> identical to previous one and forces error in Sema. > > Oh, I see, because they mangle the same way. > > I think the appropriate place to make this change is in > Sema::FunctionArgTypesAreEqual, in SemaOverload.cpp. We already > have similar logic for redeclaring functions with different protocol- > qualified types. This was my first try :). Then I discovered that it prevents declaration followed by definition, as in: id f(id ptr); objc_object* f(id ptr) { } So, the patch. > > >>> >> 1. Do nothing and let the test case crash ( I think it was a >> manufactured test ). >> 2. Accept the alternative 'struct ...' as builtin type everywhere. >> 3. Issue error if it is used anywhere. >> 4.??? > > Personally I like #3 because ObjC code using 'struct objc_object' is > very likely to either not compile or have really unfortunate > behavioral changes ? I think Argyrios recently hunted down something > in the latter category ? but that's the sort of problem we can only > suss out with SWBs. For the immediate problem, changing > FunctionArgTypesAreEqual should be enough. This is a policy decision. I am open to it. - Fariborz > > > John. From dawn at burble.org Wed Sep 8 17:10:44 2010 From: dawn at burble.org (dawn at burble.org) Date: Wed, 8 Sep 2010 15:10:44 -0700 Subject: [cfe-commits] [PATCH][Borland] - enable some MS keywords which are shared with Borland extensions In-Reply-To: References: <20100908210707.GA5576@bloodbath.burble.org> Message-ID: <20100908221044.GB5576@bloodbath.burble.org> None of the extensions you listed below are on my list. The only remaining NYI (not yet implemented) keyword extensions which Borland and MS share are: 1. __int8 __int16 __int32 __int64 2. __try __except __finally (this one scares me, so I hope you get to it first :-) ) There are also several NYI compiler options, __declspec()s and #pragmas which Borland may have adopted from MS - I'll check on that. Borland also has its own variation of some of the extensions (like __asm) which will need some tweaking. -Dawn On Wed, Sep 08, 2010 at 05:21:28PM -0400, Francois Pichet wrote: > Hi .. Are you planning to actually implement Microsoft extensions? > If so that's great but we should make sure not to duplicate work > > > Here is the tasks on my list: > > 1. flexible array member in union > > example: > typedef struct _PROPERTYINSTEX > { > WORD Length; > union > { > BYTE Byte[]; > WORD Word[]; > DWORD Dword[]; > LARGE_INTEGER LargeInt[]; > SYSTEMTIME SysTime[]; > > }; > } PROPERTYINSTEX; > > > 2. clang must parse this: (superfluous A::) > class A { > int A::f() { return 0; } > }; > > > 3. microsoft enum support: > -clang must parse this: > enum FOO { > a = (FOO) 3 > }; > - forward enum must have an underlying type. (int) > - support enum FOO : int {}; > > 4. MSVC Compiler Intrinsics > ex: __noop > > > On Wed, Sep 8, 2010 at 5:07 PM, wrote: > > > > There are several MS extensions supported by the Borland compiler. ?This > > adds support for a few of those (with more soon to come). ?Please review. > > > > Thanks, > > -Dawn > > > > _______________________________________________ > > cfe-commits mailing list > > cfe-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > > > > From rjmccall at apple.com Wed Sep 8 17:35:41 2010 From: rjmccall at apple.com (John McCall) Date: Wed, 8 Sep 2010 15:35:41 -0700 Subject: [cfe-commits] r113397 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaType.cpp test/SemaObjC/legacy-objc-types.m test/SemaObjCXX/legacy-objc-types.mm In-Reply-To: <72897555-5D09-4835-8A98-8E8772DA31CD@apple.com> References: <20100908200819.0D2FB2A6C12C@llvm.org> <72897555-5D09-4835-8A98-8E8772DA31CD@apple.com> Message-ID: <98C46843-1A86-4C79-AE68-3160CDF14086@apple.com> On Sep 8, 2010, at 3:10 PM, Fariborz Jahanian wrote: > > On Sep 8, 2010, at 2:59 PM, John McCall wrote: > >> On Sep 8, 2010, at 2:30 PM, Fariborz Jahanian wrote: >>> On Sep 8, 2010, at 2:04 PM, John McCall wrote: >>>> If I understand this patch correctly, there's a crash arising from invalid redeclarations of functions. If that's true, this is almost certainly a workaround rather than a fix, because it's just making the redeclaration valid. Please fix the underlying crash rather than working around it like this. >>> >>> Underlying crash is in IRgen because we do not catch such duplicate function definitions. This patch makes the re-declaration identical to previous one and forces error in Sema. >> >> Oh, I see, because they mangle the same way. >> >> I think the appropriate place to make this change is in Sema::FunctionArgTypesAreEqual, in SemaOverload.cpp. We already have similar logic for redeclaring functions with different protocol-qualified types. > > This was my first try :). Then I discovered that it prevents declaration followed by definition, as in: > id f(id ptr); > objc_object* f(id ptr) { } > > So, the patch. By 'prevents' do you mean that it produces an error or that it doesn't produce an error and IR gen crashes on it? Because this *should* be an error unless we start accepting objc_object as builtin-id. >>> 1. Do nothing and let the test case crash ( I think it was a manufactured test ). >>> 2. Accept the alternative 'struct ...' as builtin type everywhere. >>> 3. Issue error if it is used anywhere. >>> 4.??? >> >> Personally I like #3 because ObjC code using 'struct objc_object' is very likely to either not compile or have really unfortunate behavioral changes ? I think Argyrios recently hunted down something in the latter category ? but that's the sort of problem we can only suss out with SWBs. For the immediate problem, changing FunctionArgTypesAreEqual should be enough. > This is a policy decision. I am open to it. Okay. Can you file a radar to track this discussion? John. From fjahanian at apple.com Wed Sep 8 17:36:14 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Wed, 08 Sep 2010 22:36:14 -0000 Subject: [cfe-commits] r113428 - /cfe/trunk/test/SemaObjC/legacy-objc-types.m Message-ID: <20100908223614.8DB252A6C12C@llvm.org> Author: fjahanian Date: Wed Sep 8 17:36:14 2010 New Revision: 113428 URL: http://llvm.org/viewvc/llvm-project?rev=113428&view=rev Log: Test removed. Removed: cfe/trunk/test/SemaObjC/legacy-objc-types.m Removed: cfe/trunk/test/SemaObjC/legacy-objc-types.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/legacy-objc-types.m?rev=113427&view=auto ============================================================================== --- cfe/trunk/test/SemaObjC/legacy-objc-types.m (original) +++ cfe/trunk/test/SemaObjC/legacy-objc-types.m (removed) @@ -1,20 +0,0 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -// rdar:// 8400356 - -struct objc_object; - -void f(id ptr) { } // expected-note {{previous definition is here}} -void f(struct objc_object* ptr) { } // expected-error {{redefinition of 'f'}} - -struct objc_class; - -void g(Class ptr) {} // expected-note {{previous definition is here}} -void g(struct objc_class* ptr) { } // expected-error {{redefinition of 'g'}} - -void h(Class ptr, struct objc_object* ptr1) {} // expected-note {{previous definition is here}} -void h(struct objc_class* ptr, id ptr1) {} // expected-error {{redefinition of 'h'}} - -void i(Class ptr, struct objc_object* ptr1); -void i(struct objc_class* ptr, id ptr1) {} -void i(struct objc_class* ptr, struct objc_object* ptr1); - From clattner at apple.com Wed Sep 8 17:41:26 2010 From: clattner at apple.com (Chris Lattner) Date: Wed, 8 Sep 2010 15:41:26 -0700 Subject: [cfe-commits] [PATCH][Borland] - enable some MS keywords which are shared with Borland extensions In-Reply-To: <20100908210707.GA5576@bloodbath.burble.org> References: <20100908210707.GA5576@bloodbath.burble.org> Message-ID: <0B2E12DC-D0FB-4F45-8FF3-A78E55F0C4B4@apple.com> On Sep 8, 2010, at 2:07 PM, dawn at burble.org wrote: > > There are several MS extensions supported by the Borland compiler. This > adds support for a few of those (with more soon to come). Please review. Looks good, please commit. -Chris From dgregor at apple.com Wed Sep 8 17:47:51 2010 From: dgregor at apple.com (Douglas Gregor) Date: Wed, 08 Sep 2010 22:47:51 -0000 Subject: [cfe-commits] r113431 - in /cfe/trunk: lib/Sema/SemaCodeComplete.cpp test/Index/complete-blocks.m Message-ID: <20100908224751.AC0EC2A6C12C@llvm.org> Author: dgregor Date: Wed Sep 8 17:47:51 2010 New Revision: 113431 URL: http://llvm.org/viewvc/llvm-project?rev=113431&view=rev Log: When providing a completion for a function/method parameter of block pointer type, actually provide a usable block literal expression. Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp cfe/trunk/test/Index/complete-blocks.m Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=113431&r1=113430&r2=113431&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original) +++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Wed Sep 8 17:47:51 2010 @@ -1830,23 +1830,28 @@ // We have the function prototype behind the block pointer type, as it was // written in the source. - std::string Result = "(^)("; - for (unsigned I = 0, N = Block->getNumArgs(); I != N; ++I) { - if (I) - Result += ", "; - Result += FormatFunctionParameter(Context, Block->getArg(I)); - - if (I == N - 1 && Block->getTypePtr()->isVariadic()) - Result += ", ..."; + std::string Result; + QualType ResultType = Block->getTypePtr()->getResultType(); + if (!ResultType->isVoidType()) + ResultType.getAsStringInternal(Result, Context.PrintingPolicy); + + Result = '^' + Result; + if (Block->getNumArgs() == 0) { + if (Block->getTypePtr()->isVariadic()) + Result += "(...)"; + } else { + Result += "("; + for (unsigned I = 0, N = Block->getNumArgs(); I != N; ++I) { + if (I) + Result += ", "; + Result += FormatFunctionParameter(Context, Block->getArg(I)); + + if (I == N - 1 && Block->getTypePtr()->isVariadic()) + Result += ", ..."; + } + Result += ")"; } - if (Block->getTypePtr()->isVariadic() && Block->getNumArgs() == 0) - Result += "..."; - else if (Block->getNumArgs() == 0 && !Context.getLangOptions().CPlusPlus) - Result += "void"; - - Result += ")"; - Block->getTypePtr()->getResultType().getAsStringInternal(Result, - Context.PrintingPolicy); + return Result; } Modified: cfe/trunk/test/Index/complete-blocks.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/complete-blocks.m?rev=113431&r1=113430&r2=113431&view=diff ============================================================================== --- cfe/trunk/test/Index/complete-blocks.m (original) +++ cfe/trunk/test/Index/complete-blocks.m Wed Sep 8 17:47:51 2010 @@ -16,9 +16,20 @@ void test_A(A *a) { [a method:0]; } + + at interface B +- method3:(int (^)(void))b; + at end + +void test_B(B *b) { + [b method3:^int(void){ return 0; }]; +} + // RUN: c-index-test -code-completion-at=%s:8:1 %s | FileCheck -check-prefix=CHECK-CC1 %s -// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder int (^)(int x, int y)}{RightParen )} (45) -// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{Placeholder void (^)(float f, double d)}{RightParen )} (45) +// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder ^int(int x, int y)}{RightParen )} (45) +// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{Placeholder ^(float f, double d)}{RightParen )} (45) // RUN: c-index-test -code-completion-at=%s:17:6 %s | FileCheck -check-prefix=CHECK-CC2 %s -// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method2:}{Placeholder void (^)(float f, double d)} (20) -// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method:}{Placeholder int (^)(int x, int y)} (20) +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method2:}{Placeholder ^(float f, double d)} (20) +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method:}{Placeholder ^int(int x, int y)} (20) +// RUN: c-index-test -code-completion-at=%s:25:6 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText method3:}{Placeholder ^int} (20) From fjahanian at apple.com Wed Sep 8 17:49:35 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Wed, 8 Sep 2010 15:49:35 -0700 Subject: [cfe-commits] r113397 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaType.cpp test/SemaObjC/legacy-objc-types.m test/SemaObjCXX/legacy-objc-types.mm In-Reply-To: <98C46843-1A86-4C79-AE68-3160CDF14086@apple.com> References: <20100908200819.0D2FB2A6C12C@llvm.org> <72897555-5D09-4835-8A98-8E8772DA31CD@apple.com> <98C46843-1A86-4C79-AE68-3160CDF14086@apple.com> Message-ID: <837BE370-7953-45FE-919F-3BE0745509E6@apple.com> On Sep 8, 2010, at 3:35 PM, John McCall wrote: > > On Sep 8, 2010, at 3:10 PM, Fariborz Jahanian wrote: > >> >> On Sep 8, 2010, at 2:59 PM, John McCall wrote: >> >>> On Sep 8, 2010, at 2:30 PM, Fariborz Jahanian wrote: >>>> On Sep 8, 2010, at 2:04 PM, John McCall wrote: >>>>> If I understand this patch correctly, there's a crash arising >>>>> from invalid redeclarations of functions. If that's true, this >>>>> is almost certainly a workaround rather than a fix, because it's >>>>> just making the redeclaration valid. Please fix the underlying >>>>> crash rather than working around it like this. >>>> >>>> Underlying crash is in IRgen because we do not catch such >>>> duplicate function definitions. This patch makes the re- >>>> declaration identical to previous one and forces error in Sema. >>> >>> Oh, I see, because they mangle the same way. >>> >>> I think the appropriate place to make this change is in >>> Sema::FunctionArgTypesAreEqual, in SemaOverload.cpp. We already >>> have similar logic for redeclaring functions with different >>> protocol-qualified types. >> >> This was my first try :). Then I discovered that it prevents >> declaration followed by definition, as in: >> id f(id ptr); >> objc_object* f(id ptr) { } >> >> So, the patch. > > By 'prevents' do you mean that it produces an error or that it > doesn't produce an error and IR gen crashes on it? Because this > *should* be an error unless we start accepting objc_object as > builtin-id. Oops. Correcting test I ran into: void f(id ptr); void f(objc_object* ptr) {} After the change, clang issued error in Sema (about duplicate declaration). This should not be an error. > > >>>> 1. Do nothing and let the test case crash ( I think it was a >>>> manufactured test ). >>>> 2. Accept the alternative 'struct ...' as builtin type everywhere. >>>> 3. Issue error if it is used anywhere. >>>> 4.??? >>> >>> Personally I like #3 because ObjC code using 'struct objc_object' >>> is very likely to either not compile or have really unfortunate >>> behavioral changes ? I think Argyrios recently hunted down >>> something in the latter category ? but that's the sort of problem >>> we can only suss out with SWBs. For the immediate problem, >>> changing FunctionArgTypesAreEqual should be enough. >> This is a policy decision. I am open to it. > > Okay. Can you file a radar to track this discussion? Radar 8400356 is it. - Fariborz > > > John. From dawn at burble.org Wed Sep 8 17:56:24 2010 From: dawn at burble.org (Dawn Perchik) Date: Wed, 08 Sep 2010 22:56:24 -0000 Subject: [cfe-commits] r113434 - in /cfe/trunk: include/clang/Basic/TokenKinds.def test/SemaCXX/borland-extensions.cpp Message-ID: <20100908225624.E3DC02A6C12C@llvm.org> Author: dperchik Date: Wed Sep 8 17:56:24 2010 New Revision: 113434 URL: http://llvm.org/viewvc/llvm-project?rev=113434&view=rev Log: Add support for a few MS extensions supported by the Borland compiler (__uuidof, _fastcall, etc.). Modified: cfe/trunk/include/clang/Basic/TokenKinds.def cfe/trunk/test/SemaCXX/borland-extensions.cpp Modified: cfe/trunk/include/clang/Basic/TokenKinds.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=113434&r1=113433&r2=113434&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/TokenKinds.def (original) +++ cfe/trunk/include/clang/Basic/TokenKinds.def Wed Sep 8 17:56:24 2010 @@ -336,7 +336,7 @@ KEYWORD(__thiscall , KEYALL) KEYWORD(__forceinline , KEYALL) -// Borland Extension. +// Borland Extensions. KEYWORD(__pascal , KEYALL) // Altivec Extension. @@ -369,13 +369,13 @@ // Microsoft extensions which should be disabled in strict conformance mode KEYWORD(__ptr64 , KEYMS) KEYWORD(__w64 , KEYMS) -KEYWORD(__uuidof , KEYMS) +KEYWORD(__uuidof , KEYMS | KEYBORLAND) ALIAS("_asm" , asm , KEYMS) -ALIAS("_cdecl" , __cdecl , KEYMS) -ALIAS("_fastcall" , __fastcall , KEYMS) -ALIAS("_stdcall" , __stdcall , KEYMS) +ALIAS("_cdecl" , __cdecl , KEYMS | KEYBORLAND) +ALIAS("_fastcall" , __fastcall , KEYMS | KEYBORLAND) +ALIAS("_stdcall" , __stdcall , KEYMS | KEYBORLAND) ALIAS("_thiscall" , __thiscall , KEYMS) -ALIAS("_uuidof" ,__uuidof , KEYMS) +ALIAS("_uuidof" , __uuidof , KEYMS | KEYBORLAND) // Borland Extensions which should be disabled in strict conformance mode. ALIAS("_pascal" , __pascal , KEYBORLAND) Modified: cfe/trunk/test/SemaCXX/borland-extensions.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/borland-extensions.cpp?rev=113434&r1=113433&r2=113434&view=diff ============================================================================== --- cfe/trunk/test/SemaCXX/borland-extensions.cpp (original) +++ cfe/trunk/test/SemaCXX/borland-extensions.cpp Wed Sep 8 17:56:24 2010 @@ -24,3 +24,30 @@ i = h2(&M::addP); f = h2(&M::subtractP); } + +// 3. test other calling conventions +int _cdecl fa3(); +int _fastcall fc3(); +int _stdcall fd3(); + +// 4. test __uuidof() +typedef struct _GUID { + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[ 8 ]; +} GUID; + +struct __declspec(uuid("{12345678-1234-1234-1234-123456789abc}")) Foo; +struct Data { + GUID const* Guid; +}; + +void t4() { + unsigned long data; + + const GUID guid_inl = __uuidof(Foo); + Data ata1 = { &guid_inl}; + data = ata1.Guid->Data1; +} + From dgregor at apple.com Wed Sep 8 18:15:33 2010 From: dgregor at apple.com (Douglas Gregor) Date: Wed, 8 Sep 2010 16:15:33 -0700 Subject: [cfe-commits] [PATCH][MS] - operator __uuidof implementation part 1 In-Reply-To: References: <1F7451DD-853D-4911-BC7B-05EB0B9B5138@apple.com> Message-ID: On Sep 8, 2010, at 8:54 AM, Francois Pichet wrote: >> >> RParenLoc is never set to a location (other than its default, empty state), either on this path or on the __uuidof(expression) path. >> > > The same problem occurs for the typeid operator. Oops, I've fixed that now. > Also since you asked me to cache the lookup of _GUID I assume it would > be a good idea to also cache the lookup of type_info. It is currently > not cached. ... and I've fixed that as well, thanks! - Doug From dgregor at apple.com Wed Sep 8 18:14:30 2010 From: dgregor at apple.com (Douglas Gregor) Date: Wed, 08 Sep 2010 23:14:30 -0000 Subject: [cfe-commits] r113441 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Parse/ParseExprCXX.cpp lib/Sema/Sema.cpp lib/Sema/SemaExprCXX.cpp Message-ID: <20100908231430.D4AF92A6C12C@llvm.org> Author: dgregor Date: Wed Sep 8 18:14:30 2010 New Revision: 113441 URL: http://llvm.org/viewvc/llvm-project?rev=113441&view=rev Log: Fix a few minor issues with parsing and semantic analysis of C++ typeid expressions: - make sure we have a proper source location for the closing ')' - cache the declaration of std::type_info once we've found it Modified: cfe/trunk/include/clang/Sema/Sema.h cfe/trunk/lib/Parse/ParseExprCXX.cpp cfe/trunk/lib/Sema/Sema.cpp cfe/trunk/lib/Sema/SemaExprCXX.cpp Modified: cfe/trunk/include/clang/Sema/Sema.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=113441&r1=113440&r2=113441&view=diff ============================================================================== --- cfe/trunk/include/clang/Sema/Sema.h (original) +++ cfe/trunk/include/clang/Sema/Sema.h Wed Sep 8 18:14:30 2010 @@ -365,6 +365,9 @@ /// standard library. LazyDeclPtr StdBadAlloc; + /// \brief The C++ "type_info" declaration, which is defined in . + RecordDecl *CXXTypeInfoDecl; + /// \brief The MSVC "_GUID" struct, which is defined in MSVC header files. RecordDecl *MSVCGuidDecl; Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=113441&r1=113440&r2=113441&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original) +++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Wed Sep 8 18:14:30 2010 @@ -500,9 +500,9 @@ TypeResult Ty = ParseTypeName(); // Match the ')'. - MatchRHSPunctuation(tok::r_paren, LParenLoc); + RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc); - if (Ty.isInvalid()) + if (Ty.isInvalid() || RParenLoc.isInvalid()) return ExprError(); Result = Actions.ActOnCXXTypeid(OpLoc, LParenLoc, /*isType=*/true, @@ -524,8 +524,10 @@ if (Result.isInvalid()) SkipUntil(tok::r_paren); else { - MatchRHSPunctuation(tok::r_paren, LParenLoc); - + RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc); + if (RParenLoc.isInvalid()) + return ExprError(); + Result = Actions.ActOnCXXTypeid(OpLoc, LParenLoc, /*isType=*/false, Result.release(), RParenLoc); } Modified: cfe/trunk/lib/Sema/Sema.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=113441&r1=113440&r2=113441&view=diff ============================================================================== --- cfe/trunk/lib/Sema/Sema.cpp (original) +++ cfe/trunk/lib/Sema/Sema.cpp Wed Sep 8 18:14:30 2010 @@ -134,7 +134,7 @@ Diags(PP.getDiagnostics()), SourceMgr(PP.getSourceManager()), ExternalSource(0), CodeCompleter(CodeCompleter), CurContext(0), PackContext(0), VisContext(0), ParsingDeclDepth(0), - IdResolver(pp.getLangOptions()), MSVCGuidDecl(0), + IdResolver(pp.getLangOptions()), CXXTypeInfoDecl(0), MSVCGuidDecl(0), GlobalNewDeleteDeclared(false), CompleteTranslationUnit(CompleteTranslationUnit), NumSFINAEErrors(0), SuppressAccessChecking(false), Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=113441&r1=113440&r2=113441&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Sep 8 18:14:30 2010 @@ -262,9 +262,9 @@ /// \brief Build a C++ typeid expression with a type operand. ExprResult Sema::BuildCXXTypeId(QualType TypeInfoType, - SourceLocation TypeidLoc, - TypeSourceInfo *Operand, - SourceLocation RParenLoc) { + SourceLocation TypeidLoc, + TypeSourceInfo *Operand, + SourceLocation RParenLoc) { // C++ [expr.typeid]p4: // The top-level cv-qualifiers of the lvalue expression or the type-id // that is the operand of typeid are always ignored. @@ -285,9 +285,9 @@ /// \brief Build a C++ typeid expression with an expression operand. ExprResult Sema::BuildCXXTypeId(QualType TypeInfoType, - SourceLocation TypeidLoc, - Expr *E, - SourceLocation RParenLoc) { + SourceLocation TypeidLoc, + Expr *E, + SourceLocation RParenLoc) { bool isUnevaluatedOperand = true; if (E && !E->isTypeDependent()) { QualType T = E->getType(); @@ -343,14 +343,16 @@ if (!StdNamespace) return ExprError(Diag(OpLoc, diag::err_need_header_before_typeid)); - IdentifierInfo *TypeInfoII = &PP.getIdentifierTable().get("type_info"); - LookupResult R(*this, TypeInfoII, SourceLocation(), LookupTagName); - LookupQualifiedName(R, getStdNamespace()); - RecordDecl *TypeInfoRecordDecl = R.getAsSingle(); - if (!TypeInfoRecordDecl) - return ExprError(Diag(OpLoc, diag::err_need_header_before_typeid)); + if (!CXXTypeInfoDecl) { + IdentifierInfo *TypeInfoII = &PP.getIdentifierTable().get("type_info"); + LookupResult R(*this, TypeInfoII, SourceLocation(), LookupTagName); + LookupQualifiedName(R, getStdNamespace()); + CXXTypeInfoDecl = R.getAsSingle(); + if (!CXXTypeInfoDecl) + return ExprError(Diag(OpLoc, diag::err_need_header_before_typeid)); + } - QualType TypeInfoType = Context.getTypeDeclType(TypeInfoRecordDecl); + QualType TypeInfoType = Context.getTypeDeclType(CXXTypeInfoDecl); if (isType) { // The operand is a type; handle it as such. From daniel at zuster.org Wed Sep 8 18:40:30 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 08 Sep 2010 23:40:30 -0000 Subject: [cfe-commits] r113443 - /cfe/trunk/lib/Frontend/CMakeLists.txt Message-ID: <20100908234030.4FF092A6C12C@llvm.org> Author: ddunbar Date: Wed Sep 8 18:40:30 2010 New Revision: 113443 URL: http://llvm.org/viewvc/llvm-project?rev=113443&view=rev Log: Add another missing CMake dependency. Modified: cfe/trunk/lib/Frontend/CMakeLists.txt Modified: cfe/trunk/lib/Frontend/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CMakeLists.txt?rev=113443&r1=113442&r2=113443&view=diff ============================================================================== --- cfe/trunk/lib/Frontend/CMakeLists.txt (original) +++ cfe/trunk/lib/Frontend/CMakeLists.txt Wed Sep 8 18:40:30 2010 @@ -52,6 +52,7 @@ add_dependencies(clangFrontend ClangAttrClasses ClangAttrList + ClangCC1Options ClangDiagnosticFrontend ClangDiagnosticLex ClangDiagnosticSema From pichet2000 at gmail.com Wed Sep 8 18:47:05 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Wed, 08 Sep 2010 23:47:05 -0000 Subject: [cfe-commits] r113444 - in /cfe/trunk: lib/AST/ExprConstant.cpp lib/Checker/GRExprEngine.cpp lib/CodeGen/Mangle.cpp tools/libclang/CXCursor.cpp Message-ID: <20100908234705.715B02A6C12C@llvm.org> Author: fpichet Date: Wed Sep 8 18:47:05 2010 New Revision: 113444 URL: http://llvm.org/viewvc/llvm-project?rev=113444&view=rev Log: Fix warnings caused by new CXXUuidofExprClass enumerator. Modified: cfe/trunk/lib/AST/ExprConstant.cpp cfe/trunk/lib/Checker/GRExprEngine.cpp cfe/trunk/lib/CodeGen/Mangle.cpp cfe/trunk/tools/libclang/CXCursor.cpp Modified: cfe/trunk/lib/AST/ExprConstant.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=113444&r1=113443&r2=113444&view=diff ============================================================================== --- cfe/trunk/lib/AST/ExprConstant.cpp (original) +++ cfe/trunk/lib/AST/ExprConstant.cpp Wed Sep 8 18:47:05 2010 @@ -2379,6 +2379,7 @@ case Expr::CXXMemberCallExprClass: case Expr::CXXDynamicCastExprClass: case Expr::CXXTypeidExprClass: + case Expr::CXXUuidofExprClass: case Expr::CXXNullPtrLiteralExprClass: case Expr::CXXThisExprClass: case Expr::CXXThrowExprClass: Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=113444&r1=113443&r2=113444&view=diff ============================================================================== --- cfe/trunk/lib/Checker/GRExprEngine.cpp (original) +++ cfe/trunk/lib/Checker/GRExprEngine.cpp Wed Sep 8 18:47:05 2010 @@ -773,6 +773,7 @@ case Stmt::CXXThrowExprClass: case Stmt::CXXTryStmtClass: case Stmt::CXXTypeidExprClass: + case Stmt::CXXUuidofExprClass: case Stmt::CXXUnresolvedConstructExprClass: case Stmt::CXXScalarValueInitExprClass: case Stmt::DependentScopeDeclRefExprClass: Modified: cfe/trunk/lib/CodeGen/Mangle.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=113444&r1=113443&r2=113444&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/Mangle.cpp (original) +++ cfe/trunk/lib/CodeGen/Mangle.cpp Wed Sep 8 18:47:05 2010 @@ -1617,7 +1617,8 @@ case Expr::StmtExprClass: case Expr::TypesCompatibleExprClass: case Expr::UnaryTypeTraitExprClass: - case Expr::VAArgExprClass: { + case Expr::VAArgExprClass: + case Expr::CXXUuidofExprClass: { // As bad as this diagnostic is, it's better than crashing. Diagnostic &Diags = Context.getDiags(); unsigned DiagID = Diags.getCustomDiagID(Diagnostic::Error, Modified: cfe/trunk/tools/libclang/CXCursor.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=113444&r1=113443&r2=113444&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CXCursor.cpp (original) +++ cfe/trunk/tools/libclang/CXCursor.cpp Wed Sep 8 18:47:05 2010 @@ -124,6 +124,7 @@ case Stmt::CXXConstCastExprClass: case Stmt::CXXFunctionalCastExprClass: case Stmt::CXXTypeidExprClass: + case Stmt::CXXUuidofExprClass: case Stmt::CXXBoolLiteralExprClass: case Stmt::CXXNullPtrLiteralExprClass: case Stmt::CXXThisExprClass: From dgregor at apple.com Wed Sep 8 18:56:00 2010 From: dgregor at apple.com (Douglas Gregor) Date: Wed, 08 Sep 2010 23:56:00 -0000 Subject: [cfe-commits] r113446 - /cfe/trunk/lib/Sema/TreeTransform.h Message-ID: <20100908235600.D34E82A6C12C@llvm.org> Author: dgregor Date: Wed Sep 8 18:56:00 2010 New Revision: 113446 URL: http://llvm.org/viewvc/llvm-project?rev=113446&view=rev Log: Push the range associated with a nested-name-specifier further through TreeTransform, since we were getting an empty source range where we shouldn't. Sadly, the test case is Boost.Proto, and isn't worth reducing. Modified: cfe/trunk/lib/Sema/TreeTransform.h Modified: cfe/trunk/lib/Sema/TreeTransform.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=113446&r1=113445&r2=113446&view=diff ============================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h (original) +++ cfe/trunk/lib/Sema/TreeTransform.h Wed Sep 8 18:56:00 2010 @@ -534,14 +534,16 @@ /// this routine to provide different behavior. QualType RebuildDependentTemplateSpecializationType( ElaboratedTypeKeyword Keyword, - NestedNameSpecifier *NNS, + NestedNameSpecifier *Qualifier, + SourceRange QualifierRange, const IdentifierInfo *Name, SourceLocation NameLoc, const TemplateArgumentListInfo &Args) { // Rebuild the template name. // TODO: avoid TemplateName abstraction TemplateName InstName = - getDerived().RebuildTemplateName(NNS, *Name, QualType()); + getDerived().RebuildTemplateName(Qualifier, QualifierRange, *Name, + QualType()); if (InstName.isNull()) return QualType(); @@ -549,7 +551,7 @@ // If it's still dependent, make a dependent specialization. if (InstName.getAsDependentTemplateName()) return SemaRef.Context.getDependentTemplateSpecializationType( - Keyword, NNS, Name, Args); + Keyword, Qualifier, Name, Args); // Otherwise, make an elaborated type wrapping a non-dependent // specialization. @@ -689,6 +691,7 @@ /// template name. Subclasses may override this routine to provide different /// behavior. TemplateName RebuildTemplateName(NestedNameSpecifier *Qualifier, + SourceRange QualifierRange, const IdentifierInfo &II, QualType ObjectType); @@ -2185,9 +2188,13 @@ ObjectType.isNull()) return Name; - if (DTN->isIdentifier()) - return getDerived().RebuildTemplateName(NNS, *DTN->getIdentifier(), + if (DTN->isIdentifier()) { + // FIXME: Bad range + SourceRange QualifierRange(getDerived().getBaseLocation()); + return getDerived().RebuildTemplateName(NNS, QualifierRange, + *DTN->getIdentifier(), ObjectType); + } return getDerived().RebuildTemplateName(NNS, DTN->getOperator(), ObjectType); @@ -3375,12 +3382,13 @@ NewTemplateArgs.addArgument(Loc); } - QualType Result = getDerived().RebuildDependentTemplateSpecializationType( - T->getKeyword(), - NNS, - T->getIdentifier(), - TL.getNameLoc(), - NewTemplateArgs); + QualType Result + = getDerived().RebuildDependentTemplateSpecializationType(T->getKeyword(), + NNS, + TL.getQualifierRange(), + T->getIdentifier(), + TL.getNameLoc(), + NewTemplateArgs); if (Result.isNull()) return QualType(); @@ -6578,10 +6586,11 @@ template TemplateName TreeTransform::RebuildTemplateName(NestedNameSpecifier *Qualifier, + SourceRange QualifierRange, const IdentifierInfo &II, QualType ObjectType) { CXXScopeSpec SS; - SS.setRange(SourceRange(getDerived().getBaseLocation())); + SS.setRange(QualifierRange); SS.setScopeRep(Qualifier); UnqualifiedId Name; Name.setIdentifier(&II, /*FIXME:*/getDerived().getBaseLocation()); From kremenek at apple.com Wed Sep 8 19:05:53 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 00:05:53 -0000 Subject: [cfe-commits] r113447 - in /cfe/trunk: include/clang/AST/Stmt.h lib/Sema/SemaStmt.cpp lib/Serialization/ASTReaderStmt.cpp lib/Serialization/ASTWriterStmt.cpp Message-ID: <20100909000553.60A0A2A6C12C@llvm.org> Author: kremenek Date: Wed Sep 8 19:05:53 2010 New Revision: 113447 URL: http://llvm.org/viewvc/llvm-project?rev=113447&view=rev Log: When building SwitchStmts in Sema, record whether all the enum values of a switch(enum) where covered by individual case statements. Flow-based analyses may wish to consult this information, and recording this in the AST allows us to obviate reconstructing this information later when we build the CFG. Modified: cfe/trunk/include/clang/AST/Stmt.h cfe/trunk/lib/Sema/SemaStmt.cpp cfe/trunk/lib/Serialization/ASTReaderStmt.cpp cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Modified: cfe/trunk/include/clang/AST/Stmt.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=113447&r1=113446&r2=113447&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/Stmt.h (original) +++ cfe/trunk/include/clang/AST/Stmt.h Wed Sep 8 19:05:53 2010 @@ -662,6 +662,11 @@ SwitchCase *FirstCase; SourceLocation SwitchLoc; + /// If the SwitchStmt is a switch on an enum value, this records whether + /// all the enum values were covered by CaseStmts. This value is meant to + /// be a hint for possible clients. + unsigned AllEnumCasesCovered : 1; + public: SwitchStmt(ASTContext &C, VarDecl *Var, Expr *cond); @@ -709,6 +714,19 @@ SC->setNextSwitchCase(FirstCase); FirstCase = SC; } + + /// Set a flag in the SwitchStmt indicating that if the 'switch (X)' is a + /// switch over an enum value then all cases have been explicitly covered. + void setAllEnumCasesCovered() { + AllEnumCasesCovered = 1; + } + + /// Returns true if the SwitchStmt is a switch of an enum value and all cases + /// have been explicitly covered. + bool isAllEnumCasesCovered() const { + return (bool) AllEnumCasesCovered; + } + virtual SourceRange getSourceRange() const { return SourceRange(SwitchLoc, SubExprs[BODY]->getLocEnd()); } Modified: cfe/trunk/lib/Sema/SemaStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=113447&r1=113446&r2=113447&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaStmt.cpp (original) +++ cfe/trunk/lib/Sema/SemaStmt.cpp Wed Sep 8 19:05:53 2010 @@ -696,14 +696,14 @@ } // Check to see if switch is over an Enum and handles all of its - // values. We don't need to do this if there's a default - // statement or if we have a constant condition. + // values. We only issue a warning if there is not 'default:', but + // we still do the analysis to preserve this information in the AST + // (which can be used by flow-based analyes). // - // TODO: we might want to check whether case values are out of the - // enum even if we don't want to check whether all cases are handled. const EnumType* ET = CondTypeBeforePromotion->getAs(); + // If switch has default case, then ignore it. - if (!CaseListIsErroneous && !TheDefaultStmt && !HasConstantCond && ET) { + if (!CaseListIsErroneous && !HasConstantCond && ET) { const EnumDecl *ED = ET->getDecl(); typedef llvm::SmallVector, 64> EnumValsTy; EnumValsTy EnumVals; @@ -723,40 +723,46 @@ std::stable_sort(EnumVals.begin(), EnumVals.end(), CmpEnumVals); EnumValsTy::iterator EIend = std::unique(EnumVals.begin(), EnumVals.end(), EqEnumVals); - // See which case values aren't in enum - EnumValsTy::const_iterator EI = EnumVals.begin(); - for (CaseValsTy::const_iterator CI = CaseVals.begin(); + + // See which case values aren't in enum. + // TODO: we might want to check whether case values are out of the + // enum even if we don't want to check whether all cases are handled. + if (!TheDefaultStmt) { + EnumValsTy::const_iterator EI = EnumVals.begin(); + for (CaseValsTy::const_iterator CI = CaseVals.begin(); CI != CaseVals.end(); CI++) { - while (EI != EIend && EI->first < CI->first) - EI++; - if (EI == EIend || EI->first > CI->first) + while (EI != EIend && EI->first < CI->first) + EI++; + if (EI == EIend || EI->first > CI->first) Diag(CI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum) << ED->getDeclName(); - } - // See which of case ranges aren't in enum - EI = EnumVals.begin(); - for (CaseRangesTy::const_iterator RI = CaseRanges.begin(); + } + // See which of case ranges aren't in enum + EI = EnumVals.begin(); + for (CaseRangesTy::const_iterator RI = CaseRanges.begin(); RI != CaseRanges.end() && EI != EIend; RI++) { - while (EI != EIend && EI->first < RI->first) - EI++; + while (EI != EIend && EI->first < RI->first) + EI++; - if (EI == EIend || EI->first != RI->first) { - Diag(RI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum) - << ED->getDeclName(); - } - - llvm::APSInt Hi = RI->second->getRHS()->EvaluateAsInt(Context); - while (EI != EIend && EI->first < Hi) - EI++; - if (EI == EIend || EI->first != Hi) - Diag(RI->second->getRHS()->getExprLoc(), diag::warn_not_in_enum) - << ED->getDeclName(); + if (EI == EIend || EI->first != RI->first) { + Diag(RI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum) + << ED->getDeclName(); + } + + llvm::APSInt Hi = RI->second->getRHS()->EvaluateAsInt(Context); + while (EI != EIend && EI->first < Hi) + EI++; + if (EI == EIend || EI->first != Hi) + Diag(RI->second->getRHS()->getExprLoc(), diag::warn_not_in_enum) + << ED->getDeclName(); + } } - //Check which enum vals aren't in switch + // Check which enum vals aren't in switch CaseValsTy::const_iterator CI = CaseVals.begin(); CaseRangesTy::const_iterator RI = CaseRanges.begin(); - EI = EnumVals.begin(); - for (; EI != EIend; EI++) { + bool hasCasesNotInSwitch = false; + + for (EnumValsTy::const_iterator EI = EnumVals.begin(); EI != EIend; EI++){ //Drop unneeded case values llvm::APSInt CIVal; while (CI != CaseVals.end() && CI->first < EI->first) @@ -765,17 +771,23 @@ if (CI != CaseVals.end() && CI->first == EI->first) continue; - //Drop unneeded case ranges + // Drop unneeded case ranges for (; RI != CaseRanges.end(); RI++) { llvm::APSInt Hi = RI->second->getRHS()->EvaluateAsInt(Context); if (EI->first <= Hi) break; } - if (RI == CaseRanges.end() || EI->first < RI->first) - Diag(CondExpr->getExprLoc(), diag::warn_missing_cases) - << EI->second->getDeclName(); + if (RI == CaseRanges.end() || EI->first < RI->first) { + hasCasesNotInSwitch = true; + if (!TheDefaultStmt) + Diag(CondExpr->getExprLoc(), diag::warn_missing_cases) + << EI->second->getDeclName(); + } } + + if (!hasCasesNotInSwitch) + SS->setAllEnumCasesCovered(); } } Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=113447&r1=113446&r2=113447&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original) +++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Wed Sep 8 19:05:53 2010 @@ -239,6 +239,9 @@ S->setCond(Reader.ReadSubExpr()); S->setBody(Reader.ReadSubStmt()); S->setSwitchLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); + if (Record[Idx++]) + S->setAllEnumCasesCovered(); + SwitchCase *PrevSC = 0; for (unsigned N = Record.size(); Idx != N; ++Idx) { SwitchCase *SC = Reader.getSwitchCaseWithID(Record[Idx]); Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=113447&r1=113446&r2=113447&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original) +++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Wed Sep 8 19:05:53 2010 @@ -233,6 +233,7 @@ Writer.AddStmt(S->getCond()); Writer.AddStmt(S->getBody()); Writer.AddSourceLocation(S->getSwitchLoc(), Record); + Record.push_back(S->isAllEnumCasesCovered()); for (SwitchCase *SC = S->getSwitchCaseList(); SC; SC = SC->getNextSwitchCase()) Record.push_back(Writer.RecordSwitchCaseID(SC)); From kremenek at apple.com Wed Sep 8 19:06:01 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 00:06:01 -0000 Subject: [cfe-commits] r113448 - /cfe/trunk/lib/AST/Stmt.cpp Message-ID: <20100909000601.D41932A6C12C@llvm.org> Author: kremenek Date: Wed Sep 8 19:06:01 2010 New Revision: 113448 URL: http://llvm.org/viewvc/llvm-project?rev=113448&view=rev Log: Initialize 'AllEnumCasesCovered' in SwitchStmt's constructor. Modified: cfe/trunk/lib/AST/Stmt.cpp Modified: cfe/trunk/lib/AST/Stmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=113448&r1=113447&r2=113448&view=diff ============================================================================== --- cfe/trunk/lib/AST/Stmt.cpp (original) +++ cfe/trunk/lib/AST/Stmt.cpp Wed Sep 8 19:06:01 2010 @@ -530,7 +530,7 @@ } SwitchStmt::SwitchStmt(ASTContext &C, VarDecl *Var, Expr *cond) - : Stmt(SwitchStmtClass), FirstCase(0) + : Stmt(SwitchStmtClass), FirstCase(0), AllEnumCasesCovered(0) { setConditionVariable(C, Var); SubExprs[COND] = reinterpret_cast(cond); From kremenek at apple.com Wed Sep 8 19:06:04 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 00:06:04 -0000 Subject: [cfe-commits] r113449 - in /cfe/trunk: include/clang/Analysis/CFG.h lib/Analysis/CFG.cpp Message-ID: <20100909000604.C9FD72A6C12D@llvm.org> Author: kremenek Date: Wed Sep 8 19:06:04 2010 New Revision: 113449 URL: http://llvm.org/viewvc/llvm-project?rev=113449&view=rev Log: Add 'filtered_pred_iterator' and 'filtered_succ_iterator' to CFGBlock. This allows a client to selectively walk successors/predecessors based on commonly used filters. For starters, add a filter to ignore 'default:' cases for SwitchStmts when all enum values are covered by CaseStmts. Modified: cfe/trunk/include/clang/Analysis/CFG.h cfe/trunk/lib/Analysis/CFG.cpp Modified: cfe/trunk/include/clang/Analysis/CFG.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/CFG.h?rev=113449&r1=113448&r2=113449&view=diff ============================================================================== --- cfe/trunk/include/clang/Analysis/CFG.h (original) +++ cfe/trunk/include/clang/Analysis/CFG.h Wed Sep 8 19:06:04 2010 @@ -205,6 +205,59 @@ unsigned pred_size() const { return Preds.size(); } bool pred_empty() const { return Preds.empty(); } + + class FilterOptions { + public: + FilterOptions() { + IgnoreDefaultsWithCoveredEnums = 0; + }; + + unsigned IgnoreDefaultsWithCoveredEnums : 1; + }; + + static bool FilterEdge(const FilterOptions &F, const CFGBlock *Src, + const CFGBlock *Dst); + + template + class FilteredCFGBlockIterator { + private: + IMPL I, E; + const FilterOptions F; + const CFGBlock *From; + public: + explicit FilteredCFGBlockIterator(const IMPL &i, const IMPL &e, + const CFGBlock *from, + const FilterOptions &f) + : I(i), E(e), F(f), From(from) {} + + bool hasMore() const { return I != E; } + + FilteredCFGBlockIterator &operator++() { + do { ++I; } while (hasMore() && Filter(*I)); + return *this; + } + + const CFGBlock *operator*() const { return *I; } + private: + bool Filter(const CFGBlock *To) { + return IsPred ? FilterEdge(F, To, From) : FilterEdge(F, From, To); + } + }; + + typedef FilteredCFGBlockIterator + filtered_pred_iterator; + + typedef FilteredCFGBlockIterator + filtered_succ_iterator; + + filtered_pred_iterator filtered_pred_start_end(const FilterOptions &f) const { + return filtered_pred_iterator(pred_begin(), pred_end(), this, f); + } + + filtered_succ_iterator filtered_succ_start_end(const FilterOptions &f) const { + return filtered_succ_iterator(succ_begin(), succ_end(), this, f); + } + // Manipulation of block contents void setTerminator(Stmt* Statement) { Terminator = Statement; } Modified: cfe/trunk/lib/Analysis/CFG.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=113449&r1=113448&r2=113449&view=diff ============================================================================== --- cfe/trunk/lib/Analysis/CFG.cpp (original) +++ cfe/trunk/lib/Analysis/CFG.cpp Wed Sep 8 19:06:04 2010 @@ -1937,6 +1937,29 @@ } //===----------------------------------------------------------------------===// +// Filtered walking of the CFG. +//===----------------------------------------------------------------------===// + +bool CFGBlock::FilterEdge(const CFGBlock::FilterOptions &F, + const CFGBlock *From, const CFGBlock *To) { + + if (F.IgnoreDefaultsWithCoveredEnums) { + // If the 'To' has no label or is labeled but the label isn't a + // CaseStmt then filter this edge. + if (const SwitchStmt *S = + dyn_cast_or_null(From->getTerminator())) { + if (S->isAllEnumCasesCovered()) { + const Stmt *L = To->getLabel(); + if (!L || !isa(L)) + return true; + } + } + } + + return false; +} + +//===----------------------------------------------------------------------===// // Cleanup: CFG dstor. //===----------------------------------------------------------------------===// From kremenek at apple.com Wed Sep 8 19:06:07 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 00:06:07 -0000 Subject: [cfe-commits] r113450 - in /cfe/trunk: lib/Sema/AnalysisBasedWarnings.cpp test/Sema/return.c Message-ID: <20100909000607.B340E2A6C12E@llvm.org> Author: kremenek Date: Wed Sep 8 19:06:07 2010 New Revision: 113450 URL: http://llvm.org/viewvc/llvm-project?rev=113450&view=rev Log: Enhance -Wreturn-type to not warn when control-flow is most likely limited by a switch statement explicitly covering all the cases for an enum value. Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp cfe/trunk/test/Sema/return.c Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=113450&r1=113449&r2=113450&view=diff ============================================================================== --- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original) +++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Wed Sep 8 19:06:07 2010 @@ -108,11 +108,15 @@ bool HasFakeEdge = false; bool HasPlainEdge = false; bool HasAbnormalEdge = false; - for (CFGBlock::pred_iterator I=cfg->getExit().pred_begin(), - E = cfg->getExit().pred_end(); - I != E; - ++I) { - CFGBlock& B = **I; + + // Ignore default cases that aren't likely to be reachable because all + // enums in a switch(X) have explicit case statements. + CFGBlock::FilterOptions FO; + FO.IgnoreDefaultsWithCoveredEnums = 1; + + for (CFGBlock::filtered_pred_iterator + I = cfg->getExit().filtered_pred_start_end(FO); I.hasMore(); ++I) { + const CFGBlock& B = **I; if (!live[B.getBlockID()]) continue; if (B.size() == 0) { Modified: cfe/trunk/test/Sema/return.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/return.c?rev=113450&r1=113449&r2=113450&view=diff ============================================================================== --- cfe/trunk/test/Sema/return.c (original) +++ cfe/trunk/test/Sema/return.c Wed Sep 8 19:06:07 2010 @@ -242,3 +242,16 @@ // Test warnings on ignored qualifiers on return types. const int ignored_c_quals(); // expected-warning{{'const' type qualifier on return type has no effect}} const volatile int ignored_cv_quals(); // expected-warning{{'const volatile' type qualifiers on return type have no effect}} + +// Test that for switch(enum) that if the switch statement covers all the cases +// that we don't consider that for -Wreturn-type. +enum Cases { C1, C2, C3, C4 }; +int test_enum_cases(enum Cases C) { + switch (C) { + case C1: return 1; + case C2: return 2; + case C4: return 3; + case C3: return 4; + } +} // no-warning + From kremenek at apple.com Wed Sep 8 19:06:10 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 00:06:10 -0000 Subject: [cfe-commits] r113451 - in /cfe/trunk: lib/Analysis/ReachableCode.cpp test/Sema/warn-unreachable.c Message-ID: <20100909000610.580EE2A6C12C@llvm.org> Author: kremenek Date: Wed Sep 8 19:06:10 2010 New Revision: 113451 URL: http://llvm.org/viewvc/llvm-project?rev=113451&view=rev Log: Enhance -Wunreachable-code to not consider the 'default:' branch of a switch statement live if a switch on an enum value has explicit 'case:' statements for each enum value. Modified: cfe/trunk/lib/Analysis/ReachableCode.cpp cfe/trunk/test/Sema/warn-unreachable.c Modified: cfe/trunk/lib/Analysis/ReachableCode.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/ReachableCode.cpp?rev=113451&r1=113450&r2=113451&view=diff ============================================================================== --- cfe/trunk/lib/Analysis/ReachableCode.cpp (original) +++ cfe/trunk/lib/Analysis/ReachableCode.cpp Wed Sep 8 19:06:10 2010 @@ -131,6 +131,9 @@ } // Solve + CFGBlock::FilterOptions FO; + FO.IgnoreDefaultsWithCoveredEnums = 1; + while (!WL.empty()) { const CFGBlock *item = WL.back(); WL.pop_back(); @@ -147,8 +150,8 @@ } reachable.set(item->getBlockID()); - for (CFGBlock::const_succ_iterator I=item->succ_begin(), E=item->succ_end(); - I != E; ++I) + for (CFGBlock::filtered_succ_iterator I = + item->filtered_succ_start_end(FO); I.hasMore(); ++I) if (const CFGBlock *B = *I) { unsigned blockID = B->getBlockID(); if (!reachable[blockID]) { @@ -190,14 +193,17 @@ ++count; WL.push_back(&Start); - // Find the reachable blocks from 'Start'. + // Find the reachable blocks from 'Start'. + CFGBlock::FilterOptions FO; + FO.IgnoreDefaultsWithCoveredEnums = 1; + while (!WL.empty()) { const CFGBlock *item = WL.back(); WL.pop_back(); // Look at the successors and mark then reachable. - for (CFGBlock::const_succ_iterator I=item->succ_begin(), E=item->succ_end(); - I != E; ++I) + for (CFGBlock::filtered_succ_iterator I= item->filtered_succ_start_end(FO); + I.hasMore(); ++I) if (const CFGBlock *B = *I) { unsigned blockID = B->getBlockID(); if (!Reachable[blockID]) { Modified: cfe/trunk/test/Sema/warn-unreachable.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-unreachable.c?rev=113451&r1=113450&r2=113451&view=diff ============================================================================== --- cfe/trunk/test/Sema/warn-unreachable.c (original) +++ cfe/trunk/test/Sema/warn-unreachable.c Wed Sep 8 19:06:10 2010 @@ -98,3 +98,19 @@ } } } + +enum Cases { C1, C2, C3 }; +int test_enum_cases(enum Cases C) { + switch (C) { + case C1: + case C2: + case C3: + return 1; + default: { + int i = 0; // expected-warning{{will never be executed}} + ++i; + return i; + } + } +} + From fjahanian at apple.com Wed Sep 8 19:21:45 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Thu, 09 Sep 2010 00:21:45 -0000 Subject: [cfe-commits] r113454 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/block-var-layout.m Message-ID: <20100909002145.4097F2A6C12C@llvm.org> Author: fjahanian Date: Wed Sep 8 19:21:45 2010 New Revision: 113454 URL: http://llvm.org/viewvc/llvm-project?rev=113454&view=rev Log: Block ivar layout must assume that the 'isa' field of the block descriptor is GC'able (scanned) as this what the runtime expects (one can send it messages). Radar 8394947. Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp cfe/trunk/test/CodeGenObjC/block-var-layout.m Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=113454&r1=113453&r2=113454&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original) +++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Wed Sep 8 19:21:45 2010 @@ -1675,6 +1675,9 @@ unsigned WordSizeInBits = CGM.getContext().Target.getPointerWidth(0); unsigned ByteSizeInBits = CGM.getContext().Target.getCharWidth(); + // __isa is the first field in block descriptor and must assume by runtime's + // convention that it is GC'able. + IvarsInfo.push_back(GC_IVAR(0, 1)); for (size_t i = 0; i < DeclRefs.size(); ++i) { const BlockDeclRefExpr *BDRE = DeclRefs[i]; const ValueDecl *VD = BDRE->getDecl(); Modified: cfe/trunk/test/CodeGenObjC/block-var-layout.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/block-var-layout.m?rev=113454&r1=113453&r2=113454&view=diff ============================================================================== --- cfe/trunk/test/CodeGenObjC/block-var-layout.m (original) +++ cfe/trunk/test/CodeGenObjC/block-var-layout.m Wed Sep 8 19:21:45 2010 @@ -108,16 +108,16 @@ } // CHECK-LP64: L_OBJC_CLASS_NAME_: -// CHECK-LP64-NEXT: .asciz "A\024" +// CHECK-LP64-NEXT: .asciz "\0011\024" // CHECK-LP64: L_OBJC_CLASS_NAME_1: -// CHECK-LP64-NEXT: .asciz "A\025" +// CHECK-LP64-NEXT: .asciz "\0011\025" // CHECK-LP64: L_OBJC_CLASS_NAME_6: -// CHECK-LP64-NEXT: .asciz "A\023!" +// CHECK-LP64-NEXT: .asciz "\0011\023!" // CHECK-LP64: L_OBJC_CLASS_NAME_11: -// CHECK-LP64-NEXT: .asciz "Q\021\021" +// CHECK-LP64-NEXT: .asciz "\001A\021\021" // CHECK-LP64: L_OBJC_CLASS_NAME_14: -// CHECK-LP64-NEXT: .asciz "Q\021\022p" +// CHECK-LP64-NEXT: .asciz "\001A\021\022p" From kremenek at apple.com Wed Sep 8 19:40:40 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 00:40:40 -0000 Subject: [cfe-commits] r113457 - in /cfe/trunk: include/clang/AST/Expr.h include/clang/Checker/PathSensitive/GRCoreEngine.h lib/Checker/GRExprEngine.cpp Message-ID: <20100909004040.9D78A2A6C12D@llvm.org> Author: kremenek Date: Wed Sep 8 19:40:40 2010 New Revision: 113457 URL: http://llvm.org/viewvc/llvm-project?rev=113457&view=rev Log: Static analyzer fix: Switch on enum should not consider default case live if all enum values are covered Modified: cfe/trunk/include/clang/AST/Expr.h cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h cfe/trunk/lib/Checker/GRExprEngine.cpp Modified: cfe/trunk/include/clang/AST/Expr.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=113457&r1=113456&r2=113457&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/Expr.h (original) +++ cfe/trunk/include/clang/AST/Expr.h Wed Sep 8 19:40:40 2010 @@ -422,6 +422,10 @@ /// ParenExpr or ImplicitCastExprs, returning their operand. Expr *IgnoreParenImpCasts(); + const Expr *IgnoreParenImpCasts() const { + return const_cast(this)->IgnoreParenImpCasts(); + } + /// IgnoreParenNoopCasts - Ignore parentheses and casts that do not change the /// value (including ptr->int casts of the same size). Strip off any /// ParenExpr or CastExprs, returning their operand. Modified: cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h?rev=113457&r1=113456&r2=113457&view=diff ============================================================================== --- cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h (original) +++ cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h Wed Sep 8 19:40:40 2010 @@ -422,6 +422,10 @@ iterator begin() { return iterator(Src->succ_rbegin()+1); } iterator end() { return iterator(Src->succ_rend()); } + const SwitchStmt *getSwitch() const { + return llvm::cast(Src->getTerminator()); + } + ExplodedNode* generateCaseStmtNode(const iterator& I, const GRState* State); ExplodedNode* generateDefaultCaseNode(const GRState* State, Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=113457&r1=113456&r2=113457&view=diff ============================================================================== --- cfe/trunk/lib/Checker/GRExprEngine.cpp (original) +++ cfe/trunk/lib/Checker/GRExprEngine.cpp Wed Sep 8 19:40:40 2010 @@ -1561,9 +1561,24 @@ } while (true); } - // If we reach here, than we know that the default branch is - // possible. - if (defaultIsFeasible) builder.generateDefaultCaseNode(DefaultSt); + if (!defaultIsFeasible) + return; + + // If we have switch(enum value), the default branch is not + // feasible if all of the enum constants not covered by 'case:' statements + // are not feasible values for the switch condition. + // + // Note that this isn't as accurate as it could be. Even if there isn't + // a case for a particular enum value as long as that enum value isn't + // feasible then it shouldn't be considered for making 'default:' reachable. + const SwitchStmt *SS = builder.getSwitch(); + const Expr *CondExpr = SS->getCond()->IgnoreParenImpCasts(); + if (CondExpr->getType()->getAs()) { + if (SS->isAllEnumCasesCovered()) + return; + } + + builder.generateDefaultCaseNode(DefaultSt); } void GRExprEngine::ProcessCallEnter(GRCallEnterNodeBuilder &B) { From kremenek at apple.com Wed Sep 8 19:40:43 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 00:40:43 -0000 Subject: [cfe-commits] r113458 - /cfe/trunk/test/Analysis/misc-ps.m Message-ID: <20100909004043.C5B3A2A6C12E@llvm.org> Author: kremenek Date: Wed Sep 8 19:40:43 2010 New Revision: 113458 URL: http://llvm.org/viewvc/llvm-project?rev=113458&view=rev Log: Include test case for . Modified: cfe/trunk/test/Analysis/misc-ps.m Modified: cfe/trunk/test/Analysis/misc-ps.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=113458&r1=113457&r2=113458&view=diff ============================================================================== --- cfe/trunk/test/Analysis/misc-ps.m (original) +++ cfe/trunk/test/Analysis/misc-ps.m Wed Sep 8 19:40:43 2010 @@ -1068,3 +1068,30 @@ *arg = malloc(1); } +// Switch on enum should not consider default case live +// if all enum values are covered +enum Cases { C1, C2, C3, C4 }; +void test_enum_cases(enum Cases C) { + switch (C) { + case C1: + case C2: + case C4: + case C3: + return; + } + int *p = 0; + *p = 0xDEADBEEF; // no-warning +} + +void test_enum_cases_positive(enum Cases C) { + switch (C) { // expected-warning{{enumeration value 'C4' not handled in switch}} + case C1: + case C2: + case C3: + return; + } + int *p = 0; + *p = 0xDEADBEEF; // expected-warning{{Dereference of null pointer}} +} + + From pichet2000 at gmail.com Wed Sep 8 20:03:08 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Wed, 8 Sep 2010 21:03:08 -0400 Subject: [cfe-commits] [PATCH][MS] - Fix 6 lit tests on windows In-Reply-To: <3478254024203035170@unknownmsgid> References: <4BEA1589-EC2B-4260-BD19-84E1C02B1EAB@apple.com> <3478254024203035170@unknownmsgid> Message-ID: I just spent a hour on this. 3 observations: 1- it crashes in fprintf c-index-test.c. 2- it doesn't crash in debug mode. only in release 3- it doesn't seem to crash if executed outside of the python context. investigation to continue... crash call stack: MSVCR90.dll!_invoke_watson+0xf9 MSVCR90.dll!_write+0x59 MSVCR90.dll!_flsbuf+0xd4 MSVCR90.dll!_vcwprintf_s+0x21a2 MSVCR90.dll!_vcwprintf_s+0x2cad MSVCR90.dll!fprintf+0xf0 c-index-test.exe+0x3275 c-index-test.exe+0x32e0 c-index-test.exe+0x34e5 c-index-test.exe+0x443a On Wed, Sep 8, 2010 at 5:56 PM, Daniel Dunbar wrote: > Have you tried inserting additional code to validate that a < b => !(b > < a) and so on? Sometimes that is enough to flush out the problem. > > ?- Daniel > > > On Sep 7, 2010, at 16:57, Douglas Gregor wrote: > >> >> On Sep 7, 2010, at 4:52 PM, Francois Pichet wrote: >> >>> On Tue, Sep 7, 2010 at 7:29 PM, Daniel Dunbar wrote: >>>> Hi Francois, >>>> >>>> I didn't see this email, but I just applied a different fix which uses >>>> -ffreestanding instead, which avoids introducing a platform specific >>>> dependency. This resolved all the test failures on VS10, at least for >>>> me. >>> >>> Great this fix 8 tests. >>> I am still getting some tests failing using VS 2008 and Windows 7 x64 >>> + about 4 popups with c-index-test.exe crashing. >>> >>> Failing Tests (8): >>> ? Clang :: Driver/darwin-ld.c >>> ? Clang :: Index/complete-exprs.c >>> ? Clang :: Index/complete-hiding.c >>> ? Clang :: Index/complete-macros.c >>> ? Clang :: Index/complete-natural.m >>> ? Clang :: Index/complete-preprocessor.m >>> ? Clang :: Index/preamble-reparse.c >>> ? Clang :: Index/preamble.c >> >> The code-completion failures seem to be due to a bogus partial ordering in the clang::operator< in lib/Sema/CodeCompleteConsumer.cpp, but (from inspection) I don't see any problems there. Very annoying! >> >> ? ?- Doug > From kremenek at apple.com Wed Sep 8 20:17:32 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 01:17:32 -0000 Subject: [cfe-commits] r113464 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDeclAttr.cpp test/SemaObjC/nonnull.m Message-ID: <20100909011732.4A40F2A6C12E@llvm.org> Author: kremenek Date: Wed Sep 8 20:17:32 2010 New Revision: 113464 URL: http://llvm.org/viewvc/llvm-project?rev=113464&view=rev Log: Relax __attribute_((nonnull)) checking to allow the attribute on functions with no pointer arguments. GCC doesn't warn in this case, and the attribute is trivially satisfied (and benign). Fixes . Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/lib/Sema/SemaDeclAttr.cpp cfe/trunk/test/SemaObjC/nonnull.m Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=113464&r1=113463&r2=113464&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Sep 8 20:17:32 2010 @@ -1016,14 +1016,11 @@ "type of machine mode does not match type of base type">; def err_attr_wrong_decl : Error< "'%0' attribute invalid on this declaration, requires typedef or value">; -def warn_attribute_nonnull_no_pointers : Warning< - "'nonnull' attribute applied to function with no pointer arguments">; def warn_attribute_malloc_pointer_only : Warning< "'malloc' attribute only applies to functions returning a pointer type">; def warn_transparent_union_nonpointer : Warning< "'transparent_union' attribute support incomplete; only supported for " "pointer unions">; - def warn_attribute_sentinel_named_arguments : Warning< "'sentinel' attribute requires named arguments">; def warn_attribute_sentinel_not_variadic : Warning< Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=113464&r1=113463&r2=113464&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original) +++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Sep 8 20:17:32 2010 @@ -373,10 +373,10 @@ NonNullArgs.push_back(I); } - if (NonNullArgs.empty()) { - S.Diag(Attr.getLoc(), diag::warn_attribute_nonnull_no_pointers); + // No pointer arguments? The attribute in this case is + // trivially satisfied. + if (NonNullArgs.empty()) return; - } } unsigned* start = &NonNullArgs[0]; Modified: cfe/trunk/test/SemaObjC/nonnull.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/nonnull.m?rev=113464&r1=113463&r2=113464&view=diff ============================================================================== --- cfe/trunk/test/SemaObjC/nonnull.m (original) +++ cfe/trunk/test/SemaObjC/nonnull.m Wed Sep 8 20:17:32 2010 @@ -2,7 +2,7 @@ @class NSObject; -int f1(int x) __attribute__((nonnull)); // expected-warning{{'nonnull' attribute applied to function with no pointer arguments}} +int f1(int x) __attribute__((nonnull)); //no-warning int f2(int *x) __attribute__ ((nonnull (1))); int f3(int *x) __attribute__ ((nonnull (0))); // expected-error {{'nonnull' attribute parameter 1 is out of bounds}} int f4(int *x, int *y) __attribute__ ((nonnull (1,2))); @@ -44,4 +44,4 @@ func7((NSObject*) 0); // no-warning } -void func5(int) __attribute__((nonnull)); // expected-warning{{'nonnull' attribute applied to function with no pointer arguments}} +void func5(int) __attribute__((nonnull)); // no-warning From tcare at apple.com Wed Sep 8 20:51:18 2010 From: tcare at apple.com (Tom Care) Date: Wed, 8 Sep 2010 18:51:18 -0700 Subject: [cfe-commits] r113449 - in /cfe/trunk: include/clang/Analysis/CFG.h lib/Analysis/CFG.cpp In-Reply-To: <20100909000604.C9FD72A6C12D@llvm.org> References: <20100909000604.C9FD72A6C12D@llvm.org> Message-ID: <0F239149-9132-48BF-8F0B-191D737EEE4C@apple.com> FYI, line 213's ';' is triggering a -pedantic warning for me, and lines 219, 229, and 230 contain tabs. Tom On Sep 8, 2010, at 5:06 PM, Ted Kremenek wrote: > Author: kremenek > Date: Wed Sep 8 19:06:04 2010 > New Revision: 113449 > > URL: http://llvm.org/viewvc/llvm-project?rev=113449&view=rev > Log: > Add 'filtered_pred_iterator' and 'filtered_succ_iterator' to CFGBlock. This allows a client > to selectively walk successors/predecessors based on commonly used filters. For starters, add > a filter to ignore 'default:' cases for SwitchStmts when all enum values are covered by CaseStmts. > > Modified: > cfe/trunk/include/clang/Analysis/CFG.h > cfe/trunk/lib/Analysis/CFG.cpp > > Modified: cfe/trunk/include/clang/Analysis/CFG.h > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/CFG.h?rev=113449&r1=113448&r2=113449&view=diff > ============================================================================== > --- cfe/trunk/include/clang/Analysis/CFG.h (original) > +++ cfe/trunk/include/clang/Analysis/CFG.h Wed Sep 8 19:06:04 2010 > @@ -205,6 +205,59 @@ > unsigned pred_size() const { return Preds.size(); } > bool pred_empty() const { return Preds.empty(); } > > + > + class FilterOptions { > + public: > + FilterOptions() { > + IgnoreDefaultsWithCoveredEnums = 0; > + }; > + > + unsigned IgnoreDefaultsWithCoveredEnums : 1; > + }; > + > + static bool FilterEdge(const FilterOptions &F, const CFGBlock *Src, > + const CFGBlock *Dst); > + > + template > + class FilteredCFGBlockIterator { > + private: > + IMPL I, E; > + const FilterOptions F; > + const CFGBlock *From; > + public: > + explicit FilteredCFGBlockIterator(const IMPL &i, const IMPL &e, > + const CFGBlock *from, > + const FilterOptions &f) > + : I(i), E(e), F(f), From(from) {} > + > + bool hasMore() const { return I != E; } > + > + FilteredCFGBlockIterator &operator++() { > + do { ++I; } while (hasMore() && Filter(*I)); > + return *this; > + } > + > + const CFGBlock *operator*() const { return *I; } > + private: > + bool Filter(const CFGBlock *To) { > + return IsPred ? FilterEdge(F, To, From) : FilterEdge(F, From, To); > + } > + }; > + > + typedef FilteredCFGBlockIterator > + filtered_pred_iterator; > + > + typedef FilteredCFGBlockIterator > + filtered_succ_iterator; > + > + filtered_pred_iterator filtered_pred_start_end(const FilterOptions &f) const { > + return filtered_pred_iterator(pred_begin(), pred_end(), this, f); > + } > + > + filtered_succ_iterator filtered_succ_start_end(const FilterOptions &f) const { > + return filtered_succ_iterator(succ_begin(), succ_end(), this, f); > + } > + > // Manipulation of block contents > > void setTerminator(Stmt* Statement) { Terminator = Statement; } > > Modified: cfe/trunk/lib/Analysis/CFG.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=113449&r1=113448&r2=113449&view=diff > ============================================================================== > --- cfe/trunk/lib/Analysis/CFG.cpp (original) > +++ cfe/trunk/lib/Analysis/CFG.cpp Wed Sep 8 19:06:04 2010 > @@ -1937,6 +1937,29 @@ > } > > //===----------------------------------------------------------------------===// > +// Filtered walking of the CFG. > +//===----------------------------------------------------------------------===// > + > +bool CFGBlock::FilterEdge(const CFGBlock::FilterOptions &F, > + const CFGBlock *From, const CFGBlock *To) { > + > + if (F.IgnoreDefaultsWithCoveredEnums) { > + // If the 'To' has no label or is labeled but the label isn't a > + // CaseStmt then filter this edge. > + if (const SwitchStmt *S = > + dyn_cast_or_null(From->getTerminator())) { > + if (S->isAllEnumCasesCovered()) { > + const Stmt *L = To->getLabel(); > + if (!L || !isa(L)) > + return true; > + } > + } > + } > + > + return false; > +} > + > +//===----------------------------------------------------------------------===// > // Cleanup: CFG dstor. > //===----------------------------------------------------------------------===// > > > > _______________________________________________ > cfe-commits mailing list > cfe-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits From tcare at apple.com Wed Sep 8 21:04:52 2010 From: tcare at apple.com (Tom Care) Date: Thu, 09 Sep 2010 02:04:52 -0000 Subject: [cfe-commits] r113465 - /cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp Message-ID: <20100909020452.546AF2A6C12C@llvm.org> Author: tcare Date: Wed Sep 8 21:04:52 2010 New Revision: 113465 URL: http://llvm.org/viewvc/llvm-project?rev=113465&view=rev Log: Simplified reachability checking in IdempotentOperationChecker and added a helper function for path display. - Created private class CFGReachabilityAnalysis, which provides cached reachability lookups in the CFG - Simplified PathWasCompletelyAnalyzed to use the new reachability class - Added getLastRelevantNodes function for future use with path displaying in BugReporter Modified: cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp Modified: cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp?rev=113465&r1=113464&r2=113465&view=diff ============================================================================== --- cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp (original) +++ cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp Wed Sep 8 21:04:52 2010 @@ -62,45 +62,64 @@ namespace { class IdempotentOperationChecker : public CheckerVisitor { +public: + static void *getTag(); + void PreVisitBinaryOperator(CheckerContext &C, const BinaryOperator *B); + void PostVisitBinaryOperator(CheckerContext &C, const BinaryOperator *B); + void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, GRExprEngine &Eng); + +private: + // Our assumption about a particular operation. + enum Assumption { Possible = 0, Impossible, Equal, LHSis1, RHSis1, LHSis0, + RHSis0 }; + + void UpdateAssumption(Assumption &A, const Assumption &New); + + // False positive reduction methods + static bool isSelfAssign(const Expr *LHS, const Expr *RHS); + static bool isUnused(const Expr *E, AnalysisContext *AC); + static bool isTruncationExtensionAssignment(const Expr *LHS, + const Expr *RHS); + bool PathWasCompletelyAnalyzed(const CFG *C, + const CFGBlock *CB, + const GRCoreEngine &CE); + static bool CanVary(const Expr *Ex, + AnalysisContext *AC); + static bool isConstantOrPseudoConstant(const DeclRefExpr *DR, + AnalysisContext *AC); + static bool containsNonLocalVarDecl(const Stmt *S); + const ExplodedNodeSet getLastRelevantNodes(const CFGBlock *Begin, + const ExplodedNode *N); + + // Hash table and related data structures + struct BinaryOperatorData { + BinaryOperatorData() : assumption(Possible), analysisContext(0) {} + + Assumption assumption; + AnalysisContext *analysisContext; + ExplodedNodeSet explodedNodes; // Set of ExplodedNodes that refer to a + // BinaryOperator + }; + typedef llvm::DenseMap + AssumptionMap; + AssumptionMap hash; + + // A class that performs reachability queries for CFGBlocks. Several internal + // checks in this checker require reachability information. The requests all + // tend to have a common destination, so we lazily do a predecessor search + // from the destination node and cache the results to prevent work + // duplication. + class CFGReachabilityAnalysis { + typedef llvm::SmallSet ReachableSet; + typedef llvm::DenseMap ReachableMap; + ReachableSet analyzed; + ReachableMap reachable; public: - static void *getTag(); - void PreVisitBinaryOperator(CheckerContext &C, const BinaryOperator *B); - void PostVisitBinaryOperator(CheckerContext &C, const BinaryOperator *B); - void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, GRExprEngine &Eng); - + inline bool isReachable(const CFGBlock *Src, const CFGBlock *Dst); private: - // Our assumption about a particular operation. - enum Assumption { Possible = 0, Impossible, Equal, LHSis1, RHSis1, LHSis0, - RHSis0 }; - - void UpdateAssumption(Assumption &A, const Assumption &New); - - // False positive reduction methods - static bool isSelfAssign(const Expr *LHS, const Expr *RHS); - static bool isUnused(const Expr *E, AnalysisContext *AC); - static bool isTruncationExtensionAssignment(const Expr *LHS, - const Expr *RHS); - static bool PathWasCompletelyAnalyzed(const CFG *C, - const CFGBlock *CB, - const GRCoreEngine &CE); - static bool CanVary(const Expr *Ex, - AnalysisContext *AC); - static bool isConstantOrPseudoConstant(const DeclRefExpr *DR, - AnalysisContext *AC); - static bool containsNonLocalVarDecl(const Stmt *S); - - // Hash table and related data structures - struct BinaryOperatorData { - BinaryOperatorData() : assumption(Possible), analysisContext(0) {} - - Assumption assumption; - AnalysisContext *analysisContext; - ExplodedNodeSet explodedNodes; // Set of ExplodedNodes that refer to a - // BinaryOperator - }; - typedef llvm::DenseMap - AssumptionMap; - AssumptionMap hash; + void MapReachability(const CFGBlock *Dst); + }; + CFGReachabilityAnalysis CRA; }; } @@ -530,50 +549,23 @@ const CFG *C, const CFGBlock *CB, const GRCoreEngine &CE) { - std::deque WorkList; - llvm::SmallSet Aborted; - llvm::SmallSet Visited; - - // Create a set of all aborted blocks + // Test for reachability from any aborted blocks to this block typedef GRCoreEngine::BlocksAborted::const_iterator AbortedIterator; for (AbortedIterator I = CE.blocks_aborted_begin(), E = CE.blocks_aborted_end(); I != E; ++I) { const BlockEdge &BE = I->first; // The destination block on the BlockEdge is the first block that was not - // analyzed. - Aborted.insert(BE.getDst()->getBlockID()); - } - - // Save the entry block ID for early exiting - unsigned EntryBlockID = C->getEntry().getBlockID(); - - // Create initial node - WorkList.push_back(CB); - - while (!WorkList.empty()) { - const CFGBlock *Head = WorkList.front(); - WorkList.pop_front(); - Visited.insert(Head->getBlockID()); - - // If we found the entry block, then there exists a path from the target - // node to the entry point of this function -> the path was completely - // analyzed. - if (Head->getBlockID() == EntryBlockID) - return true; - - // If any of the aborted blocks are on the path to the beginning, then all - // paths to this block were not analyzed. - if (Aborted.count(Head->getBlockID())) + // analyzed. If we can reach this block from the aborted block, then this + // block was not completely analyzed. + if (CRA.isReachable(BE.getDst(), CB)) return false; - - // Add the predecessors to the worklist unless we have already visited them - for (CFGBlock::const_pred_iterator I = Head->pred_begin(); - I != Head->pred_end(); ++I) - if (!Visited.count((*I)->getBlockID())) - WorkList.push_back(*I); } + // Verify that this block is reachable from the entry block + if (!CRA.isReachable(&C->getEntry(), CB)) + return false; + // If we get to this point, there is no connection to the entry block or an // aborted block. This path is unreachable and we can report the error. return true; @@ -700,3 +692,94 @@ return false; } + +// Returns the successor nodes of N whose CFGBlocks cannot reach N's CFGBlock. +// This effectively gives us a set of points in the ExplodedGraph where +// subsequent execution could not affect the idempotent operation on this path. +// This is useful for displaying paths after the point of the error, providing +// an example of how this idempotent operation cannot change. +const ExplodedNodeSet IdempotentOperationChecker::getLastRelevantNodes( + const CFGBlock *Begin, const ExplodedNode *N) { + std::deque WorkList; + llvm::SmallPtrSet Visited; + ExplodedNodeSet Result; + + WorkList.push_back(N); + + while (!WorkList.empty()) { + const ExplodedNode *Head = WorkList.front(); + WorkList.pop_front(); + Visited.insert(Head); + + const ProgramPoint &PP = Head->getLocation(); + if (const BlockEntrance *BE = dyn_cast(&PP)) { + // Get the CFGBlock and test the reachability + const CFGBlock *CB = BE->getBlock(); + + // If we cannot reach the beginning CFGBlock from this block, then we are + // finished + if (!CRA.isReachable(CB, Begin)) { + Result.Add(const_cast(Head)); + continue; + } + } + + // Add unvisited children to the worklist + for (ExplodedNode::const_succ_iterator I = Head->succ_begin(), + E = Head->succ_end(); I != E; ++I) + if (!Visited.count(*I)) + WorkList.push_back(*I); + } + + // Return the ExplodedNodes that were found + return Result; +} + +bool IdempotentOperationChecker::CFGReachabilityAnalysis::isReachable( + const CFGBlock *Src, + const CFGBlock *Dst) { + const unsigned DstBlockID = Dst->getBlockID(); + + // If we haven't analyzed the destination node, run the analysis now + if (!analyzed.count(DstBlockID)) { + MapReachability(Dst); + analyzed.insert(DstBlockID); + } + + // Return the cached result + return reachable[DstBlockID].count(Src->getBlockID()); +} + +// Maps reachability to a common node by walking the predecessors of the +// destination node. +void IdempotentOperationChecker::CFGReachabilityAnalysis::MapReachability( + const CFGBlock *Dst) { + std::deque WorkList; + // Maintain a visited list to ensure we don't get stuck on cycles + llvm::SmallSet Visited; + ReachableSet &DstReachability = reachable[Dst->getBlockID()]; + + // Start searching from the destination node, since we commonly will perform + // multiple queries relating to a destination node. + WorkList.push_back(Dst); + + bool firstRun = true; + while (!WorkList.empty()) { + const CFGBlock *Head = WorkList.front(); + WorkList.pop_front(); + Visited.insert(Head->getBlockID()); + + // Update reachability information for this node -> Dst + if (!firstRun) + // Don't insert Dst -> Dst unless it was a predecessor of itself + DstReachability.insert(Head->getBlockID()); + else + firstRun = false; + + // Add the predecessors to the worklist unless we have already visited them + for (CFGBlock::const_pred_iterator I = Head->pred_begin(); + I != Head->pred_end(); ++I) + if (!Visited.count((*I)->getBlockID())) + WorkList.push_back(*I); + } +} From andersca at mac.com Wed Sep 8 21:12:30 2010 From: andersca at mac.com (Anders Carlsson) Date: Wed, 08 Sep 2010 19:12:30 -0700 Subject: [cfe-commits] r113018 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaCXX/flexible-array-test.cpp In-Reply-To: References: <20100903215349.5DEAF2A6C12C@llvm.org> Message-ID: <6BB38214-E4E4-4F8C-A81E-D1D6AA8B791D@mac.com> Sep 6, 2010 kl. 9:49 PM skrev Francois Pichet: > Any reason to to disallow flexible array element in union? > Both gcc 4.5 and msvc allow it. For example: > struct A > { > int Length; > union > { > char dataC[]; > short dataS[]; > long dataL[]; > }; > }; > Hi Francois, the reason for it was that it doesn't make sense to have a single union with a flexible array element, for example: union A { int a; char[] b; }; but I definitely agree that having them in unions is OK as long as they're nested inside another struct (and all fields are flexible array members etc). - Anders From kremenek at apple.com Wed Sep 8 21:57:48 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 02:57:48 -0000 Subject: [cfe-commits] r113466 - in /cfe/trunk: include/clang/Analysis/CFG.h lib/Analysis/CFG.cpp Message-ID: <20100909025748.9B1F22A6C12C@llvm.org> Author: kremenek Date: Wed Sep 8 21:57:48 2010 New Revision: 113466 URL: http://llvm.org/viewvc/llvm-project?rev=113466&view=rev Log: Remove stray ';' and convert tabs to spaces. Modified: cfe/trunk/include/clang/Analysis/CFG.h cfe/trunk/lib/Analysis/CFG.cpp Modified: cfe/trunk/include/clang/Analysis/CFG.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/CFG.h?rev=113466&r1=113465&r2=113466&view=diff ============================================================================== --- cfe/trunk/include/clang/Analysis/CFG.h (original) +++ cfe/trunk/include/clang/Analysis/CFG.h Wed Sep 8 21:57:48 2010 @@ -210,13 +210,13 @@ public: FilterOptions() { IgnoreDefaultsWithCoveredEnums = 0; - }; + } unsigned IgnoreDefaultsWithCoveredEnums : 1; }; static bool FilterEdge(const FilterOptions &F, const CFGBlock *Src, - const CFGBlock *Dst); + const CFGBlock *Dst); template class FilteredCFGBlockIterator { @@ -226,8 +226,8 @@ const CFGBlock *From; public: explicit FilteredCFGBlockIterator(const IMPL &i, const IMPL &e, - const CFGBlock *from, - const FilterOptions &f) + const CFGBlock *from, + const FilterOptions &f) : I(i), E(e), F(f), From(from) {} bool hasMore() const { return I != E; } Modified: cfe/trunk/lib/Analysis/CFG.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=113466&r1=113465&r2=113466&view=diff ============================================================================== --- cfe/trunk/lib/Analysis/CFG.cpp (original) +++ cfe/trunk/lib/Analysis/CFG.cpp Wed Sep 8 21:57:48 2010 @@ -1941,17 +1941,17 @@ //===----------------------------------------------------------------------===// bool CFGBlock::FilterEdge(const CFGBlock::FilterOptions &F, - const CFGBlock *From, const CFGBlock *To) { + const CFGBlock *From, const CFGBlock *To) { if (F.IgnoreDefaultsWithCoveredEnums) { // If the 'To' has no label or is labeled but the label isn't a // CaseStmt then filter this edge. if (const SwitchStmt *S = - dyn_cast_or_null(From->getTerminator())) { + dyn_cast_or_null(From->getTerminator())) { if (S->isAllEnumCasesCovered()) { - const Stmt *L = To->getLabel(); - if (!L || !isa(L)) - return true; + const Stmt *L = To->getLabel(); + if (!L || !isa(L)) + return true; } } } From kremenek at apple.com Wed Sep 8 21:57:51 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 02:57:51 -0000 Subject: [cfe-commits] r113467 - /cfe/trunk/lib/Sema/SemaStmt.cpp Message-ID: <20100909025751.C3B142A6C12D@llvm.org> Author: kremenek Date: Wed Sep 8 21:57:51 2010 New Revision: 113467 URL: http://llvm.org/viewvc/llvm-project?rev=113467&view=rev Log: Remove tabs I accidentally introduced. Modified: cfe/trunk/lib/Sema/SemaStmt.cpp Modified: cfe/trunk/lib/Sema/SemaStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=113467&r1=113466&r2=113467&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaStmt.cpp (original) +++ cfe/trunk/lib/Sema/SemaStmt.cpp Wed Sep 8 21:57:51 2010 @@ -728,34 +728,34 @@ // TODO: we might want to check whether case values are out of the // enum even if we don't want to check whether all cases are handled. if (!TheDefaultStmt) { - EnumValsTy::const_iterator EI = EnumVals.begin(); - for (CaseValsTy::const_iterator CI = CaseVals.begin(); + EnumValsTy::const_iterator EI = EnumVals.begin(); + for (CaseValsTy::const_iterator CI = CaseVals.begin(); CI != CaseVals.end(); CI++) { - while (EI != EIend && EI->first < CI->first) - EI++; - if (EI == EIend || EI->first > CI->first) + while (EI != EIend && EI->first < CI->first) + EI++; + if (EI == EIend || EI->first > CI->first) Diag(CI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum) << ED->getDeclName(); - } - // See which of case ranges aren't in enum - EI = EnumVals.begin(); - for (CaseRangesTy::const_iterator RI = CaseRanges.begin(); + } + // See which of case ranges aren't in enum + EI = EnumVals.begin(); + for (CaseRangesTy::const_iterator RI = CaseRanges.begin(); RI != CaseRanges.end() && EI != EIend; RI++) { - while (EI != EIend && EI->first < RI->first) - EI++; + while (EI != EIend && EI->first < RI->first) + EI++; - if (EI == EIend || EI->first != RI->first) { - Diag(RI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum) - << ED->getDeclName(); - } - - llvm::APSInt Hi = RI->second->getRHS()->EvaluateAsInt(Context); - while (EI != EIend && EI->first < Hi) - EI++; - if (EI == EIend || EI->first != Hi) - Diag(RI->second->getRHS()->getExprLoc(), diag::warn_not_in_enum) - << ED->getDeclName(); - } + if (EI == EIend || EI->first != RI->first) { + Diag(RI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum) + << ED->getDeclName(); + } + + llvm::APSInt Hi = RI->second->getRHS()->EvaluateAsInt(Context); + while (EI != EIend && EI->first < Hi) + EI++; + if (EI == EIend || EI->first != Hi) + Diag(RI->second->getRHS()->getExprLoc(), diag::warn_not_in_enum) + << ED->getDeclName(); + } } // Check which enum vals aren't in switch CaseValsTy::const_iterator CI = CaseVals.begin(); @@ -779,15 +779,15 @@ } if (RI == CaseRanges.end() || EI->first < RI->first) { - hasCasesNotInSwitch = true; - if (!TheDefaultStmt) - Diag(CondExpr->getExprLoc(), diag::warn_missing_cases) - << EI->second->getDeclName(); - } + hasCasesNotInSwitch = true; + if (!TheDefaultStmt) + Diag(CondExpr->getExprLoc(), diag::warn_missing_cases) + << EI->second->getDeclName(); + } } if (!hasCasesNotInSwitch) - SS->setAllEnumCasesCovered(); + SS->setAllEnumCasesCovered(); } } From kremenek at apple.com Wed Sep 8 22:51:39 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 03:51:39 -0000 Subject: [cfe-commits] r113468 - /cfe/trunk/lib/Sema/SemaChecking.cpp Message-ID: <20100909035139.6C5052A6C12C@llvm.org> Author: kremenek Date: Wed Sep 8 22:51:39 2010 New Revision: 113468 URL: http://llvm.org/viewvc/llvm-project?rev=113468&view=rev Log: Avoid redundant recursive calls in SemaCheckStringLiteral by just updating the expression and trying again. Modified: cfe/trunk/lib/Sema/SemaChecking.cpp Modified: cfe/trunk/lib/Sema/SemaChecking.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=113468&r1=113467&r2=113468&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaChecking.cpp (original) +++ cfe/trunk/lib/Sema/SemaChecking.cpp Wed Sep 8 22:51:39 2010 @@ -942,7 +942,7 @@ bool HasVAListArg, unsigned format_idx, unsigned firstDataArg, bool isPrintf) { - + tryAgain: if (E->isTypeDependent() || E->isValueDependent()) return false; @@ -956,15 +956,13 @@ } case Stmt::ImplicitCastExprClass: { - const ImplicitCastExpr *Expr = cast(E); - return SemaCheckStringLiteral(Expr->getSubExpr(), TheCall, HasVAListArg, - format_idx, firstDataArg, isPrintf); + E = cast(E)->getSubExpr(); + goto tryAgain; } case Stmt::ParenExprClass: { - const ParenExpr *Expr = cast(E); - return SemaCheckStringLiteral(Expr->getSubExpr(), TheCall, HasVAListArg, - format_idx, firstDataArg, isPrintf); + E = cast(E)->getSubExpr(); + goto tryAgain; } case Stmt::DeclRefExprClass: { From kremenek at apple.com Wed Sep 8 22:51:43 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 03:51:43 -0000 Subject: [cfe-commits] r113469 - in /cfe/trunk: lib/Sema/SemaChecking.cpp test/Sema/format-strings.c Message-ID: <20100909035143.1AD292A6C12D@llvm.org> Author: kremenek Date: Wed Sep 8 22:51:42 2010 New Revision: 113469 URL: http://llvm.org/viewvc/llvm-project?rev=113469&view=rev Log: It appears that technically a null format string is not warned under -Wformat-nonliteral, as the function processing the format string can decided whether or not to accept a null format string (e.g., asl_log). Fixes . Modified: cfe/trunk/lib/Sema/SemaChecking.cpp cfe/trunk/test/Sema/format-strings.c Modified: cfe/trunk/lib/Sema/SemaChecking.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=113469&r1=113468&r2=113469&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaChecking.cpp (original) +++ cfe/trunk/lib/Sema/SemaChecking.cpp Wed Sep 8 22:51:42 2010 @@ -955,6 +955,13 @@ format_idx, firstDataArg, isPrintf); } + case Stmt::IntegerLiteralClass: + // Technically -Wformat-nonliteral does not warn about this case. + // The behavior of printf and friends in this case is implementation + // dependent. Ideally if the format string cannot be null then + // it should have a 'nonnull' attribute in the function prototype. + return true; + case Stmt::ImplicitCastExprClass: { E = cast(E)->getSubExpr(); goto tryAgain; Modified: cfe/trunk/test/Sema/format-strings.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-strings.c?rev=113469&r1=113468&r2=113469&view=diff ============================================================================== --- cfe/trunk/test/Sema/format-strings.c (original) +++ cfe/trunk/test/Sema/format-strings.c Wed Sep 8 22:51:42 2010 @@ -301,3 +301,10 @@ printf("%lc", c2); // no-warning } +// -Wformat-security says NULL is not a string literal +void r8269537() { + // This is likely to crash in most cases, but -Wformat-nonliteral technically + // doesn't warn in this case. + printf(0); // no-warning +} + From kremenek at apple.com Wed Sep 8 23:33:05 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 04:33:05 -0000 Subject: [cfe-commits] r113472 - in /cfe/trunk: lib/Sema/SemaChecking.cpp test/Sema/format-strings.c Message-ID: <20100909043305.6BC6D2A6C12C@llvm.org> Author: kremenek Date: Wed Sep 8 23:33:05 2010 New Revision: 113472 URL: http://llvm.org/viewvc/llvm-project?rev=113472&view=rev Log: Check format strings when a called function has more than one FormatAttr (one for 'scanf' and one for 'printf'). Fixes . Modified: cfe/trunk/lib/Sema/SemaChecking.cpp cfe/trunk/test/Sema/format-strings.c Modified: cfe/trunk/lib/Sema/SemaChecking.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=113472&r1=113471&r2=113472&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaChecking.cpp (original) +++ cfe/trunk/lib/Sema/SemaChecking.cpp Wed Sep 8 23:33:05 2010 @@ -341,8 +341,12 @@ // more efficient. For example, just map function ids to custom // handlers. - // Printf checking. - if (const FormatAttr *Format = FDecl->getAttr()) { + // Printf and scanf checking. + for (specific_attr_iterator + i = FDecl->specific_attr_begin(), + e = FDecl->specific_attr_end(); i != e ; ++i) { + + const FormatAttr *Format = *i; const bool b = Format->getType() == "scanf"; if (b || CheckablePrintfAttr(Format, TheCall)) { bool HasVAListArg = Format->getFirstArg() == 0; @@ -353,12 +357,11 @@ } } - specific_attr_iterator - i = FDecl->specific_attr_begin(), - e = FDecl->specific_attr_end(); - - for (; i != e; ++i) + for (specific_attr_iterator + i = FDecl->specific_attr_begin(), + e = FDecl->specific_attr_end(); i != e; ++i) { CheckNonNullArguments(*i, TheCall); + } return false; } Modified: cfe/trunk/test/Sema/format-strings.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-strings.c?rev=113472&r1=113471&r2=113472&view=diff ============================================================================== --- cfe/trunk/test/Sema/format-strings.c (original) +++ cfe/trunk/test/Sema/format-strings.c Wed Sep 8 23:33:05 2010 @@ -302,9 +302,18 @@ } // -Wformat-security says NULL is not a string literal -void r8269537() { +void rdar8269537() { // This is likely to crash in most cases, but -Wformat-nonliteral technically // doesn't warn in this case. printf(0); // no-warning } +// Handle functions with multiple format attributes. +extern void rdar8332221_vprintf_scanf(const char *, va_list, const char *, ...) + __attribute__((__format__(__printf__, 1, 0))) + __attribute__((__format__(__scanf__, 3, 4))); + +void rdar8332221(va_list ap, int *x, long *y) { + rdar8332221_vprintf_scanf("%", ap, "%d", x); // expected-warning{{incomplete format specifier}} +} + From kremenek at apple.com Thu Sep 9 01:53:59 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 06:53:59 -0000 Subject: [cfe-commits] r113476 - /cfe/trunk/lib/Sema/SemaStmt.cpp Message-ID: <20100909065359.B89222A6C12C@llvm.org> Author: kremenek Date: Thu Sep 9 01:53:59 2010 New Revision: 113476 URL: http://llvm.org/viewvc/llvm-project?rev=113476&view=rev Log: Fix indentation. Modified: cfe/trunk/lib/Sema/SemaStmt.cpp Modified: cfe/trunk/lib/Sema/SemaStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=113476&r1=113475&r2=113476&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaStmt.cpp (original) +++ cfe/trunk/lib/Sema/SemaStmt.cpp Thu Sep 9 01:53:59 2010 @@ -728,34 +728,34 @@ // TODO: we might want to check whether case values are out of the // enum even if we don't want to check whether all cases are handled. if (!TheDefaultStmt) { - EnumValsTy::const_iterator EI = EnumVals.begin(); - for (CaseValsTy::const_iterator CI = CaseVals.begin(); + EnumValsTy::const_iterator EI = EnumVals.begin(); + for (CaseValsTy::const_iterator CI = CaseVals.begin(); CI != CaseVals.end(); CI++) { - while (EI != EIend && EI->first < CI->first) - EI++; - if (EI == EIend || EI->first > CI->first) + while (EI != EIend && EI->first < CI->first) + EI++; + if (EI == EIend || EI->first > CI->first) Diag(CI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum) << ED->getDeclName(); - } - // See which of case ranges aren't in enum - EI = EnumVals.begin(); - for (CaseRangesTy::const_iterator RI = CaseRanges.begin(); + } + // See which of case ranges aren't in enum + EI = EnumVals.begin(); + for (CaseRangesTy::const_iterator RI = CaseRanges.begin(); RI != CaseRanges.end() && EI != EIend; RI++) { - while (EI != EIend && EI->first < RI->first) - EI++; + while (EI != EIend && EI->first < RI->first) + EI++; - if (EI == EIend || EI->first != RI->first) { - Diag(RI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum) - << ED->getDeclName(); - } + if (EI == EIend || EI->first != RI->first) { + Diag(RI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum) + << ED->getDeclName(); + } - llvm::APSInt Hi = RI->second->getRHS()->EvaluateAsInt(Context); - while (EI != EIend && EI->first < Hi) - EI++; - if (EI == EIend || EI->first != Hi) - Diag(RI->second->getRHS()->getExprLoc(), diag::warn_not_in_enum) - << ED->getDeclName(); - } + llvm::APSInt Hi = RI->second->getRHS()->EvaluateAsInt(Context); + while (EI != EIend && EI->first < Hi) + EI++; + if (EI == EIend || EI->first != Hi) + Diag(RI->second->getRHS()->getExprLoc(), diag::warn_not_in_enum) + << ED->getDeclName(); + } } // Check which enum vals aren't in switch CaseValsTy::const_iterator CI = CaseVals.begin(); @@ -779,15 +779,15 @@ } if (RI == CaseRanges.end() || EI->first < RI->first) { - hasCasesNotInSwitch = true; - if (!TheDefaultStmt) - Diag(CondExpr->getExprLoc(), diag::warn_missing_cases) - << EI->second->getDeclName(); - } + hasCasesNotInSwitch = true; + if (!TheDefaultStmt) + Diag(CondExpr->getExprLoc(), diag::warn_missing_cases) + << EI->second->getDeclName(); + } } if (!hasCasesNotInSwitch) - SS->setAllEnumCasesCovered(); + SS->setAllEnumCasesCovered(); } } From kremenek at apple.com Thu Sep 9 02:13:00 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 07:13:00 -0000 Subject: [cfe-commits] r113477 - in /cfe/trunk: include/clang/Checker/PathSensitive/GRState.h lib/Checker/GRExprEngine.cpp lib/Checker/GRState.cpp lib/Checker/IdempotentOperationChecker.cpp test/Analysis/dead-stores.c test/Analysis/misc-ps-region-store.m test/Analysis/plist-output-alternate.m test/Analysis/plist-output.m Message-ID: <20100909071300.F058A2A6C12C@llvm.org> Author: kremenek Date: Thu Sep 9 02:13:00 2010 New Revision: 113477 URL: http://llvm.org/viewvc/llvm-project?rev=113477&view=rev Log: Rename GRState::getSVal() -> getRawSVal() and getSimplifiedSVal() -> getSVal(). The end result is now we eagarly constant-fold symbols in the analyzer that are perfectly constrained to be a constant value. This allows us to recover some path-sensitivity in some cases by lowering the required level of reasoning power needed to evaluate some expressions. The net win from this change is that the false positive in PR 8015 is fixed, and we also find more idempotent operations bugs. We do, however, regress with the BugReporterVisitors, which need to be modified to understand this constant folding (and look past it). This causes some diagnostic regressions in plist-output.m which will get addressed in a future patch. plist-output.m is now marked XFAIL, while plist-output-alternate.m now tests that the plist output is working, but with the suboptimal diagnostics. This second test file will eventually be removed. Added: cfe/trunk/test/Analysis/plist-output-alternate.m - copied, changed from r113476, cfe/trunk/test/Analysis/plist-output.m Modified: cfe/trunk/include/clang/Checker/PathSensitive/GRState.h cfe/trunk/lib/Checker/GRExprEngine.cpp cfe/trunk/lib/Checker/GRState.cpp cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp cfe/trunk/test/Analysis/dead-stores.c cfe/trunk/test/Analysis/misc-ps-region-store.m cfe/trunk/test/Analysis/plist-output.m Modified: cfe/trunk/include/clang/Checker/PathSensitive/GRState.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/GRState.h?rev=113477&r1=113476&r2=113477&view=diff ============================================================================== --- cfe/trunk/include/clang/Checker/PathSensitive/GRState.h (original) +++ cfe/trunk/include/clang/Checker/PathSensitive/GRState.h Thu Sep 9 02:13:00 2010 @@ -270,12 +270,9 @@ SVal getSValAsScalarOrLoc(const Stmt *Ex) const; SVal getSVal(Loc LV, QualType T = QualType()) const; - - /// Returns a "simplified" SVal bound to the location 'LV' in the state's - /// store. A simplified SVal will include optimizations such as - /// if the SVal is a symbol whose value is perfectly constrained then that - /// constant value is returned instead. - SVal getSimplifiedSVal(Loc LV, QualType T= QualType()) const; + + /// Returns the "raw" SVal bound to LV before any value simplfication. + SVal getRawSVal(Loc LV, QualType T= QualType()) const; SVal getSVal(const MemRegion* R) const; @@ -674,7 +671,7 @@ return UnknownVal(); } -inline SVal GRState::getSVal(Loc LV, QualType T) const { +inline SVal GRState::getRawSVal(Loc LV, QualType T) const { return getStateManager().StoreMgr->Retrieve(St, LV, T); } Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=113477&r1=113476&r2=113477&view=diff ============================================================================== --- cfe/trunk/lib/Checker/GRExprEngine.cpp (original) +++ cfe/trunk/lib/Checker/GRExprEngine.cpp Thu Sep 9 02:13:00 2010 @@ -1876,7 +1876,7 @@ // is non-NULL. Checkers typically care about GRStmtNodeBuilderRef BuilderRef(Dst, *Builder, *this, *I, newState, StoreE, - newState != state); + true); getTF().EvalBind(BuilderRef, location, Val); } @@ -1970,16 +1970,18 @@ // Proceed with the load. for (ExplodedNodeSet::iterator NI=Tmp.begin(), NE=Tmp.end(); NI!=NE; ++NI) { state = GetState(*NI); + if (location.isUnknown()) { // This is important. We must nuke the old binding. MakeNode(Dst, Ex, *NI, state->BindExpr(Ex, UnknownVal()), ProgramPoint::PostLoadKind, tag); } else { - SVal V = state->getSVal(cast(location), LoadTy.isNull() ? - Ex->getType() : LoadTy); - MakeNode(Dst, Ex, *NI, state->BindExpr(Ex, V), ProgramPoint::PostLoadKind, - tag); + if (LoadTy.isNull()) + LoadTy = Ex->getType(); + SVal V = state->getSVal(cast(location), LoadTy); + MakeNode(Dst, Ex, *NI, state->bindExprAndLocation(Ex, location, V), + ProgramPoint::PostLoadKind, tag); } } } @@ -3384,13 +3386,7 @@ SVal Result = EvalBinOp(state, Op, LeftV, RightV, B->getType()); if (Result.isUnknown()) { - if (OldSt != state) { - // Generate a new node if we have already created a new state. - MakeNode(Tmp3, B, *I2, state); - } - else - Tmp3.Add(*I2); - + MakeNode(Tmp3, B, *I2, state); continue; } Modified: cfe/trunk/lib/Checker/GRState.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRState.cpp?rev=113477&r1=113476&r2=113477&view=diff ============================================================================== --- cfe/trunk/lib/Checker/GRState.cpp (original) +++ cfe/trunk/lib/Checker/GRState.cpp Thu Sep 9 02:13:00 2010 @@ -169,9 +169,9 @@ return UnknownVal(); } -SVal GRState::getSimplifiedSVal(Loc location, QualType T) const { - SVal V = getSVal(cast(location), T); - +SVal GRState::getSVal(Loc location, QualType T) const { + SVal V = getRawSVal(cast(location), T); + // If 'V' is a symbolic value that is *perfectly* constrained to // be a constant value, use that value instead to lessen the burden // on later analysis stages (so we have less symbolic values to reason Modified: cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp?rev=113477&r1=113476&r2=113477&view=diff ============================================================================== --- cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp (original) +++ cfe/trunk/lib/Checker/IdempotentOperationChecker.cpp Thu Sep 9 02:13:00 2010 @@ -200,7 +200,7 @@ A = Impossible; return; } - LHSVal = state->getSVal(cast(LHSVal)); + LHSVal = state->getSVal(cast(LHSVal), LHS->getType()); } @@ -355,6 +355,8 @@ const BinaryOperator *B) { // Add the ExplodedNode we just visited BinaryOperatorData &Data = hash[B]; + assert(isa(cast(C.getPredecessor() + ->getLocation()).getStmt())); Data.explodedNodes.Add(C.getPredecessor()); } Modified: cfe/trunk/test/Analysis/dead-stores.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/dead-stores.c?rev=113477&r1=113476&r2=113477&view=diff ============================================================================== --- cfe/trunk/test/Analysis/dead-stores.c (original) +++ cfe/trunk/test/Analysis/dead-stores.c Thu Sep 9 02:13:00 2010 @@ -150,7 +150,7 @@ int f16(int x) { x = x * 2; - x = sizeof(int [x = (x || x + 1) * 2]) // expected-warning{{Although the value stored to 'x' is used}} expected-warning{{The left operand to '*' is always 1}} + x = sizeof(int [x = (x || x + 1) * 2]) // expected-warning{{Although the value stored to 'x' is used}} expected-warning{{The left operand to '*' is always 1}} expected-warning{{The left operand to '+' is always 0}} ? 5 : 8; return x; } Modified: cfe/trunk/test/Analysis/misc-ps-region-store.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-region-store.m?rev=113477&r1=113476&r2=113477&view=diff ============================================================================== --- cfe/trunk/test/Analysis/misc-ps-region-store.m (original) +++ cfe/trunk/test/Analysis/misc-ps-region-store.m Thu Sep 9 02:13:00 2010 @@ -1103,16 +1103,18 @@ } } -// FIXME: This is a false positive due to not reasoning about symbolic -// array indices correctly. Discussion in PR 8015. +// Tests that we correctly handle that 'number' is perfectly constrained +// after 'if (nunber == 0)', allowing us to resolve that +// numbers[number] == numbers[0]. void pr8015_D_FIXME() { int number = pr8015_A(); const char *numbers[] = { "zero" }; if (number == 0) { - if (numbers[number] == numbers[0]) + if (numbers[number] == numbers[0]) // expected-warning{{Both operands to '==' always have the same value}} return; + // Unreachable. int *p = 0; - *p = 0xDEADBEEF; // expected-warning{{Dereference of null pointer}} + *p = 0xDEADBEEF; // no-warnng } } Copied: cfe/trunk/test/Analysis/plist-output-alternate.m (from r113476, cfe/trunk/test/Analysis/plist-output.m) URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plist-output-alternate.m?p2=cfe/trunk/test/Analysis/plist-output-alternate.m&p1=cfe/trunk/test/Analysis/plist-output.m&r1=113476&r2=113477&rev=113477&view=diff ============================================================================== --- cfe/trunk/test/Analysis/plist-output.m (original) +++ cfe/trunk/test/Analysis/plist-output-alternate.m Thu Sep 9 02:13:00 2010 @@ -450,68 +450,6 @@ // CHECK: end // CHECK: // CHECK: -// CHECK: line22 -// CHECK: col7 -// CHECK: file0 -// CHECK: -// CHECK: -// CHECK: line22 -// CHECK: col8 -// CHECK: file0 -// CHECK: -// CHECK: -// CHECK: -// CHECK: -// CHECK: -// CHECK: -// CHECK: kindevent -// CHECK: location -// CHECK: -// CHECK: line22 -// CHECK: col7 -// CHECK: file0 -// CHECK: -// CHECK: ranges -// CHECK: -// CHECK: -// CHECK: -// CHECK: line22 -// CHECK: col7 -// CHECK: file0 -// CHECK: -// CHECK: -// CHECK: line22 -// CHECK: col8 -// CHECK: file0 -// CHECK: -// CHECK: -// CHECK: -// CHECK: extended_message -// CHECK: Assuming pointer value is null -// CHECK: message -// CHECK: Assuming pointer value is null -// CHECK: -// CHECK: -// CHECK: kindcontrol -// CHECK: edges -// CHECK: -// CHECK: -// CHECK: start -// CHECK: -// CHECK: -// CHECK: line22 -// CHECK: col7 -// CHECK: file0 -// CHECK: -// CHECK: -// CHECK: line22 -// CHECK: col8 -// CHECK: file0 -// CHECK: -// CHECK: -// CHECK: end -// CHECK: -// CHECK: // CHECK: line23 // CHECK: col5 // CHECK: file0 @@ -588,13 +526,13 @@ // CHECK: end // CHECK: // CHECK: -// CHECK: line28 -// CHECK: col7 +// CHECK: line29 +// CHECK: col5 // CHECK: file0 // CHECK: // CHECK: -// CHECK: line28 -// CHECK: col8 +// CHECK: line29 +// CHECK: col10 // CHECK: file0 // CHECK: // CHECK: @@ -605,63 +543,29 @@ // CHECK: kindevent // CHECK: location // CHECK: -// CHECK: line28 -// CHECK: col7 +// CHECK: line29 +// CHECK: col5 // CHECK: file0 // CHECK: // CHECK: ranges // CHECK: // CHECK: // CHECK: -// CHECK: line28 -// CHECK: col7 +// CHECK: line29 +// CHECK: col5 // CHECK: file0 // CHECK: // CHECK: -// CHECK: line28 -// CHECK: col8 +// CHECK: line29 +// CHECK: col10 // CHECK: file0 // CHECK: // CHECK: // CHECK: // CHECK: extended_message -// CHECK: Assuming pointer value is null +// CHECK: Variable 'p' initialized to a null pointer value // CHECK: message -// CHECK: Assuming pointer value is null -// CHECK: -// CHECK: -// CHECK: kindcontrol -// CHECK: edges -// CHECK: -// CHECK: -// CHECK: start -// CHECK: -// CHECK: -// CHECK: line28 -// CHECK: col7 -// CHECK: file0 -// CHECK: -// CHECK: -// CHECK: line28 -// CHECK: col8 -// CHECK: file0 -// CHECK: -// CHECK: -// CHECK: end -// CHECK: -// CHECK: -// CHECK: line29 -// CHECK: col5 -// CHECK: file0 -// CHECK: -// CHECK: -// CHECK: line29 -// CHECK: col5 -// CHECK: file0 -// CHECK: -// CHECK: -// CHECK: -// CHECK: +// CHECK: Variable 'p' initialized to a null pointer value // CHECK: // CHECK: // CHECK: kindcontrol @@ -677,7 +581,7 @@ // CHECK: // CHECK: // CHECK: line29 -// CHECK: col5 +// CHECK: col10 // CHECK: file0 // CHECK: // CHECK: @@ -849,3 +753,4 @@ // CHECK: // CHECK: // CHECK: + Modified: cfe/trunk/test/Analysis/plist-output.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plist-output.m?rev=113477&r1=113476&r2=113477&view=diff ============================================================================== --- cfe/trunk/test/Analysis/plist-output.m (original) +++ cfe/trunk/test/Analysis/plist-output.m Thu Sep 9 02:13:00 2010 @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-output=plist -o - %s | FileCheck %s +// XFAIL: * void test_null_init(void) { int *p = 0; From akyrtzi at gmail.com Thu Sep 9 03:45:59 2010 From: akyrtzi at gmail.com (Argyrios Kyrtzidis) Date: Thu, 9 Sep 2010 09:45:59 +0100 Subject: [cfe-commits] r113397 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaType.cpp test/SemaObjC/legacy-objc-types.m test/SemaObjCXX/legacy-objc-types.mm In-Reply-To: References: <20100908200819.0D2FB2A6C12C@llvm.org> Message-ID: On Sep 8, 2010, at 10:59 PM, John McCall wrote: >> >> I agree on this point. I can tighten up the type checking. >> In any case, point of this patch was to fix the crash in a limited case and not treat 'struct objc_object' as a replacement for 'id' everywhere. >> So, these are alternatives. >> >> 1. Do nothing and let the test case crash ( I think it was a manufactured test ). >> 2. Accept the alternative 'struct ...' as builtin type everywhere. >> 3. Issue error if it is used anywhere. >> 4.??? > > Personally I like #3 because ObjC code using 'struct objc_object' is very likely to either not compile or have really unfortunate behavioral changes ? I think Argyrios recently hunted down something in the latter category ? but that's the sort of problem we can only suss out with SWBs. For the immediate problem, changing FunctionArgTypesAreEqual should be enough. FWIW, I came upon the crash while testing out how 'struct objc_object' is handled in clang. So it wasn't in 'real' code but letting in known crashes is really bad IMO. -Argiris > > John. > _______________________________________________ > cfe-commits mailing list > cfe-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits From ggreif at gmail.com Thu Sep 9 05:51:37 2010 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 09 Sep 2010 10:51:37 -0000 Subject: [cfe-commits] r113480 - in /cfe/trunk/lib/Checker: ArrayBoundChecker.cpp CStringChecker.cpp ReturnPointerRangeChecker.cpp Message-ID: <20100909105137.EAC352A6C12C@llvm.org> Author: ggreif Date: Thu Sep 9 05:51:37 2010 New Revision: 113480 URL: http://llvm.org/viewvc/llvm-project?rev=113480&view=rev Log: do not bind temporaries to non-const references this fixes all analyser test failures in my gcc34-based environment how the cast result could bind to the non-const ref is somewhat mysterious and remains to be investigated; to avoid similar miscompilations (by gcc34 only?) Modified: cfe/trunk/lib/Checker/ArrayBoundChecker.cpp cfe/trunk/lib/Checker/CStringChecker.cpp cfe/trunk/lib/Checker/ReturnPointerRangeChecker.cpp Modified: cfe/trunk/lib/Checker/ArrayBoundChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/ArrayBoundChecker.cpp?rev=113480&r1=113479&r2=113480&view=diff ============================================================================== --- cfe/trunk/lib/Checker/ArrayBoundChecker.cpp (original) +++ cfe/trunk/lib/Checker/ArrayBoundChecker.cpp Thu Sep 9 05:51:37 2010 @@ -51,7 +51,7 @@ return; // Get the index of the accessed element. - DefinedOrUnknownSVal &Idx = cast(ER->getIndex()); + DefinedOrUnknownSVal Idx = cast(ER->getIndex()); const GRState *state = C.getState(); Modified: cfe/trunk/lib/Checker/CStringChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/CStringChecker.cpp?rev=113480&r1=113479&r2=113480&view=diff ============================================================================== --- cfe/trunk/lib/Checker/CStringChecker.cpp (original) +++ cfe/trunk/lib/Checker/CStringChecker.cpp Thu Sep 9 05:51:37 2010 @@ -193,7 +193,7 @@ DefinedOrUnknownSVal Size = cast(Extent); // Get the index of the accessed element. - DefinedOrUnknownSVal &Idx = cast(ER->getIndex()); + DefinedOrUnknownSVal Idx = cast(ER->getIndex()); const GRState *StInBound = state->AssumeInBound(Idx, Size, true); const GRState *StOutBound = state->AssumeInBound(Idx, Size, false); Modified: cfe/trunk/lib/Checker/ReturnPointerRangeChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/ReturnPointerRangeChecker.cpp?rev=113480&r1=113479&r2=113480&view=diff ============================================================================== --- cfe/trunk/lib/Checker/ReturnPointerRangeChecker.cpp (original) +++ cfe/trunk/lib/Checker/ReturnPointerRangeChecker.cpp Thu Sep 9 05:51:37 2010 @@ -59,7 +59,7 @@ if (!ER) return; - DefinedOrUnknownSVal &Idx = cast(ER->getIndex()); + DefinedOrUnknownSVal Idx = cast(ER->getIndex()); // FIXME: All of this out-of-bounds checking should eventually be refactored // into a common place. From akyrtzi at gmail.com Thu Sep 9 06:28:23 2010 From: akyrtzi at gmail.com (Argyrios Kyrtzidis) Date: Thu, 09 Sep 2010 11:28:23 -0000 Subject: [cfe-commits] r113481 - in /cfe/trunk: include/clang/AST/DeclTemplate.h lib/AST/Decl.cpp lib/Serialization/ASTReaderDecl.cpp lib/Serialization/ASTWriterDecl.cpp Message-ID: <20100909112823.5723C2A6C12C@llvm.org> Author: akirtzidis Date: Thu Sep 9 06:28:23 2010 New Revision: 113481 URL: http://llvm.org/viewvc/llvm-project?rev=113481&view=rev Log: Fix C++ PCH issue. Another beating by boost in this test case: http://llvm.org/PR8117 A function specialization wasn't properly initialized if it wasn't canonical. I wish there was a nice little test case but this was boost. Modified: cfe/trunk/include/clang/AST/DeclTemplate.h cfe/trunk/lib/AST/Decl.cpp cfe/trunk/lib/Serialization/ASTReaderDecl.cpp cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Modified: cfe/trunk/include/clang/AST/DeclTemplate.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclTemplate.h?rev=113481&r1=113480&r2=113481&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/DeclTemplate.h (original) +++ cfe/trunk/include/clang/AST/DeclTemplate.h Thu Sep 9 06:28:23 2010 @@ -292,7 +292,31 @@ /// which is a FunctionDecl that has been explicitly specialization or /// instantiated from a function template. class FunctionTemplateSpecializationInfo : public llvm::FoldingSetNode { + FunctionTemplateSpecializationInfo(FunctionDecl *FD, + FunctionTemplateDecl *Template, + TemplateSpecializationKind TSK, + const TemplateArgumentList *TemplateArgs, + const TemplateArgumentListInfo *TemplateArgsAsWritten, + SourceLocation POI) + : Function(FD), + Template(Template, TSK - 1), + TemplateArguments(TemplateArgs), + TemplateArgumentsAsWritten(TemplateArgsAsWritten), + PointOfInstantiation(POI) { } + public: + static FunctionTemplateSpecializationInfo * + Create(ASTContext &C, FunctionDecl *FD, FunctionTemplateDecl *Template, + TemplateSpecializationKind TSK, + const TemplateArgumentList *TemplateArgs, + const TemplateArgumentListInfo *TemplateArgsAsWritten, + SourceLocation POI) { + return new (C) FunctionTemplateSpecializationInfo(FD, Template, TSK, + TemplateArgs, + TemplateArgsAsWritten, + POI); + } + /// \brief The function template specialization that this structure /// describes. FunctionDecl *Function; Modified: cfe/trunk/lib/AST/Decl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=113481&r1=113480&r2=113481&view=diff ============================================================================== --- cfe/trunk/lib/AST/Decl.cpp (original) +++ cfe/trunk/lib/AST/Decl.cpp Thu Sep 9 06:28:23 2010 @@ -1376,14 +1376,10 @@ FunctionTemplateSpecializationInfo *Info = TemplateOrSpecialization.dyn_cast(); if (!Info) - Info = new (C) FunctionTemplateSpecializationInfo; - - Info->Function = this; - Info->Template.setPointer(Template); - Info->Template.setInt(TSK - 1); - Info->TemplateArguments = TemplateArgs; - Info->TemplateArgumentsAsWritten = TemplateArgsAsWritten; - Info->PointOfInstantiation = PointOfInstantiation; + Info = FunctionTemplateSpecializationInfo::Create(C, this, Template, TSK, + TemplateArgs, + TemplateArgsAsWritten, + PointOfInstantiation); TemplateOrSpecialization = Info; // Insert this function template specialization into the set of known Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=113481&r1=113480&r2=113481&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original) +++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Thu Sep 9 06:28:23 2010 @@ -280,25 +280,32 @@ SourceLocation POI = Reader.ReadSourceLocation(Record, Idx); - if (FD->isCanonicalDecl()) { // if canonical add to template's set. - ASTContext &C = *Reader.getContext(); - TemplateArgumentList *TemplArgList - = new (C) TemplateArgumentList(C, TemplArgs.data(), TemplArgs.size()); - TemplateArgumentListInfo *TemplArgsInfo - = new (C) TemplateArgumentListInfo(LAngleLoc, RAngleLoc); - for (unsigned i=0, e = TemplArgLocs.size(); i != e; ++i) - TemplArgsInfo->addArgument(TemplArgLocs[i]); + ASTContext &C = *Reader.getContext(); + TemplateArgumentList *TemplArgList + = new (C) TemplateArgumentList(C, TemplArgs.data(), TemplArgs.size()); + TemplateArgumentListInfo *TemplArgsInfo + = new (C) TemplateArgumentListInfo(LAngleLoc, RAngleLoc); + for (unsigned i=0, e = TemplArgLocs.size(); i != e; ++i) + TemplArgsInfo->addArgument(TemplArgLocs[i]); + FunctionTemplateSpecializationInfo *FTInfo + = FunctionTemplateSpecializationInfo::Create(C, FD, Template, TSK, + TemplArgList, + TemplArgsInfo, POI); + FD->TemplateOrSpecialization = FTInfo; + if (FD->isCanonicalDecl()) { // if canonical add to template's set. + // Get the InsertPos by FindNodeOrInsertPos() instead of calling + // InsertNode(FTInfo) directly to avoid the getASTContext() call in + // FunctionTemplateSpecializationInfo's Profile(). + // We avoid getASTContext because a decl in the parent hierarchy may + // be initializing. llvm::FoldingSetNodeID ID; FunctionTemplateSpecializationInfo::Profile(ID, TemplArgs.data(), TemplArgs.size(), C); void *InsertPos = 0; - FunctionTemplateSpecializationInfo *PrevFTInfo = - Template->getSpecializations().FindNodeOrInsertPos(ID, InsertPos); - (void)PrevFTInfo; - assert(!PrevFTInfo && "Another specialization already inserted!"); - FD->setFunctionTemplateSpecialization(C, Template, TemplArgList, InsertPos, - TSK, TemplArgsInfo, POI); + Template->getSpecializations().FindNodeOrInsertPos(ID, InsertPos); + assert(InsertPos && "Another specialization already inserted!"); + Template->getSpecializations().InsertNode(FTInfo, InsertPos); } break; } Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=113481&r1=113480&r2=113481&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original) +++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Thu Sep 9 06:28:23 2010 @@ -237,8 +237,7 @@ case FunctionDecl::TK_FunctionTemplateSpecialization: { FunctionTemplateSpecializationInfo * FTSInfo = D->getTemplateSpecializationInfo(); - // We want it canonical to guarantee that it has a Common*. - Writer.AddDeclRef(FTSInfo->getTemplate()->getCanonicalDecl(), Record); + Writer.AddDeclRef(FTSInfo->getTemplate(), Record); Record.push_back(FTSInfo->getTemplateSpecializationKind()); // Template arguments. From benny.kra at googlemail.com Thu Sep 9 07:27:34 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Thu, 09 Sep 2010 12:27:34 -0000 Subject: [cfe-commits] r113482 - /cfe/trunk/lib/Checker/GRExprEngine.cpp Message-ID: <20100909122734.45C3D2A6C12C@llvm.org> Author: d0k Date: Thu Sep 9 07:27:34 2010 New Revision: 113482 URL: http://llvm.org/viewvc/llvm-project?rev=113482&view=rev Log: Remove unused variable. Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=113482&r1=113481&r2=113482&view=diff ============================================================================== --- cfe/trunk/lib/Checker/GRExprEngine.cpp (original) +++ cfe/trunk/lib/Checker/GRExprEngine.cpp Thu Sep 9 07:27:34 2010 @@ -3356,7 +3356,6 @@ I2 != E2; ++I2) { const GRState *state = GetState(*I2); - const GRState *OldSt = state; SVal RightV = state->getSVal(RHS); BinaryOperator::Opcode Op = B->getOpcode(); From hhinnant at apple.com Thu Sep 9 08:58:34 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Thu, 09 Sep 2010 13:58:34 -0000 Subject: [cfe-commits] [libcxx] r113487 - /libcxx/trunk/include/type_traits Message-ID: <20100909135834.D03D72A6C12C@llvm.org> Author: hhinnant Date: Thu Sep 9 08:58:34 2010 New Revision: 113487 URL: http://llvm.org/viewvc/llvm-project?rev=113487&view=rev Log: Yonggang Luo fixed gcc version checking for type_traits support. Modified: libcxx/trunk/include/type_traits Modified: libcxx/trunk/include/type_traits URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=113487&r1=113486&r2=113487&view=diff ============================================================================== --- libcxx/trunk/include/type_traits (original) +++ libcxx/trunk/include/type_traits Thu Sep 9 08:58:34 2010 @@ -264,28 +264,32 @@ template struct is_reference<_Tp&&> : public true_type {}; #endif +#if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +#define _LIBCPP_HAS_TYPE_TRAITS +#endif + // is_union -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct is_union : public integral_constant {}; -#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#else // _LIBCPP_HAS_TYPE_TRAITS template struct __libcpp_union : public false_type {}; template struct is_union : public __libcpp_union::type> {}; -#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#endif // _LIBCPP_HAS_TYPE_TRAITS // is_class -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct is_class : public integral_constant {}; -#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#else // _LIBCPP_HAS_TYPE_TRAITS namespace __is_class_imp { @@ -296,7 +300,7 @@ template struct is_class : public integral_constant(0)) == 1 && !is_union<_Tp>::value> {}; -#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#endif // _LIBCPP_HAS_TYPE_TRAITS // is_function @@ -342,12 +346,12 @@ // is_enum -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct is_enum : public integral_constant {}; -#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#else // _LIBCPP_HAS_TYPE_TRAITS template struct is_enum : public integral_constant::value && @@ -361,7 +365,7 @@ !is_class<_Tp>::value && !is_function<_Tp>::value > {}; -#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#endif // _LIBCPP_HAS_TYPE_TRAITS // is_arithmetic @@ -742,12 +746,12 @@ // has_trivial_default_constructor -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct has_trivial_default_constructor : public integral_constant {}; -#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#else // _LIBCPP_HAS_TYPE_TRAITS template struct __has_trivial_default_constructor : public integral_constant::value> {}; @@ -755,52 +759,50 @@ template struct has_trivial_default_constructor : public __has_trivial_default_constructor::type> {}; -#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#endif // _LIBCPP_HAS_TYPE_TRAITS // has_nothrow_default_constructor -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct has_nothrow_default_constructor : public integral_constant {}; -#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#else // _LIBCPP_HAS_TYPE_TRAITS template struct has_nothrow_default_constructor : public has_trivial_default_constructor<_Tp> {}; -#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#endif // _LIBCPP_HAS_TYPE_TRAITS // has_trivial_copy_constructor -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct has_trivial_copy_constructor : public integral_constant {}; -#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#else // _LIBCPP_HAS_TYPE_TRAITS template struct has_trivial_copy_constructor : public integral_constant::value || is_reference<_Tp>::value> {}; - -#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#endif // _LIBCPP_HAS_TYPE_TRAITS // has_nothrow_copy_constructor -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct has_nothrow_copy_constructor : public integral_constant {}; -#else // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) +#else // _LIBCPP_HAS_TYPE_TRAITS template struct has_nothrow_copy_constructor : public has_trivial_copy_constructor<_Tp> {}; -#endif // __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 || defined(__clang__) - +#endif // _LIBCPP_HAS_TYPE_TRAITS // has_nothrow_move_constructor @@ -808,41 +810,41 @@ // has_trivial_copy_assign -#if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct has_trivial_copy_assign : public integral_constant {}; -#else +#else // _LIBCPP_HAS_TYPE_TRAITS template struct has_trivial_copy_assign : public integral_constant::value && !is_const<_Tp>::value> {}; -#endif // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#endif // _LIBCPP_HAS_TYPE_TRAITS // has_nothrow_copy_assign -#if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct has_nothrow_copy_assign : public integral_constant {}; -#else // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#else // _LIBCPP_HAS_TYPE_TRAITS template struct has_nothrow_copy_assign : public has_trivial_copy_assign<_Tp> {}; -#endif // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#endif // _LIBCPP_HAS_TYPE_TRAITS // has_trivial_destructor -#if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct has_trivial_destructor : public integral_constant {}; -#else // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#else // _LIBCPP_HAS_TYPE_TRAITS template struct __libcpp_trivial_destructor : public integral_constant::value || @@ -851,36 +853,36 @@ template struct has_trivial_destructor : public __libcpp_trivial_destructor::type> {}; -#endif // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#endif // _LIBCPP_HAS_TYPE_TRAITS // has_virtual_destructor -#if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct has_virtual_destructor : public integral_constant {}; -#else // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#else // _LIBCPP_HAS_TYPE_TRAITS template struct has_virtual_destructor : public false_type {}; -#endif // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#endif // _LIBCPP_HAS_TYPE_TRAITS // is_pod -#if defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#ifdef _LIBCPP_HAS_TYPE_TRAITS template struct is_pod : public integral_constant {}; -#else // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#else // _LIBCPP_HAS_TYPE_TRAITS template struct is_pod : public integral_constant::value && has_trivial_copy_constructor<_Tp>::value && has_trivial_copy_assign<_Tp>::value && has_trivial_destructor<_Tp>::value> {}; -#endif // defined(__clang__) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#endif // _LIBCPP_HAS_TYPE_TRAITS // alignment_of From dgregor at apple.com Thu Sep 9 10:44:59 2010 From: dgregor at apple.com (Douglas Gregor) Date: Thu, 09 Sep 2010 15:44:59 -0000 Subject: [cfe-commits] r113489 - in /cfe/trunk: lib/Analysis/CMakeLists.txt lib/Checker/CMakeLists.txt lib/CodeGen/CMakeLists.txt lib/Driver/CMakeLists.txt lib/Frontend/CMakeLists.txt lib/FrontendTool/CMakeLists.txt lib/Index/CMakeLists.txt lib/Rewrite/CMakeLists.txt lib/Serialization/CMakeLists.txt tools/c-index-test/CMakeLists.txt tools/libclang/CMakeLists.txt Message-ID: <20100909154459.2BAA42A6C12C@llvm.org> Author: dgregor Date: Thu Sep 9 10:44:58 2010 New Revision: 113489 URL: http://llvm.org/viewvc/llvm-project?rev=113489&view=rev Log: Clean up CMake dependencies Modified: cfe/trunk/lib/Analysis/CMakeLists.txt cfe/trunk/lib/Checker/CMakeLists.txt cfe/trunk/lib/CodeGen/CMakeLists.txt cfe/trunk/lib/Driver/CMakeLists.txt cfe/trunk/lib/Frontend/CMakeLists.txt cfe/trunk/lib/FrontendTool/CMakeLists.txt cfe/trunk/lib/Index/CMakeLists.txt cfe/trunk/lib/Rewrite/CMakeLists.txt cfe/trunk/lib/Serialization/CMakeLists.txt cfe/trunk/tools/c-index-test/CMakeLists.txt cfe/trunk/tools/libclang/CMakeLists.txt Modified: cfe/trunk/lib/Analysis/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CMakeLists.txt?rev=113489&r1=113488&r2=113489&view=diff ============================================================================== --- cfe/trunk/lib/Analysis/CMakeLists.txt (original) +++ cfe/trunk/lib/Analysis/CMakeLists.txt Thu Sep 9 10:44:58 2010 @@ -1,5 +1,7 @@ set(LLVM_NO_RTTI 1) +set(LLVM_USED_LIBS clangBasic clangAST clangIndex) + add_clang_library(clangAnalysis AnalysisContext.cpp CFG.cpp Modified: cfe/trunk/lib/Checker/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/CMakeLists.txt?rev=113489&r1=113488&r2=113489&view=diff ============================================================================== --- cfe/trunk/lib/Checker/CMakeLists.txt (original) +++ cfe/trunk/lib/Checker/CMakeLists.txt Thu Sep 9 10:44:58 2010 @@ -1,5 +1,7 @@ set(LLVM_NO_RTTI 1) +set(LLVM_USED_LIBS clangBasic clangLex clangAST clangFrontend clangRewrite) + add_clang_library(clangChecker AdjustedReturnValueChecker.cpp AggExprVisitor.cpp Modified: cfe/trunk/lib/CodeGen/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CMakeLists.txt?rev=113489&r1=113488&r2=113489&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CMakeLists.txt (original) +++ cfe/trunk/lib/CodeGen/CMakeLists.txt Thu Sep 9 10:44:58 2010 @@ -1,5 +1,7 @@ set(LLVM_NO_RTTI 1) +set(LLVM_USED_LIBS clangBasic clangAST clangFrontend) + add_clang_library(clangCodeGen BackendUtil.cpp CGBlocks.cpp Modified: cfe/trunk/lib/Driver/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CMakeLists.txt?rev=113489&r1=113488&r2=113489&view=diff ============================================================================== --- cfe/trunk/lib/Driver/CMakeLists.txt (original) +++ cfe/trunk/lib/Driver/CMakeLists.txt Thu Sep 9 10:44:58 2010 @@ -1,5 +1,7 @@ set(LLVM_NO_RTTI 1) +set(LLVM_USED_LIBS clangBasic clangAST clangParse) + add_clang_library(clangDriver Action.cpp Arg.cpp Modified: cfe/trunk/lib/Frontend/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CMakeLists.txt?rev=113489&r1=113488&r2=113489&view=diff ============================================================================== --- cfe/trunk/lib/Frontend/CMakeLists.txt (original) +++ cfe/trunk/lib/Frontend/CMakeLists.txt Thu Sep 9 10:44:58 2010 @@ -1,14 +1,9 @@ set(LLVM_NO_RTTI 1) set( LLVM_USED_LIBS - clangSerialization - clangCodeGen + clangDriver clangParse clangSema - clangChecker - clangAnalysis - clangIndex - clangRewrite clangAST clangLex clangBasic Modified: cfe/trunk/lib/FrontendTool/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/FrontendTool/CMakeLists.txt?rev=113489&r1=113488&r2=113489&view=diff ============================================================================== --- cfe/trunk/lib/FrontendTool/CMakeLists.txt (original) +++ cfe/trunk/lib/FrontendTool/CMakeLists.txt Thu Sep 9 10:44:58 2010 @@ -1,5 +1,8 @@ set(LLVM_NO_RTTI 1) +set(LLVM_USED_LIBS clangDriver clangFrontend clangRewrite clangCodeGen + clangChecker) + add_clang_library(clangFrontendTool ExecuteCompilerInvocation.cpp ) Modified: cfe/trunk/lib/Index/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/CMakeLists.txt?rev=113489&r1=113488&r2=113489&view=diff ============================================================================== --- cfe/trunk/lib/Index/CMakeLists.txt (original) +++ cfe/trunk/lib/Index/CMakeLists.txt Thu Sep 9 10:44:58 2010 @@ -1,5 +1,7 @@ set(LLVM_NO_RTTI 1) +set(LLVM_USED_LIBS clangBasic clangLex clangAST) + set( LLVM_USED_LIBS clangSerialization clangFrontend @@ -27,3 +29,6 @@ Program.cpp SelectorMap.cpp ) + +add_dependencies(clangIndex ClangAttrClasses ClangAttrList + ClangDeclNodes ClangStmtNodes) Modified: cfe/trunk/lib/Rewrite/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/CMakeLists.txt?rev=113489&r1=113488&r2=113489&view=diff ============================================================================== --- cfe/trunk/lib/Rewrite/CMakeLists.txt (original) +++ cfe/trunk/lib/Rewrite/CMakeLists.txt Thu Sep 9 10:44:58 2010 @@ -1,6 +1,6 @@ set(LLVM_NO_RTTI 1) -set(LLVM_USED_LIBS clangBasic) +set(LLVM_USED_LIBS clangBasic clangAST clangParse clangFrontend) add_clang_library(clangRewrite DeltaTree.cpp Modified: cfe/trunk/lib/Serialization/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/CMakeLists.txt?rev=113489&r1=113488&r2=113489&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/CMakeLists.txt (original) +++ cfe/trunk/lib/Serialization/CMakeLists.txt Thu Sep 9 10:44:58 2010 @@ -1,5 +1,7 @@ set(LLVM_NO_RTTI 1) +set(LLVM_USED_LIBS clangFrontend) + add_clang_library(clangSerialization GeneratePCH.cpp ASTCommon.cpp Modified: cfe/trunk/tools/c-index-test/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/CMakeLists.txt?rev=113489&r1=113488&r2=113489&view=diff ============================================================================== --- cfe/trunk/tools/c-index-test/CMakeLists.txt (original) +++ cfe/trunk/tools/c-index-test/CMakeLists.txt Thu Sep 9 10:44:58 2010 @@ -1,18 +1,6 @@ set(LLVM_NO_RTTI 1) -set( LLVM_USED_LIBS - libclang - clangIndex - clangFrontend - clangDriver - clangSerialization - clangParse - clangSema - clangAnalysis - clangAST - clangLex - clangBasic - ) +set(LLVM_USED_LIBS libclang) set( LLVM_LINK_COMPONENTS bitreader Modified: cfe/trunk/tools/libclang/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CMakeLists.txt?rev=113489&r1=113488&r2=113489&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CMakeLists.txt (original) +++ cfe/trunk/tools/libclang/CMakeLists.txt Thu Sep 9 10:44:58 2010 @@ -6,9 +6,8 @@ clangFrontend clangDriver clangSerialization - clangParse + clangIndex clangSema - clangAnalysis clangAST clangLex clangBasic) From dgregor at apple.com Thu Sep 9 11:14:45 2010 From: dgregor at apple.com (Douglas Gregor) Date: Thu, 09 Sep 2010 16:14:45 -0000 Subject: [cfe-commits] r113492 - in /cfe/trunk: include/clang/AST/ExprCXX.h include/clang/AST/RecursiveASTVisitor.h include/clang/Sema/Sema.h lib/AST/ExprCXX.cpp lib/Parse/ParseExprCXX.cpp lib/Sema/SemaExprCXX.cpp lib/Sema/TreeTransform.h lib/Serialization/ASTReaderStmt.cpp lib/Serialization/ASTWriterStmt.cpp test/Index/load-stmts.cpp tools/libclang/CIndex.cpp Message-ID: <20100909161445.564D12A6C12C@llvm.org> Author: dgregor Date: Thu Sep 9 11:14:44 2010 New Revision: 113492 URL: http://llvm.org/viewvc/llvm-project?rev=113492&view=rev Log: Add proper type-source information to UnaryTypeTraitExpr, including libclang visitation. Modified: cfe/trunk/include/clang/AST/ExprCXX.h cfe/trunk/include/clang/AST/RecursiveASTVisitor.h cfe/trunk/include/clang/Sema/Sema.h cfe/trunk/lib/AST/ExprCXX.cpp cfe/trunk/lib/Parse/ParseExprCXX.cpp cfe/trunk/lib/Sema/SemaExprCXX.cpp cfe/trunk/lib/Sema/TreeTransform.h cfe/trunk/lib/Serialization/ASTReaderStmt.cpp cfe/trunk/lib/Serialization/ASTWriterStmt.cpp cfe/trunk/test/Index/load-stmts.cpp cfe/trunk/tools/libclang/CIndex.cpp Modified: cfe/trunk/include/clang/AST/ExprCXX.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=113492&r1=113491&r2=113492&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/ExprCXX.h (original) +++ cfe/trunk/include/clang/AST/ExprCXX.h Thu Sep 9 11:14:44 2010 @@ -1378,24 +1378,28 @@ /// RParen - The location of the closing paren. SourceLocation RParen; - /// QueriedType - The type we're testing. - QualType QueriedType; + TypeSourceInfo *QueriedType; public: - UnaryTypeTraitExpr(SourceLocation loc, UnaryTypeTrait utt, QualType queried, + UnaryTypeTraitExpr(SourceLocation loc, UnaryTypeTrait utt, + TypeSourceInfo *queried, SourceLocation rparen, QualType ty) - : Expr(UnaryTypeTraitExprClass, ty, false, queried->isDependentType()), + : Expr(UnaryTypeTraitExprClass, ty, false, + queried->getType()->isDependentType()), UTT(utt), Loc(loc), RParen(rparen), QueriedType(queried) { } explicit UnaryTypeTraitExpr(EmptyShell Empty) - : Expr(UnaryTypeTraitExprClass, Empty), UTT((UnaryTypeTrait)0) { } + : Expr(UnaryTypeTraitExprClass, Empty), UTT((UnaryTypeTrait)0), + QueriedType() { } virtual SourceRange getSourceRange() const { return SourceRange(Loc, RParen);} UnaryTypeTrait getTrait() const { return UTT; } - QualType getQueriedType() const { return QueriedType; } + QualType getQueriedType() const { return QueriedType->getType(); } + TypeSourceInfo *getQueriedTypeSourceInfo() const { return QueriedType; } + bool EvaluateTrait(ASTContext&) const; static bool classof(const Stmt *T) { Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=113492&r1=113491&r2=113492&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original) +++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Thu Sep 9 11:14:44 2010 @@ -1782,7 +1782,7 @@ }) DEF_TRAVERSE_STMT(UnaryTypeTraitExpr, { - TRY_TO(TraverseType(S->getQueriedType())); + TRY_TO(TraverseTypeLoc(S->getQueriedTypeSourceInfo()->getTypeLoc())); }) // These exprs (most of them), do not need any action except iterating Modified: cfe/trunk/include/clang/Sema/Sema.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=113492&r1=113491&r2=113492&view=diff ============================================================================== --- cfe/trunk/include/clang/Sema/Sema.h (original) +++ cfe/trunk/include/clang/Sema/Sema.h Thu Sep 9 11:14:44 2010 @@ -2260,10 +2260,14 @@ /// pseudo-functions. ExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT, SourceLocation KWLoc, - SourceLocation LParen, ParsedType Ty, SourceLocation RParen); + ExprResult BuildUnaryTypeTrait(UnaryTypeTrait OTT, + SourceLocation KWLoc, + TypeSourceInfo *T, + SourceLocation RParen); + ExprResult ActOnStartCXXMemberReference(Scope *S, Expr *Base, SourceLocation OpLoc, Modified: cfe/trunk/lib/AST/ExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=113492&r1=113491&r2=113492&view=diff ============================================================================== --- cfe/trunk/lib/AST/ExprCXX.cpp (original) +++ cfe/trunk/lib/AST/ExprCXX.cpp Thu Sep 9 11:14:44 2010 @@ -328,30 +328,31 @@ } bool UnaryTypeTraitExpr::EvaluateTrait(ASTContext& C) const { + QualType T = getQueriedType(); switch(UTT) { default: assert(false && "Unknown type trait or not implemented"); - case UTT_IsPOD: return QueriedType->isPODType(); - case UTT_IsLiteral: return QueriedType->isLiteralType(); + case UTT_IsPOD: return T->isPODType(); + case UTT_IsLiteral: return T->isLiteralType(); case UTT_IsClass: // Fallthrough case UTT_IsUnion: - if (const RecordType *Record = QueriedType->getAs()) { + if (const RecordType *Record = T->getAs()) { bool Union = Record->getDecl()->isUnion(); return UTT == UTT_IsUnion ? Union : !Union; } return false; - case UTT_IsEnum: return QueriedType->isEnumeralType(); + case UTT_IsEnum: return T->isEnumeralType(); case UTT_IsPolymorphic: - if (const RecordType *Record = QueriedType->getAs()) { + if (const RecordType *Record = T->getAs()) { // Type traits are only parsed in C++, so we've got CXXRecords. return cast(Record->getDecl())->isPolymorphic(); } return false; case UTT_IsAbstract: - if (const RecordType *RT = QueriedType->getAs()) + if (const RecordType *RT = T->getAs()) return cast(RT->getDecl())->isAbstract(); return false; case UTT_IsEmpty: - if (const RecordType *Record = QueriedType->getAs()) { + if (const RecordType *Record = T->getAs()) { return !Record->getDecl()->isUnion() && cast(Record->getDecl())->isEmpty(); } @@ -361,10 +362,10 @@ // If __is_pod (type) is true then the trait is true, else if type is // a cv class or union type (or array thereof) with a trivial default // constructor ([class.ctor]) then the trait is true, else it is false. - if (QueriedType->isPODType()) + if (T->isPODType()) return true; if (const RecordType *RT = - C.getBaseElementType(QueriedType)->getAs()) + C.getBaseElementType(T)->getAs()) return cast(RT->getDecl())->hasTrivialConstructor(); return false; case UTT_HasTrivialCopy: @@ -373,9 +374,9 @@ // the trait is true, else if type is a cv class or union type // with a trivial copy constructor ([class.copy]) then the trait // is true, else it is false. - if (QueriedType->isPODType() || QueriedType->isReferenceType()) + if (T->isPODType() || T->isReferenceType()) return true; - if (const RecordType *RT = QueriedType->getAs()) + if (const RecordType *RT = T->getAs()) return cast(RT->getDecl())->hasTrivialCopyConstructor(); return false; case UTT_HasTrivialAssign: @@ -391,11 +392,11 @@ // errors if the copy assignment operator is actually used, q.v. // [class.copy]p12). - if (C.getBaseElementType(QueriedType).isConstQualified()) + if (C.getBaseElementType(T).isConstQualified()) return false; - if (QueriedType->isPODType()) + if (T->isPODType()) return true; - if (const RecordType *RT = QueriedType->getAs()) + if (const RecordType *RT = T->getAs()) return cast(RT->getDecl())->hasTrivialCopyAssignment(); return false; case UTT_HasTrivialDestructor: @@ -405,10 +406,10 @@ // type (or array thereof) with a trivial destructor // ([class.dtor]) then the trait is true, else it is // false. - if (QueriedType->isPODType() || QueriedType->isReferenceType()) + if (T->isPODType() || T->isReferenceType()) return true; if (const RecordType *RT = - C.getBaseElementType(QueriedType)->getAs()) + C.getBaseElementType(T)->getAs()) return cast(RT->getDecl())->hasTrivialDestructor(); return false; // TODO: Propagate nothrowness for implicitly declared special members. @@ -420,13 +421,13 @@ // or union type with copy assignment operators that are known // not to throw an exception then the trait is true, else it is // false. - if (C.getBaseElementType(QueriedType).isConstQualified()) + if (C.getBaseElementType(T).isConstQualified()) return false; - if (QueriedType->isReferenceType()) + if (T->isReferenceType()) return false; - if (QueriedType->isPODType()) + if (T->isPODType()) return true; - if (const RecordType *RT = QueriedType->getAs()) { + if (const RecordType *RT = T->getAs()) { CXXRecordDecl* RD = cast(RT->getDecl()); if (RD->hasTrivialCopyAssignment()) return true; @@ -458,9 +459,9 @@ // if type is a cv class or union type with copy constructors that are // known not to throw an exception then the trait is true, else it is // false. - if (QueriedType->isPODType() || QueriedType->isReferenceType()) + if (T->isPODType() || T->isReferenceType()) return true; - if (const RecordType *RT = QueriedType->getAs()) { + if (const RecordType *RT = T->getAs()) { CXXRecordDecl *RD = cast(RT->getDecl()); if (RD->hasTrivialCopyConstructor()) return true; @@ -469,8 +470,7 @@ bool AllNoThrow = true; unsigned FoundTQs; DeclarationName ConstructorName - = C.DeclarationNames.getCXXConstructorName( - C.getCanonicalType(QueriedType)); + = C.DeclarationNames.getCXXConstructorName(C.getCanonicalType(T)); DeclContext::lookup_const_iterator Con, ConEnd; for (llvm::tie(Con, ConEnd) = RD->lookup(ConstructorName); Con != ConEnd; ++Con) { @@ -495,10 +495,9 @@ // true, else if type is a cv class or union type (or array // thereof) with a default constructor that is known not to // throw an exception then the trait is true, else it is false. - if (QueriedType->isPODType()) + if (T->isPODType()) return true; - if (const RecordType *RT = - C.getBaseElementType(QueriedType)->getAs()) { + if (const RecordType *RT = C.getBaseElementType(T)->getAs()) { CXXRecordDecl *RD = cast(RT->getDecl()); if (RD->hasTrivialConstructor()) return true; @@ -517,7 +516,7 @@ // http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html: // If type is a class type with a virtual destructor ([class.dtor]) // then the trait is true, else it is false. - if (const RecordType *Record = QueriedType->getAs()) { + if (const RecordType *Record = T->getAs()) { CXXRecordDecl *RD = cast(Record->getDecl()); if (CXXDestructorDecl *Destructor = RD->getDestructor()) return Destructor->isVirtual(); Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=113492&r1=113491&r2=113492&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original) +++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Thu Sep 9 11:14:44 2010 @@ -1832,7 +1832,7 @@ if (Ty.isInvalid()) return ExprError(); - return Actions.ActOnUnaryTypeTrait(UTT, Loc, LParen, Ty.get(), RParen); + return Actions.ActOnUnaryTypeTrait(UTT, Loc, Ty.get(), RParen); } /// ParseCXXAmbiguousParenExpression - We have parsed the left paren of a Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=113492&r1=113491&r2=113492&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Thu Sep 9 11:14:44 2010 @@ -1982,12 +1982,23 @@ } ExprResult Sema::ActOnUnaryTypeTrait(UnaryTypeTrait OTT, - SourceLocation KWLoc, - SourceLocation LParen, - ParsedType Ty, - SourceLocation RParen) { - QualType T = GetTypeFromParser(Ty); + SourceLocation KWLoc, + ParsedType Ty, + SourceLocation RParen) { + TypeSourceInfo *TSInfo; + QualType T = GetTypeFromParser(Ty, &TSInfo); + + if (!TSInfo) + TSInfo = Context.getTrivialTypeSourceInfo(T); + return BuildUnaryTypeTrait(OTT, KWLoc, TSInfo, RParen); +} +ExprResult Sema::BuildUnaryTypeTrait(UnaryTypeTrait OTT, + SourceLocation KWLoc, + TypeSourceInfo *TSInfo, + SourceLocation RParen) { + QualType T = TSInfo->getType(); + // According to http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html // all traits except __is_class, __is_enum and __is_union require a the type // to be complete, an array of unknown bound, or void. @@ -2004,7 +2015,7 @@ // There is no point in eagerly computing the value. The traits are designed // to be used from type trait templates, so Ty will be a template parameter // 99% of the time. - return Owned(new (Context) UnaryTypeTraitExpr(KWLoc, OTT, T, + return Owned(new (Context) UnaryTypeTraitExpr(KWLoc, OTT, TSInfo, RParen, Context.BoolTy)); } Modified: cfe/trunk/lib/Sema/TreeTransform.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=113492&r1=113491&r2=113492&view=diff ============================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h (original) +++ cfe/trunk/lib/Sema/TreeTransform.h Thu Sep 9 11:14:44 2010 @@ -1643,12 +1643,10 @@ /// By default, performs semantic analysis to build the new expression. /// Subclasses may override this routine to provide different behavior. ExprResult RebuildUnaryTypeTrait(UnaryTypeTrait Trait, - SourceLocation StartLoc, - SourceLocation LParenLoc, - QualType T, - SourceLocation RParenLoc) { - return getSema().ActOnUnaryTypeTrait(Trait, StartLoc, LParenLoc, - ParsedType::make(T), RParenLoc); + SourceLocation StartLoc, + TypeSourceInfo *T, + SourceLocation RParenLoc) { + return getSema().BuildUnaryTypeTrait(Trait, StartLoc, T, RParenLoc); } /// \brief Build a new (previously unresolved) declaration reference @@ -5614,23 +5612,16 @@ template ExprResult TreeTransform::TransformUnaryTypeTraitExpr(UnaryTypeTraitExpr *E) { - TemporaryBase Rebase(*this, /*FIXME*/E->getLocStart(), DeclarationName()); - - QualType T = getDerived().TransformType(E->getQueriedType()); - if (T.isNull()) + TypeSourceInfo *T = getDerived().TransformType(E->getQueriedTypeSourceInfo()); + if (!T) return ExprError(); if (!getDerived().AlwaysRebuild() && - T == E->getQueriedType()) + T == E->getQueriedTypeSourceInfo()) return SemaRef.Owned(E->Retain()); - // FIXME: Bad location information - SourceLocation FakeLParenLoc - = SemaRef.PP.getLocForEndOfToken(E->getLocStart()); - return getDerived().RebuildUnaryTypeTrait(E->getTrait(), E->getLocStart(), - /*FIXME:*/FakeLParenLoc, T, E->getLocEnd()); } Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=113492&r1=113491&r2=113492&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original) +++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Thu Sep 9 11:14:44 2010 @@ -1249,7 +1249,7 @@ SourceRange Range = Reader.ReadSourceRange(Record, Idx); E->Loc = Range.getBegin(); E->RParen = Range.getEnd(); - E->QueriedType = Reader.GetType(Record[Idx++]); + E->QueriedType = Reader.GetTypeSourceInfo(DeclsCursor, Record, Idx); } Stmt *ASTReader::ReadStmt(llvm::BitstreamCursor &Cursor) { Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=113492&r1=113491&r2=113492&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original) +++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Thu Sep 9 11:14:44 2010 @@ -1279,7 +1279,7 @@ VisitExpr(E); Record.push_back(E->getTrait()); Writer.AddSourceRange(E->getSourceRange(), Record); - Writer.AddTypeRef(E->getQueriedType(), Record); + Writer.AddTypeSourceInfo(E->getQueriedTypeSourceInfo(), Record); Code = serialization::EXPR_CXX_UNARY_TYPE_TRAIT; } Modified: cfe/trunk/test/Index/load-stmts.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/load-stmts.cpp?rev=113492&r1=113491&r2=113492&view=diff ============================================================================== --- cfe/trunk/test/Index/load-stmts.cpp (original) +++ cfe/trunk/test/Index/load-stmts.cpp Thu Sep 9 11:14:44 2010 @@ -88,6 +88,7 @@ void test_even_more_dependent_exprs(T t, Y y) { typedef T type; (void)type(t, y); + (void)__has_nothrow_assign(type); } // RUN: c-index-test -test-load-source all %s | FileCheck %s @@ -195,3 +196,5 @@ // CHECK: load-stmts.cpp:90:9: TypeRef=type:89:13 Extent=[90:9 - 90:13] // CHECK: load-stmts.cpp:90:14: DeclRefExpr=t:88:39 Extent=[90:14 - 90:15] // CHECK: load-stmts.cpp:90:17: DeclRefExpr=y:88:44 Extent=[90:17 - 90:18] +// CHECK: load-stmts.cpp:91:9: UnexposedExpr= Extent=[91:9 - 91:35] +// CHECK: load-stmts.cpp:91:30: TypeRef=type:89:13 Extent=[91:30 - 91:34] Modified: cfe/trunk/tools/libclang/CIndex.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=113492&r1=113491&r2=113492&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CIndex.cpp (original) +++ cfe/trunk/tools/libclang/CIndex.cpp Thu Sep 9 11:14:44 2010 @@ -366,7 +366,6 @@ bool VisitCaseStmt(CaseStmt *S); bool VisitWhileStmt(WhileStmt *S); bool VisitForStmt(ForStmt *S); -// bool VisitSwitchCase(SwitchCase *S); // Expression visitors bool VisitDeclRefExpr(DeclRefExpr *E); @@ -385,12 +384,13 @@ // FIXME: InitListExpr (for the designators) // FIXME: DesignatedInitExpr bool VisitCXXTypeidExpr(CXXTypeidExpr *E); + bool VisitCXXUuidofExpr(CXXUuidofExpr *E); bool VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) { return false; } bool VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E); bool VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E); bool VisitCXXNewExpr(CXXNewExpr *E); bool VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E); - // FIXME: UnaryTypeTraitExpr has poor source-location information. + bool VisitUnaryTypeTraitExpr(UnaryTypeTraitExpr *E); bool VisitOverloadExpr(OverloadExpr *E); bool VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E); bool VisitCXXUnresolvedConstructExpr(CXXUnresolvedConstructExpr *E); @@ -1590,6 +1590,17 @@ return VisitExpr(E); } +bool CursorVisitor::VisitCXXUuidofExpr(CXXUuidofExpr *E) { + if (E->isTypeOperand()) { + if (TypeSourceInfo *TSInfo = E->getTypeOperandSourceInfo()) + return Visit(TSInfo->getTypeLoc()); + + return false; + } + + return VisitExpr(E); +} + bool CursorVisitor::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) { if (TypeSourceInfo *TSInfo = E->getTypeSourceInfo()) return Visit(TSInfo->getTypeLoc()); @@ -1651,6 +1662,10 @@ return false; } +bool CursorVisitor::VisitUnaryTypeTraitExpr(UnaryTypeTraitExpr *E) { + return Visit(E->getQueriedTypeSourceInfo()->getTypeLoc()); +} + bool CursorVisitor::VisitOverloadExpr(OverloadExpr *E) { // Visit the nested-name-specifier. if (NestedNameSpecifier *Qualifier = E->getQualifier()) From dgregor at apple.com Thu Sep 9 11:16:39 2010 From: dgregor at apple.com (Douglas Gregor) Date: Thu, 09 Sep 2010 16:16:39 -0000 Subject: [cfe-commits] r113493 - /cfe/trunk/test/Index/complete-hiding.c Message-ID: <20100909161639.485AF2A6C12C@llvm.org> Author: dgregor Date: Thu Sep 9 11:16:39 2010 New Revision: 113493 URL: http://llvm.org/viewvc/llvm-project?rev=113493&view=rev Log: Use temporary files for this test, to see if we can flush out an inexplicable error on Windows Modified: cfe/trunk/test/Index/complete-hiding.c Modified: cfe/trunk/test/Index/complete-hiding.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/complete-hiding.c?rev=113493&r1=113492&r2=113493&view=diff ============================================================================== --- cfe/trunk/test/Index/complete-hiding.c (original) +++ cfe/trunk/test/Index/complete-hiding.c Thu Sep 9 11:16:39 2010 @@ -16,14 +16,17 @@ struct StructA sa = { }; } -// RUN: c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: c-index-test -code-completion-at=%s:16:3 %s > %t +// RUN: FileCheck -check-prefix=CHECK-CC1 -input-file=%t %s // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: VarDecl:{ResultType int}{TypedText StructA} (8) // CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueA} (8) // CHECK-CC1-NOT: VarDecl:{ResultType int}{TypedText ValueA} (50) // CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueB} (50) -// RUN: c-index-test -code-completion-at=%s:16:10 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: c-index-test -code-completion-at=%s:16:10 %s > %t +// RUN: FileCheck -check-prefix=CHECK-CC2 -input-file=%t %s // CHECK-CC2: StructDecl:{TypedText StructA} (65) // CHECK-CC2-NOT: StructDecl:{TypedText StructB} (65) // CHECK-CC2: StructDecl:{TypedText StructC} (65) -// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:10 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:10 %s > %t +// RUN: FileCheck -check-prefix=CHECK-CC2 -input-file=%t %s From dgregor at apple.com Thu Sep 9 11:33:13 2010 From: dgregor at apple.com (Douglas Gregor) Date: Thu, 09 Sep 2010 16:33:13 -0000 Subject: [cfe-commits] r113495 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp lib/Parse/ParseExpr.cpp lib/Parse/ParseExprCXX.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaExprCXX.cpp lib/Sema/SemaOverload.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/TreeTransform.h Message-ID: <20100909163314.1DB8F2A6C12C@llvm.org> Author: dgregor Date: Thu Sep 9 11:33:13 2010 New Revision: 113495 URL: http://llvm.org/viewvc/llvm-project?rev=113495&view=rev Log: Eliminate the comma locations from all of the Sema routines that deal with comma-separated lists. We never actually used the comma locations, nor did we store them in the AST, but we did manage to waste time during template instantiation to produce fake locations. Modified: cfe/trunk/include/clang/Sema/Sema.h cfe/trunk/lib/Parse/ParseDecl.cpp cfe/trunk/lib/Parse/ParseDeclCXX.cpp cfe/trunk/lib/Parse/ParseExpr.cpp cfe/trunk/lib/Parse/ParseExprCXX.cpp cfe/trunk/lib/Sema/SemaDeclCXX.cpp cfe/trunk/lib/Sema/SemaExpr.cpp cfe/trunk/lib/Sema/SemaExprCXX.cpp cfe/trunk/lib/Sema/SemaOverload.cpp cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp cfe/trunk/lib/Sema/TreeTransform.h Modified: cfe/trunk/include/clang/Sema/Sema.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=113495&r1=113494&r2=113495&view=diff ============================================================================== --- cfe/trunk/include/clang/Sema/Sema.h (original) +++ cfe/trunk/include/clang/Sema/Sema.h Thu Sep 9 11:33:13 2010 @@ -1103,7 +1103,6 @@ UnresolvedLookupExpr *ULE, SourceLocation LParenLoc, Expr **Args, unsigned NumArgs, - SourceLocation *CommaLocs, SourceLocation RParenLoc); ExprResult CreateOverloadedUnaryOp(SourceLocation OpLoc, @@ -1123,12 +1122,10 @@ ExprResult BuildCallToMemberFunction(Scope *S, Expr *MemExpr, SourceLocation LParenLoc, Expr **Args, - unsigned NumArgs, SourceLocation *CommaLocs, - SourceLocation RParenLoc); + unsigned NumArgs, SourceLocation RParenLoc); ExprResult BuildCallToObjectOfClassType(Scope *S, Expr *Object, SourceLocation LParenLoc, Expr **Args, unsigned NumArgs, - SourceLocation *CommaLocs, SourceLocation RParenLoc); ExprResult BuildOverloadedArrowExpr(Scope *S, Expr *Base, @@ -1809,8 +1806,7 @@ /// This provides the location of the left/right parens and a list of comma /// locations. ExprResult ActOnCallExpr(Scope *S, Expr *Fn, SourceLocation LParenLoc, - MultiExprArg Args, SourceLocation *CommaLocs, - SourceLocation RParenLoc); + MultiExprArg Args, SourceLocation RParenLoc); ExprResult BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, SourceLocation LParenLoc, Expr **Args, unsigned NumArgs, @@ -2015,7 +2011,6 @@ void AddCXXDirectInitializerToDecl(Decl *Dcl, SourceLocation LParenLoc, MultiExprArg Exprs, - SourceLocation *CommaLocs, SourceLocation RParenLoc); /// InitializeVarWithConstructor - Creates an CXXConstructExpr @@ -2198,7 +2193,6 @@ ExprResult ActOnCXXTypeConstructExpr(ParsedType TypeRep, SourceLocation LParenLoc, MultiExprArg Exprs, - SourceLocation *CommaLocs, SourceLocation RParenLoc); ExprResult BuildCXXTypeConstructExpr(TypeSourceInfo *Type, @@ -2464,7 +2458,6 @@ SourceLocation IdLoc, SourceLocation LParenLoc, Expr **Args, unsigned NumArgs, - SourceLocation *CommaLocs, SourceLocation RParenLoc); MemInitResult BuildMemberInitializer(FieldDecl *Member, Expr **Args, Modified: cfe/trunk/lib/Parse/ParseDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=113495&r1=113494&r2=113495&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseDecl.cpp (original) +++ cfe/trunk/lib/Parse/ParseDecl.cpp Thu Sep 9 11:33:13 2010 @@ -650,7 +650,7 @@ Actions.AddCXXDirectInitializerToDecl(ThisDecl, LParenLoc, move_arg(Exprs), - CommaLocs.data(), RParenLoc); + RParenLoc); } } else { bool TypeContainsUndeducedAuto = Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=113495&r1=113494&r2=113495&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original) +++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Thu Sep 9 11:33:13 2010 @@ -1811,8 +1811,7 @@ return Actions.ActOnMemInitializer(ConstructorDecl, getCurScope(), SS, II, TemplateTypeTy, IdLoc, LParenLoc, ArgExprs.take(), - ArgExprs.size(), CommaLocs.data(), - RParenLoc); + ArgExprs.size(), RParenLoc); } /// ParseExceptionSpecification - Parse a C++ exception-specification Modified: cfe/trunk/lib/Parse/ParseExpr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=113495&r1=113494&r2=113495&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseExpr.cpp (original) +++ cfe/trunk/lib/Parse/ParseExpr.cpp Thu Sep 9 11:33:13 2010 @@ -1023,8 +1023,7 @@ assert((ArgExprs.size() == 0 || ArgExprs.size()-1 == CommaLocs.size())&& "Unexpected number of commas!"); LHS = Actions.ActOnCallExpr(getCurScope(), LHS.take(), Loc, - move_arg(ArgExprs), CommaLocs.data(), - Tok.getLocation()); + move_arg(ArgExprs), Tok.getLocation()); } ConsumeParen(); Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=113495&r1=113494&r2=113495&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original) +++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Thu Sep 9 11:33:13 2010 @@ -742,7 +742,7 @@ assert((Exprs.size() == 0 || Exprs.size()-1 == CommaLocs.size())&& "Unexpected number of commas!"); return Actions.ActOnCXXTypeConstructExpr(TypeRep, LParenLoc, move_arg(Exprs), - CommaLocs.data(), RParenLoc); + RParenLoc); } /// ParseCXXCondition - if/switch/while condition expression. Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=113495&r1=113494&r2=113495&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Sep 9 11:33:13 2010 @@ -1063,7 +1063,6 @@ SourceLocation IdLoc, SourceLocation LParenLoc, ExprTy **Args, unsigned NumArgs, - SourceLocation *CommaLocs, SourceLocation RParenLoc) { if (!ConstructorD) return true; @@ -4644,8 +4643,8 @@ // Build the call to the assignment operator. ExprResult Call = S.BuildCallToMemberFunction(/*Scope=*/0, - OpEqualRef.takeAs(), - Loc, &From, 1, 0, Loc); + OpEqualRef.takeAs(), + Loc, &From, 1, Loc); if (Call.isInvalid()) return StmtError(); @@ -5156,20 +5155,17 @@ CallArgs.push_back(To.takeAs()); CallArgs.push_back(From.takeAs()); CallArgs.push_back(IntegerLiteral::Create(Context, Size, SizeType, Loc)); - llvm::SmallVector Commas; // FIXME: Silly - Commas.push_back(Loc); - Commas.push_back(Loc); ExprResult Call = ExprError(); if (NeedsCollectableMemCpy) Call = ActOnCallExpr(/*Scope=*/0, CollectableMemCpyRef, Loc, move_arg(CallArgs), - Commas.data(), Loc); + Loc); else Call = ActOnCallExpr(/*Scope=*/0, BuiltinMemCpyRef, Loc, move_arg(CallArgs), - Commas.data(), Loc); + Loc); assert(!Call.isInvalid() && "Call to __builtin_memcpy cannot fail!"); Statements.push_back(Call.takeAs()); @@ -5511,7 +5507,6 @@ void Sema::AddCXXDirectInitializerToDecl(Decl *RealDecl, SourceLocation LParenLoc, MultiExprArg Exprs, - SourceLocation *CommaLocs, SourceLocation RParenLoc) { assert(Exprs.size() != 0 && Exprs.get() && "missing expressions"); Modified: cfe/trunk/lib/Sema/SemaExpr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=113495&r1=113494&r2=113495&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExpr.cpp (original) +++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu Sep 9 11:33:13 2010 @@ -3020,8 +3020,7 @@ << FixItHint::CreateInsertion(Loc, "()"); ExprResult NewBase - = ActOnCallExpr(0, BaseExpr, Loc, - MultiExprArg(*this, 0, 0), 0, Loc); + = ActOnCallExpr(0, BaseExpr, Loc, MultiExprArg(*this, 0, 0), Loc); BaseExpr = 0; if (NewBase.isInvalid()) return ExprError(); @@ -3590,8 +3589,7 @@ /// locations. ExprResult Sema::ActOnCallExpr(Scope *S, Expr *Fn, SourceLocation LParenLoc, - MultiExprArg args, - SourceLocation *CommaLocs, SourceLocation RParenLoc) { + MultiExprArg args, SourceLocation RParenLoc) { unsigned NumArgs = args.size(); // Since this might be a postfix expression, get rid of ParenListExprs. @@ -3635,7 +3633,7 @@ // Determine whether this is a call to an object (C++ [over.call.object]). if (Fn->getType()->isRecordType()) return Owned(BuildCallToObjectOfClassType(S, Fn, LParenLoc, Args, NumArgs, - CommaLocs, RParenLoc)); + RParenLoc)); Expr *NakedFn = Fn->IgnoreParens(); @@ -3652,7 +3650,7 @@ (void)MemE; return BuildCallToMemberFunction(S, Fn, LParenLoc, Args, NumArgs, - CommaLocs, RParenLoc); + RParenLoc); } // Determine whether this is a call to a member function. @@ -3660,7 +3658,7 @@ NamedDecl *MemDecl = MemExpr->getMemberDecl(); if (isa(MemDecl)) return BuildCallToMemberFunction(S, Fn, LParenLoc, Args, NumArgs, - CommaLocs, RParenLoc); + RParenLoc); } // Determine whether this is a call to a pointer-to-member function. @@ -3702,7 +3700,7 @@ if (isa(NakedFn)) { UnresolvedLookupExpr *ULE = cast(NakedFn); return BuildOverloadedCallExpr(S, Fn, ULE, LParenLoc, Args, NumArgs, - CommaLocs, RParenLoc); + RParenLoc); } NamedDecl *NDecl = 0; Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=113495&r1=113494&r2=113495&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Thu Sep 9 11:33:13 2010 @@ -543,7 +543,6 @@ Sema::ActOnCXXTypeConstructExpr(ParsedType TypeRep, SourceLocation LParenLoc, MultiExprArg exprs, - SourceLocation *CommaLocs, SourceLocation RParenLoc) { if (!TypeRep) return ExprError(); @@ -2847,7 +2846,6 @@ MemExpr, /*LPLoc*/ ExpectedLParenLoc, MultiExprArg(), - /*CommaLocs*/ 0, /*RPLoc*/ ExpectedLParenLoc); } Modified: cfe/trunk/lib/Sema/SemaOverload.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=113495&r1=113494&r2=113495&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaOverload.cpp (original) +++ cfe/trunk/lib/Sema/SemaOverload.cpp Thu Sep 9 11:33:13 2010 @@ -6589,7 +6589,6 @@ UnresolvedLookupExpr *ULE, SourceLocation LParenLoc, Expr **Args, unsigned NumArgs, - SourceLocation *CommaLocs, SourceLocation RParenLoc) { CXXScopeSpec SS; @@ -6629,8 +6628,7 @@ // an expression with non-empty lookup results, which should never // end up here. return SemaRef.ActOnCallExpr(/*Scope*/ 0, NewFn.take(), LParenLoc, - MultiExprArg(Args, NumArgs), - CommaLocs, RParenLoc); + MultiExprArg(Args, NumArgs), RParenLoc); } /// ResolveOverloadedCallFn - Given the call expression that calls Fn @@ -6644,7 +6642,6 @@ Sema::BuildOverloadedCallExpr(Scope *S, Expr *Fn, UnresolvedLookupExpr *ULE, SourceLocation LParenLoc, Expr **Args, unsigned NumArgs, - SourceLocation *CommaLocs, SourceLocation RParenLoc) { #ifndef NDEBUG if (ULE->requiresADL()) { @@ -6675,7 +6672,7 @@ // bailout out if it fails. if (CandidateSet.empty()) return BuildRecoveryCallExpr(*this, S, Fn, ULE, LParenLoc, Args, NumArgs, - CommaLocs, RParenLoc); + RParenLoc); OverloadCandidateSet::iterator Best; switch (CandidateSet.BestViableFunction(*this, Fn->getLocStart(), Best)) { @@ -7269,8 +7266,7 @@ ExprResult Sema::BuildCallToMemberFunction(Scope *S, Expr *MemExprE, SourceLocation LParenLoc, Expr **Args, - unsigned NumArgs, SourceLocation *CommaLocs, - SourceLocation RParenLoc) { + unsigned NumArgs, SourceLocation RParenLoc) { // Dig out the member expression. This holds both the object // argument and the member function we're referring to. Expr *NakedMemExpr = MemExprE->IgnoreParens(); @@ -7415,7 +7411,6 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Object, SourceLocation LParenLoc, Expr **Args, unsigned NumArgs, - SourceLocation *CommaLocs, SourceLocation RParenLoc) { assert(Object->getType()->isRecordType() && "Requires object type argument"); const RecordType *Record = Object->getType()->getAs(); @@ -7551,7 +7546,7 @@ Conv); return ActOnCallExpr(S, CE, LParenLoc, MultiExprArg(Args, NumArgs), - CommaLocs, RParenLoc); + RParenLoc); } CheckMemberOperatorAccess(LParenLoc, Object, 0, Best->FoundDecl); Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=113495&r1=113494&r2=113495&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original) +++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Thu Sep 9 11:33:13 2010 @@ -251,7 +251,6 @@ static bool InstantiateInitializationArguments(Sema &SemaRef, Expr **Args, unsigned NumArgs, const MultiLevelTemplateArgumentList &TemplateArgs, - llvm::SmallVectorImpl &FakeCommaLocs, ASTOwningVector &InitArgs) { for (unsigned I = 0; I != NumArgs; ++I) { // When we hit the first defaulted argument, break out of the loop: @@ -263,12 +262,7 @@ if (Arg.isInvalid()) return true; - Expr *ArgExpr = (Expr *)Arg.get(); InitArgs.push_back(Arg.release()); - - // FIXME: We're faking all of the comma locations. Do we need them? - FakeCommaLocs.push_back( - SemaRef.PP.getLocForEndOfToken(ArgExpr->getLocEnd())); } return false; @@ -290,7 +284,6 @@ static bool InstantiateInitializer(Sema &S, Expr *Init, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation &LParenLoc, - llvm::SmallVector &CommaLocs, ASTOwningVector &NewArgs, SourceLocation &RParenLoc) { NewArgs.clear(); @@ -314,8 +307,7 @@ RParenLoc = ParenList->getRParenLoc(); return InstantiateInitializationArguments(S, ParenList->getExprs(), ParenList->getNumExprs(), - TemplateArgs, CommaLocs, - NewArgs); + TemplateArgs, NewArgs); } if (CXXConstructExpr *Construct = dyn_cast(Init)) { @@ -323,13 +315,12 @@ if (InstantiateInitializationArguments(S, Construct->getArgs(), Construct->getNumArgs(), - TemplateArgs, - CommaLocs, NewArgs)) + TemplateArgs, NewArgs)) return true; // FIXME: Fake locations! LParenLoc = S.PP.getLocForEndOfToken(Init->getLocStart()); - RParenLoc = CommaLocs.empty()? LParenLoc : CommaLocs.back(); + RParenLoc = LParenLoc; return false; } } @@ -419,17 +410,15 @@ // Instantiate the initializer. SourceLocation LParenLoc, RParenLoc; - llvm::SmallVector CommaLocs; ASTOwningVector InitArgs(SemaRef); if (!InstantiateInitializer(SemaRef, D->getInit(), TemplateArgs, LParenLoc, - CommaLocs, InitArgs, RParenLoc)) { + InitArgs, RParenLoc)) { // Attach the initializer to the declaration. if (D->hasCXXDirectInitializer()) { // Add the direct initializer to the declaration. SemaRef.AddCXXDirectInitializerToDecl(Var, LParenLoc, move_arg(InitArgs), - CommaLocs.data(), RParenLoc); } else if (InitArgs.size() == 1) { Expr *Init = InitArgs.take()[0]; @@ -2281,11 +2270,10 @@ SourceLocation LParenLoc, RParenLoc; ASTOwningVector NewArgs(*this); - llvm::SmallVector CommaLocs; // Instantiate the initializer. if (InstantiateInitializer(*this, Init->getInit(), TemplateArgs, - LParenLoc, CommaLocs, NewArgs, RParenLoc)) { + LParenLoc, NewArgs, RParenLoc)) { AnyErrors = true; continue; } Modified: cfe/trunk/lib/Sema/TreeTransform.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=113495&r1=113494&r2=113495&view=diff ============================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h (original) +++ cfe/trunk/lib/Sema/TreeTransform.h Thu Sep 9 11:33:13 2010 @@ -1129,10 +1129,9 @@ /// Subclasses may override this routine to provide different behavior. ExprResult RebuildCallExpr(Expr *Callee, SourceLocation LParenLoc, MultiExprArg Args, - SourceLocation *CommaLocs, SourceLocation RParenLoc) { return getSema().ActOnCallExpr(/*Scope=*/0, Callee, LParenLoc, - move(Args), CommaLocs, RParenLoc); + move(Args), RParenLoc); } /// \brief Build a new member access expression. @@ -4452,16 +4451,11 @@ // Transform arguments. bool ArgChanged = false; ASTOwningVector Args(SemaRef); - llvm::SmallVector FakeCommaLocs; for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I) { ExprResult Arg = getDerived().TransformExpr(E->getArg(I)); if (Arg.isInvalid()) return ExprError(); - // FIXME: Wrong source location information for the ','. - FakeCommaLocs.push_back( - SemaRef.PP.getLocForEndOfToken(E->getArg(I)->getSourceRange().getEnd())); - ArgChanged = ArgChanged || Arg.get() != E->getArg(I); Args.push_back(Arg.get()); } @@ -4476,7 +4470,6 @@ = ((Expr *)Callee.get())->getSourceRange().getBegin(); return getDerived().RebuildCallExpr(Callee.get(), FakeLParenLoc, move_arg(Args), - FakeCommaLocs.data(), E->getRParenLoc()); } @@ -4960,7 +4953,6 @@ // Transform the call arguments. ASTOwningVector Args(SemaRef); - llvm::SmallVector FakeCommaLocs; for (unsigned I = 1, N = E->getNumArgs(); I != N; ++I) { if (getDerived().DropCallArgument(E->getArg(I))) break; @@ -4969,17 +4961,11 @@ if (Arg.isInvalid()) return ExprError(); - // FIXME: Poor source location information. - SourceLocation FakeCommaLoc - = SemaRef.PP.getLocForEndOfToken( - static_cast(Arg.get())->getLocEnd()); - FakeCommaLocs.push_back(FakeCommaLoc); Args.push_back(Arg.release()); } return getDerived().RebuildCallExpr(Object.get(), FakeLParenLoc, move_arg(Args), - FakeCommaLocs.data(), E->getLocEnd()); } From dgregor at apple.com Thu Sep 9 11:55:46 2010 From: dgregor at apple.com (Douglas Gregor) Date: Thu, 09 Sep 2010 16:55:46 -0000 Subject: [cfe-commits] r113498 - /cfe/trunk/lib/Sema/TreeTransform.h Message-ID: <20100909165546.8D87B2A6C12D@llvm.org> Author: dgregor Date: Thu Sep 9 11:55:46 2010 New Revision: 113498 URL: http://llvm.org/viewvc/llvm-project?rev=113498&view=rev Log: Eliminate some unnecessary uses of TreeTransform::TemporaryBase. There are still a few (legitimate, unfortunate) uses of this hack around, but at least now there are fewer. Modified: cfe/trunk/lib/Sema/TreeTransform.h Modified: cfe/trunk/lib/Sema/TreeTransform.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=113498&r1=113497&r2=113498&view=diff ============================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h (original) +++ cfe/trunk/lib/Sema/TreeTransform.h Thu Sep 9 11:55:46 2010 @@ -1558,8 +1558,8 @@ /// semantic analysis. Subclasses may override this routine to provide /// different behavior. ExprResult RebuildCXXThisExpr(SourceLocation ThisLoc, - QualType ThisType, - bool isImplicit) { + QualType ThisType, + bool isImplicit) { return getSema().Owned( new (getSema().Context) CXXThisExpr(ThisLoc, ThisType, isImplicit)); @@ -4618,32 +4618,22 @@ template ExprResult TreeTransform::TransformCStyleCastExpr(CStyleCastExpr *E) { - TypeSourceInfo *OldT; - TypeSourceInfo *NewT; - { - // FIXME: Source location isn't quite accurate. - SourceLocation TypeStartLoc - = SemaRef.PP.getLocForEndOfToken(E->getLParenLoc()); - TemporaryBase Rebase(*this, TypeStartLoc, DeclarationName()); - - OldT = E->getTypeInfoAsWritten(); - NewT = getDerived().TransformType(OldT); - if (!NewT) - return ExprError(); - } - + TypeSourceInfo *Type = getDerived().TransformType(E->getTypeInfoAsWritten()); + if (!Type) + return ExprError(); + ExprResult SubExpr = getDerived().TransformExpr(E->getSubExprAsWritten()); if (SubExpr.isInvalid()) return ExprError(); if (!getDerived().AlwaysRebuild() && - OldT == NewT && + Type == E->getTypeInfoAsWritten() && SubExpr.get() == E->getSubExpr()) return SemaRef.Owned(E->Retain()); return getDerived().RebuildCStyleCastExpr(E->getLParenLoc(), - NewT, + Type, E->getRParenLoc(), SubExpr.get()); } @@ -5024,27 +5014,17 @@ template ExprResult TreeTransform::TransformCXXNamedCastExpr(CXXNamedCastExpr *E) { - TypeSourceInfo *OldT; - TypeSourceInfo *NewT; - { - // FIXME: Source location isn't quite accurate. - SourceLocation TypeStartLoc - = SemaRef.PP.getLocForEndOfToken(E->getOperatorLoc()); - TemporaryBase Rebase(*this, TypeStartLoc, DeclarationName()); - - OldT = E->getTypeInfoAsWritten(); - NewT = getDerived().TransformType(OldT); - if (!NewT) - return ExprError(); - } - + TypeSourceInfo *Type = getDerived().TransformType(E->getTypeInfoAsWritten()); + if (!Type) + return ExprError(); + ExprResult SubExpr = getDerived().TransformExpr(E->getSubExprAsWritten()); if (SubExpr.isInvalid()) return ExprError(); if (!getDerived().AlwaysRebuild() && - OldT == NewT && + Type == E->getTypeInfoAsWritten() && SubExpr.get() == E->getSubExpr()) return SemaRef.Owned(E->Retain()); @@ -5058,7 +5038,7 @@ return getDerived().RebuildCXXNamedCastExpr(E->getOperatorLoc(), E->getStmtClass(), FakeLAngleLoc, - NewT, + Type, FakeRAngleLoc, FakeRAngleLoc, SubExpr.get(), @@ -5094,16 +5074,9 @@ ExprResult TreeTransform::TransformCXXFunctionalCastExpr( CXXFunctionalCastExpr *E) { - TypeSourceInfo *OldT; - TypeSourceInfo *NewT; - { - TemporaryBase Rebase(*this, E->getTypeBeginLoc(), DeclarationName()); - - OldT = E->getTypeInfoAsWritten(); - NewT = getDerived().TransformType(OldT); - if (!NewT) - return ExprError(); - } + TypeSourceInfo *Type = getDerived().TransformType(E->getTypeInfoAsWritten()); + if (!Type) + return ExprError(); ExprResult SubExpr = getDerived().TransformExpr(E->getSubExprAsWritten()); @@ -5111,11 +5084,11 @@ return ExprError(); if (!getDerived().AlwaysRebuild() && - OldT == NewT && + Type == E->getTypeInfoAsWritten() && SubExpr.get() == E->getSubExpr()) return SemaRef.Owned(E->Retain()); - return getDerived().RebuildCXXFunctionalCastExpr(NewT, + return getDerived().RebuildCXXFunctionalCastExpr(Type, /*FIXME:*/E->getSubExpr()->getLocStart(), SubExpr.get(), E->getRParenLoc()); @@ -5214,14 +5187,11 @@ template ExprResult TreeTransform::TransformCXXThisExpr(CXXThisExpr *E) { - TemporaryBase Rebase(*this, E->getLocStart(), DeclarationName()); - - QualType T = getDerived().TransformType(E->getType()); - if (T.isNull()) - return ExprError(); + DeclContext *DC = getSema().getFunctionLevelDeclContext(); + CXXMethodDecl *MD = dyn_cast(DC); + QualType T = MD->getThisType(getSema().Context); - if (!getDerived().AlwaysRebuild() && - T == E->getType()) + if (!getDerived().AlwaysRebuild() && T == E->getType()) return SemaRef.Owned(E->Retain()); return getDerived().RebuildCXXThisExpr(E->getLocStart(), T, E->isImplicit()); From rjmccall at apple.com Thu Sep 9 12:09:20 2010 From: rjmccall at apple.com (John McCall) Date: Thu, 9 Sep 2010 10:09:20 -0700 Subject: [cfe-commits] r113480 - in /cfe/trunk/lib/Checker: ArrayBoundChecker.cpp CStringChecker.cpp ReturnPointerRangeChecker.cpp In-Reply-To: <20100909105137.EAC352A6C12C@llvm.org> References: <20100909105137.EAC352A6C12C@llvm.org> Message-ID: On Sep 9, 2010, at 3:51 AM, Gabor Greif wrote: > Author: ggreif > Date: Thu Sep 9 05:51:37 2010 > New Revision: 113480 > > URL: http://llvm.org/viewvc/llvm-project?rev=113480&view=rev > Log: > do not bind temporaries to non-const references > > this fixes all analyser test failures in my gcc34-based > environment > > how the cast result could bind to the non-const ref is > somewhat mysterious and remains to be investigated; to > avoid similar miscompilations (by gcc34 only?) This is badness in cast<>, I think. John. From dgregor at apple.com Thu Sep 9 12:09:21 2010 From: dgregor at apple.com (Douglas Gregor) Date: Thu, 09 Sep 2010 17:09:21 -0000 Subject: [cfe-commits] r113500 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/TreeTransform.h tools/libclang/CIndex.cpp Message-ID: <20100909170922.0629A2A6C12C@llvm.org> Author: dgregor Date: Thu Sep 9 12:09:21 2010 New Revision: 113500 URL: http://llvm.org/viewvc/llvm-project?rev=113500&view=rev Log: Simplify template instantiation for C++ exception declarations, eliminating an unnecessary use of TemporaryBase in the process. Modified: cfe/trunk/include/clang/Sema/Sema.h cfe/trunk/lib/Sema/SemaDeclCXX.cpp cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp cfe/trunk/lib/Sema/TreeTransform.h cfe/trunk/tools/libclang/CIndex.cpp Modified: cfe/trunk/include/clang/Sema/Sema.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=113500&r1=113499&r2=113500&view=diff ============================================================================== --- cfe/trunk/include/clang/Sema/Sema.h (original) +++ cfe/trunk/include/clang/Sema/Sema.h Thu Sep 9 12:09:21 2010 @@ -1609,11 +1609,10 @@ Expr *SynchExpr, Stmt *SynchBody); - VarDecl *BuildExceptionDeclaration(Scope *S, QualType ExDeclType, + VarDecl *BuildExceptionDeclaration(Scope *S, TypeSourceInfo *TInfo, IdentifierInfo *Name, - SourceLocation Loc, - SourceRange Range); + SourceLocation Loc); Decl *ActOnExceptionDeclarator(Scope *S, Declarator &D); StmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc, Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=113500&r1=113499&r2=113500&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Sep 9 12:09:21 2010 @@ -6077,13 +6077,13 @@ /// \brief Perform semantic analysis for the variable declaration that /// occurs within a C++ catch clause, returning the newly-created /// variable. -VarDecl *Sema::BuildExceptionDeclaration(Scope *S, QualType ExDeclType, +VarDecl *Sema::BuildExceptionDeclaration(Scope *S, TypeSourceInfo *TInfo, IdentifierInfo *Name, - SourceLocation Loc, - SourceRange Range) { + SourceLocation Loc) { bool Invalid = false; - + QualType ExDeclType = TInfo->getType(); + // Arrays and functions decay. if (ExDeclType->isArrayType()) ExDeclType = Context.getArrayDecayedType(ExDeclType); @@ -6095,7 +6095,7 @@ // incomplete type, other than [cv] void*. // N2844 forbids rvalue references. if (!ExDeclType->isDependentType() && ExDeclType->isRValueReferenceType()) { - Diag(Loc, diag::err_catch_rvalue_ref) << Range; + Diag(Loc, diag::err_catch_rvalue_ref); Invalid = true; } @@ -6213,10 +6213,9 @@ Invalid = true; } - VarDecl *ExDecl = BuildExceptionDeclaration(S, ExDeclType, TInfo, + VarDecl *ExDecl = BuildExceptionDeclaration(S, TInfo, D.getIdentifier(), - D.getIdentifierLoc(), - D.getDeclSpec().getSourceRange()); + D.getIdentifierLoc()); if (Invalid) ExDecl->setInvalidDecl(); Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=113500&r1=113499&r2=113500&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original) +++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Thu Sep 9 12:09:21 2010 @@ -602,10 +602,10 @@ /// \brief Rebuild the exception declaration and register the declaration /// as an instantiated local. - VarDecl *RebuildExceptionDecl(VarDecl *ExceptionDecl, QualType T, + VarDecl *RebuildExceptionDecl(VarDecl *ExceptionDecl, TypeSourceInfo *Declarator, IdentifierInfo *Name, - SourceLocation Loc, SourceRange TypeRange); + SourceLocation Loc); /// \brief Rebuild the Objective-C exception declaration and register the /// declaration as an instantiated local. @@ -719,13 +719,11 @@ VarDecl * TemplateInstantiator::RebuildExceptionDecl(VarDecl *ExceptionDecl, - QualType T, TypeSourceInfo *Declarator, IdentifierInfo *Name, - SourceLocation Loc, - SourceRange TypeRange) { - VarDecl *Var = inherited::RebuildExceptionDecl(ExceptionDecl, T, Declarator, - Name, Loc, TypeRange); + SourceLocation Loc) { + VarDecl *Var = inherited::RebuildExceptionDecl(ExceptionDecl, Declarator, + Name, Loc); if (Var) getSema().CurrentInstantiationScope->InstantiatedLocal(ExceptionDecl, Var); return Var; Modified: cfe/trunk/lib/Sema/TreeTransform.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=113500&r1=113499&r2=113500&view=diff ============================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h (original) +++ cfe/trunk/lib/Sema/TreeTransform.h Thu Sep 9 12:09:21 2010 @@ -980,13 +980,11 @@ /// /// By default, performs semantic analysis to build the new decaration. /// Subclasses may override this routine to provide different behavior. - VarDecl *RebuildExceptionDecl(VarDecl *ExceptionDecl, QualType T, + VarDecl *RebuildExceptionDecl(VarDecl *ExceptionDecl, TypeSourceInfo *Declarator, IdentifierInfo *Name, - SourceLocation Loc, - SourceRange TypeRange) { - return getSema().BuildExceptionDeclaration(0, T, Declarator, Name, Loc, - TypeRange); + SourceLocation Loc) { + return getSema().BuildExceptionDeclaration(0, Declarator, Name, Loc); } /// \brief Build a new C++ catch statement. @@ -4127,20 +4125,14 @@ VarDecl *Var = 0; if (S->getExceptionDecl()) { VarDecl *ExceptionDecl = S->getExceptionDecl(); - TemporaryBase Rebase(*this, ExceptionDecl->getLocation(), - ExceptionDecl->getDeclName()); - - QualType T = getDerived().TransformType(ExceptionDecl->getType()); - if (T.isNull()) + TypeSourceInfo *T = getDerived().TransformType( + ExceptionDecl->getTypeSourceInfo()); + if (!T) return StmtError(); - Var = getDerived().RebuildExceptionDecl(ExceptionDecl, - T, - ExceptionDecl->getTypeSourceInfo(), + Var = getDerived().RebuildExceptionDecl(ExceptionDecl, T, ExceptionDecl->getIdentifier(), - ExceptionDecl->getLocation(), - /*FIXME: Inaccurate*/ - SourceRange(ExceptionDecl->getLocation())); + ExceptionDecl->getLocation()); if (!Var || Var->isInvalidDecl()) return StmtError(); } Modified: cfe/trunk/tools/libclang/CIndex.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=113500&r1=113499&r2=113500&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CIndex.cpp (original) +++ cfe/trunk/tools/libclang/CIndex.cpp Thu Sep 9 12:09:21 2010 @@ -312,8 +312,6 @@ bool VisitObjCImplDecl(ObjCImplDecl *D); bool VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D); bool VisitObjCImplementationDecl(ObjCImplementationDecl *D); - // FIXME: ObjCPropertyDecl requires TypeSourceInfo, getter/setter locations, - // etc. // FIXME: ObjCCompatibleAliasDecl requires aliased-class locations. bool VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D); bool VisitObjCClassDecl(ObjCClassDecl *D); @@ -846,7 +844,7 @@ } bool CursorVisitor::VisitObjCPropertyDecl(ObjCPropertyDecl *PD) { - if (Visit(PD->getTypeSourceInfo()->getTypeLoc())) + if (PD->getTypeSourceInfo() && Visit(PD->getTypeSourceInfo()->getTypeLoc())) return true; // FIXME: This implements a workaround with @property declarations also being From daniel at zuster.org Thu Sep 9 12:38:18 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 09 Sep 2010 17:38:18 -0000 Subject: [cfe-commits] r113504 - /cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Message-ID: <20100909173818.ECB6B2A6C12D@llvm.org> Author: ddunbar Date: Thu Sep 9 12:38:18 2010 New Revision: 113504 URL: http://llvm.org/viewvc/llvm-project?rev=113504&view=rev Log: Fix indentation. Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=113504&r1=113503&r2=113504&view=diff ============================================================================== --- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original) +++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Thu Sep 9 12:38:18 2010 @@ -445,41 +445,39 @@ } llvm::Triple::OSType os = triple.getOS(); switch (os) { - case llvm::Triple::Win32: - { - std::string VSDir; - std::string WindowsSDKDir; - if (getVisualStudioDir(VSDir)) { - AddPath(VSDir + "\\VC\\include", System, false, false, false); - if (getWindowsSDKDir(WindowsSDKDir)) - AddPath(WindowsSDKDir + "\\include", System, false, false, false); - else - AddPath(VSDir + "\\VC\\PlatformSDK\\Include", - System, false, false, false); - } - else { - // Default install paths. - AddPath("C:/Program Files/Microsoft Visual Studio 10.0/VC/include", - System, false, false, false); - AddPath("C:/Program Files/Microsoft Visual Studio 9.0/VC/include", - System, false, false, false); - AddPath( + case llvm::Triple::Win32: { + std::string VSDir; + std::string WindowsSDKDir; + if (getVisualStudioDir(VSDir)) { + AddPath(VSDir + "\\VC\\include", System, false, false, false); + if (getWindowsSDKDir(WindowsSDKDir)) + AddPath(WindowsSDKDir + "\\include", System, false, false, false); + else + AddPath(VSDir + "\\VC\\PlatformSDK\\Include", + System, false, false, false); + } else { + // Default install paths. + AddPath("C:/Program Files/Microsoft Visual Studio 10.0/VC/include", + System, false, false, false); + AddPath("C:/Program Files/Microsoft Visual Studio 9.0/VC/include", + System, false, false, false); + AddPath( "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include", - System, false, false, false); - AddPath("C:/Program Files/Microsoft Visual Studio 8/VC/include", - System, false, false, false); - AddPath( + System, false, false, false); + AddPath("C:/Program Files/Microsoft Visual Studio 8/VC/include", + System, false, false, false); + AddPath( "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include", - System, false, false, false); - // For some clang developers. - AddPath("G:/Program Files/Microsoft Visual Studio 9.0/VC/include", - System, false, false, false); - AddPath( + System, false, false, false); + // For some clang developers. + AddPath("G:/Program Files/Microsoft Visual Studio 9.0/VC/include", + System, false, false, false); + AddPath( "G:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include", - System, false, false, false); - } + System, false, false, false); } break; + } case llvm::Triple::Haiku: AddPath("/boot/common/include", System, true, false, false); AddPath("/boot/develop/headers/os", System, true, false, false); From daniel at zuster.org Thu Sep 9 12:38:22 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 09 Sep 2010 17:38:22 -0000 Subject: [cfe-commits] r113505 - in /cfe/trunk: include/clang/Driver/CC1Options.td include/clang/Frontend/HeaderSearchOptions.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/InitHeaderSearch.cpp Message-ID: <20100909173822.DA30E2A6C12E@llvm.org> Author: ddunbar Date: Thu Sep 9 12:38:22 2010 New Revision: 113505 URL: http://llvm.org/viewvc/llvm-project?rev=113505&view=rev Log: Frontend: Add -cxx-system-include option which can be used to specify an explicit list for the C++ system include directories at the -cc1 level, as an alternative to the horrible AddDefaultCPlusPlusIncludePaths(). Modified: cfe/trunk/include/clang/Driver/CC1Options.td cfe/trunk/include/clang/Frontend/HeaderSearchOptions.h cfe/trunk/lib/Frontend/CompilerInvocation.cpp cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Modified: cfe/trunk/include/clang/Driver/CC1Options.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=113505&r1=113504&r2=113505&view=diff ============================================================================== --- cfe/trunk/include/clang/Driver/CC1Options.td (original) +++ cfe/trunk/include/clang/Driver/CC1Options.td Thu Sep 9 12:38:22 2010 @@ -516,6 +516,8 @@ HelpText<"Set directory to include search path with prefix">; def isysroot : JoinedOrSeparate<"-isysroot">, MetaVarName<"">, HelpText<"Set the system root directory (usually /)">; +def cxx_system_include : Separate<"-cxx-system-include">, + HelpText<"Add a system #include directory for the C++ standard library">; def v : Flag<"-v">, HelpText<"Enable verbose output">; //===----------------------------------------------------------------------===// Modified: cfe/trunk/include/clang/Frontend/HeaderSearchOptions.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/HeaderSearchOptions.h?rev=113505&r1=113504&r2=113505&view=diff ============================================================================== --- cfe/trunk/include/clang/Frontend/HeaderSearchOptions.h (original) +++ cfe/trunk/include/clang/Frontend/HeaderSearchOptions.h Thu Sep 9 12:38:22 2010 @@ -54,6 +54,9 @@ /// User specified include entries. std::vector UserEntries; + /// If non-empty, the list of C++ standard include paths to use. + std::vector CXXSystemIncludes; + /// A (system-path) delimited list of include paths to be added from the /// environment following the user specified includes (but prior to builtin /// and standard includes). This is parsed in the same manner as the CPATH Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=113505&r1=113504&r2=113505&view=diff ============================================================================== --- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original) +++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Thu Sep 9 12:38:22 2010 @@ -443,6 +443,11 @@ Res.push_back(Opts.Sysroot); } + for (unsigned i = 0, e = Opts.CXXSystemIncludes.size(); i != e; ++i) { + Res.push_back("-cxx-system-include"); + Res.push_back(Opts.CXXSystemIncludes[i]); + } + /// User specified include entries. for (unsigned i = 0, e = Opts.UserEntries.size(); i != e; ++i) { const HeaderSearchOptions::Entry &E = Opts.UserEntries[i]; @@ -1143,6 +1148,7 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) { using namespace cc1options; + Opts.CXXSystemIncludes = Args.getAllArgValues(OPT_cxx_system_include); Opts.Sysroot = Args.getLastArgValue(OPT_isysroot, "/"); Opts.Verbose = Args.hasArg(OPT_v); Opts.UseBuiltinIncludes = !Args.hasArg(OPT_nobuiltininc); Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=113505&r1=113504&r2=113505&view=diff ============================================================================== --- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original) +++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Thu Sep 9 12:38:22 2010 @@ -772,8 +772,13 @@ void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang, const llvm::Triple &triple, const HeaderSearchOptions &HSOpts) { - if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes) - AddDefaultCPlusPlusIncludePaths(triple); + if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes) { + if (!HSOpts.CXXSystemIncludes.empty()) { + for (unsigned i = 0, e = HSOpts.CXXSystemIncludes.size(); i != e; ++i) + AddPath(HSOpts.CXXSystemIncludes[i], System, true, false, false); + } else + AddDefaultCPlusPlusIncludePaths(triple); + } AddDefaultCIncludePaths(triple, HSOpts); From kremenek at apple.com Thu Sep 9 14:05:34 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 19:05:34 -0000 Subject: [cfe-commits] r113524 - in /cfe/trunk: include/clang/Checker/BugReporter/BugReporter.h lib/Checker/BugReporter.cpp test/Analysis/plist-output-alternate.m Message-ID: <20100909190534.4AD822A6C12C@llvm.org> Author: kremenek Date: Thu Sep 9 14:05:34 2010 New Revision: 113524 URL: http://llvm.org/viewvc/llvm-project?rev=113524&view=rev Log: Use FindReportInEquivalenceClass to identify all the nodes used for the trimmed graph (in BugReporter). This fixes a problem where a leak that happened to occur on both an exit() path and a non-exit() path was getting reported with the exit() path (which users don't care about). This fixes: leak reports should not show paths that end with exit() (but ones that don't end with exit()) Modified: cfe/trunk/include/clang/Checker/BugReporter/BugReporter.h cfe/trunk/lib/Checker/BugReporter.cpp cfe/trunk/test/Analysis/plist-output-alternate.m Modified: cfe/trunk/include/clang/Checker/BugReporter/BugReporter.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/BugReporter/BugReporter.h?rev=113524&r1=113523&r2=113524&view=diff ============================================================================== --- cfe/trunk/include/clang/Checker/BugReporter/BugReporter.h (original) +++ cfe/trunk/include/clang/Checker/BugReporter/BugReporter.h Thu Sep 9 14:05:34 2010 @@ -306,7 +306,8 @@ SourceManager& getSourceManager() { return D.getSourceManager(); } virtual void GeneratePathDiagnostic(PathDiagnostic& PD, - BugReportEquivClass& EQ) {} + BugReportEquivClass& EQ, + llvm::SmallVectorImpl &Nodes) {} void Register(BugType *BT); @@ -368,7 +369,8 @@ GRStateManager &getStateManager(); virtual void GeneratePathDiagnostic(PathDiagnostic& PD, - BugReportEquivClass& R); + BugReportEquivClass& R, + llvm::SmallVectorImpl &Nodes); void addNotableSymbol(SymbolRef Sym) { NotableSymbols.insert(Sym); Modified: cfe/trunk/lib/Checker/BugReporter.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/BugReporter.cpp?rev=113524&r1=113523&r2=113524&view=diff ============================================================================== --- cfe/trunk/lib/Checker/BugReporter.cpp (original) +++ cfe/trunk/lib/Checker/BugReporter.cpp Thu Sep 9 14:05:34 2010 @@ -1567,23 +1567,18 @@ } void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, - BugReportEquivClass& EQ) { + BugReportEquivClass& EQ, + llvm::SmallVectorImpl &Nodes) { - std::vector Nodes; - for (BugReportEquivClass::iterator I=EQ.begin(), E=EQ.end(); I!=E; ++I) { - const ExplodedNode* N = I->getEndNode(); - if (N) Nodes.push_back(N); - } - - if (Nodes.empty()) - return; + assert(!Nodes.empty()); // Construct a new graph that contains only a single path from the error // node to a root. const std::pair, std::pair >& - GPair = MakeReportGraph(&getGraph(), &Nodes[0], &Nodes[0] + Nodes.size()); + GPair = MakeReportGraph(&getGraph(), &Nodes[0], + Nodes.data() + Nodes.size()); // Find the BugReport with the original location. BugReport *R = 0; @@ -1657,21 +1652,36 @@ }; } -static BugReport *FindReportInEquivalenceClass(BugReportEquivClass& EQ) { +static BugReport * +FindReportInEquivalenceClass(BugReportEquivClass& EQ, + llvm::SmallVectorImpl &Nodes) { + BugReportEquivClass::iterator I = EQ.begin(), E = EQ.end(); assert(I != E); BugReport *R = *I; BugType& BT = R->getBugType(); - - if (!BT.isSuppressOnSink()) + + // If we don't need to suppress any of the nodes because they are post-dominated + // by a sink, simply add all the nodes in the equivalence class to 'Nodes'. + if (!BT.isSuppressOnSink()) { + for (BugReportEquivClass::iterator I=EQ.begin(), E=EQ.end(); I!=E; ++I) { + const ExplodedNode* N = I->getEndNode(); + if (N) { + R = *I; + Nodes.push_back(N); + } + } return R; - + } + // For bug reports that should be suppressed when all paths are post-dominated // by a sink node, iterate through the reports in the equivalence class // until we find one that isn't post-dominated (if one exists). We use a // DFS traversal of the ExplodedGraph to find a non-sink node. We could write // this as a recursive function, but we don't want to risk blowing out the // stack for very long paths. + BugReport *ExampleReport = 0; + for (; I != E; ++I) { R = *I; const ExplodedNode *N = R->getEndNode(); @@ -1682,12 +1692,17 @@ if (N->isSink()) { assert(false && "BugType::isSuppressSink() should not be 'true' for sink end nodes"); - return R; + return 0; } - - if (N->succ_empty()) - return R; - + + // No successors? By definition this nodes isn't post-dominated by a sink. + if (N->succ_empty()) { + Nodes.push_back(N); + if (!ExampleReport) + ExampleReport = R; + continue; + } + // At this point we know that 'N' is not a sink and it has at least one // successor. Use a DFS worklist to find a non-sink end-of-path node. typedef FRIEC_WLItem WLItem; @@ -1706,15 +1721,17 @@ const ExplodedNode *Succ = *WI.I; // End-of-path node? if (Succ->succ_empty()) { - // If we found an end-of-path node that is not a sink, then return - // this report. - if (!Succ->isSink()) - return R; - + // If we found an end-of-path node that is not a sink. + if (!Succ->isSink()) { + Nodes.push_back(N); + if (!ExampleReport) + ExampleReport = R; + WL.clear(); + break; + } // Found a sink? Continue on to the next successor. continue; } - // Mark the successor as visited. If it hasn't been explored, // enqueue it to the DFS worklist. unsigned &mark = Visited[Succ]; @@ -1724,17 +1741,18 @@ break; } } - - if (&WL.back() == &WI) + + // The worklist may have been cleared at this point. First + // check if it is empty before checking the last item. + if (!WL.empty() && &WL.back() == &WI) WL.pop_back(); } } - - // If we reach here, the end nodes for all reports in the equivalence - // class are post-dominated by a sink node. - return NULL; -} + // ExampleReport will be NULL if all the nodes in the equivalence class + // were post-dominated by sinks. + return ExampleReport; +} //===----------------------------------------------------------------------===// // DiagnosticCache. This is a hack to cache analyzer diagnostics. It @@ -1780,7 +1798,8 @@ } void BugReporter::FlushReport(BugReportEquivClass& EQ) { - BugReport *R = FindReportInEquivalenceClass(EQ); + llvm::SmallVector Nodes; + BugReport *R = FindReportInEquivalenceClass(EQ, Nodes); if (!R) return; @@ -1797,7 +1816,8 @@ ? R->getDescription() : R->getShortDescription(), BT.getCategory())); - GeneratePathDiagnostic(*D.get(), EQ); + if (!Nodes.empty()) + GeneratePathDiagnostic(*D.get(), EQ, Nodes); if (IsCachedDiagnostic(R, D.get())) return; Modified: cfe/trunk/test/Analysis/plist-output-alternate.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plist-output-alternate.m?rev=113524&r1=113523&r2=113524&view=diff ============================================================================== --- cfe/trunk/test/Analysis/plist-output-alternate.m (original) +++ cfe/trunk/test/Analysis/plist-output-alternate.m Thu Sep 9 14:05:34 2010 @@ -37,6 +37,25 @@ *(x.p) = 0xDEADBEEF; } +// leak reports should not show paths that end with exit() (but ones that don't end with exit()) +void panic() __attribute__((noreturn)); +enum { kCFNumberSInt8Type = 1, kCFNumberSInt16Type = 2, kCFNumberSInt32Type = 3, kCFNumberSInt64Type = 4, kCFNumberFloat32Type = 5, kCFNumberFloat64Type = 6, kCFNumberCharType = 7, kCFNumberShortType = 8, kCFNumberIntType = 9, kCFNumberLongType = 10, kCFNumberLongLongType = 11, kCFNumberFloatType = 12, kCFNumberDoubleType = 13, kCFNumberCFIndexType = 14, kCFNumberNSIntegerType = 15, kCFNumberCGFloatType = 16, kCFNumberMaxType = 16 }; +typedef const struct __CFAllocator * CFAllocatorRef; +extern const CFAllocatorRef kCFAllocatorDefault; +typedef signed long CFIndex; +typedef CFIndex CFNumberType; +typedef const struct __CFNumber * CFNumberRef; + +extern CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr); + +void rdar8331641(int x) { + signed z = 1; + CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z); // expected-warning{{leak}} + if (x) + panic(); + (void) value; +} + // CHECK: // CHECK: // CHECK: @@ -750,7 +769,246 @@ // CHECK: file0 // CHECK: // CHECK: +// CHECK: +// CHECK: path +// CHECK: +// CHECK: +// CHECK: kindcontrol +// CHECK: edges +// CHECK: +// CHECK: +// CHECK: start +// CHECK: +// CHECK: +// CHECK: line52 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line52 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: end +// CHECK: +// CHECK: +// CHECK: line53 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line53 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: kindcontrol +// CHECK: edges +// CHECK: +// CHECK: +// CHECK: start +// CHECK: +// CHECK: +// CHECK: line53 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line53 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: end +// CHECK: +// CHECK: +// CHECK: line53 +// CHECK: col23 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line53 +// CHECK: col82 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: kindevent +// CHECK: location +// CHECK: +// CHECK: line53 +// CHECK: col23 +// CHECK: file0 +// CHECK: +// CHECK: ranges +// CHECK: +// CHECK: +// CHECK: +// CHECK: line53 +// CHECK: col23 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line53 +// CHECK: col82 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: +// CHECK: extended_message +// CHECK: Call to function 'CFNumberCreate' returns a Core Foundation object with a +1 retain count (owning reference) +// CHECK: message +// CHECK: Call to function 'CFNumberCreate' returns a Core Foundation object with a +1 retain count (owning reference) +// CHECK: +// CHECK: +// CHECK: kindcontrol +// CHECK: edges +// CHECK: +// CHECK: +// CHECK: start +// CHECK: +// CHECK: +// CHECK: line53 +// CHECK: col23 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line53 +// CHECK: col82 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: end +// CHECK: +// CHECK: +// CHECK: line54 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line54 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: kindcontrol +// CHECK: edges +// CHECK: +// CHECK: +// CHECK: start +// CHECK: +// CHECK: +// CHECK: line54 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line54 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: end +// CHECK: +// CHECK: +// CHECK: line56 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line56 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: kindcontrol +// CHECK: edges +// CHECK: +// CHECK: +// CHECK: start +// CHECK: +// CHECK: +// CHECK: line56 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line56 +// CHECK: col3 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: end +// CHECK: +// CHECK: +// CHECK: line57 +// CHECK: col1 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line57 +// CHECK: col1 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: +// CHECK: kindevent +// CHECK: location +// CHECK: +// CHECK: line57 +// CHECK: col1 +// CHECK: file0 +// CHECK: +// CHECK: ranges +// CHECK: +// CHECK: +// CHECK: +// CHECK: line57 +// CHECK: col1 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: line57 +// CHECK: col1 +// CHECK: file0 +// CHECK: +// CHECK: +// CHECK: +// CHECK: extended_message +// CHECK: Object allocated on line 53 and stored into 'value' is no longer referenced after this point and has a retain count of +1 (object leaked) +// CHECK: message +// CHECK: Object allocated on line 53 and stored into 'value' is no longer referenced after this point and has a retain count of +1 (object leaked) +// CHECK: +// CHECK: +// CHECK: descriptionPotential leak of an object allocated on line 53 and stored into 'value' +// CHECK: categoryMemory (Core Foundation/Objective-C) +// CHECK: typeLeak of returned object +// CHECK: location +// CHECK: +// CHECK: line57 +// CHECK: col1 +// CHECK: file0 +// CHECK: +// CHECK: // CHECK: // CHECK: // CHECK: - From isanbard at gmail.com Thu Sep 9 15:27:36 2010 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 09 Sep 2010 20:27:36 -0000 Subject: [cfe-commits] r113534 - /cfe/trunk/include/clang/Basic/Makefile Message-ID: <20100909202736.D243A2A6C12C@llvm.org> Author: void Date: Thu Sep 9 15:27:36 2010 New Revision: 113534 URL: http://llvm.org/viewvc/llvm-project?rev=113534&view=rev Log: Remove the 'rc' suffix. It indicates a "release candidate" during LLVM release qualification. Modified: cfe/trunk/include/clang/Basic/Makefile Modified: cfe/trunk/include/clang/Basic/Makefile URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Makefile?rev=113534&r1=113533&r2=113534&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/Makefile (original) +++ cfe/trunk/include/clang/Basic/Makefile Thu Sep 9 15:27:36 2010 @@ -16,6 +16,7 @@ # Compute the Clang version from the LLVM version, unless specified explicitly. ifndef CLANG_VERSION CLANG_VERSION := $(subst svn,,$(LLVMVersion)) +CLANG_VERSION := $(subst rc,,$(CLANG_VERSION)) endif CLANG_VERSION_COMPONENTS := $(subst ., ,$(CLANG_VERSION)) From daniel at zuster.org Thu Sep 9 16:17:44 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 09 Sep 2010 21:17:44 -0000 Subject: [cfe-commits] r113541 - /cfe/trunk/lib/Driver/Tools.cpp Message-ID: <20100909211744.65CE62A6C12C@llvm.org> Author: ddunbar Date: Thu Sep 9 16:17:44 2010 New Revision: 113541 URL: http://llvm.org/viewvc/llvm-project?rev=113541&view=rev Log: Driver: Mark function as nounwind when -mkernel or -fapple-kext is present. Modified: cfe/trunk/lib/Driver/Tools.cpp Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=113541&r1=113540&r2=113541&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Thu Sep 9 16:17:44 2010 @@ -1184,7 +1184,8 @@ CmdArgs.push_back("-fno-access-control"); // -fexceptions=0 is default. - if (needsExceptions(Args, InputType, getToolChain().getTriple())) + if (!KernelOrKext && + needsExceptions(Args, InputType, getToolChain().getTriple())) CmdArgs.push_back("-fexceptions"); if (getToolChain().UseSjLjExceptions()) From daniel at zuster.org Thu Sep 9 16:27:25 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 09 Sep 2010 21:27:25 -0000 Subject: [cfe-commits] r113542 - /cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Message-ID: <20100909212725.2E4622A6C12C@llvm.org> Author: ddunbar Date: Thu Sep 9 16:27:25 2010 New Revision: 113542 URL: http://llvm.org/viewvc/llvm-project?rev=113542&view=rev Log: Fix typo in diagnostic. Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=113542&r1=113541&r2=113542&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Thu Sep 9 16:27:25 2010 @@ -18,7 +18,7 @@ DefaultFatal; // Error generated by the backend. def err_fe_inline_asm : Error<"%0">, CatInlineAsm; -def note_fe_inline_asm_here : Note<"instantated into assembly here">; +def note_fe_inline_asm_here : Note<"instantiated into assembly here">; From dgregor at apple.com Thu Sep 9 16:42:20 2010 From: dgregor at apple.com (Douglas Gregor) Date: Thu, 09 Sep 2010 21:42:20 -0000 Subject: [cfe-commits] r113545 - in /cfe/trunk: include/clang-c/Index.h lib/Sema/SemaCodeComplete.cpp test/Index/complete-ctor-inits.cpp test/Index/load-stmts.cpp tools/libclang/CIndex.cpp tools/libclang/CXCursor.cpp tools/libclang/CXCursor.h Message-ID: <20100909214220.C1D852A6C12C@llvm.org> Author: dgregor Date: Thu Sep 9 16:42:20 2010 New Revision: 113545 URL: http://llvm.org/viewvc/llvm-project?rev=113545&view=rev Log: Teach libclang to walk the base and member initializers of a constructor, in source order. Also introduces a new reference kind for class members, which is used here (for member initializers) and will also be used for designated initializers and offsetof. Modified: cfe/trunk/include/clang-c/Index.h cfe/trunk/lib/Sema/SemaCodeComplete.cpp cfe/trunk/test/Index/complete-ctor-inits.cpp cfe/trunk/test/Index/load-stmts.cpp cfe/trunk/tools/libclang/CIndex.cpp cfe/trunk/tools/libclang/CXCursor.cpp cfe/trunk/tools/libclang/CXCursor.h Modified: cfe/trunk/include/clang-c/Index.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=113545&r1=113544&r2=113545&view=diff ============================================================================== --- cfe/trunk/include/clang-c/Index.h (original) +++ cfe/trunk/include/clang-c/Index.h Thu Sep 9 16:42:20 2010 @@ -1027,15 +1027,20 @@ CXCursor_TypeRef = 43, CXCursor_CXXBaseSpecifier = 44, /** - * \brief A reference to a class template, function template, or template - * template parameter. + * \brief A reference to a class template, function template, template + * template parameter, or class template partial specialization. */ CXCursor_TemplateRef = 45, /** * \brief A reference to a namespace or namespace alias. */ CXCursor_NamespaceRef = 46, - CXCursor_LastRef = CXCursor_NamespaceRef, + /** + * A reference to a member of a struct, union, or class that occurs in some + * non-expression context, e.g., a designated initializer. + */ + CXCursor_MemberRef = 47, + CXCursor_LastRef = CXCursor_MemberRef, /* Error conditions */ CXCursor_FirstInvalid = 70, Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=113545&r1=113544&r2=113545&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original) +++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Thu Sep 9 16:42:20 2010 @@ -3438,7 +3438,8 @@ Pattern->AddChunk(CodeCompletionString::CK_RightParen); Results.AddResult(CodeCompletionResult(Pattern, SawLastInitializer? CCP_NextInitializer - : CCP_MemberDeclaration)); + : CCP_MemberDeclaration, + CXCursor_MemberRef)); SawLastInitializer = false; } Results.ExitScope(); Modified: cfe/trunk/test/Index/complete-ctor-inits.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/complete-ctor-inits.cpp?rev=113545&r1=113544&r2=113545&view=diff ============================================================================== --- cfe/trunk/test/Index/complete-ctor-inits.cpp (original) +++ cfe/trunk/test/Index/complete-ctor-inits.cpp Thu Sep 9 16:42:20 2010 @@ -18,23 +18,23 @@ Z::Z() : ::X(0), Virt(), b(), c() { } // RUN: c-index-test -code-completion-at=%s:18:10 %s | FileCheck -check-prefix=CHECK-CC1 %s -// CHECK-CC1: NotImplemented:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (20) -// CHECK-CC1: NotImplemented:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )} (20) -// CHECK-CC1: NotImplemented:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (20) +// CHECK-CC1: MemberRef:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (20) +// CHECK-CC1: MemberRef:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )} (20) +// CHECK-CC1: MemberRef:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (20) // CHECK-CC1: NotImplemented:{TypedText Virt}{LeftParen (}{Placeholder args}{RightParen )} (20) // CHECK-CC1: NotImplemented:{TypedText X}{LeftParen (}{Placeholder args}{RightParen )} (7) // CHECK-CC1: NotImplemented:{TypedText Y}{LeftParen (}{Placeholder args}{RightParen )} (20) // RUN: c-index-test -code-completion-at=%s:18:23 %s | FileCheck -check-prefix=CHECK-CC2 %s -// CHECK-CC2: NotImplemented:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (20) -// CHECK-CC2: NotImplemented:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )} (20) -// CHECK-CC2: NotImplemented:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (20) +// CHECK-CC2: MemberRef:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (20) +// CHECK-CC2: MemberRef:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )} (20) +// CHECK-CC2: MemberRef:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (20) // CHECK-CC2: NotImplemented:{TypedText Virt}{LeftParen (}{Placeholder args}{RightParen )} (20) // CHECK-CC2: NotImplemented:{TypedText Y}{LeftParen (}{Placeholder args}{RightParen )} (7) // RUN: c-index-test -code-completion-at=%s:18:36 %s | FileCheck -check-prefix=CHECK-CC3 %s -// CHECK-CC3: NotImplemented:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (20) -// CHECK-CC3-NOT: NotImplemented:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )} -// CHECK-CC3: NotImplemented:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (7) +// CHECK-CC3: MemberRef:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (20) +// CHECK-CC3-NOT: MemberRef:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )} +// CHECK-CC3: MemberRef:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (7) // CHECK-CC3-NOT: NotImplemented:{TypedText Virt}{LeftParen (}{Placeholder args}{RightParen )} // CHECK-CC3: NotImplemented:{TypedText Y}{LeftParen (}{Placeholder args}{RightParen )} (20) Modified: cfe/trunk/test/Index/load-stmts.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/load-stmts.cpp?rev=113545&r1=113544&r2=113545&view=diff ============================================================================== --- cfe/trunk/test/Index/load-stmts.cpp (original) +++ cfe/trunk/test/Index/load-stmts.cpp Thu Sep 9 16:42:20 2010 @@ -91,6 +91,19 @@ (void)__has_nothrow_assign(type); } +struct Base { + Base(int); +}; + +struct Derived : public Base { + Derived(int x); + int member; +}; + +Derived::Derived(int x) + : member(x), Base(x) { +} + // RUN: c-index-test -test-load-source all %s | FileCheck %s // CHECK: load-stmts.cpp:1:13: TypedefDecl=T:1:13 (Definition) Extent=[1:13 - 1:14] // CHECK: load-stmts.cpp:2:8: StructDecl=X:2:8 (Definition) Extent=[2:1 - 2:23] @@ -198,3 +211,12 @@ // CHECK: load-stmts.cpp:90:17: DeclRefExpr=y:88:44 Extent=[90:17 - 90:18] // CHECK: load-stmts.cpp:91:9: UnexposedExpr= Extent=[91:9 - 91:35] // CHECK: load-stmts.cpp:91:30: TypeRef=type:89:13 Extent=[91:30 - 91:34] +// CHECK: load-stmts.cpp:103:10: CXXConstructor=Derived:103:10 (Definition) +// CHECK: load-stmts.cpp:103:1: TypeRef=struct Derived:98:8 Extent=[103:1 - 103: +// FIXME: Missing TypeRef for constructor name. +// CHECK: load-stmts.cpp:103:22: ParmDecl=x:103:22 (Definition) +// CHECK: load-stmts.cpp:104:5: MemberRef=member:100:7 Extent=[104:5 - 104:11] +// CHECK: load-stmts.cpp:104:12: DeclRefExpr=x:103:22 Extent=[104:12 - 104:13] +// CHECK: load-stmts.cpp:104:16: TypeRef=struct Base:94:8 Extent=[104:16 - 104:2 +// CHECK: load-stmts.cpp:104:16: CallExpr= Extent=[104:16 - 104:22] +// CHECK: load-stmts.cpp:104:21: DeclRefExpr=x:103:22 Extent=[104:21 - 104:22] Modified: cfe/trunk/tools/libclang/CIndex.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=113545&r1=113544&r2=113545&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CIndex.cpp (original) +++ cfe/trunk/tools/libclang/CIndex.cpp Thu Sep 9 16:42:20 2010 @@ -30,6 +30,7 @@ #include "clang/Lex/Lexer.h" #include "clang/Lex/PreprocessingRecord.h" #include "clang/Lex/Preprocessor.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Support/CrashRecoveryContext.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Timer.h" @@ -697,6 +698,21 @@ return false; } +/// \brief Compare two base or member initializers based on their source order. +static int CompareCXXBaseOrMemberInitializers(const void* Xp, const void *Yp) { + CXXBaseOrMemberInitializer const * const *X + = static_cast(Xp); + CXXBaseOrMemberInitializer const * const *Y + = static_cast(Yp); + + if ((*X)->getSourceOrder() < (*Y)->getSourceOrder()) + return -1; + else if ((*X)->getSourceOrder() > (*Y)->getSourceOrder()) + return 1; + else + return 0; +} + bool CursorVisitor::VisitFunctionDecl(FunctionDecl *ND) { if (TypeSourceInfo *TSInfo = ND->getTypeSourceInfo()) { // Visit the function declaration's syntactic components in the order @@ -729,9 +745,45 @@ // FIXME: Attributes? } - if (ND->isThisDeclarationADefinition() && - Visit(MakeCXCursor(ND->getBody(), StmtParent, TU))) - return true; + if (ND->isThisDeclarationADefinition()) { + if (CXXConstructorDecl *Constructor = dyn_cast(ND)) { + // Find the initializers that were written in the source. + llvm::SmallVector WrittenInits; + for (CXXConstructorDecl::init_iterator I = Constructor->init_begin(), + IEnd = Constructor->init_end(); + I != IEnd; ++I) { + if (!(*I)->isWritten()) + continue; + + WrittenInits.push_back(*I); + } + + // Sort the initializers in source order + llvm::array_pod_sort(WrittenInits.begin(), WrittenInits.end(), + &CompareCXXBaseOrMemberInitializers); + + // Visit the initializers in source order + for (unsigned I = 0, N = WrittenInits.size(); I != N; ++I) { + CXXBaseOrMemberInitializer *Init = WrittenInits[I]; + if (Init->isMemberInitializer()) { + if (Visit(MakeCursorMemberRef(Init->getMember(), + Init->getMemberLocation(), TU))) + return true; + } else if (TypeSourceInfo *BaseInfo = Init->getBaseClassInfo()) { + if (Visit(BaseInfo->getTypeLoc())) + return true; + } + + // Visit the initializer value. + if (Expr *Initializer = Init->getInit()) + if (Visit(MakeCXCursor(Initializer, ND, TU))) + return true; + } + } + + if (Visit(MakeCXCursor(ND->getBody(), StmtParent, TU))) + return true; + } return false; } @@ -2485,6 +2537,13 @@ return createCXString(NS->getNameAsString()); } + case CXCursor_MemberRef: { + FieldDecl *Field = getCursorMemberRef(C).first; + assert(Field && "Missing member decl"); + + return createCXString(Field->getNameAsString()); + } + default: return createCXString(""); } @@ -2567,6 +2626,8 @@ return createCXString("TemplateRef"); case CXCursor_NamespaceRef: return createCXString("NamespaceRef"); + case CXCursor_MemberRef: + return createCXString("MemberRef"); case CXCursor_UnexposedExpr: return createCXString("UnexposedExpr"); case CXCursor_BlockExpr: @@ -2769,6 +2830,11 @@ return cxloc::translateSourceLocation(P.first->getASTContext(), P.second); } + case CXCursor_MemberRef: { + std::pair P = getCursorMemberRef(C); + return cxloc::translateSourceLocation(P.first->getASTContext(), P.second); + } + case CXCursor_CXXBaseSpecifier: { // FIXME: Figure out what location to return for a CXXBaseSpecifier. return clang_getNullLocation(); @@ -2832,7 +2898,10 @@ case CXCursor_NamespaceRef: return getCursorNamespaceRef(C).second; - + + case CXCursor_MemberRef: + return getCursorMemberRef(C).second; + case CXCursor_CXXBaseSpecifier: // FIXME: Figure out what source range to use for a CXBaseSpecifier. return SourceRange(); @@ -2916,6 +2985,9 @@ case CXCursor_NamespaceRef: return MakeCXCursor(getCursorNamespaceRef(C).first, CXXUnit); + case CXCursor_MemberRef: + return MakeCXCursor(getCursorMemberRef(C).first, CXXUnit); + case CXCursor_CXXBaseSpecifier: { CXXBaseSpecifier *B = cxcursor::getCursorCXXBaseSpecifier(C); return clang_getTypeDeclaration(cxtype::MakeCXType(B->getType(), Modified: cfe/trunk/tools/libclang/CXCursor.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=113545&r1=113544&r2=113545&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CXCursor.cpp (original) +++ cfe/trunk/tools/libclang/CXCursor.cpp Thu Sep 9 16:42:20 2010 @@ -291,6 +291,23 @@ reinterpret_cast(C.data[1]))); } +CXCursor cxcursor::MakeCursorMemberRef(FieldDecl *Field, SourceLocation Loc, + ASTUnit *TU) { + + assert(Field && TU && "Invalid arguments!"); + void *RawLoc = reinterpret_cast(Loc.getRawEncoding()); + CXCursor C = { CXCursor_MemberRef, { Field, RawLoc, TU } }; + return C; +} + +std::pair +cxcursor::getCursorMemberRef(CXCursor C) { + assert(C.kind == CXCursor_MemberRef); + return std::make_pair(static_cast(C.data[0]), + SourceLocation::getFromRawEncoding( + reinterpret_cast(C.data[1]))); +} + CXCursor cxcursor::MakeCursorCXXBaseSpecifier(CXXBaseSpecifier *B, ASTUnit *TU){ CXCursor C = { CXCursor_CXXBaseSpecifier, { B, 0, TU } }; return C; Modified: cfe/trunk/tools/libclang/CXCursor.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.h?rev=113545&r1=113544&r2=113545&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CXCursor.h (original) +++ cfe/trunk/tools/libclang/CXCursor.h Thu Sep 9 16:42:20 2010 @@ -26,6 +26,7 @@ class CXXBaseSpecifier; class Decl; class Expr; +class FieldDecl; class MacroDefinition; class MacroInstantiation; class NamedDecl; @@ -93,6 +94,14 @@ /// it references and the location where the reference occurred. std::pair getCursorNamespaceRef(CXCursor C); +/// \brief Create a reference to a field at the given location. +CXCursor MakeCursorMemberRef(FieldDecl *Field, SourceLocation Loc, + ASTUnit *TU); + +/// \brief Unpack a MemberRef cursor into the field it references and the +/// location where the reference occurred. +std::pair getCursorMemberRef(CXCursor C); + /// \brief Create a CXX base specifier cursor. CXCursor MakeCursorCXXBaseSpecifier(CXXBaseSpecifier *B, ASTUnit *TU); From daniel at zuster.org Thu Sep 9 16:51:05 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 09 Sep 2010 21:51:05 -0000 Subject: [cfe-commits] r113549 - in /cfe/trunk/lib/Driver: Tools.cpp Tools.h Message-ID: <20100909215105.A06D62A6C12C@llvm.org> Author: ddunbar Date: Thu Sep 9 16:51:05 2010 New Revision: 113549 URL: http://llvm.org/viewvc/llvm-project?rev=113549&view=rev Log: Driver/Darwin: Make the compilation object available in AddLinkArgs. Modified: cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/lib/Driver/Tools.h Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=113549&r1=113548&r2=113549&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Thu Sep 9 16:51:05 2010 @@ -2188,7 +2188,8 @@ CmdArgs.push_back("-force_cpusubtype_ALL"); } -void darwin::Link::AddLinkArgs(const ArgList &Args, +void darwin::Link::AddLinkArgs(Compilation &C, + const ArgList &Args, ArgStringList &CmdArgs) const { const Driver &D = getToolChain().getDriver(); @@ -2378,7 +2379,7 @@ // I'm not sure why this particular decomposition exists in gcc, but // we follow suite for ease of comparison. - AddLinkArgs(Args, CmdArgs); + AddLinkArgs(C, Args, CmdArgs); Args.AddAllArgs(CmdArgs, options::OPT_d_Flag); Args.AddAllArgs(CmdArgs, options::OPT_s); Modified: cfe/trunk/lib/Driver/Tools.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=113549&r1=113548&r2=113549&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Tools.h (original) +++ cfe/trunk/lib/Driver/Tools.h Thu Sep 9 16:51:05 2010 @@ -232,7 +232,8 @@ }; class LLVM_LIBRARY_VISIBILITY Link : public DarwinTool { - void AddLinkArgs(const ArgList &Args, ArgStringList &CmdArgs) const; + void AddLinkArgs(Compilation &C, const ArgList &Args, + ArgStringList &CmdArgs) const; public: Link(const ToolChain &TC) : DarwinTool("darwin::Link", "linker", TC) {} From dgregor at apple.com Thu Sep 9 17:45:38 2010 From: dgregor at apple.com (Douglas Gregor) Date: Thu, 09 Sep 2010 22:45:38 -0000 Subject: [cfe-commits] r113553 - in /cfe/trunk: include/clang/Lex/Pragma.h include/clang/Lex/Preprocessor.h lib/Frontend/PrintPreprocessedOutput.cpp lib/Lex/PPDirectives.cpp lib/Lex/Pragma.cpp lib/Parse/ParsePragma.cpp lib/Parse/ParsePragma.h test/Lexer/pragma-operators.cpp Message-ID: <20100909224539.02F482A6C12C@llvm.org> Author: dgregor Date: Thu Sep 9 17:45:38 2010 New Revision: 113553 URL: http://llvm.org/viewvc/llvm-project?rev=113553&view=rev Log: When we parse a pragma, keep track of how that pragma was originally spelled (#pragma, _Pragma, __pragma). In -E mode, use that information to add appropriate newlines when translating _Pragma and __pragma into #pragma, like GCC does. Fixes . Added: cfe/trunk/test/Lexer/pragma-operators.cpp Modified: cfe/trunk/include/clang/Lex/Pragma.h cfe/trunk/include/clang/Lex/Preprocessor.h cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp cfe/trunk/lib/Lex/PPDirectives.cpp cfe/trunk/lib/Lex/Pragma.cpp cfe/trunk/lib/Parse/ParsePragma.cpp cfe/trunk/lib/Parse/ParsePragma.h Modified: cfe/trunk/include/clang/Lex/Pragma.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Pragma.h?rev=113553&r1=113552&r2=113553&view=diff ============================================================================== --- cfe/trunk/include/clang/Lex/Pragma.h (original) +++ cfe/trunk/include/clang/Lex/Pragma.h Thu Sep 9 17:45:38 2010 @@ -25,6 +25,28 @@ class IdentifierInfo; class PragmaNamespace; + /** + * \brief Describes how the pragma was introduced, e.g., with #pragma, + * _Pragma, or __pragma. + */ + enum PragmaIntroducerKind { + /** + * \brief The pragma was introduced via #pragma. + */ + PIK_HashPragma, + + /** + * \brief The pragma was introduced via the C99 _Pragma(string-literal). + */ + PIK__Pragma, + + /** + * \brief The pragma was introduced via the Microsoft + * __pragma(token-string). + */ + PIK___pragma + }; + /// PragmaHandler - Instances of this interface defined to handle the various /// pragmas that the language front-end uses. Each handler optionally has a /// name (e.g. "pack") and the HandlePragma method is invoked when a pragma with @@ -42,7 +64,8 @@ virtual ~PragmaHandler(); llvm::StringRef getName() const { return Name; } - virtual void HandlePragma(Preprocessor &PP, Token &FirstToken) = 0; + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &FirstToken) = 0; /// getIfNamespace - If this is a namespace, return it. This is equivalent to /// using a dynamic_cast, but doesn't require RTTI. @@ -55,7 +78,8 @@ public: EmptyPragmaHandler(); - virtual void HandlePragma(Preprocessor &PP, Token &FirstToken); + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &FirstToken); }; /// PragmaNamespace - This PragmaHandler subdivides the namespace of pragmas, @@ -90,7 +114,8 @@ return Handlers.empty(); } - virtual void HandlePragma(Preprocessor &PP, Token &FirstToken); + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &FirstToken); virtual PragmaNamespace *getIfNamespace() { return this; } }; Modified: cfe/trunk/include/clang/Lex/Preprocessor.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=113553&r1=113552&r2=113553&view=diff ============================================================================== --- cfe/trunk/include/clang/Lex/Preprocessor.h (original) +++ cfe/trunk/include/clang/Lex/Preprocessor.h Thu Sep 9 17:45:38 2010 @@ -909,8 +909,8 @@ /// is not enclosed within a string literal. void HandleMicrosoft__pragma(Token &Tok); - void Handle_Pragma(const std::string &StrVal, SourceLocation PragmaLoc, - SourceLocation RParenLoc); + void Handle_Pragma(unsigned Introducer, const std::string &StrVal, + SourceLocation PragmaLoc, SourceLocation RParenLoc); /// EnterSourceFileWithLexer - Add a lexer to the top of the include stack and /// start lexing tokens from it instead of the current buffer. @@ -981,7 +981,7 @@ void HandleElifDirective(Token &Tok); // Pragmas. - void HandlePragmaDirective(); + void HandlePragmaDirective(unsigned Introducer); public: void HandlePragmaOnce(Token &OnceTok); void HandlePragmaMark(); Modified: cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp?rev=113553&r1=113552&r2=113553&view=diff ============================================================================== --- cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp (original) +++ cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp Thu Sep 9 17:45:38 2010 @@ -120,6 +120,8 @@ void SetEmittedTokensOnThisLine() { EmittedTokensOnThisLine = true; } bool hasEmittedTokensOnThisLine() const { return EmittedTokensOnThisLine; } + bool StartNewLineIfNeeded(); + virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason, SrcMgr::CharacteristicKind FileType); virtual void Ident(SourceLocation Loc, const std::string &str); @@ -138,7 +140,7 @@ return ConcatInfo.AvoidConcat(PrevPrevTok, PrevTok, Tok); } void WriteLineInfo(unsigned LineNo, const char *Extra=0, unsigned ExtraLen=0); - + bool LineMarkersAreDisabled() const { return DisableLineMarkers; } void HandleNewlinesInToken(const char *TokStr, unsigned Len); /// MacroDefined - This hook is called whenever a macro definition is seen. @@ -213,6 +215,17 @@ return true; } +bool PrintPPOutputPPCallbacks::StartNewLineIfNeeded() { + if (EmittedTokensOnThisLine || EmittedMacroOnThisLine) { + OS << '\n'; + EmittedTokensOnThisLine = false; + EmittedMacroOnThisLine = false; + ++CurLine; + return true; + } + + return false; +} /// FileChanged - Whenever the preprocessor enters or exits a #include file /// it invokes this handler. Update our conception of the current source @@ -438,12 +451,15 @@ UnknownPragmaHandler(const char *prefix, PrintPPOutputPPCallbacks *callbacks) : Prefix(prefix), Callbacks(callbacks) {} - virtual void HandlePragma(Preprocessor &PP, Token &PragmaTok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &PragmaTok) { // Figure out what line we went to and insert the appropriate number of // newline characters. + if (Introducer == PIK__Pragma || Introducer == PIK___pragma) + Callbacks->StartNewLineIfNeeded(); Callbacks->MoveToLine(PragmaTok.getLocation()); Callbacks->OS.write(Prefix, strlen(Prefix)); - + Callbacks->SetEmittedTokensOnThisLine(); // Read and print all of the pragma tokens. while (PragmaTok.isNot(tok::eom)) { if (PragmaTok.hasLeadingSpace()) @@ -452,7 +468,7 @@ Callbacks->OS.write(&TokSpell[0], TokSpell.size()); PP.LexUnexpandedToken(PragmaTok); } - Callbacks->OS << '\n'; + Callbacks->StartNewLineIfNeeded(); } }; } // end anonymous namespace Modified: cfe/trunk/lib/Lex/PPDirectives.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=113553&r1=113552&r2=113553&view=diff ============================================================================== --- cfe/trunk/lib/Lex/PPDirectives.cpp (original) +++ cfe/trunk/lib/Lex/PPDirectives.cpp Thu Sep 9 17:45:38 2010 @@ -17,6 +17,7 @@ #include "clang/Lex/MacroInfo.h" #include "clang/Lex/LexDiagnostic.h" #include "clang/Lex/CodeCompletionHandler.h" +#include "clang/Lex/Pragma.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/SourceManager.h" #include "llvm/ADT/APInt.h" @@ -588,7 +589,7 @@ // C99 6.10.6 - Pragma Directive. case tok::pp_pragma: - return HandlePragmaDirective(); + return HandlePragmaDirective(PIK_HashPragma); // GNU Extensions. case tok::pp_import: Modified: cfe/trunk/lib/Lex/Pragma.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Pragma.cpp?rev=113553&r1=113552&r2=113553&view=diff ============================================================================== --- cfe/trunk/lib/Lex/Pragma.cpp (original) +++ cfe/trunk/lib/Lex/Pragma.cpp Thu Sep 9 17:45:38 2010 @@ -35,7 +35,9 @@ EmptyPragmaHandler::EmptyPragmaHandler() {} -void EmptyPragmaHandler::HandlePragma(Preprocessor &PP, Token &FirstToken) {} +void EmptyPragmaHandler::HandlePragma(Preprocessor &PP, + PragmaIntroducerKind Introducer, + Token &FirstToken) {} //===----------------------------------------------------------------------===// // PragmaNamespace Implementation. @@ -73,7 +75,9 @@ Handlers.erase(Handler->getName()); } -void PragmaNamespace::HandlePragma(Preprocessor &PP, Token &Tok) { +void PragmaNamespace::HandlePragma(Preprocessor &PP, + PragmaIntroducerKind Introducer, + Token &Tok) { // Read the 'namespace' that the directive is in, e.g. STDC. Do not macro // expand it, the user can have a STDC #define, that should not affect this. PP.LexUnexpandedToken(Tok); @@ -89,7 +93,7 @@ } // Otherwise, pass it down. - Handler->HandlePragma(PP, Tok); + Handler->HandlePragma(PP, Introducer, Tok); } //===----------------------------------------------------------------------===// @@ -98,12 +102,12 @@ /// HandlePragmaDirective - The "#pragma" directive has been parsed. Lex the /// rest of the pragma, passing it to the registered pragma handlers. -void Preprocessor::HandlePragmaDirective() { +void Preprocessor::HandlePragmaDirective(unsigned Introducer) { ++NumPragma; // Invoke the first level of pragma handlers which reads the namespace id. Token Tok; - PragmaHandlers->HandlePragma(*this, Tok); + PragmaHandlers->HandlePragma(*this, PragmaIntroducerKind(Introducer), Tok); // If the pragma handler didn't read the rest of the line, consume it now. if (CurPPLexer && CurPPLexer->ParsingPreprocessorDirective) @@ -170,7 +174,7 @@ } } - Handle_Pragma(StrVal, PragmaLoc, RParenLoc); + Handle_Pragma(PIK__Pragma, StrVal, PragmaLoc, RParenLoc); // Finally, return whatever came after the pragma directive. return Lex(Tok); @@ -216,13 +220,14 @@ SourceLocation RParenLoc = Tok.getLocation(); - Handle_Pragma(StrVal, PragmaLoc, RParenLoc); + Handle_Pragma(PIK___pragma, StrVal, PragmaLoc, RParenLoc); // Finally, return whatever came after the pragma directive. return Lex(Tok); } -void Preprocessor::Handle_Pragma(const std::string &StrVal, +void Preprocessor::Handle_Pragma(unsigned Introducer, + const std::string &StrVal, SourceLocation PragmaLoc, SourceLocation RParenLoc) { @@ -241,7 +246,7 @@ EnterSourceFileWithLexer(TL, 0); // With everything set up, lex this as a #pragma directive. - HandlePragmaDirective(); + HandlePragmaDirective(Introducer); } @@ -704,7 +709,8 @@ /// PragmaOnceHandler - "#pragma once" marks the file as atomically included. struct PragmaOnceHandler : public PragmaHandler { PragmaOnceHandler() : PragmaHandler("once") {} - virtual void HandlePragma(Preprocessor &PP, Token &OnceTok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &OnceTok) { PP.CheckEndOfDirective("pragma once"); PP.HandlePragmaOnce(OnceTok); } @@ -714,7 +720,8 @@ /// rest of the line is not lexed. struct PragmaMarkHandler : public PragmaHandler { PragmaMarkHandler() : PragmaHandler("mark") {} - virtual void HandlePragma(Preprocessor &PP, Token &MarkTok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &MarkTok) { PP.HandlePragmaMark(); } }; @@ -722,7 +729,8 @@ /// PragmaPoisonHandler - "#pragma poison x" marks x as not usable. struct PragmaPoisonHandler : public PragmaHandler { PragmaPoisonHandler() : PragmaHandler("poison") {} - virtual void HandlePragma(Preprocessor &PP, Token &PoisonTok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &PoisonTok) { PP.HandlePragmaPoison(PoisonTok); } }; @@ -731,21 +739,24 @@ /// as a system header, which silences warnings in it. struct PragmaSystemHeaderHandler : public PragmaHandler { PragmaSystemHeaderHandler() : PragmaHandler("system_header") {} - virtual void HandlePragma(Preprocessor &PP, Token &SHToken) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &SHToken) { PP.HandlePragmaSystemHeader(SHToken); PP.CheckEndOfDirective("pragma"); } }; struct PragmaDependencyHandler : public PragmaHandler { PragmaDependencyHandler() : PragmaHandler("dependency") {} - virtual void HandlePragma(Preprocessor &PP, Token &DepToken) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &DepToken) { PP.HandlePragmaDependency(DepToken); } }; struct PragmaDebugHandler : public PragmaHandler { PragmaDebugHandler() : PragmaHandler("__debug") {} - virtual void HandlePragma(Preprocessor &PP, Token &DepToken) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &DepToken) { Token Tok; PP.LexUnexpandedToken(Tok); if (Tok.isNot(tok::identifier)) { @@ -783,7 +794,8 @@ struct PragmaDiagnosticHandler : public PragmaHandler { public: explicit PragmaDiagnosticHandler() : PragmaHandler("diagnostic") {} - virtual void HandlePragma(Preprocessor &PP, Token &DiagToken) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &DiagToken) { Token Tok; PP.LexUnexpandedToken(Tok); if (Tok.isNot(tok::identifier)) { @@ -866,7 +878,8 @@ /// PragmaCommentHandler - "#pragma comment ...". struct PragmaCommentHandler : public PragmaHandler { PragmaCommentHandler() : PragmaHandler("comment") {} - virtual void HandlePragma(Preprocessor &PP, Token &CommentTok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &CommentTok) { PP.HandlePragmaComment(CommentTok); } }; @@ -874,7 +887,8 @@ /// PragmaMessageHandler - "#pragma message("...")". struct PragmaMessageHandler : public PragmaHandler { PragmaMessageHandler() : PragmaHandler("message") {} - virtual void HandlePragma(Preprocessor &PP, Token &CommentTok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &CommentTok) { PP.HandlePragmaMessage(CommentTok); } }; @@ -883,7 +897,8 @@ /// macro on the top of the stack. struct PragmaPushMacroHandler : public PragmaHandler { PragmaPushMacroHandler() : PragmaHandler("push_macro") {} - virtual void HandlePragma(Preprocessor &PP, Token &PushMacroTok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &PushMacroTok) { PP.HandlePragmaPushMacro(PushMacroTok); } }; @@ -893,7 +908,8 @@ /// macro to the value on the top of the stack. struct PragmaPopMacroHandler : public PragmaHandler { PragmaPopMacroHandler() : PragmaHandler("pop_macro") {} - virtual void HandlePragma(Preprocessor &PP, Token &PopMacroTok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &PopMacroTok) { PP.HandlePragmaPopMacro(PopMacroTok); } }; @@ -935,7 +951,8 @@ /// PragmaSTDC_FP_CONTRACTHandler - "#pragma STDC FP_CONTRACT ...". struct PragmaSTDC_FP_CONTRACTHandler : public PragmaHandler { PragmaSTDC_FP_CONTRACTHandler() : PragmaHandler("FP_CONTRACT") {} - virtual void HandlePragma(Preprocessor &PP, Token &Tok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &Tok) { // We just ignore the setting of FP_CONTRACT. Since we don't do contractions // at all, our default is OFF and setting it to ON is an optimization hint // we can safely ignore. When we support -ffma or something, we would need @@ -947,7 +964,8 @@ /// PragmaSTDC_FENV_ACCESSHandler - "#pragma STDC FENV_ACCESS ...". struct PragmaSTDC_FENV_ACCESSHandler : public PragmaHandler { PragmaSTDC_FENV_ACCESSHandler() : PragmaHandler("FENV_ACCESS") {} - virtual void HandlePragma(Preprocessor &PP, Token &Tok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &Tok) { if (LexOnOffSwitch(PP) == STDC_ON) PP.Diag(Tok, diag::warn_stdc_fenv_access_not_supported); } @@ -957,7 +975,8 @@ struct PragmaSTDC_CX_LIMITED_RANGEHandler : public PragmaHandler { PragmaSTDC_CX_LIMITED_RANGEHandler() : PragmaHandler("CX_LIMITED_RANGE") {} - virtual void HandlePragma(Preprocessor &PP, Token &Tok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &Tok) { LexOnOffSwitch(PP); } }; @@ -965,7 +984,8 @@ /// PragmaSTDC_UnknownHandler - "#pragma STDC ...". struct PragmaSTDC_UnknownHandler : public PragmaHandler { PragmaSTDC_UnknownHandler() {} - virtual void HandlePragma(Preprocessor &PP, Token &UnknownTok) { + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &UnknownTok) { // C99 6.10.6p2, unknown forms are not allowed. PP.Diag(UnknownTok, diag::ext_stdc_pragma_ignored); } Modified: cfe/trunk/lib/Parse/ParsePragma.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParsePragma.cpp?rev=113553&r1=113552&r2=113553&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParsePragma.cpp (original) +++ cfe/trunk/lib/Parse/ParsePragma.cpp Thu Sep 9 17:45:38 2010 @@ -21,7 +21,9 @@ // #pragma GCC visibility comes in two variants: // 'push' '(' [visibility] ')' // 'pop' -void PragmaGCCVisibilityHandler::HandlePragma(Preprocessor &PP, Token &VisTok) { +void PragmaGCCVisibilityHandler::HandlePragma(Preprocessor &PP, + PragmaIntroducerKind Introducer, + Token &VisTok) { SourceLocation VisLoc = VisTok.getLocation(); Token Tok; @@ -74,7 +76,9 @@ // pack '(' [integer] ')' // pack '(' 'show' ')' // pack '(' ('push' | 'pop') [',' identifier] [, integer] ')' -void PragmaPackHandler::HandlePragma(Preprocessor &PP, Token &PackTok) { +void PragmaPackHandler::HandlePragma(Preprocessor &PP, + PragmaIntroducerKind Introducer, + Token &PackTok) { SourceLocation PackLoc = PackTok.getLocation(); Token Tok; @@ -222,16 +226,22 @@ Actions.ActOnPragmaOptionsAlign(Kind, FirstTok.getLocation(), KindLoc); } -void PragmaAlignHandler::HandlePragma(Preprocessor &PP, Token &AlignTok) { +void PragmaAlignHandler::HandlePragma(Preprocessor &PP, + PragmaIntroducerKind Introducer, + Token &AlignTok) { ParseAlignPragma(Actions, PP, AlignTok, /*IsOptions=*/false); } -void PragmaOptionsHandler::HandlePragma(Preprocessor &PP, Token &OptionsTok) { +void PragmaOptionsHandler::HandlePragma(Preprocessor &PP, + PragmaIntroducerKind Introducer, + Token &OptionsTok) { ParseAlignPragma(Actions, PP, OptionsTok, /*IsOptions=*/true); } // #pragma unused(identifier) -void PragmaUnusedHandler::HandlePragma(Preprocessor &PP, Token &UnusedTok) { +void PragmaUnusedHandler::HandlePragma(Preprocessor &PP, + PragmaIntroducerKind Introducer, + Token &UnusedTok) { // FIXME: Should we be expanding macros here? My guess is no. SourceLocation UnusedLoc = UnusedTok.getLocation(); @@ -298,7 +308,9 @@ // #pragma weak identifier // #pragma weak identifier '=' identifier -void PragmaWeakHandler::HandlePragma(Preprocessor &PP, Token &WeakTok) { +void PragmaWeakHandler::HandlePragma(Preprocessor &PP, + PragmaIntroducerKind Introducer, + Token &WeakTok) { // FIXME: Should we be expanding macros here? My guess is no. SourceLocation WeakLoc = WeakTok.getLocation(); Modified: cfe/trunk/lib/Parse/ParsePragma.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParsePragma.h?rev=113553&r1=113552&r2=113553&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParsePragma.h (original) +++ cfe/trunk/lib/Parse/ParsePragma.h Thu Sep 9 17:45:38 2010 @@ -25,7 +25,8 @@ public: explicit PragmaAlignHandler(Sema &A) : PragmaHandler("align"), Actions(A) {} - virtual void HandlePragma(Preprocessor &PP, Token &FirstToken); + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &FirstToken); }; class PragmaGCCVisibilityHandler : public PragmaHandler { @@ -34,7 +35,8 @@ explicit PragmaGCCVisibilityHandler(Sema &A) : PragmaHandler("visibility"), Actions(A) {} - virtual void HandlePragma(Preprocessor &PP, Token &FirstToken); + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &FirstToken); }; class PragmaOptionsHandler : public PragmaHandler { @@ -43,7 +45,8 @@ explicit PragmaOptionsHandler(Sema &A) : PragmaHandler("options"), Actions(A) {} - virtual void HandlePragma(Preprocessor &PP, Token &FirstToken); + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &FirstToken); }; class PragmaPackHandler : public PragmaHandler { @@ -52,7 +55,8 @@ explicit PragmaPackHandler(Sema &A) : PragmaHandler("pack"), Actions(A) {} - virtual void HandlePragma(Preprocessor &PP, Token &FirstToken); + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &FirstToken); }; class PragmaUnusedHandler : public PragmaHandler { @@ -62,7 +66,8 @@ PragmaUnusedHandler(Sema &A, Parser& p) : PragmaHandler("unused"), Actions(A), parser(p) {} - virtual void HandlePragma(Preprocessor &PP, Token &FirstToken); + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &FirstToken); }; class PragmaWeakHandler : public PragmaHandler { @@ -71,7 +76,8 @@ explicit PragmaWeakHandler(Sema &A) : PragmaHandler("weak"), Actions(A) {} - virtual void HandlePragma(Preprocessor &PP, Token &FirstToken); + virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer, + Token &FirstToken); }; } // end namespace clang Added: cfe/trunk/test/Lexer/pragma-operators.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/pragma-operators.cpp?rev=113553&view=auto ============================================================================== --- cfe/trunk/test/Lexer/pragma-operators.cpp (added) +++ cfe/trunk/test/Lexer/pragma-operators.cpp Thu Sep 9 17:45:38 2010 @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fms-extensions -E %s | FileCheck %s + +// Test that we properly expand the C99 _Pragma and Microsoft __pragma +// into #pragma directives, with newlines where needed. + +// CHECK: extern +// CHECK: #line +// CHECK: #pragma warning(push) +// CHECK: #line +// CHECK: ; void f0(); +// CHECK: #line +// CHECK: #pragma warning(pop) +// CHECK: #line +// CHECK: ; } +extern "C" { _Pragma("warning(push)"); void f0(); __pragma(warning(pop)); } From kremenek at apple.com Thu Sep 9 17:51:56 2010 From: kremenek at apple.com (Ted Kremenek) Date: Thu, 09 Sep 2010 22:51:56 -0000 Subject: [cfe-commits] r113554 - in /cfe/trunk: lib/Checker/CallAndMessageChecker.cpp test/Analysis/misc-ps-region-store.m test/Analysis/misc-ps.m test/Analysis/null-deref-ps.c test/Analysis/uninit-msg-expr.m test/Analysis/uninit-ps-rdar6145427.m test/Analysis/uninit-vals-ps.c Message-ID: <20100909225156.25AC32A6C12C@llvm.org> Author: kremenek Date: Thu Sep 9 17:51:55 2010 New Revision: 113554 URL: http://llvm.org/viewvc/llvm-project?rev=113554&view=rev Log: Clean up obtuse wording of checker diagnostic of using an uninitialized value in a function call. Fixes: ?warning: Pass-by-value argument in function call is undefined? message can be improved Modified: cfe/trunk/lib/Checker/CallAndMessageChecker.cpp cfe/trunk/test/Analysis/misc-ps-region-store.m cfe/trunk/test/Analysis/misc-ps.m cfe/trunk/test/Analysis/null-deref-ps.c cfe/trunk/test/Analysis/uninit-msg-expr.m cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m cfe/trunk/test/Analysis/uninit-vals-ps.c Modified: cfe/trunk/lib/Checker/CallAndMessageChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/CallAndMessageChecker.cpp?rev=113554&r1=113553&r2=113554&view=diff ============================================================================== --- cfe/trunk/lib/Checker/CallAndMessageChecker.cpp (original) +++ cfe/trunk/lib/Checker/CallAndMessageChecker.cpp Thu Sep 9 17:51:55 2010 @@ -193,7 +193,7 @@ if (L.isUndef()) { if (!BT_call_undef) BT_call_undef = - new BuiltinBug("Called function pointer is an undefined pointer value"); + new BuiltinBug("Called function pointer is an uninitalized pointer value"); EmitBadCall(BT_call_undef, C, CE); return; } @@ -208,8 +208,8 @@ for (CallExpr::const_arg_iterator I = CE->arg_begin(), E = CE->arg_end(); I != E; ++I) if (PreVisitProcessArg(C, *I, - "Pass-by-value argument in function call is" - " undefined", BT_call_arg)) + "Function call argument is an uninitialized value", + BT_call_arg)) return; } @@ -224,7 +224,7 @@ if (ExplodedNode *N = C.GenerateSink()) { if (!BT_msg_undef) BT_msg_undef = - new BuiltinBug("Receiver in message expression is a garbage value"); + new BuiltinBug("Receiver in message expression is an uninitialized value"); EnhancedBugReport *R = new EnhancedBugReport(*BT_msg_undef, BT_msg_undef->getName(), N); R->addRange(receiver->getSourceRange()); @@ -239,8 +239,8 @@ for (ObjCMessageExpr::const_arg_iterator I = ME->arg_begin(), E = ME->arg_end(); I != E; ++I) if (PreVisitProcessArg(C, *I, - "Pass-by-value argument in message expression " - "is undefined", BT_msg_arg)) + "Argument in message expression " + "is an uninitialized value", BT_msg_arg)) return; } Modified: cfe/trunk/test/Analysis/misc-ps-region-store.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-region-store.m?rev=113554&r1=113553&r2=113554&view=diff ============================================================================== --- cfe/trunk/test/Analysis/misc-ps-region-store.m (original) +++ cfe/trunk/test/Analysis/misc-ps-region-store.m Thu Sep 9 17:51:55 2010 @@ -394,7 +394,7 @@ int rdar_7332673_test2_aux(char *x); void rdar_7332673_test2() { char *value; - if ( rdar_7332673_test2_aux(value) != 1 ) {} // expected-warning{{Pass-by-value argument in function call is undefined}} + if ( rdar_7332673_test2_aux(value) != 1 ) {} // expected-warning{{Function call argument is an uninitialized value}} } //===----------------------------------------------------------------------===// @@ -671,7 +671,7 @@ builder = ^(id object) { id x; if (object) { - builder(x); // expected-warning{{Pass-by-value argument in function call is undefined}} + builder(x); // expected-warning{{Function call argument is an uninitialized value}} } }; builder(target); Modified: cfe/trunk/test/Analysis/misc-ps.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=113554&r1=113553&r2=113554&view=diff ============================================================================== --- cfe/trunk/test/Analysis/misc-ps.m (original) +++ cfe/trunk/test/Analysis/misc-ps.m Thu Sep 9 17:51:55 2010 @@ -794,7 +794,7 @@ void test_bad_call_aux(int x); void test_bad_call(void) { int y; - test_bad_call_aux(y); // expected-warning{{Pass-by-value argument in function call is undefined}} + test_bad_call_aux(y); // expected-warning{{Function call argument is an uninitialized value}} } @interface TestBadArg {} @@ -803,7 +803,7 @@ void test_bad_msg(TestBadArg *p) { int y; - [p testBadArg:y]; // expected-warning{{Pass-by-value argument in message expression is undefined}} + [p testBadArg:y]; // expected-warning{{Argument in message expression is an uninitialized value}} } //===----------------------------------------------------------------------===// Modified: cfe/trunk/test/Analysis/null-deref-ps.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/null-deref-ps.c?rev=113554&r1=113553&r2=113554&view=diff ============================================================================== --- cfe/trunk/test/Analysis/null-deref-ps.c (original) +++ cfe/trunk/test/Analysis/null-deref-ps.c Thu Sep 9 17:51:55 2010 @@ -288,7 +288,7 @@ void pr4759() { int *p; - pr4759_aux(p); // expected-warning{{undefined}} + pr4759_aux(p); // expected-warning{{Function call argument is an uninitialized value}} } Modified: cfe/trunk/test/Analysis/uninit-msg-expr.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-msg-expr.m?rev=113554&r1=113553&r2=113554&view=diff ============================================================================== --- cfe/trunk/test/Analysis/uninit-msg-expr.m (original) +++ cfe/trunk/test/Analysis/uninit-msg-expr.m Thu Sep 9 17:51:55 2010 @@ -42,7 +42,7 @@ unsigned f1() { NSString *aString; - return [aString length]; // expected-warning {{Receiver in message expression is a garbage value}} + return [aString length]; // expected-warning {{Receiver in message expression is an uninitialized value}} } unsigned f2() { @@ -53,5 +53,5 @@ void f3() { NSMutableArray *aArray = [NSArray array]; NSString *aString; - [aArray addObject:aString]; // expected-warning {{Pass-by-value argument in message expression is undefined.}} + [aArray addObject:aString]; // expected-warning {{Argument in message expression is an uninitialized value}} } Modified: cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m?rev=113554&r1=113553&r2=113554&view=diff ============================================================================== --- cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m (original) +++ cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m Thu Sep 9 17:51:55 2010 @@ -30,7 +30,7 @@ int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is a garbage value}} + id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is an uninitialized value}} NSLog(@"%@", someUnintializedPointer); [pool drain]; return 0; Modified: cfe/trunk/test/Analysis/uninit-vals-ps.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-vals-ps.c?rev=113554&r1=113553&r2=113554&view=diff ============================================================================== --- cfe/trunk/test/Analysis/uninit-vals-ps.c (original) +++ cfe/trunk/test/Analysis/uninit-vals-ps.c Thu Sep 9 17:51:55 2010 @@ -15,7 +15,7 @@ int f1_b() { int x; - return bar(x)+1; // expected-warning{{Pass-by-value argument in function call is undefined.}} + return bar(x)+1; // expected-warning{{Function call argument is an uninitialized value}} } int f2() { From fjahanian at apple.com Thu Sep 9 18:01:10 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Thu, 09 Sep 2010 23:01:10 -0000 Subject: [cfe-commits] r113555 - in /cfe/trunk: lib/AST/ExprClassification.cpp lib/Sema/SemaExpr.cpp test/CodeGenObjCXX/property-objects.mm test/SemaObjCXX/propert-dot-error.mm Message-ID: <20100909230111.147002A6C12C@llvm.org> Author: fjahanian Date: Thu Sep 9 18:01:10 2010 New Revision: 113555 URL: http://llvm.org/viewvc/llvm-project?rev=113555&view=rev Log: property reference expression used on lhs of assignment follows objective's semantics and is not overload'able with an assignment operator. Fixes a crash and a missing diagnostics. Radar 8379892. Added: cfe/trunk/test/SemaObjCXX/propert-dot-error.mm Modified: cfe/trunk/lib/AST/ExprClassification.cpp cfe/trunk/lib/Sema/SemaExpr.cpp cfe/trunk/test/CodeGenObjCXX/property-objects.mm Modified: cfe/trunk/lib/AST/ExprClassification.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprClassification.cpp?rev=113555&r1=113554&r2=113555&view=diff ============================================================================== --- cfe/trunk/lib/AST/ExprClassification.cpp (original) +++ cfe/trunk/lib/AST/ExprClassification.cpp Thu Sep 9 18:01:10 2010 @@ -420,7 +420,8 @@ // Records with any const fields (recursively) are not modifiable. if (const RecordType *R = CT->getAs()) { - assert(!Ctx.getLangOptions().CPlusPlus && + assert((isa(E) || + !Ctx.getLangOptions().CPlusPlus) && "C++ struct assignment should be resolved by the " "copy assignment operator."); if (R->hasConstFields()) Modified: cfe/trunk/lib/Sema/SemaExpr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=113555&r1=113554&r2=113555&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExpr.cpp (original) +++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu Sep 9 18:01:10 2010 @@ -6685,6 +6685,8 @@ BinaryOperatorKind Opc, Expr *lhs, Expr *rhs) { if (getLangOptions().CPlusPlus && + (!isa(lhs) || + rhs->isTypeDependent()) && (lhs->getType()->isOverloadableType() || rhs->getType()->isOverloadableType())) { // Find all of the overloaded operators visible from this Modified: cfe/trunk/test/CodeGenObjCXX/property-objects.mm URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/property-objects.mm?rev=113555&r1=113554&r2=113555&view=diff ============================================================================== --- cfe/trunk/test/CodeGenObjCXX/property-objects.mm (original) +++ cfe/trunk/test/CodeGenObjCXX/property-objects.mm Thu Sep 9 18:01:10 2010 @@ -57,3 +57,22 @@ return 0; } +// rdar://8379892 +// CHECK: define void @_Z1fP1A +// CHECK: @objc_msgSend to void +struct X { + X(); + X(const X&); + ~X(); +}; + + at interface A { + X xval; +} +- (X)x; +- (void)setX:(X)x; + at end + +void f(A* a) { + a.x = X(); +} Added: cfe/trunk/test/SemaObjCXX/propert-dot-error.mm URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/propert-dot-error.mm?rev=113555&view=auto ============================================================================== --- cfe/trunk/test/SemaObjCXX/propert-dot-error.mm (added) +++ cfe/trunk/test/SemaObjCXX/propert-dot-error.mm Thu Sep 9 18:01:10 2010 @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// rdar: // 8379892 + +struct X { + X(); + X(const X&); + ~X(); +}; + + at interface A { + X xval; +} + +- (X)x; +- (void)setx:(X)x; + at end + +void f(A* a) { + a.x = X(); // expected-error {{setter method is needed to assign to object using property assignment syntax}} +} + From dgregor at apple.com Thu Sep 9 18:10:46 2010 From: dgregor at apple.com (Douglas Gregor) Date: Thu, 09 Sep 2010 23:10:46 -0000 Subject: [cfe-commits] r113556 - in /cfe/trunk: test/Index/load-exprs.c tools/libclang/CIndex.cpp Message-ID: <20100909231047.043A72A6C12C@llvm.org> Author: dgregor Date: Thu Sep 9 18:10:46 2010 New Revision: 113556 URL: http://llvm.org/viewvc/llvm-project?rev=113556&view=rev Log: Add libclang visitation for __builtin_offsetof's components (fields and array references). Modified: cfe/trunk/test/Index/load-exprs.c cfe/trunk/tools/libclang/CIndex.cpp Modified: cfe/trunk/test/Index/load-exprs.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/load-exprs.c?rev=113556&r1=113555&r2=113556&view=diff ============================================================================== --- cfe/trunk/test/Index/load-exprs.c (original) +++ cfe/trunk/test/Index/load-exprs.c Thu Sep 9 18:10:46 2010 @@ -20,6 +20,17 @@ return y; } +struct Y { + struct X array[3]; +}; + +enum { StartIndex = 1 }; + +void test_members(int aval, int bval) { + struct Y y0 = { .array[StartIndex].b = bval, .array[StartIndex].a = aval }; + __builtin_offsetof(struct Y, array[StartIndex].b); +} + // RUN: c-index-test -test-load-source all %s -fblocks | FileCheck %s // CHECK: load-exprs.c:1:13: TypedefDecl=T:1:13 (Definition) Extent=[1:13 - 1:14] @@ -52,4 +63,9 @@ // CHECK: load-exprs.c:16:10: DeclRefExpr=z:13:17 Extent=[16:10 - 16:11] // CHECK: load-exprs.c:17:10: DeclRefExpr= Extent=[17:10 - 17:11] // CHECK: load-exprs.c:20:10: DeclRefExpr=y:11:15 Extent=[20:10 - 20:11] +// CHECK: load-exprs.c:29:6: FunctionDecl=test_members:29:6 (Definition) +// CHECK: load-exprs.c:31:29: TypeRef=struct Y:23:8 Extent=[31:29 - 31:30] +// CHECK: load-exprs.c:31:32: MemberRef=array:24:12 Extent=[31:32 - 31:37] +// CHECK: load-exprs.c:31:38: DeclRefExpr=StartIndex:27:8 Extent=[31:38 - 31:48] +// CHECK: load-exprs.c:31:50: MemberRef=b:2:19 Extent=[31:50 - 31:51] Modified: cfe/trunk/tools/libclang/CIndex.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=113556&r1=113555&r2=113556&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CIndex.cpp (original) +++ cfe/trunk/tools/libclang/CIndex.cpp Thu Sep 9 18:10:46 2010 @@ -1555,11 +1555,34 @@ } bool CursorVisitor::VisitOffsetOfExpr(OffsetOfExpr *E) { - // FIXME: Visit fields as well? + // Visit the type into which we're computing an offset. if (Visit(E->getTypeSourceInfo()->getTypeLoc())) return true; + + // Visit the components of the offsetof expression. + for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) { + typedef OffsetOfExpr::OffsetOfNode OffsetOfNode; + const OffsetOfNode &Node = E->getComponent(I); + switch (Node.getKind()) { + case OffsetOfNode::Array: + if (Visit(MakeCXCursor(E->getIndexExpr(Node.getArrayExprIndex()), + StmtParent, TU))) + return true; + break; + + case OffsetOfNode::Field: + if (Visit(MakeCursorMemberRef(Node.getField(), Node.getRange().getEnd(), + TU))) + return true; + break; + + case OffsetOfNode::Identifier: + case OffsetOfNode::Base: + continue; + } + } - return VisitExpr(E); + return false; } bool CursorVisitor::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) { From dgregor at apple.com Thu Sep 9 18:28:24 2010 From: dgregor at apple.com (Douglas Gregor) Date: Thu, 09 Sep 2010 23:28:24 -0000 Subject: [cfe-commits] r113560 - in /cfe/trunk: test/Index/load-exprs.c tools/libclang/CIndex.cpp Message-ID: <20100909232824.1F2C32A6C12C@llvm.org> Author: dgregor Date: Thu Sep 9 18:28:23 2010 New Revision: 113560 URL: http://llvm.org/viewvc/llvm-project?rev=113560&view=rev Log: Add libclang visitation for C99 designated initializers. Modified: cfe/trunk/test/Index/load-exprs.c cfe/trunk/tools/libclang/CIndex.cpp Modified: cfe/trunk/test/Index/load-exprs.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/load-exprs.c?rev=113560&r1=113559&r2=113560&view=diff ============================================================================== --- cfe/trunk/test/Index/load-exprs.c (original) +++ cfe/trunk/test/Index/load-exprs.c Thu Sep 9 18:28:23 2010 @@ -64,6 +64,16 @@ // CHECK: load-exprs.c:17:10: DeclRefExpr= Extent=[17:10 - 17:11] // CHECK: load-exprs.c:20:10: DeclRefExpr=y:11:15 Extent=[20:10 - 20:11] // CHECK: load-exprs.c:29:6: FunctionDecl=test_members:29:6 (Definition) +// CHECK: load-exprs.c:30:12: VarDecl=y0:30:12 (Definition) Extent=[30:10 - 30:77] +// CHECK: load-exprs.c:30:10: TypeRef=struct Y:23:8 Extent=[30:10 - 30:11] +// CHECK: load-exprs.c:30:20: MemberRef=array:24:12 Extent=[30:20 - 30:25] +// CHECK: load-exprs.c:30:26: DeclRefExpr=StartIndex:27:8 Extent=[30:26 - 30:36] +// CHECK: load-exprs.c:30:38: MemberRef=b:2:19 Extent=[30:38 - 30:39] +// CHECK: load-exprs.c:30:42: DeclRefExpr=bval:29:33 Extent=[30:42 - 30:46] +// CHECK: load-exprs.c:30:49: MemberRef=array:24:12 Extent=[30:49 - 30:54] +// CHECK: load-exprs.c:30:55: DeclRefExpr=StartIndex:27:8 Extent=[30:55 - 30:65] +// CHECK: load-exprs.c:30:67: MemberRef=a:2:16 Extent=[30:67 - 30:68] +// CHECK: load-exprs.c:30:71: DeclRefExpr=aval:29:23 Extent=[30:71 - 30:75] // CHECK: load-exprs.c:31:29: TypeRef=struct Y:23:8 Extent=[31:29 - 31:30] // CHECK: load-exprs.c:31:32: MemberRef=array:24:12 Extent=[31:32 - 31:37] // CHECK: load-exprs.c:31:38: DeclRefExpr=StartIndex:27:8 Extent=[31:38 - 31:48] Modified: cfe/trunk/tools/libclang/CIndex.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=113560&r1=113559&r2=113560&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CIndex.cpp (original) +++ cfe/trunk/tools/libclang/CIndex.cpp Thu Sep 9 18:28:23 2010 @@ -380,8 +380,8 @@ // FIXME: AddrLabelExpr (once we have cursors for labels) bool VisitTypesCompatibleExpr(TypesCompatibleExpr *E); bool VisitVAArgExpr(VAArgExpr *E); - // FIXME: InitListExpr (for the designators) - // FIXME: DesignatedInitExpr + bool VisitInitListExpr(InitListExpr *E); + bool VisitDesignatedInitExpr(DesignatedInitExpr *E); bool VisitCXXTypeidExpr(CXXTypeidExpr *E); bool VisitCXXUuidofExpr(CXXUuidofExpr *E); bool VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) { return false; } @@ -1652,6 +1652,42 @@ return Visit(MakeCXCursor(E->getSubExpr(), StmtParent, TU)); } +bool CursorVisitor::VisitInitListExpr(InitListExpr *E) { + // We care about the syntactic form of the initializer list, only. + return VisitExpr(E->getSyntacticForm()); +} + +bool CursorVisitor::VisitDesignatedInitExpr(DesignatedInitExpr *E) { + // Visit the designators. + typedef DesignatedInitExpr::Designator Designator; + for (DesignatedInitExpr::designators_iterator D = E->designators_begin(), + DEnd = E->designators_end(); + D != DEnd; ++D) { + if (D->isFieldDesignator()) { + if (FieldDecl *Field = D->getField()) + if (Visit(MakeCursorMemberRef(Field, D->getFieldLoc(), TU))) + return true; + + continue; + } + + if (D->isArrayDesignator()) { + if (Visit(MakeCXCursor(E->getArrayIndex(*D), StmtParent, TU))) + return true; + + continue; + } + + assert(D->isArrayRangeDesignator() && "Unknown designator kind"); + if (Visit(MakeCXCursor(E->getArrayRangeStart(*D), StmtParent, TU)) || + Visit(MakeCXCursor(E->getArrayRangeEnd(*D), StmtParent, TU))) + return true; + } + + // Visit the initializer value itself. + return Visit(MakeCXCursor(E->getInit(), StmtParent, TU)); +} + bool CursorVisitor::VisitCXXTypeidExpr(CXXTypeidExpr *E) { if (E->isTypeOperand()) { if (TypeSourceInfo *TSInfo = E->getTypeOperandSourceInfo()) From dgregor at apple.com Thu Sep 9 19:22:18 2010 From: dgregor at apple.com (Douglas Gregor) Date: Fri, 10 Sep 2010 00:22:18 -0000 Subject: [cfe-commits] r113564 - in /cfe/trunk: include/clang-c/Index.h test/Index/c-index-api-loadTU-test.m test/Index/index-templates.cpp test/Index/load-stmts.cpp test/Index/preamble.c test/Index/remap-load.c tools/libclang/CIndex.cpp tools/libclang/CXCursor.cpp tools/libclang/CXCursor.h Message-ID: <20100910002219.151CB2A6C12C@llvm.org> Author: dgregor Date: Thu Sep 9 19:22:18 2010 New Revision: 113564 URL: http://llvm.org/viewvc/llvm-project?rev=113564&view=rev Log: Add libclang support for label statements, gotos, and taking the address of a label (GNU extension). Modified: cfe/trunk/include/clang-c/Index.h cfe/trunk/test/Index/c-index-api-loadTU-test.m cfe/trunk/test/Index/index-templates.cpp cfe/trunk/test/Index/load-stmts.cpp cfe/trunk/test/Index/preamble.c cfe/trunk/test/Index/remap-load.c cfe/trunk/tools/libclang/CIndex.cpp cfe/trunk/tools/libclang/CXCursor.cpp cfe/trunk/tools/libclang/CXCursor.h Modified: cfe/trunk/include/clang-c/Index.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=113564&r1=113563&r2=113564&view=diff ============================================================================== --- cfe/trunk/include/clang-c/Index.h (original) +++ cfe/trunk/include/clang-c/Index.h Thu Sep 9 19:22:18 2010 @@ -1000,7 +1000,6 @@ CXCursor_UsingDirective = 34, /** \brief A using declaration. */ CXCursor_UsingDeclaration = 35, - CXCursor_FirstDecl = CXCursor_UnexposedDecl, CXCursor_LastDecl = CXCursor_UsingDeclaration, @@ -1036,11 +1035,28 @@ */ CXCursor_NamespaceRef = 46, /** - * A reference to a member of a struct, union, or class that occurs in some - * non-expression context, e.g., a designated initializer. + * \brief A reference to a member of a struct, union, or class that occurs in + * some non-expression context, e.g., a designated initializer. */ CXCursor_MemberRef = 47, - CXCursor_LastRef = CXCursor_MemberRef, + /** + * \brief A reference to a labeled statement. + * + * This cursor kind is used to describe the jump to "start_over" in the + * goto statement in the following example: + * + * \code + * start_over: + * ++counter; + * + * goto start_over; + * \endcode + * + * A label reference cursor refers to a label statement. + */ + CXCursor_LabelRef = 48, + + CXCursor_LastRef = CXCursor_LabelRef, /* Error conditions */ CXCursor_FirstInvalid = 70, @@ -1100,7 +1116,21 @@ * reported. */ CXCursor_UnexposedStmt = 200, - CXCursor_LastStmt = 200, + + /** \brief A labelled statement in a function. + * + * This cursor kind is used to describe the "start_over:" label statement in + * the following example: + * + * \code + * start_over: + * ++counter; + * \endcode + * + */ + CXCursor_LabelStmt = 201, + + CXCursor_LastStmt = CXCursor_LabelStmt, /** * \brief Cursor that represents the translation unit itself. Modified: cfe/trunk/test/Index/c-index-api-loadTU-test.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/c-index-api-loadTU-test.m?rev=113564&r1=113563&r2=113564&view=diff ============================================================================== --- cfe/trunk/test/Index/c-index-api-loadTU-test.m (original) +++ cfe/trunk/test/Index/c-index-api-loadTU-test.m Thu Sep 9 19:22:18 2010 @@ -103,23 +103,18 @@ // CHECK: c-index-api-loadTU-test.m:46:5: FunctionDecl=main:46:5 (Definition) Extent=[46:5 - 55:2] // CHECK: c-index-api-loadTU-test.m:46:15: ParmDecl=argc:46:15 (Definition) Extent=[46:11 - 46:19] // CHECK: c-index-api-loadTU-test.m:46:34: ParmDecl=argv:46:34 (Definition) Extent=[46:27 - 46:38] -// CHECK: :0:0: UnexposedStmt= Extent=[46:42 - 55:2] -// CHECK: :0:0: UnexposedStmt= Extent=[47:2 - 47:12] // CHECK: c-index-api-loadTU-test.m:47:8: VarDecl=bee:47:8 (Definition) Extent=[47:2 - 47:11] // CHECK: c-index-api-loadTU-test.m:47:2: ObjCClassRef=Baz:33:12 Extent=[47:2 - 47:5] -// CHECK: :0:0: UnexposedStmt= Extent=[48:2 - 48:19] // CHECK: c-index-api-loadTU-test.m:48:5: VarDecl=a:48:5 (Definition) Extent=[48:2 - 48:18] // CHECK: c-index-api-loadTU-test.m:48:2: TypeRef=id:0:0 Extent=[48:2 - 48:4] // CHECK: c-index-api-loadTU-test.m:48:9: ObjCMessageExpr=foo:9:1 Extent=[48:9 - 48:18] // CHECK: c-index-api-loadTU-test.m:48:10: DeclRefExpr=bee:47:8 Extent=[48:10 - 48:13] -// CHECK: :0:0: UnexposedStmt= Extent=[49:2 - 49:27] // CHECK: c-index-api-loadTU-test.m:49:12: VarDecl=c:49:12 (Definition) Extent=[49:2 - 49:26] // CHECK: c-index-api-loadTU-test.m:49:2: TypeRef=id:0:0 Extent=[49:2 - 49:4] // CHECK: c-index-api-loadTU-test.m:49:6: ObjCProtocolRef=SubP:29:1 Extent=[49:6 - 49:10] // CHECK: c-index-api-loadTU-test.m:49:16: UnexposedExpr=fooC:10:1 Extent=[49:16 - 49:26] // CHECK: c-index-api-loadTU-test.m:49:16: ObjCMessageExpr=fooC:10:1 Extent=[49:16 - 49:26] // CHECK: c-index-api-loadTU-test.m:49:17: ObjCClassRef=Foo:4:12 Extent=[49:17 - 49:20] -// CHECK: :0:0: UnexposedStmt= Extent=[50:2 - 50:15] // CHECK: c-index-api-loadTU-test.m:50:13: VarDecl=d:50:13 (Definition) Extent=[50:2 - 50:14] // CHECK: c-index-api-loadTU-test.m:50:2: TypeRef=id:0:0 Extent=[50:2 - 50:4] // CHECK: c-index-api-loadTU-test.m:50:6: ObjCProtocolRef=Proto:25:1 Extent=[50:6 - 50:11] Modified: cfe/trunk/test/Index/index-templates.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/index-templates.cpp?rev=113564&r1=113563&r2=113564&view=diff ============================================================================== --- cfe/trunk/test/Index/index-templates.cpp (original) +++ cfe/trunk/test/Index/index-templates.cpp Thu Sep 9 19:22:18 2010 @@ -110,7 +110,6 @@ // CHECK-LOAD: index-templates.cpp:50:26: FunctionTemplate=getAs:50:26 Extent=[50:3 - 50:33] // CHECK-LOAD: index-templates.cpp:50:21: TemplateTypeParameter=T:50:21 (Definition) Extent=[50:21 - 50:22] // CHECK-LOAD: index-templates.cpp:53:6: FunctionDecl=template_exprs:53:6 (Definition) -// CHECK-LOAD: :0:0: UnexposedStmt= // CHECK-LOAD: index-templates.cpp:54:3: CallExpr=f:4:6 Extent=[54:3 - 54:68] // CHECK-LOAD: index-templates.cpp:54:3: UnexposedExpr=f:4:6 Extent=[54:3 - 54:35] // CHECK-LOAD: index-templates.cpp:54:3: DeclRefExpr=f:4:6 Extent=[54:3 - 54:35] Modified: cfe/trunk/test/Index/load-stmts.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/load-stmts.cpp?rev=113564&r1=113563&r2=113564&view=diff ============================================================================== --- cfe/trunk/test/Index/load-stmts.cpp (original) +++ cfe/trunk/test/Index/load-stmts.cpp Thu Sep 9 19:22:18 2010 @@ -104,6 +104,15 @@ : member(x), Base(x) { } +void considered_harmful(int x) { + start_over: + void *ptr = &&start_over; + if (x > 17) + goto *ptr; + else + goto start_over; +} + // RUN: c-index-test -test-load-source all %s | FileCheck %s // CHECK: load-stmts.cpp:1:13: TypedefDecl=T:1:13 (Definition) Extent=[1:13 - 1:14] // CHECK: load-stmts.cpp:2:8: StructDecl=X:2:8 (Definition) Extent=[2:1 - 2:23] @@ -111,9 +120,6 @@ // CHECK: load-stmts.cpp:2:19: FieldDecl=b:2:19 (Definition) Extent=[2:19 - 2:20] // CHECK: load-stmts.cpp:3:6: FunctionDecl=f:3:6 (Definition) Extent=[3:6 - 11:2] // CHECK: load-stmts.cpp:3:12: ParmDecl=x:3:12 (Definition) Extent=[3:8 - 3:13] -// CHECK: :0:0: UnexposedStmt= Extent=[3:15 - 11:2] -// CHECK: :0:0: UnexposedStmt= Extent=[4:3 - 5:4] -// CHECK: :0:0: UnexposedStmt= Extent=[4:8 - 4:16] // CHECK: load-stmts.cpp:4:10: VarDecl=y:4:10 (Definition) Extent=[4:8 - 4:15] // CHECK: load-stmts.cpp:4:8: TypeRef=T:1:13 Extent=[4:8 - 4:9] // CHECK: load-stmts.cpp:4:14: DeclRefExpr=x:3:12 Extent=[4:14 - 4:15] @@ -124,32 +130,23 @@ // CHECK: load-stmts.cpp:4:19: DeclRefExpr=z:4:19 Extent=[4:19 - 4:20] // CHECK: load-stmts.cpp:4:26: UnexposedExpr= Extent=[4:26 - 4:29] // CHECK: load-stmts.cpp:4:28: DeclRefExpr=x:3:12 Extent=[4:28 - 4:29] -// CHECK: :0:0: UnexposedStmt= Extent=[4:31 - 5:4] -// CHECK: :0:0: UnexposedStmt= Extent=[6:3 - 6:22] // CHECK: load-stmts.cpp:6:10: VarDecl=z2:6:10 (Definition) Extent=[6:7 - 6:17] // CHECK: load-stmts.cpp:6:7: TypeRef=T:1:13 Extent=[6:7 - 6:8] // CHECK: load-stmts.cpp:6:15: UnexposedExpr= Extent=[6:15 - 6:17] // CHECK: load-stmts.cpp:6:16: DeclRefExpr=x:3:12 Extent=[6:16 - 6:17] // CHECK: load-stmts.cpp:6:10: UnexposedExpr=z2:6:10 Extent=[6:10 - 6:12] // CHECK: load-stmts.cpp:6:10: DeclRefExpr=z2:6:10 Extent=[6:10 - 6:12] -// CHECK: :0:0: UnexposedStmt= Extent=[6:19 - 6:22] -// CHECK: :0:0: UnexposedStmt= Extent=[7:3 - 7:25] // CHECK: load-stmts.cpp:7:13: VarDecl=z3:7:13 (Definition) Extent=[7:10 - 7:20] // CHECK: load-stmts.cpp:7:10: TypeRef=T:1:13 Extent=[7:10 - 7:11] // CHECK: load-stmts.cpp:7:18: UnexposedExpr= Extent=[7:18 - 7:20] // CHECK: load-stmts.cpp:7:19: DeclRefExpr=x:3:12 Extent=[7:19 - 7:20] // CHECK: load-stmts.cpp:7:13: UnexposedExpr=z3:7:13 Extent=[7:13 - 7:15] // CHECK: load-stmts.cpp:7:13: DeclRefExpr=z3:7:13 Extent=[7:13 - 7:15] -// CHECK: :0:0: UnexposedStmt= Extent=[7:22 - 7:25] -// CHECK: :0:0: UnexposedStmt= Extent=[8:3 - 10:4] // CHECK: load-stmts.cpp:8:13: VarDecl=z4:8:13 (Definition) Extent=[8:11 - 8:19] // CHECK: load-stmts.cpp:8:11: TypeRef=T:1:13 Extent=[8:11 - 8:12] // CHECK: load-stmts.cpp:8:18: DeclRefExpr=x:3:12 Extent=[8:18 - 8:19] // CHECK: load-stmts.cpp:8:13: DeclRefExpr=z4:8:13 Extent=[8:13 - 8:15] -// CHECK: :0:0: UnexposedStmt= Extent=[8:21 - 10:4] -// CHECK: :0:0: UnexposedStmt= Extent=[9:3 - 9:17] // CHECK: load-stmts.cpp:9:8: UnexposedExpr= Extent=[9:8 - 9:10] -// CHECK: :0:0: UnexposedStmt= Extent=[9:12 - 9:17] // CHECK: load-stmts.cpp:14:7: ClassDecl=A:14:7 (Definition) Extent=[14:1 - 16:2] // CHECK: load-stmts.cpp:15:8: CXXMethod=doA:15:8 Extent=[15:8 - 15:13] // CHECK: load-stmts.cpp:18:7: ClassDecl=B:18:7 (Definition) Extent=[18:1 - 20:2] @@ -220,3 +217,7 @@ // CHECK: load-stmts.cpp:104:16: TypeRef=struct Base:94:8 Extent=[104:16 - 104:2 // CHECK: load-stmts.cpp:104:16: CallExpr= Extent=[104:16 - 104:22] // CHECK: load-stmts.cpp:104:21: DeclRefExpr=x:103:22 Extent=[104:21 - 104:22] +// CHECK: load-stmts.cpp:107:6: FunctionDecl=considered_harmful:107:6 (Definition) +// CHECK: load-stmts.cpp:108:2: LabelStmt=start_over Extent=[108:2 - 109:28] +// CHECK: load-stmts.cpp:109:17: LabelRef=start_over:108:2 Extent=[109:17 - 109:27] +// CHECK: load-stmts.cpp:113:10: LabelRef=start_over:108:2 Extent=[113:10 - 113:20] Modified: cfe/trunk/test/Index/preamble.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/preamble.c?rev=113564&r1=113563&r2=113564&view=diff ============================================================================== --- cfe/trunk/test/Index/preamble.c (original) +++ cfe/trunk/test/Index/preamble.c Thu Sep 9 19:22:18 2010 @@ -9,14 +9,10 @@ // RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -I %S/Inputs -include %t %s 2> %t.stderr.txt | FileCheck %s // RUN: FileCheck -check-prefix CHECK-DIAG %s < %t.stderr.txt // CHECK: preamble.h:1:12: FunctionDecl=bar:1:12 (Definition) Extent=[1:12 - 6:2] -// CHECK: :0:0: UnexposedStmt= Extent=[1:23 - 6:2] -// CHECK: :0:0: UnexposedStmt= Extent=[2:3 - 2:16] -// CHECK: :0:0: UnexposedStmt= Extent=[3:3 - 3:15] // CHECK: preamble.h:4:3: UnexposedExpr= Extent=[4:3 - 4:13] // CHECK: preamble.h:4:3: DeclRefExpr=ptr:2:8 Extent=[4:3 - 4:6] // CHECK: preamble.h:4:9: UnexposedExpr=ptr1:3:10 Extent=[4:9 - 4:13] // CHECK: preamble.h:4:9: DeclRefExpr=ptr1:3:10 Extent=[4:9 - 4:13] -// CHECK: :0:0: UnexposedStmt= Extent=[5:3 - 5:11] // CHECK: preamble.h:5:10: UnexposedExpr= Extent=[5:10 - 5:11] // CHECK: preamble.c:3:5: FunctionDecl=wibble:3:5 Extent=[3:5 - 3:16] // CHECK: preamble.c:3:15: ParmDecl=:3:15 (Definition) Extent=[3:12 - 3:16] Modified: cfe/trunk/test/Index/remap-load.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/remap-load.c?rev=113564&r1=113563&r2=113564&view=diff ============================================================================== --- cfe/trunk/test/Index/remap-load.c (original) +++ cfe/trunk/test/Index/remap-load.c Thu Sep 9 19:22:18 2010 @@ -5,8 +5,6 @@ // CHECK: remap-load.c:1:5: FunctionDecl=foo:1:5 (Definition) Extent=[1:5 - 3:2] // CHECK: remap-load.c:1:13: ParmDecl=parm1:1:13 (Definition) Extent=[1:9 - 1:18] // CHECK: remap-load.c:1:26: ParmDecl=parm2:1:26 (Definition) Extent=[1:20 - 1:31] -// CHECK: :0:0: UnexposedStmt= Extent=[1:33 - 3:2] -// CHECK: :0:0: UnexposedStmt= Extent=[2:3 - 2:23] // CHECK: remap-load.c:2:10: UnexposedExpr= Extent=[2:10 - 2:23] // CHECK: remap-load.c:2:10: UnexposedExpr= Extent=[2:10 - 2:23] // CHECK: remap-load.c:2:10: UnexposedExpr=parm1:1:13 Extent=[2:10 - 2:15] Modified: cfe/trunk/tools/libclang/CIndex.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=113564&r1=113563&r2=113564&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CIndex.cpp (original) +++ cfe/trunk/tools/libclang/CIndex.cpp Thu Sep 9 19:22:18 2010 @@ -359,7 +359,7 @@ // Statement visitors bool VisitStmt(Stmt *S); bool VisitDeclStmt(DeclStmt *S); - // FIXME: LabelStmt label? + bool VisitGotoStmt(GotoStmt *S); bool VisitIfStmt(IfStmt *S); bool VisitSwitchStmt(SwitchStmt *S); bool VisitCaseStmt(CaseStmt *S); @@ -377,7 +377,7 @@ bool VisitOffsetOfExpr(OffsetOfExpr *E); bool VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E); bool VisitMemberExpr(MemberExpr *E); - // FIXME: AddrLabelExpr (once we have cursors for labels) + bool VisitAddrLabelExpr(AddrLabelExpr *E); bool VisitTypesCompatibleExpr(TypesCompatibleExpr *E); bool VisitVAArgExpr(VAArgExpr *E); bool VisitInitListExpr(InitListExpr *E); @@ -1438,6 +1438,10 @@ return false; } +bool CursorVisitor::VisitGotoStmt(GotoStmt *S) { + return Visit(MakeCursorLabelRef(S->getLabel(), S->getLabelLoc(), TU)); +} + bool CursorVisitor::VisitIfStmt(IfStmt *S) { if (VarDecl *Var = S->getConditionVariable()) { if (Visit(MakeCXCursor(Var, TU))) @@ -1640,6 +1644,10 @@ return VisitExpr(E); } +bool CursorVisitor::VisitAddrLabelExpr(AddrLabelExpr *E) { + return Visit(MakeCursorLabelRef(E->getLabel(), E->getLabelLoc(), TU)); +} + bool CursorVisitor::VisitTypesCompatibleExpr(TypesCompatibleExpr *E) { return Visit(E->getArgTInfo1()->getTypeLoc()) || Visit(E->getArgTInfo2()->getTypeLoc()); @@ -2603,6 +2611,13 @@ return createCXString(Field->getNameAsString()); } + case CXCursor_LabelRef: { + LabelStmt *Label = getCursorLabelRef(C).first; + assert(Label && "Missing label"); + + return createCXString(Label->getID()->getName()); + } + default: return createCXString(""); } @@ -2615,6 +2630,14 @@ return createCXString(""); } + if (clang_isStatement(C.kind)) { + Stmt *S = getCursorStmt(C); + if (LabelStmt *Label = dyn_cast_or_null(S)) + return createCXString(Label->getID()->getName()); + + return createCXString(""); + } + if (C.kind == CXCursor_MacroInstantiation) return createCXString(getCursorMacroInstantiation(C)->getName() ->getNameStart()); @@ -2687,6 +2710,8 @@ return createCXString("NamespaceRef"); case CXCursor_MemberRef: return createCXString("MemberRef"); + case CXCursor_LabelRef: + return createCXString("LabelRef"); case CXCursor_UnexposedExpr: return createCXString("UnexposedExpr"); case CXCursor_BlockExpr: @@ -2701,6 +2726,8 @@ return createCXString("ObjCMessageExpr"); case CXCursor_UnexposedStmt: return createCXString("UnexposedStmt"); + case CXCursor_LabelStmt: + return createCXString("LabelStmt"); case CXCursor_InvalidFile: return createCXString("InvalidFile"); case CXCursor_InvalidCode: @@ -2899,6 +2926,11 @@ return clang_getNullLocation(); } + case CXCursor_LabelRef: { + std::pair P = getCursorLabelRef(C); + return cxloc::translateSourceLocation(getCursorContext(C), P.second); + } + default: // FIXME: Need a way to enumerate all non-reference cases. llvm_unreachable("Missed a reference kind"); @@ -2909,6 +2941,10 @@ return cxloc::translateSourceLocation(getCursorContext(C), getLocationFromExpr(getCursorExpr(C))); + if (clang_isStatement(C.kind)) + return cxloc::translateSourceLocation(getCursorContext(C), + getCursorStmt(C)->getLocStart()); + if (C.kind == CXCursor_PreprocessingDirective) { SourceLocation L = cxcursor::getCursorPreprocessingDirective(C).getBegin(); return cxloc::translateSourceLocation(getCursorContext(C), L); @@ -2965,6 +3001,9 @@ // FIXME: Figure out what source range to use for a CXBaseSpecifier. return SourceRange(); + case CXCursor_LabelRef: + return getCursorLabelRef(C).second; + default: // FIXME: Need a way to enumerate all non-reference cases. llvm_unreachable("Missed a reference kind"); @@ -3017,6 +3056,15 @@ return clang_getNullCursor(); } + if (clang_isStatement(C.kind)) { + Stmt *S = getCursorStmt(C); + if (GotoStmt *Goto = dyn_cast_or_null(S)) + return MakeCXCursor(Goto->getLabel(), getCursorDecl(C), + getCursorASTUnit(C)); + + return clang_getNullCursor(); + } + if (C.kind == CXCursor_MacroInstantiation) { if (MacroDefinition *Def = getCursorMacroInstantiation(C)->getDefinition()) return MakeMacroDefinitionCursor(Def, CXXUnit); @@ -3053,6 +3101,13 @@ CXXUnit)); } + case CXCursor_LabelRef: + // FIXME: We end up faking the "parent" declaration here because we + // don't want to make CXCursor larger. + return MakeCXCursor(getCursorLabelRef(C).first, + CXXUnit->getASTContext().getTranslationUnitDecl(), + CXXUnit); + default: // We would prefer to enumerate all non-reference cursor kinds here. llvm_unreachable("Unhandled reference cursor kind"); Modified: cfe/trunk/tools/libclang/CXCursor.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=113564&r1=113563&r2=113564&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CXCursor.cpp (original) +++ cfe/trunk/tools/libclang/CXCursor.cpp Thu Sep 9 19:22:18 2010 @@ -65,7 +65,6 @@ case Stmt::CompoundStmtClass: case Stmt::CaseStmtClass: case Stmt::DefaultStmtClass: - case Stmt::LabelStmtClass: case Stmt::IfStmtClass: case Stmt::SwitchStmtClass: case Stmt::WhileStmtClass: @@ -90,6 +89,10 @@ K = CXCursor_UnexposedStmt; break; + case Stmt::LabelStmtClass: + K = CXCursor_LabelStmt; + break; + case Stmt::PredefinedExprClass: case Stmt::IntegerLiteralClass: case Stmt::FloatingLiteralClass: @@ -153,6 +156,7 @@ case Stmt::BlockExprClass: K = CXCursor_UnexposedExpr; break; + case Stmt::DeclRefExprClass: case Stmt::BlockDeclRefExprClass: // FIXME: UnresolvedLookupExpr? @@ -357,6 +361,23 @@ return static_cast(C.data[0]); } +CXCursor cxcursor::MakeCursorLabelRef(LabelStmt *Label, SourceLocation Loc, + ASTUnit *TU) { + + assert(Label && TU && "Invalid arguments!"); + void *RawLoc = reinterpret_cast(Loc.getRawEncoding()); + CXCursor C = { CXCursor_LabelRef, { Label, RawLoc, TU } }; + return C; +} + +std::pair +cxcursor::getCursorLabelRef(CXCursor C) { + assert(C.kind == CXCursor_LabelRef); + return std::make_pair(static_cast(C.data[0]), + SourceLocation::getFromRawEncoding( + reinterpret_cast(C.data[1]))); +} + Decl *cxcursor::getCursorDecl(CXCursor Cursor) { return (Decl *)Cursor.data[0]; } Modified: cfe/trunk/tools/libclang/CXCursor.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.h?rev=113564&r1=113563&r2=113564&view=diff ============================================================================== --- cfe/trunk/tools/libclang/CXCursor.h (original) +++ cfe/trunk/tools/libclang/CXCursor.h Thu Sep 9 19:22:18 2010 @@ -27,6 +27,7 @@ class Decl; class Expr; class FieldDecl; +class LabelStmt; class MacroDefinition; class MacroInstantiation; class NamedDecl; @@ -128,6 +129,13 @@ /// source range. MacroInstantiation *getCursorMacroInstantiation(CXCursor C); +/// \brief Create a label reference at the given location. +CXCursor MakeCursorLabelRef(LabelStmt *Label, SourceLocation Loc, ASTUnit *TU); + +/// \brief Unpack a label reference into the label statement it refers to and +/// the location of the reference. +std::pair getCursorLabelRef(CXCursor C); + Decl *getCursorDecl(CXCursor Cursor); Expr *getCursorExpr(CXCursor Cursor); Stmt *getCursorStmt(CXCursor Cursor); From tcare at apple.com Thu Sep 9 19:44:44 2010 From: tcare at apple.com (Tom Care) Date: Fri, 10 Sep 2010 00:44:44 -0000 Subject: [cfe-commits] r113568 - in /cfe/trunk: include/clang/Checker/PathSensitive/GRExprEngine.h include/clang/Driver/CC1Options.td include/clang/Frontend/AnalyzerOptions.h lib/Checker/AnalysisConsumer.cpp lib/Checker/AnalyzerStatsChecker.cpp lib/Checker/CMakeLists.txt lib/Checker/GRExprEngineExperimentalChecks.h lib/Frontend/CompilerInvocation.cpp test/Analysis/analyzer-stats.c Message-ID: <20100910004444.4CBBB2A6C12C@llvm.org> Author: tcare Date: Thu Sep 9 19:44:44 2010 New Revision: 113568 URL: http://llvm.org/viewvc/llvm-project?rev=113568&view=rev Log: Added AnalyzerStatsChecker, a path sensitive check that reports visitation statistics about analysis. Running clang with the -analyzer-stats flag will emit warnings containing the information. We can then run a postanalysis script to take this data and give useful information about how much the analyzer missed in a project. Added: cfe/trunk/lib/Checker/AnalyzerStatsChecker.cpp cfe/trunk/test/Analysis/analyzer-stats.c Modified: cfe/trunk/include/clang/Checker/PathSensitive/GRExprEngine.h cfe/trunk/include/clang/Driver/CC1Options.td cfe/trunk/include/clang/Frontend/AnalyzerOptions.h cfe/trunk/lib/Checker/AnalysisConsumer.cpp cfe/trunk/lib/Checker/CMakeLists.txt cfe/trunk/lib/Checker/GRExprEngineExperimentalChecks.h cfe/trunk/lib/Frontend/CompilerInvocation.cpp Modified: cfe/trunk/include/clang/Checker/PathSensitive/GRExprEngine.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/GRExprEngine.h?rev=113568&r1=113567&r2=113568&view=diff ============================================================================== --- cfe/trunk/include/clang/Checker/PathSensitive/GRExprEngine.h (original) +++ cfe/trunk/include/clang/Checker/PathSensitive/GRExprEngine.h Thu Sep 9 19:44:44 2010 @@ -264,6 +264,7 @@ // Functions for external checking of whether we have unfinished work bool wasBlockAborted() const { return CoreEngine.wasBlockAborted(); } + bool hasEmptyWorkList() const { return !CoreEngine.getWorkList()->hasWork(); } bool hasWorkRemaining() const { return wasBlockAborted() || CoreEngine.getWorkList()->hasWork(); } Modified: cfe/trunk/include/clang/Driver/CC1Options.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=113568&r1=113567&r2=113568&view=diff ============================================================================== --- cfe/trunk/include/clang/Driver/CC1Options.td (original) +++ cfe/trunk/include/clang/Driver/CC1Options.td Thu Sep 9 19:44:44 2010 @@ -64,6 +64,8 @@ HelpText<"Warn about unintended use of sizeof() on pointer expressions">; def analysis_WarnIdempotentOps : Flag<"-analyzer-check-idempotent-operations">, HelpText<"Warn about idempotent operations">; +def analysis_AnalyzerStats : Flag<"-analyzer-stats">, + HelpText<"Emit warnings with analyzer statistics">; def analyzer_store : Separate<"-analyzer-store">, HelpText<"Source Code Analysis - Abstract Memory Store Models">; Modified: cfe/trunk/include/clang/Frontend/AnalyzerOptions.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/AnalyzerOptions.h?rev=113568&r1=113567&r2=113568&view=diff ============================================================================== --- cfe/trunk/include/clang/Frontend/AnalyzerOptions.h (original) +++ cfe/trunk/include/clang/Frontend/AnalyzerOptions.h Thu Sep 9 19:44:44 2010 @@ -65,6 +65,7 @@ unsigned AnalyzeAll : 1; unsigned AnalyzerDisplayProgress : 1; unsigned AnalyzeNestedBlocks : 1; + unsigned AnalyzerStats : 1; unsigned EagerlyAssume : 1; unsigned IdempotentOps : 1; unsigned PurgeDead : 1; @@ -73,7 +74,6 @@ unsigned VisualizeEGUbi : 1; unsigned EnableExperimentalChecks : 1; unsigned EnableExperimentalInternalChecks : 1; - unsigned EnableIdempotentOperationChecker : 1; unsigned InlineCall : 1; unsigned UnoptimizedCFG : 1; @@ -85,6 +85,7 @@ AnalyzeAll = 0; AnalyzerDisplayProgress = 0; AnalyzeNestedBlocks = 0; + AnalyzerStats = 0; EagerlyAssume = 0; PurgeDead = 1; TrimGraph = 0; Modified: cfe/trunk/lib/Checker/AnalysisConsumer.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/AnalysisConsumer.cpp?rev=113568&r1=113567&r2=113568&view=diff ============================================================================== --- cfe/trunk/lib/Checker/AnalysisConsumer.cpp (original) +++ cfe/trunk/lib/Checker/AnalysisConsumer.cpp Thu Sep 9 19:44:44 2010 @@ -350,6 +350,10 @@ || C.Opts.EnableExperimentalInternalChecks) RegisterIdempotentOperationChecker(Eng); + // Enable AnalyzerStatsChecker if it was given as an argument + if (C.Opts.AnalyzerStats) + RegisterAnalyzerStatsChecker(Eng); + // Set the graph auditor. llvm::OwningPtr Auditor; if (mgr.shouldVisualizeUbigraph()) { Added: cfe/trunk/lib/Checker/AnalyzerStatsChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/AnalyzerStatsChecker.cpp?rev=113568&view=auto ============================================================================== --- cfe/trunk/lib/Checker/AnalyzerStatsChecker.cpp (added) +++ cfe/trunk/lib/Checker/AnalyzerStatsChecker.cpp Thu Sep 9 19:44:44 2010 @@ -0,0 +1,104 @@ +//==--AnalyzerStatsChecker.cpp - Analyzer visitation statistics --*- C++ -*-==// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// This file reports various statistics about analyzer visitation. +//===----------------------------------------------------------------------===// + +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/ExplodedGraph.h" +#include "clang/Checker/BugReporter/BugReporter.h" +#include "GRExprEngineExperimentalChecks.h" +#include "clang/Basic/SourceManager.h" +#include "llvm/ADT/SmallPtrSet.h" + +using namespace clang; + +namespace { +class AnalyzerStatsChecker : public CheckerVisitor { +public: + static void *getTag(); + void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, GRExprEngine &Eng); + +private: + llvm::SmallPtrSet reachable; +}; +} + +void *AnalyzerStatsChecker::getTag() { + static int x = 0; + return &x; +} + +void clang::RegisterAnalyzerStatsChecker(GRExprEngine &Eng) { + Eng.registerCheck(new AnalyzerStatsChecker()); +} + +void AnalyzerStatsChecker::VisitEndAnalysis(ExplodedGraph &G, + BugReporter &B, + GRExprEngine &Eng) { + const CFG *C = 0; + const Decl *D = 0; + const LocationContext *LC = 0; + const SourceManager &SM = B.getSourceManager(); + + // Iterate over explodedgraph + for (ExplodedGraph::node_iterator I = G.nodes_begin(); + I != G.nodes_end(); ++I) { + const ProgramPoint &P = I->getLocation(); + // Save the LocationContext if we don't have it already + if (!LC) + LC = P.getLocationContext(); + + if (const BlockEdge *BE = dyn_cast(&P)) { + const CFGBlock *CB = BE->getDst(); + reachable.insert(CB); + } + } + + // Get the CFG and the Decl of this block + C = LC->getCFG(); + D = LC->getAnalysisContext()->getDecl(); + + unsigned total = 0, unreachable = 0; + + // Find CFGBlocks that were not covered by any node + for (CFG::const_iterator I = C->begin(); I != C->end(); ++I) { + const CFGBlock *CB = *I; + ++total; + // Check if the block is unreachable + if (!reachable.count(CB)) { + ++unreachable; + } + } + + // We never 'reach' the entry block, so correct the unreachable count + unreachable--; + + // Generate the warning string + llvm::SmallString<128> buf; + llvm::raw_svector_ostream output(buf); + PresumedLoc Loc = SM.getPresumedLoc(D->getLocation()); + output << Loc.getFilename() << " : "; + + if (isa(D) || isa(D)) { + const NamedDecl *ND = cast(D); + output << ND; + } + else if (isa(D)) { + output << "block(line:" << Loc.getLine() << ":col:" << Loc.getColumn(); + } + + output << " -> Total CFGBlocks: " << total << " | Unreachable CFGBlocks: " + << unreachable << " | Aborted Block: " + << (Eng.wasBlockAborted() ? "no" : "yes") + << " | Empty WorkList: " + << (Eng.hasEmptyWorkList() ? "yes" : "no") << "\n"; + + B.EmitBasicReport("Analyzer Statistics", "Internal Statistics", output.str(), + D->getLocation()); +} Modified: cfe/trunk/lib/Checker/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/CMakeLists.txt?rev=113568&r1=113567&r2=113568&view=diff ============================================================================== --- cfe/trunk/lib/Checker/CMakeLists.txt (original) +++ cfe/trunk/lib/Checker/CMakeLists.txt Thu Sep 9 19:44:44 2010 @@ -7,6 +7,7 @@ AggExprVisitor.cpp AnalysisConsumer.cpp AnalysisManager.cpp + AnalyzerStatsChecker.cpp ArrayBoundChecker.cpp AttrNonNullChecker.cpp BasicConstraintManager.cpp Modified: cfe/trunk/lib/Checker/GRExprEngineExperimentalChecks.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngineExperimentalChecks.h?rev=113568&r1=113567&r2=113568&view=diff ============================================================================== --- cfe/trunk/lib/Checker/GRExprEngineExperimentalChecks.h (original) +++ cfe/trunk/lib/Checker/GRExprEngineExperimentalChecks.h Thu Sep 9 19:44:44 2010 @@ -19,6 +19,7 @@ class GRExprEngine; +void RegisterAnalyzerStatsChecker(GRExprEngine &Eng); void RegisterCStringChecker(GRExprEngine &Eng); void RegisterIdempotentOperationChecker(GRExprEngine &Eng); void RegisterMallocChecker(GRExprEngine &Eng); Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=113568&r1=113567&r2=113568&view=diff ============================================================================== --- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original) +++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Thu Sep 9 19:44:44 2010 @@ -99,6 +99,8 @@ Res.push_back("-analyzer-display-progress"); if (Opts.AnalyzeNestedBlocks) Res.push_back("-analyzer-opt-analyze-nested-blocks"); + if (Opts.AnalyzerStats) + Res.push_back("-analyzer-stats"); if (Opts.EagerlyAssume) Res.push_back("-analyzer-eagerly-assume"); if (!Opts.PurgeDead) @@ -815,6 +817,7 @@ Opts.AnalyzerDisplayProgress = Args.hasArg(OPT_analyzer_display_progress); Opts.AnalyzeNestedBlocks = Args.hasArg(OPT_analyzer_opt_analyze_nested_blocks); + Opts.AnalyzerStats = Args.hasArg(OPT_analysis_AnalyzerStats); Opts.PurgeDead = !Args.hasArg(OPT_analyzer_no_purge_dead); Opts.EagerlyAssume = Args.hasArg(OPT_analyzer_eagerly_assume); Opts.AnalyzeSpecificFunction = Args.getLastArgValue(OPT_analyze_function); Added: cfe/trunk/test/Analysis/analyzer-stats.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/analyzer-stats.c?rev=113568&view=auto ============================================================================== --- cfe/trunk/test/Analysis/analyzer-stats.c (added) +++ cfe/trunk/test/Analysis/analyzer-stats.c Thu Sep 9 19:44:44 2010 @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-check-dead-stores -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks -analyzer-stats %s + +int foo(); + +int test() { // expected-warning{{Total CFGBlocks}} + int a = 1; + a = 34 / 12; + + if (foo()) + return a; + + a /= 4; + return a; +} From pichet2000 at gmail.com Thu Sep 9 19:58:08 2010 From: pichet2000 at gmail.com (Francois Pichet) Date: Thu, 9 Sep 2010 20:58:08 -0400 Subject: [cfe-commits] r113493 - /cfe/trunk/test/Index/complete-hiding.c In-Reply-To: <20100909161639.485AF2A6C12C@llvm.org> References: <20100909161639.485AF2A6C12C@llvm.org> Message-ID: Hi... This fix doesn't help But I found a pattern. all the tests that fail use this: env CINDEXTEST_EDITING=1 So I went into c-index-test.c and commented out line 36 and 37: if (getenv("CINDEXTEST_EDITING")) options |= clang_defaultEditingTranslationUnitOptions(); with that in comment... all the index tests pass. I have absolutely no idea why. On Thu, Sep 9, 2010 at 12:16 PM, Douglas Gregor wrote: > Author: dgregor > Date: Thu Sep ?9 11:16:39 2010 > New Revision: 113493 > > URL: http://llvm.org/viewvc/llvm-project?rev=113493&view=rev > Log: > Use temporary files for this test, to see if we can flush out an inexplicable error on Windows > > Modified: > ? ?cfe/trunk/test/Index/complete-hiding.c > > Modified: cfe/trunk/test/Index/complete-hiding.c > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/complete-hiding.c?rev=113493&r1=113492&r2=113493&view=diff > ============================================================================== > --- cfe/trunk/test/Index/complete-hiding.c (original) > +++ cfe/trunk/test/Index/complete-hiding.c Thu Sep ?9 11:16:39 2010 > @@ -16,14 +16,17 @@ > ? struct StructA sa = { }; > ?} > > -// RUN: c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-CC1 %s > +// RUN: c-index-test -code-completion-at=%s:16:3 %s > %t > +// RUN: FileCheck -check-prefix=CHECK-CC1 -input-file=%t %s > ?// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-CC1 %s > ?// CHECK-CC1: VarDecl:{ResultType int}{TypedText StructA} (8) > ?// CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueA} (8) > ?// CHECK-CC1-NOT: VarDecl:{ResultType int}{TypedText ValueA} (50) > ?// CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueB} (50) > -// RUN: c-index-test -code-completion-at=%s:16:10 %s | FileCheck -check-prefix=CHECK-CC2 %s > +// RUN: c-index-test -code-completion-at=%s:16:10 %s > %t > +// RUN: FileCheck -check-prefix=CHECK-CC2 -input-file=%t %s > ?// CHECK-CC2: StructDecl:{TypedText StructA} (65) > ?// CHECK-CC2-NOT: StructDecl:{TypedText StructB} (65) > ?// CHECK-CC2: StructDecl:{TypedText StructC} (65) > -// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:10 %s | FileCheck -check-prefix=CHECK-CC2 %s > +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:10 %s > %t > +// RUN: FileCheck -check-prefix=CHECK-CC2 -input-file=%t %s > > > _______________________________________________ > cfe-commits mailing list > cfe-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > From dgregor at apple.com Thu Sep 9 20:20:02 2010 From: dgregor at apple.com (Douglas Gregor) Date: Thu, 09 Sep 2010 18:20:02 -0700 Subject: [cfe-commits] r113493 - /cfe/trunk/test/Index/complete-hiding.c In-Reply-To: References: <20100909161639.485AF2A6C12C@llvm.org> Message-ID: <6D50C2ED-9FD5-4924-80DF-21C8FD931321@apple.com> That environment variable enables an optimization involving precompiled headers, so that's not a big surprise. Sent from my iPhone On Sep 9, 2010, at 5:58 PM, Francois Pichet wrote: > Hi... This fix doesn't help > > But I found a pattern. all the tests that fail use this: env > CINDEXTEST_EDITING=1 > So I went into c-index-test.c and commented out line 36 and 37: > if (getenv("CINDEXTEST_EDITING")) > options |= clang_defaultEditingTranslationUnitOptions(); > > with that in comment... all the index tests pass. > I have absolutely no idea why. > > On Thu, Sep 9, 2010 at 12:16 PM, Douglas Gregor wrote: >> Author: dgregor >> Date: Thu Sep 9 11:16:39 2010 >> New Revision: 113493 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=113493&view=rev >> Log: >> Use temporary files for this test, to see if we can flush out an inexplicable error on Windows >> >> Modified: >> cfe/trunk/test/Index/complete-hiding.c >> >> Modified: cfe/trunk/test/Index/complete-hiding.c >> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/complete-hiding.c?rev=113493&r1=113492&r2=113493&view=diff >> ============================================================================== >> --- cfe/trunk/test/Index/complete-hiding.c (original) >> +++ cfe/trunk/test/Index/complete-hiding.c Thu Sep 9 11:16:39 2010 >> @@ -16,14 +16,17 @@ >> struct StructA sa = { }; >> } >> >> -// RUN: c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-CC1 %s >> +// RUN: c-index-test -code-completion-at=%s:16:3 %s > %t >> +// RUN: FileCheck -check-prefix=CHECK-CC1 -input-file=%t %s >> // RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-CC1 %s >> // CHECK-CC1: VarDecl:{ResultType int}{TypedText StructA} (8) >> // CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueA} (8) >> // CHECK-CC1-NOT: VarDecl:{ResultType int}{TypedText ValueA} (50) >> // CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueB} (50) >> -// RUN: c-index-test -code-completion-at=%s:16:10 %s | FileCheck -check-prefix=CHECK-CC2 %s >> +// RUN: c-index-test -code-completion-at=%s:16:10 %s > %t >> +// RUN: FileCheck -check-prefix=CHECK-CC2 -input-file=%t %s >> // CHECK-CC2: StructDecl:{TypedText StructA} (65) >> // CHECK-CC2-NOT: StructDecl:{TypedText StructB} (65) >> // CHECK-CC2: StructDecl:{TypedText StructC} (65) >> -// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:10 %s | FileCheck -check-prefix=CHECK-CC2 %s >> +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:10 %s > %t >> +// RUN: FileCheck -check-prefix=CHECK-CC2 -input-file=%t %s >> >> >> _______________________________________________ >> cfe-commits mailing list >> cfe-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >> From kremenek at apple.com Thu Sep 9 20:20:17 2010 From: kremenek at apple.com (Ted Kremenek) Date: Fri, 10 Sep 2010 01:20:17 -0000 Subject: [cfe-commits] r113569 - /cfe/trunk/www/analyzer/latest_checker.html.incl Message-ID: <20100910012017.CE1062A6C12C@llvm.org> Author: kremenek Date: Thu Sep 9 20:20:17 2010 New Revision: 113569 URL: http://llvm.org/viewvc/llvm-project?rev=113569&view=rev Log: Update checker build. Modified: cfe/trunk/www/analyzer/latest_checker.html.incl Modified: cfe/trunk/www/analyzer/latest_checker.html.incl URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/latest_checker.html.incl?rev=113569&r1=113568&r2=113569&view=diff ============================================================================== --- cfe/trunk/www/analyzer/latest_checker.html.incl (original) +++ cfe/trunk/www/analyzer/latest_checker.html.incl Thu Sep 9 20:20:17 2010 @@ -1 +1 @@ -checker-247.tar.bz2 (built July 30, 2010) +checker-248.tar.bz2 (built September 9, 2010) From kremenek at apple.com Thu Sep 9 22:05:33 2010 From: kremenek at apple.com (Ted Kremenek) Date: Fri, 10 Sep 2010 03:05:33 -0000 Subject: [cfe-commits] r113572 - in /cfe/trunk: include/clang/Checker/PathSensitive/CheckerVisitor.def include/clang/Checker/PathSensitive/GRExprEngine.h lib/Analysis/CFG.cpp lib/Checker/GRExprEngine.cpp Message-ID: <20100910030533.433832A6C12C@llvm.org> Author: kremenek Date: Thu Sep 9 22:05:33 2010 New Revision: 113572 URL: http://llvm.org/viewvc/llvm-project?rev=113572&view=rev Log: Add ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit for checkers). Modified: cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.def cfe/trunk/include/clang/Checker/PathSensitive/GRExprEngine.h cfe/trunk/lib/Analysis/CFG.cpp cfe/trunk/lib/Checker/GRExprEngine.cpp Modified: cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.def?rev=113572&r1=113571&r2=113572&view=diff ============================================================================== --- cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.def (original) +++ cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.def Thu Sep 9 22:05:33 2010 @@ -24,6 +24,7 @@ PREVISIT(CallExpr, Stmt) PREVISIT(CXXOperatorCallExpr, CallExpr) PREVISIT(DeclStmt, Stmt) +PREVISIT(ObjCAtSynchronizedStmt, Stmt) PREVISIT(ObjCMessageExpr, Stmt) PREVISIT(ReturnStmt, Stmt) Modified: cfe/trunk/include/clang/Checker/PathSensitive/GRExprEngine.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/GRExprEngine.h?rev=113572&r1=113571&r2=113572&view=diff ============================================================================== --- cfe/trunk/include/clang/Checker/PathSensitive/GRExprEngine.h (original) +++ cfe/trunk/include/clang/Checker/PathSensitive/GRExprEngine.h Thu Sep 9 22:05:33 2010 @@ -26,6 +26,7 @@ #include "clang/AST/Type.h" #include "clang/AST/ExprObjC.h" #include "clang/AST/ExprCXX.h" +#include "clang/AST/StmtObjC.h" namespace clang { class AnalysisManager; @@ -386,6 +387,10 @@ void VisitMemberExpr(const MemberExpr* M, ExplodedNode* Pred, ExplodedNodeSet& Dst, bool asLValue); + /// Transfer function logic for ObjCAtSynchronizedStmts. + void VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S, + ExplodedNode *Pred, ExplodedNodeSet &Dst); + /// VisitObjCIvarRefExpr - Transfer function logic for ObjCIvarRefExprs. void VisitObjCIvarRefExpr(const ObjCIvarRefExpr* DR, ExplodedNode* Pred, ExplodedNodeSet& Dst, bool asLValue); Modified: cfe/trunk/lib/Analysis/CFG.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=113572&r1=113571&r2=113572&view=diff ============================================================================== --- cfe/trunk/lib/Analysis/CFG.cpp (original) +++ cfe/trunk/lib/Analysis/CFG.cpp Thu Sep 9 22:05:33 2010 @@ -1244,6 +1244,10 @@ Succ = SyncBlock; } + // Add the @synchronized to the CFG. + autoCreateBlock(); + AppendStmt(Block, S, AddStmtChoice::AlwaysAdd); + // Inline the sync expression. return addStmt(S->getSynchExpr()); } Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=113572&r1=113571&r2=113572&view=diff ============================================================================== --- cfe/trunk/lib/Checker/GRExprEngine.cpp (original) +++ cfe/trunk/lib/Checker/GRExprEngine.cpp Thu Sep 9 22:05:33 2010 @@ -809,6 +809,10 @@ break; } + case Stmt::ObjCAtSynchronizedStmtClass: + VisitObjCAtSynchronizedStmt(cast(S), Pred, Dst); + break; + // Cases not handled yet; but will handle some day. case Stmt::DesignatedInitExprClass: case Stmt::ExtVectorElementExprClass: @@ -816,7 +820,6 @@ case Stmt::ImplicitValueInitExprClass: case Stmt::ObjCAtCatchStmtClass: case Stmt::ObjCAtFinallyStmtClass: - case Stmt::ObjCAtSynchronizedStmtClass: case Stmt::ObjCAtTryStmtClass: case Stmt::ObjCEncodeExprClass: case Stmt::ObjCImplicitSetterGetterRefExprClass: @@ -2244,6 +2247,23 @@ } //===----------------------------------------------------------------------===// +// Transfer function: Objective-C @synchronized. +//===----------------------------------------------------------------------===// + +void GRExprEngine::VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S, + ExplodedNode *Pred, + ExplodedNodeSet &Dst) { + + // The mutex expression is a CFGElement, so we don't need to explicitly + // visit it since it will already be processed. + + // Pre-visit the ObjCAtSynchronizedStmt. + ExplodedNodeSet Tmp; + Tmp.Add(Pred); + CheckerVisit(S, Dst, Tmp, PreVisitStmtCallback); +} + +//===----------------------------------------------------------------------===// // Transfer function: Objective-C ivar references. //===----------------------------------------------------------------------===// From kremenek at apple.com Thu Sep 9 22:05:40 2010 From: kremenek at apple.com (Ted Kremenek) Date: Fri, 10 Sep 2010 03:05:40 -0000 Subject: [cfe-commits] r113573 - in /cfe/trunk: lib/Checker/CMakeLists.txt lib/Checker/GRExprEngine.cpp lib/Checker/GRExprEngineInternalChecks.h test/Analysis/misc-ps.m Message-ID: <20100910030540.599C82A6C12D@llvm.org> Author: kremenek Date: Thu Sep 9 22:05:40 2010 New Revision: 113573 URL: http://llvm.org/viewvc/llvm-project?rev=113573&view=rev Log: Implement: rule request: warn if @synchronized mutex can be nil Modified: cfe/trunk/lib/Checker/CMakeLists.txt cfe/trunk/lib/Checker/GRExprEngine.cpp cfe/trunk/lib/Checker/GRExprEngineInternalChecks.h cfe/trunk/test/Analysis/misc-ps.m Modified: cfe/trunk/lib/Checker/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/CMakeLists.txt?rev=113573&r1=113572&r2=113573&view=diff ============================================================================== --- cfe/trunk/lib/Checker/CMakeLists.txt (original) +++ cfe/trunk/lib/Checker/CMakeLists.txt Thu Sep 9 22:05:40 2010 @@ -18,6 +18,7 @@ BugReporterVisitors.cpp BuiltinFunctionChecker.cpp CFRefCount.cpp + CStringChecker.cpp CallAndMessageChecker.cpp CastSizeChecker.cpp CastToStructChecker.cpp @@ -29,7 +30,6 @@ Checker.cpp CheckerHelpers.cpp CocoaConventions.cpp - CStringChecker.cpp DereferenceChecker.cpp DivZeroChecker.cpp Environment.cpp @@ -54,6 +54,7 @@ NSErrorChecker.cpp NoReturnFunctionChecker.cpp OSAtomicChecker.cpp + ObjCAtSyncChecker.cpp ObjCUnusedIVarsChecker.cpp PathDiagnostic.cpp PlistDiagnostics.cpp Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=113573&r1=113572&r2=113573&view=diff ============================================================================== --- cfe/trunk/lib/Checker/GRExprEngine.cpp (original) +++ cfe/trunk/lib/Checker/GRExprEngine.cpp Thu Sep 9 22:05:40 2010 @@ -373,6 +373,7 @@ RegisterUndefCapturedBlockVarChecker(Eng); RegisterUndefResultChecker(Eng); RegisterStackAddrLeakChecker(Eng); + RegisterObjCAtSyncChecker(Eng); // This is not a checker yet. RegisterNoReturnFunctionChecker(Eng); Modified: cfe/trunk/lib/Checker/GRExprEngineInternalChecks.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngineInternalChecks.h?rev=113573&r1=113572&r2=113573&view=diff ============================================================================== --- cfe/trunk/lib/Checker/GRExprEngineInternalChecks.h (original) +++ cfe/trunk/lib/Checker/GRExprEngineInternalChecks.h Thu Sep 9 22:05:40 2010 @@ -31,6 +31,7 @@ void RegisterDivZeroChecker(GRExprEngine &Eng); void RegisterFixedAddressChecker(GRExprEngine &Eng); void RegisterNoReturnFunctionChecker(GRExprEngine &Eng); +void RegisterObjCAtSyncChecker(GRExprEngine &Eng); void RegisterPointerArithChecker(GRExprEngine &Eng); void RegisterPointerSubChecker(GRExprEngine &Eng); void RegisterReturnPointerRangeChecker(GRExprEngine &Eng); Modified: cfe/trunk/test/Analysis/misc-ps.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=113573&r1=113572&r2=113573&view=diff ============================================================================== --- cfe/trunk/test/Analysis/misc-ps.m (original) +++ cfe/trunk/test/Analysis/misc-ps.m Thu Sep 9 22:05:40 2010 @@ -1094,4 +1094,19 @@ *p = 0xDEADBEEF; // expected-warning{{Dereference of null pointer}} } +// rule request: warn if synchronization mutex can be nil +void rdar6351970() { + id x = 0; + @synchronized(x) {} // expected-warning{{Nil value used as mutex for @synchronized() (no synchronization will occur)}} +} + +void rdar6351970_b(id x) { + if (!x) + @synchronized(x) {} // expected-warning{{Nil value used as mutex for @synchronized() (no synchronization will occur)}} +} + +void rdar6351970_c() { + id x; + @synchronized(x) {} // expected-warning{{Uninitialized value used as mutex for @synchronized}} +} From kremenek at apple.com Thu Sep 9 22:45:29 2010 From: kremenek at apple.com (Ted Kremenek) Date: Fri, 10 Sep 2010 03:45:29 -0000 Subject: [cfe-commits] r113574 - /cfe/trunk/lib/Checker/ObjCAtSyncChecker.cpp Message-ID: <20100910034529.9B4482A6C12C@llvm.org> Author: kremenek Date: Thu Sep 9 22:45:29 2010 New Revision: 113574 URL: http://llvm.org/viewvc/llvm-project?rev=113574&view=rev Log: Add checker implementation for my previous commit! Added: cfe/trunk/lib/Checker/ObjCAtSyncChecker.cpp Added: cfe/trunk/lib/Checker/ObjCAtSyncChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/ObjCAtSyncChecker.cpp?rev=113574&view=auto ============================================================================== --- cfe/trunk/lib/Checker/ObjCAtSyncChecker.cpp (added) +++ cfe/trunk/lib/Checker/ObjCAtSyncChecker.cpp Thu Sep 9 22:45:29 2010 @@ -0,0 +1,87 @@ +//== ObjCAtSyncChecker.cpp - nil mutex checker for @synchronized -*- C++ -*--=// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This defines ObjCAtSyncChecker, a builtin check that checks for null pointers +// used as mutexes for @synchronized. +// +//===----------------------------------------------------------------------===// + +#include "GRExprEngineInternalChecks.h" +#include "clang/Checker/BugReporter/BugType.h" +#include "clang/Checker/Checkers/DereferenceChecker.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" + +using namespace clang; + +namespace { +class ObjCAtSyncChecker : public CheckerVisitor { + BuiltinBug *BT_null; + BuiltinBug *BT_undef; +public: + ObjCAtSyncChecker() : BT_null(0), BT_undef(0) {} + static void *getTag() { static int tag = 0; return &tag; } + void PreVisitObjCAtSynchronizedStmt(CheckerContext &C, + const ObjCAtSynchronizedStmt *S); +}; +} // end anonymous namespace + +void clang::RegisterObjCAtSyncChecker(GRExprEngine &Eng) { + Eng.registerCheck(new ObjCAtSyncChecker()); +} + +void ObjCAtSyncChecker::PreVisitObjCAtSynchronizedStmt(CheckerContext &C, + const ObjCAtSynchronizedStmt *S) { + + const Expr *Ex = S->getSynchExpr(); + const GRState *state = C.getState(); + SVal V = state->getSVal(Ex); + + // Uninitialized value used for the mutex? + if (isa(V)) { + if (ExplodedNode *N = C.GenerateSink()) { + if (!BT_undef) + BT_undef = new BuiltinBug("Uninitialized value used as mutex " + "for @synchronized"); + EnhancedBugReport *report = + new EnhancedBugReport(*BT_undef, BT_undef->getDescription(), N); + report->addVisitorCreator(bugreporter::registerTrackNullOrUndefValue, Ex); + C.EmitReport(report); + } + return; + } + + // Check for null mutexes. + const GRState *notNullState, *nullState; + llvm::tie(notNullState, nullState) = state->Assume(cast(V)); + + if (nullState) { + if (!notNullState) { + // Generate an error node. This isn't a sink since + // a null mutex just means no synchronization occurs. + if (ExplodedNode *N = C.GenerateNode(nullState)) { + if (!BT_null) + BT_null = new BuiltinBug("Nil value used as mutex for @synchronized() " + "(no synchronization will occur)"); + EnhancedBugReport *report = + new EnhancedBugReport(*BT_null, BT_null->getDescription(), N); + report->addVisitorCreator(bugreporter::registerTrackNullOrUndefValue, + Ex); + + C.EmitReport(report); + } + } + // From this point forward, we know that the mutex is null. + C.addTransition(nullState); + } + + if (notNullState) + C.addTransition(notNullState); +} + From dgregor at apple.com Fri Sep 10 01:27:15 2010 From: dgregor at apple.com (Douglas Gregor) Date: Fri, 10 Sep 2010 06:27:15 -0000 Subject: [cfe-commits] r113580 - in /cfe/trunk: lib/AST/ExprConstant.cpp test/Sema/constant-builtins-2.c Message-ID: <20100910062715.3F73E2A6C12C@llvm.org> Author: dgregor Date: Fri Sep 10 01:27:15 2010 New Revision: 113580 URL: http://llvm.org/viewvc/llvm-project?rev=113580&view=rev Log: Support strlen() and __builtin_strlen() as constant expressions with the call argument is a string literal. Fixes . Modified: cfe/trunk/lib/AST/ExprConstant.cpp cfe/trunk/test/Sema/constant-builtins-2.c Modified: cfe/trunk/lib/AST/ExprConstant.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=113580&r1=113579&r2=113580&view=diff ============================================================================== --- cfe/trunk/lib/AST/ExprConstant.cpp (original) +++ cfe/trunk/lib/AST/ExprConstant.cpp Fri Sep 10 01:27:15 2010 @@ -1159,6 +1159,24 @@ case Builtin::BI__builtin_expect: return Visit(E->getArg(0)); + + case Builtin::BIstrlen: + case Builtin::BI__builtin_strlen: + // As an extension, we support strlen() and __builtin_strlen() as constant + // expressions when the argument is a string literal. + if (StringLiteral *S + = dyn_cast(E->getArg(0)->IgnoreParenImpCasts())) { + // The string literal may have embedded null characters. Find the first + // one and truncate there. + llvm::StringRef Str = S->getString(); + llvm::StringRef::size_type Pos = Str.find(0); + if (Pos != llvm::StringRef::npos) + Str = Str.substr(0, Pos); + + return Success(Str.size(), E); + } + + return Error(E->getLocStart(), diag::note_invalid_subexpr_in_ice, E); } } Modified: cfe/trunk/test/Sema/constant-builtins-2.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/constant-builtins-2.c?rev=113580&r1=113579&r2=113580&view=diff ============================================================================== --- cfe/trunk/test/Sema/constant-builtins-2.c (original) +++ cfe/trunk/test/Sema/constant-builtins-2.c Fri Sep 10 01:27:15 2010 @@ -50,3 +50,7 @@ //int h2 = __builtin_expect(0, 0); extern long int bi0; extern __typeof__(__builtin_expect(0, 0)) bi0; + +// Strings +int array1[__builtin_strlen("ab\0cd")]; +int array2[(sizeof(array1)/sizeof(int)) == 2? 1 : -1]; From chandlerc at gmail.com Fri Sep 10 03:13:48 2010 From: chandlerc at gmail.com (Chandler Carruth) Date: Fri, 10 Sep 2010 08:13:48 -0000 Subject: [cfe-commits] r113582 - /cfe/trunk/include/clang/Sema/Sema.h Message-ID: <20100910081348.A0F512A6C12D@llvm.org> Author: chandlerc Date: Fri Sep 10 03:13:48 2010 New Revision: 113582 URL: http://llvm.org/viewvc/llvm-project?rev=113582&view=rev Log: Re-devirtualize this. A new virtual method snuck in. Modified: cfe/trunk/include/clang/Sema/Sema.h Modified: cfe/trunk/include/clang/Sema/Sema.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=113582&r1=113581&r2=113582&view=diff ============================================================================== --- cfe/trunk/include/clang/Sema/Sema.h (original) +++ cfe/trunk/include/clang/Sema/Sema.h Fri Sep 10 03:13:48 2010 @@ -2166,10 +2166,10 @@ SourceLocation RParenLoc); /// ActOnCXXUuidof - Parse __uuidof( something ). - virtual ExprResult ActOnCXXUuidof(SourceLocation OpLoc, - SourceLocation LParenLoc, bool isType, - void *TyOrExpr, - SourceLocation RParenLoc); + ExprResult ActOnCXXUuidof(SourceLocation OpLoc, + SourceLocation LParenLoc, bool isType, + void *TyOrExpr, + SourceLocation RParenLoc); //// ActOnCXXThis - Parse 'this' pointer. From hhinnant at apple.com Fri Sep 10 11:42:26 2010 From: hhinnant at apple.com (Howard Hinnant) Date: Fri, 10 Sep 2010 16:42:26 -0000 Subject: [cfe-commits] [libcxx] r113590 - in /libcxx/trunk/include: iosfwd memory string vector Message-ID: <20100910164226.F33B82A6C12C@llvm.org> Author: hhinnant Date: Fri Sep 10 11:42:26 2010 New Revision: 113590 URL: http://llvm.org/viewvc/llvm-project?rev=113590&view=rev Log: I am experimenting with putting visibility-default attributes on all struct/classes in libc++. This checkin decorates only basic_string and vector as an experiment, and for review by those in this audience that might know more about visibilty than I do. If I get no negative feedback on this procedure I will begin to decorate the entire library in this way. Modified: libcxx/trunk/include/iosfwd libcxx/trunk/include/memory libcxx/trunk/include/string libcxx/trunk/include/vector Modified: libcxx/trunk/include/iosfwd URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/iosfwd?rev=113590&r1=113589&r2=113590&view=diff ============================================================================== --- libcxx/trunk/include/iosfwd (original) +++ libcxx/trunk/include/iosfwd Fri Sep 10 11:42:26 2010 @@ -92,8 +92,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template struct char_traits; -template class allocator; +template struct _LIBCPP_VISIBLE char_traits; +template class _LIBCPP_VISIBLE allocator; template > class basic_ios; @@ -164,7 +164,7 @@ template class _Traits = char_traits<_CharT>, - class _Allocator = allocator<_CharT> > class basic_string; + class _Allocator = allocator<_CharT> > class _LIBCPP_VISIBLE basic_string; typedef basic_string, allocator > string; typedef basic_string, allocator > wstring; Modified: libcxx/trunk/include/memory URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=113590&r1=113589&r2=113590&view=diff ============================================================================== --- libcxx/trunk/include/memory (original) +++ libcxx/trunk/include/memory Fri Sep 10 11:42:26 2010 @@ -1471,7 +1471,7 @@ // allocator template -class allocator +class _LIBCPP_VISIBLE allocator { public: typedef size_t size_type; Modified: libcxx/trunk/include/string URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/string?rev=113590&r1=113589&r2=113590&view=diff ============================================================================== --- libcxx/trunk/include/string (original) +++ libcxx/trunk/include/string Fri Sep 10 11:42:26 2010 @@ -479,7 +479,7 @@ // char_traits template -struct char_traits +struct _LIBCPP_VISIBLE char_traits { typedef _CharT char_type; typedef int int_type; @@ -591,7 +591,7 @@ // char_traits template <> -struct char_traits +struct _LIBCPP_VISIBLE char_traits { typedef char char_type; typedef int int_type; @@ -933,7 +933,7 @@ extern template class __basic_string_common; template -class basic_string +class _LIBCPP_VISIBLE basic_string : private __basic_string_common { public: Modified: libcxx/trunk/include/vector URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/vector?rev=113590&r1=113589&r2=113590&view=diff ============================================================================== --- libcxx/trunk/include/vector (original) +++ libcxx/trunk/include/vector Fri Sep 10 11:42:26 2010 @@ -419,7 +419,7 @@ } template > -class vector +class _LIBCPP_VISIBLE vector : private __vector_base<_Tp, _Allocator> { private: @@ -1682,7 +1682,7 @@ template struct hash >; template -class vector +class _LIBCPP_VISIBLE vector : private __vector_base_common { public: From fjahanian at apple.com Fri Sep 10 13:56:35 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Fri, 10 Sep 2010 18:56:35 -0000 Subject: [cfe-commits] r113602 - in /cfe/trunk: lib/CodeGen/CGExprCXX.cpp lib/CodeGen/CGObjC.cpp test/CodeGenObjCXX/property-dot-reference.mm Message-ID: <20100910185635.71F642A6C12C@llvm.org> Author: fjahanian Date: Fri Sep 10 13:56:35 2010 New Revision: 113602 URL: http://llvm.org/viewvc/llvm-project?rev=113602&view=rev Log: IRGen fix for using property-dot syntax to pass reference object to a c++ member function. fixes radar 8409336. Added: cfe/trunk/test/CodeGenObjCXX/property-dot-reference.mm Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp cfe/trunk/lib/CodeGen/CGObjC.cpp Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=113602&r1=113601&r2=113602&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original) +++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Fri Sep 10 13:56:35 2010 @@ -100,7 +100,15 @@ This = EmitScalarExpr(ME->getBase()); else { LValue BaseLV = EmitLValue(ME->getBase()); - This = BaseLV.getAddress(); + if (BaseLV.isPropertyRef() || BaseLV.isKVCRef()) { + QualType QT = ME->getBase()->getType(); + RValue RV = + BaseLV.isPropertyRef() ? EmitLoadOfPropertyRefLValue(BaseLV, QT) + : EmitLoadOfKVCRefLValue(BaseLV, QT); + This = RV.isScalar() ? RV.getScalarVal() : RV.getAggregateAddr(); + } + else + This = BaseLV.getAddress(); } if (MD->isTrivial()) { Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=113602&r1=113601&r2=113602&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGObjC.cpp (original) +++ cfe/trunk/lib/CodeGen/CGObjC.cpp Fri Sep 10 13:56:35 2010 @@ -555,7 +555,8 @@ else Receiver = EmitScalarExpr(KE->getBase()); return CGM.getObjCRuntime(). - GenerateMessageSend(*this, Return, Exp->getType(), S, + GenerateMessageSend(*this, Return, + KE->getGetterMethod()->getResultType(), S, Receiver, CallArgList(), KE->getInterfaceDecl()); } Added: cfe/trunk/test/CodeGenObjCXX/property-dot-reference.mm URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/property-dot-reference.mm?rev=113602&view=auto ============================================================================== --- cfe/trunk/test/CodeGenObjCXX/property-dot-reference.mm (added) +++ cfe/trunk/test/CodeGenObjCXX/property-dot-reference.mm Fri Sep 10 13:56:35 2010 @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fexceptions -o - %s | FileCheck %s +// rdar://8409336 + +struct TFENode { +void GetURL() const; +}; + + at interface TNodeIconAndNameCell +- (const TFENode&) node; + at end + + at implementation TNodeIconAndNameCell +- (const TFENode&) node { +// CHECK: call %struct.TFENode* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend +// CHECK-NEXT: call void @_ZNK7TFENode6GetURLEv(%struct.TFENode* %{{.*}}) + self.node.GetURL(); +} // expected-warning {{control reaches end of non-void function}} + at end From kremenek at apple.com Fri Sep 10 15:20:50 2010 From: kremenek at apple.com (Ted Kremenek) Date: Fri, 10 Sep 2010 20:20:50 -0000 Subject: [cfe-commits] r113612 - in /cfe/trunk: lib/Checker/DereferenceChecker.cpp test/Analysis/misc-ps.m Message-ID: <20100910202050.12EB72A6C12C@llvm.org> Author: kremenek Date: Fri Sep 10 15:20:49 2010 New Revision: 113612 URL: http://llvm.org/viewvc/llvm-project?rev=113612&view=rev Log: Polish diagnostics for null dereferences via ObjC ivar accesses. Finishes up . Modified: cfe/trunk/lib/Checker/DereferenceChecker.cpp cfe/trunk/test/Analysis/misc-ps.m Modified: cfe/trunk/lib/Checker/DereferenceChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/DereferenceChecker.cpp?rev=113612&r1=113611&r2=113612&view=diff ============================================================================== --- cfe/trunk/lib/Checker/DereferenceChecker.cpp (original) +++ cfe/trunk/lib/Checker/DereferenceChecker.cpp Fri Sep 10 15:20:49 2010 @@ -123,6 +123,19 @@ } break; } + case Stmt::ObjCIvarRefExprClass: { + const ObjCIvarRefExpr *IV = cast(S); + if (const DeclRefExpr *DR = + dyn_cast(IV->getBase()->IgnoreParenCasts())) { + if (const VarDecl *VD = dyn_cast(DR->getDecl())) { + llvm::raw_svector_ostream os(buf); + os << "Instance variable access (via '" << VD->getName() + << "') results in a null pointer dereference"; + } + } + Ranges.push_back(IV->getSourceRange()); + break; + } default: break; } Modified: cfe/trunk/test/Analysis/misc-ps.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=113612&r1=113611&r2=113612&view=diff ============================================================================== --- cfe/trunk/test/Analysis/misc-ps.m (original) +++ cfe/trunk/test/Analysis/misc-ps.m Fri Sep 10 15:20:49 2010 @@ -1110,3 +1110,22 @@ @synchronized(x) {} // expected-warning{{Uninitialized value used as mutex for @synchronized}} } +// rule request: direct structure member access null pointer dereference + at interface RDar6352035 { + int c; +} +- (void)foo; +- (void)bar; + at end + + at implementation RDar6352035 +- (void)foo { + RDar6352035 *friend = 0; + friend->c = 7; // expected-warning{{Instance variable access (via 'friend') results in a null pointer dereference}} +} +- (void)bar { + self = 0; + c = 7; // expected-warning{{Instance variable access (via 'self') results in a null pointer dereference}} +} + at end + From kledzik at apple.com Fri Sep 10 15:42:37 2010 From: kledzik at apple.com (Nick Kledzik) Date: Fri, 10 Sep 2010 20:42:37 -0000 Subject: [cfe-commits] [libcxx] r113616 - in /libcxx/trunk: Makefile lib/buildit lib/i386.exp lib/libc++abi.exp lib/notweak.exp lib/x86_64.exp src/typeinfo.cpp Message-ID: <20100910204237.303AC2A6C12C@llvm.org> Author: kledzik Date: Fri Sep 10 15:42:36 2010 New Revision: 113616 URL: http://llvm.org/viewvc/llvm-project?rev=113616&view=rev Log: [libstdcxx] use new linker options to make symbols non-weak Added: libcxx/trunk/lib/i386.exp libcxx/trunk/lib/libc++abi.exp libcxx/trunk/lib/notweak.exp libcxx/trunk/lib/x86_64.exp Modified: libcxx/trunk/Makefile libcxx/trunk/lib/buildit libcxx/trunk/src/typeinfo.cpp Modified: libcxx/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/Makefile?rev=113616&r1=113615&r2=113616&view=diff ============================================================================== --- libcxx/trunk/Makefile (original) +++ libcxx/trunk/Makefile Fri Sep 10 15:42:36 2010 @@ -12,7 +12,7 @@ installsrc:: $(SRCROOT) ditto $(SRCDIRS)/include $(SRCROOT)/include - ditto $(SRCDIRS)/lib/buildit $(SRCROOT)/lib/buildit + ditto $(SRCDIRS)/lib $(SRCROOT)/lib ditto $(SRCDIRS)/src $(SRCROOT)/src ditto $(SRCDIRS)/Makefile $(SRCROOT)/Makefile Modified: libcxx/trunk/lib/buildit URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/buildit?rev=113616&r1=113615&r2=113616&view=diff ============================================================================== --- libcxx/trunk/lib/buildit (original) +++ libcxx/trunk/lib/buildit Fri Sep 10 15:42:36 2010 @@ -17,6 +17,16 @@ CXX=g++ fi +if [ -z $MACOSX_DEPLOYMENT_TARGET ] +then + MACOSX_DEPLOYMENT_TARGET=10.6 +fi + +if [ -z $RC_ProjectSourceVersion ] +then + RC_ProjectSourceVersion=1 +fi + case $TRIPLE in *-apple-*) if [ -z $RC_BUILDIT ] @@ -24,12 +34,28 @@ RC_CFLAGS="-arch i386 -arch x86_64" fi SOEXT=dylib - LDSHARED_FLAGS="-o libc++.1.dylib \ - -dynamiclib -nodefaultlibs -current_version 1 \ - -compatibility_version 1 \ - -install_name /usr/lib/libc++.dylib \ - -Wl,-reexport_library,/usr/lib/libc++abi.dylib \ - /usr/lib/libSystem.B.dylib" + if [ "$MACOSX_DEPLOYMENT_TARGET" == "10.6" ] + then + LDSHARED_FLAGS="-o libc++.1.dylib \ + -dynamiclib -nodefaultlibs -current_version 1 \ + -compatibility_version 1 \ + -install_name /usr/lib/libc++.dylib \ + -Wl,-reexport_library,/usr/lib/libc++abi.dylib \ + /usr/lib/libSystem.B.dylib" + else + LDSHARED_FLAGS="-o libc++.1.dylib \ + -dynamiclib -nodefaultlibs \ + -current_version ${RC_ProjectSourceVersion} -compatibility_version 1 \ + -install_name /usr/lib/libc++.dylib \ + ${SDKROOT}/usr/lib/libc++abi.dylib \ + -lSystem \ + -Xarch_x86_64 -exported_symbols_list \ + -Xarch_x86_64 x86_64.exp \ + -Xarch_i386 -exported_symbols_list \ + -Xarch_i386 i386.exp \ + -exported_symbols_list libc++abi.exp \ + -Wl,-force_symbols_not_weak_list,notweak.exp" + fi ;; *) RC_CFLAGS="-fPIC" @@ -51,7 +77,8 @@ $CXX -c -g -Os $RC_CFLAGS -nostdinc++ -I../include $FILE done -$CXX *.o $RC_CFLAGS $LDSHARED_FLAGS + +$CXX *.o $RC_CFLAGS $LDSHARED_FLAGS #libtool -static -o libc++.a *.o Added: libcxx/trunk/lib/i386.exp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/i386.exp?rev=113616&view=auto ============================================================================== --- libcxx/trunk/lib/i386.exp (added) +++ libcxx/trunk/lib/i386.exp Fri Sep 10 15:42:36 2010 @@ -0,0 +1,2262 @@ +__ZGVNSt3__110moneypunctIcLb0EE2idE +__ZGVNSt3__110moneypunctIcLb1EE2idE +__ZGVNSt3__110moneypunctIwLb0EE2idE +__ZGVNSt3__110moneypunctIwLb1EE2idE +__ZGVNSt3__17collateIcE2idE +__ZGVNSt3__17collateIwE2idE +__ZGVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZGVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZGVNSt3__18messagesIcE2idE +__ZGVNSt3__18messagesIwE2idE +__ZGVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZGVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZGVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZGVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZNKSt10bad_typeid4whatEv +__ZNKSt11logic_error4whatEv +__ZNKSt13bad_exception4whatEv +__ZNKSt13runtime_error4whatEv +__ZNKSt16nested_exception14rethrow_nestedEv +__ZNKSt20bad_array_new_length4whatEv +__ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc +__ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc +__ZNKSt3__110error_code7messageEv +__ZNKSt3__110moneypunctIcLb0EE10neg_formatEv +__ZNKSt3__110moneypunctIcLb0EE10pos_formatEv +__ZNKSt3__110moneypunctIcLb0EE11curr_symbolEv +__ZNKSt3__110moneypunctIcLb0EE11do_groupingEv +__ZNKSt3__110moneypunctIcLb0EE11frac_digitsEv +__ZNKSt3__110moneypunctIcLb0EE13decimal_pointEv +__ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv +__ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv +__ZNKSt3__110moneypunctIcLb0EE13negative_signEv +__ZNKSt3__110moneypunctIcLb0EE13positive_signEv +__ZNKSt3__110moneypunctIcLb0EE13thousands_sepEv +__ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv +__ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv +__ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv +__ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv +__ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv +__ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv +__ZNKSt3__110moneypunctIcLb0EE8groupingEv +__ZNKSt3__110moneypunctIcLb1EE10neg_formatEv +__ZNKSt3__110moneypunctIcLb1EE10pos_formatEv +__ZNKSt3__110moneypunctIcLb1EE11curr_symbolEv +__ZNKSt3__110moneypunctIcLb1EE11do_groupingEv +__ZNKSt3__110moneypunctIcLb1EE11frac_digitsEv +__ZNKSt3__110moneypunctIcLb1EE13decimal_pointEv +__ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv +__ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv +__ZNKSt3__110moneypunctIcLb1EE13negative_signEv +__ZNKSt3__110moneypunctIcLb1EE13positive_signEv +__ZNKSt3__110moneypunctIcLb1EE13thousands_sepEv +__ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv +__ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv +__ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv +__ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv +__ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv +__ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv +__ZNKSt3__110moneypunctIcLb1EE8groupingEv +__ZNKSt3__110moneypunctIwLb0EE10neg_formatEv +__ZNKSt3__110moneypunctIwLb0EE10pos_formatEv +__ZNKSt3__110moneypunctIwLb0EE11curr_symbolEv +__ZNKSt3__110moneypunctIwLb0EE11do_groupingEv +__ZNKSt3__110moneypunctIwLb0EE11frac_digitsEv +__ZNKSt3__110moneypunctIwLb0EE13decimal_pointEv +__ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv +__ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv +__ZNKSt3__110moneypunctIwLb0EE13negative_signEv +__ZNKSt3__110moneypunctIwLb0EE13positive_signEv +__ZNKSt3__110moneypunctIwLb0EE13thousands_sepEv +__ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv +__ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv +__ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv +__ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv +__ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv +__ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv +__ZNKSt3__110moneypunctIwLb0EE8groupingEv +__ZNKSt3__110moneypunctIwLb1EE10neg_formatEv +__ZNKSt3__110moneypunctIwLb1EE10pos_formatEv +__ZNKSt3__110moneypunctIwLb1EE11curr_symbolEv +__ZNKSt3__110moneypunctIwLb1EE11do_groupingEv +__ZNKSt3__110moneypunctIwLb1EE11frac_digitsEv +__ZNKSt3__110moneypunctIwLb1EE13decimal_pointEv +__ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv +__ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv +__ZNKSt3__110moneypunctIwLb1EE13negative_signEv +__ZNKSt3__110moneypunctIwLb1EE13positive_signEv +__ZNKSt3__110moneypunctIwLb1EE13thousands_sepEv +__ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv +__ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv +__ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv +__ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv +__ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv +__ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv +__ZNKSt3__110moneypunctIwLb1EE8groupingEv +__ZNKSt3__112bad_weak_ptr4whatEv +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12__invariantsEv +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12__invariantsEv +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm +__ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc +__ZNKSt3__112ctype_bynameIcE10do_tolowerEc +__ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc +__ZNKSt3__112ctype_bynameIcE10do_toupperEc +__ZNKSt3__112ctype_bynameIwE10do_scan_isEjPKwS3_ +__ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw +__ZNKSt3__112ctype_bynameIwE10do_tolowerEw +__ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw +__ZNKSt3__112ctype_bynameIwE10do_toupperEw +__ZNKSt3__112ctype_bynameIwE11do_scan_notEjPKwS3_ +__ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pj +__ZNKSt3__112ctype_bynameIwE5do_isEjw +__ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw +__ZNKSt3__112ctype_bynameIwE8do_widenEc +__ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc +__ZNKSt3__112ctype_bynameIwE9do_narrowEwc +__ZNKSt3__112strstreambuf6pcountEv +__ZNKSt3__113basic_istreamIcNS_11char_traitsIcEEE6gcountEv +__ZNKSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentrycvbEv +__ZNKSt3__113basic_istreamIwNS_11char_traitsIwEEE6gcountEv +__ZNKSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentrycvbEv +__ZNKSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentrycvbEv +__ZNKSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentrycvbEv +__ZNKSt3__113random_device7entropyEv +__ZNKSt3__114__codecvt_utf8IjE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__114__codecvt_utf8IjE11do_encodingEv +__ZNKSt3__114__codecvt_utf8IjE13do_max_lengthEv +__ZNKSt3__114__codecvt_utf8IjE16do_always_noconvEv +__ZNKSt3__114__codecvt_utf8IjE5do_inER11__mbstate_tPKcS5_RS5_PjS7_RS7_ +__ZNKSt3__114__codecvt_utf8IjE6do_outER11__mbstate_tPKjS5_RS5_PcS7_RS7_ +__ZNKSt3__114__codecvt_utf8IjE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__114__codecvt_utf8ItE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__114__codecvt_utf8ItE11do_encodingEv +__ZNKSt3__114__codecvt_utf8ItE13do_max_lengthEv +__ZNKSt3__114__codecvt_utf8ItE16do_always_noconvEv +__ZNKSt3__114__codecvt_utf8ItE5do_inER11__mbstate_tPKcS5_RS5_PtS7_RS7_ +__ZNKSt3__114__codecvt_utf8ItE6do_outER11__mbstate_tPKtS5_RS5_PcS7_RS7_ +__ZNKSt3__114__codecvt_utf8ItE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__114__codecvt_utf8IwE11do_encodingEv +__ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv +__ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv +__ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_ +__ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_ +__ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_ +__ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_ +__ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_ +__ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_ +__ZNKSt3__114error_category10equivalentERKNS_10error_codeEi +__ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE +__ZNKSt3__114error_category23default_error_conditionEi +__ZNKSt3__115__codecvt_utf16IjLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16IjLb0EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16IjLb0EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16IjLb0EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16IjLb0EE5do_inER11__mbstate_tPKcS5_RS5_PjS7_RS7_ +__ZNKSt3__115__codecvt_utf16IjLb0EE6do_outER11__mbstate_tPKjS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16IjLb0EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115__codecvt_utf16IjLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16IjLb1EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16IjLb1EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16IjLb1EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16IjLb1EE5do_inER11__mbstate_tPKcS5_RS5_PjS7_RS7_ +__ZNKSt3__115__codecvt_utf16IjLb1EE6do_outER11__mbstate_tPKjS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16IjLb1EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115__codecvt_utf16ItLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16ItLb0EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16ItLb0EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16ItLb0EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16ItLb0EE5do_inER11__mbstate_tPKcS5_RS5_PtS7_RS7_ +__ZNKSt3__115__codecvt_utf16ItLb0EE6do_outER11__mbstate_tPKtS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16ItLb0EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115__codecvt_utf16ItLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16ItLb1EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16ItLb1EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16ItLb1EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16ItLb1EE5do_inER11__mbstate_tPKcS5_RS5_PtS7_RS7_ +__ZNKSt3__115__codecvt_utf16ItLb1EE6do_outER11__mbstate_tPKtS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16ItLb1EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_ +__ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_ +__ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE4gptrEv +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE4pptrEv +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5ebackEv +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5egptrEv +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5epptrEv +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbaseEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE4gptrEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE4pptrEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE5ebackEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE5egptrEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE5epptrEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbaseEv +__ZNKSt3__115error_condition7messageEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__XEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__cEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__rEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__xEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE7__am_pmEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE7__weeksEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__monthsEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__XEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__cEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__rEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__xEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE7__am_pmEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE7__weeksEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__monthsEv +__ZNKSt3__117__assoc_sub_state11__has_valueEv +__ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv +__ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv +__ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv +__ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv +__ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv +__ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv +__ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv +__ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv +__ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv +__ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv +__ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv +__ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv +__ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv +__ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv +__ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv +__ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv +__ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv +__ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv +__ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv +__ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv +__ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv +__ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv +__ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv +__ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv +__ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv +__ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv +__ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv +__ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv +__ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv +__ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv +__ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv +__ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv +__ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv +__ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv +__ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv +__ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv +__ZNKSt3__118__time_get_storageIcE15__do_date_orderEv +__ZNKSt3__118__time_get_storageIwE15__do_date_orderEv +__ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info +__ZNKSt3__120__codecvt_utf8_utf16IjE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__120__codecvt_utf8_utf16IjE11do_encodingEv +__ZNKSt3__120__codecvt_utf8_utf16IjE13do_max_lengthEv +__ZNKSt3__120__codecvt_utf8_utf16IjE16do_always_noconvEv +__ZNKSt3__120__codecvt_utf8_utf16IjE5do_inER11__mbstate_tPKcS5_RS5_PjS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16IjE6do_outER11__mbstate_tPKjS5_RS5_PcS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16IjE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__120__codecvt_utf8_utf16ItE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__120__codecvt_utf8_utf16ItE11do_encodingEv +__ZNKSt3__120__codecvt_utf8_utf16ItE13do_max_lengthEv +__ZNKSt3__120__codecvt_utf8_utf16ItE16do_always_noconvEv +__ZNKSt3__120__codecvt_utf8_utf16ItE5do_inER11__mbstate_tPKcS5_RS5_PtS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16ItE6do_outER11__mbstate_tPKtS5_RS5_PcS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16ItE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv +__ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv +__ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv +__ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__120__time_get_c_storageIcE3__XEv +__ZNKSt3__120__time_get_c_storageIcE3__cEv +__ZNKSt3__120__time_get_c_storageIcE3__rEv +__ZNKSt3__120__time_get_c_storageIcE3__xEv +__ZNKSt3__120__time_get_c_storageIcE7__am_pmEv +__ZNKSt3__120__time_get_c_storageIcE7__weeksEv +__ZNKSt3__120__time_get_c_storageIcE8__monthsEv +__ZNKSt3__120__time_get_c_storageIwE3__XEv +__ZNKSt3__120__time_get_c_storageIwE3__cEv +__ZNKSt3__120__time_get_c_storageIwE3__rEv +__ZNKSt3__120__time_get_c_storageIwE3__xEv +__ZNKSt3__120__time_get_c_storageIwE7__am_pmEv +__ZNKSt3__120__time_get_c_storageIwE7__weeksEv +__ZNKSt3__120__time_get_c_storageIwE8__monthsEv +__ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv +__ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv +__ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv +__ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv +__ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE +__ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE +__ZNKSt3__15ctypeIcE10do_tolowerEPcPKc +__ZNKSt3__15ctypeIcE10do_tolowerEc +__ZNKSt3__15ctypeIcE10do_toupperEPcPKc +__ZNKSt3__15ctypeIcE10do_toupperEc +__ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc +__ZNKSt3__15ctypeIcE8do_widenEc +__ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc +__ZNKSt3__15ctypeIcE9do_narrowEcc +__ZNKSt3__15ctypeIwE10do_scan_isEjPKwS3_ +__ZNKSt3__15ctypeIwE10do_tolowerEPwPKw +__ZNKSt3__15ctypeIwE10do_tolowerEw +__ZNKSt3__15ctypeIwE10do_toupperEPwPKw +__ZNKSt3__15ctypeIwE10do_toupperEw +__ZNKSt3__15ctypeIwE11do_scan_notEjPKwS3_ +__ZNKSt3__15ctypeIwE5do_isEPKwS3_Pj +__ZNKSt3__15ctypeIwE5do_isEjw +__ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw +__ZNKSt3__15ctypeIwE8do_widenEc +__ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc +__ZNKSt3__15ctypeIwE9do_narrowEwc +__ZNKSt3__16locale4nameEv +__ZNKSt3__16locale9has_facetERNS0_2idE +__ZNKSt3__16locale9use_facetERNS0_2idE +__ZNKSt3__16localeeqERKS0_ +__ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_ +__ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv +__ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv +__ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv +__ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_ +__ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_ +__ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m +__ZNKSt3__17codecvtIjc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_ +__ZNKSt3__17codecvtIjc11__mbstate_tE11do_encodingEv +__ZNKSt3__17codecvtIjc11__mbstate_tE13do_max_lengthEv +__ZNKSt3__17codecvtIjc11__mbstate_tE16do_always_noconvEv +__ZNKSt3__17codecvtIjc11__mbstate_tE5do_inERS1_PKcS5_RS5_PjS7_RS7_ +__ZNKSt3__17codecvtIjc11__mbstate_tE6do_outERS1_PKjS5_RS5_PcS7_RS7_ +__ZNKSt3__17codecvtIjc11__mbstate_tE9do_lengthERS1_PKcS5_m +__ZNKSt3__17codecvtItc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_ +__ZNKSt3__17codecvtItc11__mbstate_tE11do_encodingEv +__ZNKSt3__17codecvtItc11__mbstate_tE13do_max_lengthEv +__ZNKSt3__17codecvtItc11__mbstate_tE16do_always_noconvEv +__ZNKSt3__17codecvtItc11__mbstate_tE5do_inERS1_PKcS5_RS5_PtS7_RS7_ +__ZNKSt3__17codecvtItc11__mbstate_tE6do_outERS1_PKtS5_RS5_PcS7_RS7_ +__ZNKSt3__17codecvtItc11__mbstate_tE9do_lengthERS1_PKcS5_m +__ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_ +__ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv +__ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv +__ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv +__ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_ +__ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_ +__ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m +__ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_ +__ZNKSt3__17collateIcE12do_transformEPKcS3_ +__ZNKSt3__17collateIcE4hashEPKcS3_ +__ZNKSt3__17collateIcE7compareEPKcS3_S3_S3_ +__ZNKSt3__17collateIcE7do_hashEPKcS3_ +__ZNKSt3__17collateIcE9transformEPKcS3_ +__ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_ +__ZNKSt3__17collateIwE12do_transformEPKwS3_ +__ZNKSt3__17collateIwE4hashEPKwS3_ +__ZNKSt3__17collateIwE7compareEPKwS3_S3_S3_ +__ZNKSt3__17collateIwE7do_hashEPKwS3_ +__ZNKSt3__17collateIwE9transformEPKwS3_ +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRPv +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRb +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRd +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRe +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRf +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRl +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRm +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRt +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRx +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRy +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjS8_ +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_ +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRPv +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRb +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRd +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRe +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRf +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRl +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRm +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRt +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRx +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRy +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjS8_ +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_ +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPKv +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcb +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcd +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEce +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcl +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcm +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcx +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcy +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPKv +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwb +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwd +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwe +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwl +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwm +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwx +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwy +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy +__ZNKSt3__18ios_base6getlocEv +__ZNKSt3__18messagesIcE3getEP10__nl_cat_diiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNKSt3__18messagesIcE4openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE +__ZNKSt3__18messagesIcE5closeEP10__nl_cat_d +__ZNKSt3__18messagesIcE6do_getEP10__nl_cat_diiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE +__ZNKSt3__18messagesIcE8do_closeEP10__nl_cat_d +__ZNKSt3__18messagesIwE3getEP10__nl_cat_diiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE +__ZNKSt3__18messagesIwE4openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE +__ZNKSt3__18messagesIwE5closeEP10__nl_cat_d +__ZNKSt3__18messagesIwE6do_getEP10__nl_cat_diiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE +__ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE +__ZNKSt3__18messagesIwE8do_closeEP10__nl_cat_d +__ZNKSt3__18numpunctIcE11do_groupingEv +__ZNKSt3__18numpunctIcE11do_truenameEv +__ZNKSt3__18numpunctIcE12do_falsenameEv +__ZNKSt3__18numpunctIcE16do_decimal_pointEv +__ZNKSt3__18numpunctIcE16do_thousands_sepEv +__ZNKSt3__18numpunctIwE11do_groupingEv +__ZNKSt3__18numpunctIwE11do_truenameEv +__ZNKSt3__18numpunctIwE12do_falsenameEv +__ZNKSt3__18numpunctIwE16do_decimal_pointEv +__ZNKSt3__18numpunctIwE16do_thousands_sepEv +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10date_orderEv +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11get_weekdayES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13get_monthnameES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_ +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmcc +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8get_dateES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8get_timeES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8get_yearES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10date_orderEv +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11get_weekdayES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13get_monthnameES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_ +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmcc +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8get_dateES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8get_timeES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8get_yearES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_ +__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmcc +__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc +__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_ +__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmcc +__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc +__ZNKSt3__19basic_iosIcNS_11char_traitsIcEEE10exceptionsEv +__ZNKSt3__19basic_iosIcNS_11char_traitsIcEEE3badEv +__ZNKSt3__19basic_iosIcNS_11char_traitsIcEEE3eofEv +__ZNKSt3__19basic_iosIcNS_11char_traitsIcEEE4failEv +__ZNKSt3__19basic_iosIcNS_11char_traitsIcEEE4goodEv +__ZNKSt3__19basic_iosIcNS_11char_traitsIcEEE7rdstateEv +__ZNKSt3__19basic_iosIcNS_11char_traitsIcEEEcvbEv +__ZNKSt3__19basic_iosIcNS_11char_traitsIcEEEntEv +__ZNKSt3__19basic_iosIwNS_11char_traitsIwEEE10exceptionsEv +__ZNKSt3__19basic_iosIwNS_11char_traitsIwEEE3badEv +__ZNKSt3__19basic_iosIwNS_11char_traitsIwEEE3eofEv +__ZNKSt3__19basic_iosIwNS_11char_traitsIwEEE4failEv +__ZNKSt3__19basic_iosIwNS_11char_traitsIwEEE4goodEv +__ZNKSt3__19basic_iosIwNS_11char_traitsIwEEE7rdstateEv +__ZNKSt3__19basic_iosIwNS_11char_traitsIwEEEcvbEv +__ZNKSt3__19basic_iosIwNS_11char_traitsIwEEEntEv +__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE +__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_bRNS_8ios_baseERjRe +__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE +__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe +__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE +__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_bRNS_8ios_baseERjRe +__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE +__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe +__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE +__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_bRNS_8ios_baseEce +__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE +__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce +__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE +__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_bRNS_8ios_baseEwe +__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE +__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe +__ZNKSt8bad_cast4whatEv +__ZNKSt9bad_alloc4whatEv +__ZNKSt9exception4whatEv +__ZNSt10bad_typeidC1Ev +__ZNSt10bad_typeidC2Ev +__ZNSt10bad_typeidD0Ev +__ZNSt10bad_typeidD1Ev +__ZNSt10bad_typeidD2Ev +__ZNSt11logic_errorC1EPKc +__ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE +__ZNSt11logic_errorC1ERKS_ +__ZNSt11logic_errorC2EPKc +__ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE +__ZNSt11logic_errorC2ERKS_ +__ZNSt11logic_errorD0Ev +__ZNSt11logic_errorD1Ev +__ZNSt11logic_errorD2Ev +__ZNSt11logic_erroraSERKS_ +__ZNSt11range_errorD0Ev +__ZNSt11range_errorD1Ev +__ZNSt11range_errorD2Ev +__ZNSt12domain_errorD0Ev +__ZNSt12domain_errorD1Ev +__ZNSt12domain_errorD2Ev +__ZNSt12length_errorD0Ev +__ZNSt12length_errorD1Ev +__ZNSt12length_errorD2Ev +__ZNSt12out_of_rangeD0Ev +__ZNSt12out_of_rangeD1Ev +__ZNSt12out_of_rangeD2Ev +__ZNSt13bad_exceptionD0Ev +__ZNSt13bad_exceptionD1Ev +__ZNSt13bad_exceptionD2Ev +__ZNSt13exception_ptrC1ERKS_ +__ZNSt13exception_ptrC2ERKS_ +__ZNSt13exception_ptrD1Ev +__ZNSt13exception_ptrD2Ev +__ZNSt13exception_ptraSERKS_ +__ZNSt13runtime_errorC1EPKc +__ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE +__ZNSt13runtime_errorC1ERKS_ +__ZNSt13runtime_errorC2EPKc +__ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE +__ZNSt13runtime_errorC2ERKS_ +__ZNSt13runtime_errorD0Ev +__ZNSt13runtime_errorD1Ev +__ZNSt13runtime_errorD2Ev +__ZNSt13runtime_erroraSERKS_ +__ZNSt14overflow_errorD0Ev +__ZNSt14overflow_errorD1Ev +__ZNSt14overflow_errorD2Ev +__ZNSt15underflow_errorD0Ev +__ZNSt15underflow_errorD1Ev +__ZNSt15underflow_errorD2Ev +__ZNSt16invalid_argumentD0Ev +__ZNSt16invalid_argumentD1Ev +__ZNSt16invalid_argumentD2Ev +__ZNSt16nested_exceptionC1Ev +__ZNSt16nested_exceptionC2Ev +__ZNSt16nested_exceptionD0Ev +__ZNSt16nested_exceptionD1Ev +__ZNSt16nested_exceptionD2Ev +__ZNSt20bad_array_new_lengthC1Ev +__ZNSt20bad_array_new_lengthC2Ev +__ZNSt20bad_array_new_lengthD0Ev +__ZNSt20bad_array_new_lengthD1Ev +__ZNSt20bad_array_new_lengthD2Ev +__ZNSt3__110__time_getC1EPKc +__ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__110__time_getC2EPKc +__ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__110__time_getD1Ev +__ZNSt3__110__time_getD2Ev +__ZNSt3__110__time_putC1EPKc +__ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__110__time_putC2EPKc +__ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__110__time_putD1Ev +__ZNSt3__110__time_putD2Ev +__ZNSt3__110adopt_lockE +__ZNSt3__110defer_lockE +__ZNSt3__110istrstreamD0Ev +__ZNSt3__110istrstreamD1Ev +__ZNSt3__110istrstreamD2Ev +__ZNSt3__110moneypunctIcLb0EE2idE +__ZNSt3__110moneypunctIcLb0EEC1Em +__ZNSt3__110moneypunctIcLb0EEC2Em +__ZNSt3__110moneypunctIcLb0EED0Ev +__ZNSt3__110moneypunctIcLb0EED1Ev +__ZNSt3__110moneypunctIcLb0EED2Ev +__ZNSt3__110moneypunctIcLb1EE2idE +__ZNSt3__110moneypunctIcLb1EEC1Em +__ZNSt3__110moneypunctIcLb1EEC2Em +__ZNSt3__110moneypunctIcLb1EED0Ev +__ZNSt3__110moneypunctIcLb1EED1Ev +__ZNSt3__110moneypunctIcLb1EED2Ev +__ZNSt3__110moneypunctIwLb0EE2idE +__ZNSt3__110moneypunctIwLb0EEC1Em +__ZNSt3__110moneypunctIwLb0EEC2Em +__ZNSt3__110moneypunctIwLb0EED0Ev +__ZNSt3__110moneypunctIwLb0EED1Ev +__ZNSt3__110moneypunctIwLb0EED2Ev +__ZNSt3__110moneypunctIwLb1EE2idE +__ZNSt3__110moneypunctIwLb1EEC1Em +__ZNSt3__110moneypunctIwLb1EEC2Em +__ZNSt3__110moneypunctIwLb1EED0Ev +__ZNSt3__110moneypunctIwLb1EED1Ev +__ZNSt3__110moneypunctIwLb1EED2Ev +__ZNSt3__110ostrstreamD0Ev +__ZNSt3__110ostrstreamD1Ev +__ZNSt3__110ostrstreamD2Ev +__ZNSt3__110to_wstringEd +__ZNSt3__110to_wstringEe +__ZNSt3__110to_wstringEf +__ZNSt3__110to_wstringEi +__ZNSt3__110to_wstringEj +__ZNSt3__110to_wstringEl +__ZNSt3__110to_wstringEm +__ZNSt3__110to_wstringEx +__ZNSt3__110to_wstringEy +__ZNSt3__111__call_onceERVmPvPFvS2_E +__ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri +__ZNSt3__111__money_getIcEC1Ev +__ZNSt3__111__money_getIcEC2Ev +__ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri +__ZNSt3__111__money_getIwEC1Ev +__ZNSt3__111__money_getIwEC2Ev +__ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri +__ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i +__ZNSt3__111__money_putIcEC1Ev +__ZNSt3__111__money_putIcEC2Ev +__ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri +__ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i +__ZNSt3__111__money_putIwEC1Ev +__ZNSt3__111__money_putIwEC2Ev +__ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE +__ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE +__ZNSt3__111regex_errorD0Ev +__ZNSt3__111regex_errorD1Ev +__ZNSt3__111regex_errorD2Ev +__ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILx1ELx1000000000EEEEE +__ZNSt3__111timed_mutex4lockEv +__ZNSt3__111timed_mutex6unlockEv +__ZNSt3__111timed_mutex8try_lockEv +__ZNSt3__111timed_mutexC1Ev +__ZNSt3__111timed_mutexC2Ev +__ZNSt3__111timed_mutexD1Ev +__ZNSt3__111timed_mutexD2Ev +__ZNSt3__111try_to_lockE +__ZNSt3__111unique_lockINS_5mutexEE4lockEv +__ZNSt3__111unique_lockINS_5mutexEE6unlockEv +__ZNSt3__111unique_lockINS_5mutexEE8try_lockEv +__ZNSt3__112__do_nothingEPv +__ZNSt3__112__next_primeEm +__ZNSt3__112__rs_default4__c_E +__ZNSt3__112__rs_defaultC1ERKS0_ +__ZNSt3__112__rs_defaultC1Ev +__ZNSt3__112__rs_defaultC2ERKS0_ +__ZNSt3__112__rs_defaultC2Ev +__ZNSt3__112__rs_defaultD1Ev +__ZNSt3__112__rs_defaultD2Ev +__ZNSt3__112__rs_defaultclEv +__ZNSt3__112bad_weak_ptrD0Ev +__ZNSt3__112bad_weak_ptrD1Ev +__ZNSt3__112bad_weak_ptrD2Ev +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13shrink_to_fitEv +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPKcEENS_9enable_ifIXsrNS_21__is_forward_iteratorIT_EE5valueEvE4typeESB_SB_ +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendESt16initializer_listIcE +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendIPcEENS_9enable_ifIXsrNS_21__is_forward_iteratorIT_EE5valueERS5_E4typeESA_SA_ +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignESt16initializer_listIcE +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEESt16initializer_listIcE +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertIPKcEENS_9enable_ifIXsrNS_21__is_forward_iteratorIT_EE5valueENS_11__wrap_iterIPcEEE4typeENSD_IS8_EESB_SB_ +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceENS_11__wrap_iterIPcEES8_St16initializer_listIcE +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceIPKcEENS_9enable_ifIXsrNS_19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIPcEESI_SB_SB_ +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_ +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_ +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_ +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_ +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_ +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSESt16initializer_listIcE +__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13shrink_to_fitEv +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initIPKwEENS_9enable_ifIXsrNS_21__is_forward_iteratorIT_EE5valueEvE4typeESB_SB_ +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendESt16initializer_listIwE +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendIPwEENS_9enable_ifIXsrNS_21__is_forward_iteratorIT_EE5valueERS5_E4typeESA_SA_ +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignESt16initializer_listIwE +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignIPwEENS_9enable_ifIXsrNS_21__is_forward_iteratorIT_EE5valueERS5_E4typeESA_SA_ +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEESt16initializer_listIwE +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertIPKwEENS_9enable_ifIXsrNS_21__is_forward_iteratorIT_EE5valueENS_11__wrap_iterIPwEEE4typeENSD_IS8_EESB_SB_ +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceENS_11__wrap_iterIPwEES8_St16initializer_listIwE +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceIPKwEENS_9enable_ifIXsrNS_19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIPwEESI_SB_SB_ +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_ +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_ +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_ +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_ +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_ +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_ +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSESt16initializer_listIwE +__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw +__ZNSt3__112ctype_bynameIcEC1EPKcm +__ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__112ctype_bynameIcEC2EPKcm +__ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__112ctype_bynameIcED0Ev +__ZNSt3__112ctype_bynameIcED1Ev +__ZNSt3__112ctype_bynameIcED2Ev +__ZNSt3__112ctype_bynameIwEC1EPKcm +__ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__112ctype_bynameIwEC2EPKcm +__ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__112ctype_bynameIwED0Ev +__ZNSt3__112ctype_bynameIwED1Ev +__ZNSt3__112ctype_bynameIwED2Ev +__ZNSt3__112future_errorC1ENS_10error_codeE +__ZNSt3__112future_errorC2ENS_10error_codeE +__ZNSt3__112future_errorD0Ev +__ZNSt3__112future_errorD1Ev +__ZNSt3__112placeholders2_1E +__ZNSt3__112placeholders2_2E +__ZNSt3__112placeholders2_3E +__ZNSt3__112placeholders2_4E +__ZNSt3__112placeholders2_5E +__ZNSt3__112placeholders2_6E +__ZNSt3__112placeholders2_7E +__ZNSt3__112placeholders2_8E +__ZNSt3__112placeholders2_9E +__ZNSt3__112placeholders3_10E +__ZNSt3__112strstreambuf3strEv +__ZNSt3__112strstreambuf4swapERS0_ +__ZNSt3__112strstreambuf6__initEPciS1_ +__ZNSt3__112strstreambuf6freezeEb +__ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj +__ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj +__ZNSt3__112strstreambuf8overflowEi +__ZNSt3__112strstreambuf9pbackfailEi +__ZNSt3__112strstreambuf9underflowEv +__ZNSt3__112strstreambufC1EPFPvmEPFvS1_E +__ZNSt3__112strstreambufC1EPKai +__ZNSt3__112strstreambufC1EPKci +__ZNSt3__112strstreambufC1EPKhi +__ZNSt3__112strstreambufC1EPaiS1_ +__ZNSt3__112strstreambufC1EPciS1_ +__ZNSt3__112strstreambufC1EPhiS1_ +__ZNSt3__112strstreambufC1Ei +__ZNSt3__112strstreambufC2EPFPvmEPFvS1_E +__ZNSt3__112strstreambufC2EPKai +__ZNSt3__112strstreambufC2EPKci +__ZNSt3__112strstreambufC2EPKhi +__ZNSt3__112strstreambufC2EPaiS1_ +__ZNSt3__112strstreambufC2EPciS1_ +__ZNSt3__112strstreambufC2EPhiS1_ +__ZNSt3__112strstreambufC2Ei +__ZNSt3__112strstreambufD0Ev +__ZNSt3__112strstreambufD1Ev +__ZNSt3__112strstreambufD2Ev +__ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__112system_errorC1ENS_10error_codeE +__ZNSt3__112system_errorC1ENS_10error_codeEPKc +__ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__112system_errorC1EiRKNS_14error_categoryE +__ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc +__ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__112system_errorC2ENS_10error_codeE +__ZNSt3__112system_errorC2ENS_10error_codeEPKc +__ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__112system_errorC2EiRKNS_14error_categoryE +__ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc +__ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__112system_errorD0Ev +__ZNSt3__112system_errorD1Ev +__ZNSt3__112system_errorD2Ev +__ZNSt3__113__vector_baseINS_4pairIPNS_18condition_variableEPNS_5mutexEEENS_9allocatorIS6_EEED2Ev +__ZNSt3__113allocator_argE +__ZNSt3__113atomic_futureIvE4swapERS1_ +__ZNSt3__113atomic_futureIvED1Ev +__ZNSt3__113atomic_futureIvED2Ev +__ZNSt3__113atomic_futureIvEaSERKS1_ +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcic +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPci +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEii +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcic +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPci +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx +__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwiw +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwi +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreEii +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwiw +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwi +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx +__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKci +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_ +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_ +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1Ev +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2Ev +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx +__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwi +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_ +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_ +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1Ev +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2Ev +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx +__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy +__ZNSt3__113move_backwardIPNS_4pairIPNS_18condition_variableEPNS_5mutexEEES7_EET0_T_S9_S8_ +__ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__113random_deviceD1Ev +__ZNSt3__113random_deviceD2Ev +__ZNSt3__113random_deviceclEv +__ZNSt3__113shared_futureIvED1Ev +__ZNSt3__113shared_futureIvED2Ev +__ZNSt3__113shared_futureIvEaSERKS1_ +__ZNSt3__114__codecvt_utf8IjED0Ev +__ZNSt3__114__codecvt_utf8IjED1Ev +__ZNSt3__114__codecvt_utf8ItED0Ev +__ZNSt3__114__codecvt_utf8ItED1Ev +__ZNSt3__114__codecvt_utf8IwED0Ev +__ZNSt3__114__codecvt_utf8IwED1Ev +__ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE +__ZNSt3__114__num_get_base5__srcE +__ZNSt3__114__num_put_base12__format_intEPcPKcbj +__ZNSt3__114__num_put_base14__format_floatEPcPKcj +__ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE +__ZNSt3__114__shared_count12__add_sharedEv +__ZNSt3__114__shared_count16__release_sharedEv +__ZNSt3__114__shared_countD0Ev +__ZNSt3__114__shared_countD1Ev +__ZNSt3__114__shared_countD2Ev +__ZNSt3__114__split_bufferINS_4pairIPNS_18condition_variableEPNS_5mutexEEERNS_9allocatorIS6_EEE10push_frontERKS6_ +__ZNSt3__114__split_bufferINS_4pairIPNS_18condition_variableEPNS_5mutexEEERNS_9allocatorIS6_EEEC2EmmS9_ +__ZNSt3__114__split_bufferINS_4pairIPNS_18condition_variableEPNS_5mutexEEERNS_9allocatorIS6_EEED2Ev +__ZNSt3__114__split_bufferIPNS_17__assoc_sub_stateERNS_9allocatorIS2_EEE10push_frontERKS2_ +__ZNSt3__114__split_bufferIPNS_17__assoc_sub_stateERNS_9allocatorIS2_EEEC2EmmS5_ +__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev +__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev +__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev +__ZNSt3__114codecvt_bynameIcc11__mbstate_tEC1EPKcm +__ZNSt3__114codecvt_bynameIcc11__mbstate_tEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114codecvt_bynameIcc11__mbstate_tEC2EPKcm +__ZNSt3__114codecvt_bynameIcc11__mbstate_tEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev +__ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev +__ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev +__ZNSt3__114codecvt_bynameIjc11__mbstate_tEC1EPKcm +__ZNSt3__114codecvt_bynameIjc11__mbstate_tEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114codecvt_bynameIjc11__mbstate_tEC2EPKcm +__ZNSt3__114codecvt_bynameIjc11__mbstate_tEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114codecvt_bynameIjc11__mbstate_tED0Ev +__ZNSt3__114codecvt_bynameIjc11__mbstate_tED1Ev +__ZNSt3__114codecvt_bynameIjc11__mbstate_tED2Ev +__ZNSt3__114codecvt_bynameItc11__mbstate_tEC1EPKcm +__ZNSt3__114codecvt_bynameItc11__mbstate_tEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114codecvt_bynameItc11__mbstate_tEC2EPKcm +__ZNSt3__114codecvt_bynameItc11__mbstate_tEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114codecvt_bynameItc11__mbstate_tED0Ev +__ZNSt3__114codecvt_bynameItc11__mbstate_tED1Ev +__ZNSt3__114codecvt_bynameItc11__mbstate_tED2Ev +__ZNSt3__114codecvt_bynameIwc11__mbstate_tEC1EPKcm +__ZNSt3__114codecvt_bynameIwc11__mbstate_tEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114codecvt_bynameIwc11__mbstate_tEC2EPKcm +__ZNSt3__114codecvt_bynameIwc11__mbstate_tEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev +__ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev +__ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev +__ZNSt3__114collate_bynameIcEC1EPKcm +__ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114collate_bynameIcEC2EPKcm +__ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114collate_bynameIcED0Ev +__ZNSt3__114collate_bynameIcED1Ev +__ZNSt3__114collate_bynameIcED2Ev +__ZNSt3__114collate_bynameIwEC1EPKcm +__ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114collate_bynameIwEC2EPKcm +__ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__114collate_bynameIwED0Ev +__ZNSt3__114collate_bynameIwED1Ev +__ZNSt3__114collate_bynameIwED2Ev +__ZNSt3__114error_categoryC1Ev +__ZNSt3__114error_categoryC2Ev +__ZNSt3__114error_categoryD0Ev +__ZNSt3__114error_categoryD1Ev +__ZNSt3__114error_categoryD2Ev +__ZNSt3__115__codecvt_utf16IjLb0EED0Ev +__ZNSt3__115__codecvt_utf16IjLb0EED1Ev +__ZNSt3__115__codecvt_utf16IjLb1EED0Ev +__ZNSt3__115__codecvt_utf16IjLb1EED1Ev +__ZNSt3__115__codecvt_utf16ItLb0EED0Ev +__ZNSt3__115__codecvt_utf16ItLb0EED1Ev +__ZNSt3__115__codecvt_utf16ItLb1EED0Ev +__ZNSt3__115__codecvt_utf16ItLb1EED1Ev +__ZNSt3__115__codecvt_utf16IwLb0EED0Ev +__ZNSt3__115__codecvt_utf16IwLb0EED1Ev +__ZNSt3__115__codecvt_utf16IwLb1EED0Ev +__ZNSt3__115__codecvt_utf16IwLb1EED1Ev +__ZNSt3__115__get_classnameEPKcb +__ZNSt3__115__num_get_floatIdEET_PKcS3_Rj +__ZNSt3__115__num_get_floatIeEET_PKcS3_Rj +__ZNSt3__115__num_get_floatIfEET_PKcS3_Rj +__ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE +__ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE +__ZNSt3__115__thread_structC1Ev +__ZNSt3__115__thread_structC2Ev +__ZNSt3__115__thread_structD1Ev +__ZNSt3__115__thread_structD2Ev +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_ +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPci +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPci +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKci +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_ +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_ +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev +__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_ +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_ +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwi +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwi +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwi +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEi +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEi +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_ +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_ +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev +__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_ +__ZNSt3__115future_categoryEv +__ZNSt3__115messages_bynameIcEC1EPKcm +__ZNSt3__115messages_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__115messages_bynameIcEC2EPKcm +__ZNSt3__115messages_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__115messages_bynameIcED0Ev +__ZNSt3__115messages_bynameIcED1Ev +__ZNSt3__115messages_bynameIcED2Ev +__ZNSt3__115messages_bynameIwEC1EPKcm +__ZNSt3__115messages_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__115messages_bynameIwEC2EPKcm +__ZNSt3__115messages_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__115messages_bynameIwED0Ev +__ZNSt3__115messages_bynameIwED1Ev +__ZNSt3__115messages_bynameIwED2Ev +__ZNSt3__115numpunct_bynameIcE6__initEPKc +__ZNSt3__115numpunct_bynameIcEC1EPKcm +__ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__115numpunct_bynameIcEC2EPKcm +__ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__115numpunct_bynameIcED0Ev +__ZNSt3__115numpunct_bynameIcED1Ev +__ZNSt3__115numpunct_bynameIcED2Ev +__ZNSt3__115numpunct_bynameIwE6__initEPKc +__ZNSt3__115numpunct_bynameIwEC1EPKcm +__ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__115numpunct_bynameIwEC2EPKcm +__ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__115numpunct_bynameIwED0Ev +__ZNSt3__115numpunct_bynameIwED1Ev +__ZNSt3__115numpunct_bynameIwED2Ev +__ZNSt3__115recursive_mutex4lockEv +__ZNSt3__115recursive_mutex6unlockEv +__ZNSt3__115recursive_mutex8try_lockEv +__ZNSt3__115recursive_mutexC1Ev +__ZNSt3__115recursive_mutexC2Ev +__ZNSt3__115recursive_mutexD1Ev +__ZNSt3__115recursive_mutexD2Ev +__ZNSt3__115system_categoryEv +__ZNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC1EPKcm +__ZNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC1ERKNS_12basic_stringIcS3_NS_9allocatorIcEEEEm +__ZNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC2EPKcm +__ZNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC2ERKNS_12basic_stringIcS3_NS_9allocatorIcEEEEm +__ZNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev +__ZNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED1Ev +__ZNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev +__ZNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC1EPKcm +__ZNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC1ERKNS_12basic_stringIcNS2_IcEENS_9allocatorIcEEEEm +__ZNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC2EPKcm +__ZNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC2ERKNS_12basic_stringIcNS2_IcEENS_9allocatorIcEEEEm +__ZNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev +__ZNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED1Ev +__ZNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev +__ZNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC1EPKcm +__ZNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC1ERKNS_12basic_stringIcS3_NS_9allocatorIcEEEEm +__ZNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC2EPKcm +__ZNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC2ERKNS_12basic_stringIcS3_NS_9allocatorIcEEEEm +__ZNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev +__ZNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED1Ev +__ZNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev +__ZNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC1EPKcm +__ZNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC1ERKNS_12basic_stringIcNS2_IcEENS_9allocatorIcEEEEm +__ZNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC2EPKcm +__ZNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC2ERKNS_12basic_stringIcNS2_IcEENS_9allocatorIcEEEEm +__ZNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev +__ZNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED1Ev +__ZNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev +__ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj +__ZNSt3__116__narrow_to_utf8ILm16EED0Ev +__ZNSt3__116__narrow_to_utf8ILm16EED1Ev +__ZNSt3__116__narrow_to_utf8ILm16EED2Ev +__ZNSt3__116__narrow_to_utf8ILm32EED0Ev +__ZNSt3__116__narrow_to_utf8ILm32EED1Ev +__ZNSt3__116__narrow_to_utf8ILm32EED2Ev +__ZNSt3__116generic_categoryEv +__ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE +__ZNSt3__117__assoc_sub_state12__make_readyEv +__ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr +__ZNSt3__117__assoc_sub_state16__on_zero_sharedEv +__ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv +__ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr +__ZNSt3__117__assoc_sub_state4copyEv +__ZNSt3__117__assoc_sub_state4waitEv +__ZNSt3__117__assoc_sub_state9__executeEv +__ZNSt3__117__assoc_sub_state9set_valueEv +__ZNSt3__117__assoc_sub_stateD0Ev +__ZNSt3__117__assoc_sub_stateD1Ev +__ZNSt3__117__assoc_sub_stateD2Ev +__ZNSt3__117__widen_from_utf8ILm16EED0Ev +__ZNSt3__117__widen_from_utf8ILm16EED1Ev +__ZNSt3__117__widen_from_utf8ILm16EED2Ev +__ZNSt3__117__widen_from_utf8ILm32EED0Ev +__ZNSt3__117__widen_from_utf8ILm32EED1Ev +__ZNSt3__117__widen_from_utf8ILm32EED2Ev +__ZNSt3__117declare_reachableEPv +__ZNSt3__117iostream_categoryEv +__ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc +__ZNSt3__117moneypunct_bynameIcLb0EEC1EPKcm +__ZNSt3__117moneypunct_bynameIcLb0EEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__117moneypunct_bynameIcLb0EEC2EPKcm +__ZNSt3__117moneypunct_bynameIcLb0EEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__117moneypunct_bynameIcLb0EED0Ev +__ZNSt3__117moneypunct_bynameIcLb0EED1Ev +__ZNSt3__117moneypunct_bynameIcLb0EED2Ev +__ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc +__ZNSt3__117moneypunct_bynameIcLb1EEC1EPKcm +__ZNSt3__117moneypunct_bynameIcLb1EEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__117moneypunct_bynameIcLb1EEC2EPKcm +__ZNSt3__117moneypunct_bynameIcLb1EEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__117moneypunct_bynameIcLb1EED0Ev +__ZNSt3__117moneypunct_bynameIcLb1EED1Ev +__ZNSt3__117moneypunct_bynameIcLb1EED2Ev +__ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc +__ZNSt3__117moneypunct_bynameIwLb0EEC1EPKcm +__ZNSt3__117moneypunct_bynameIwLb0EEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__117moneypunct_bynameIwLb0EEC2EPKcm +__ZNSt3__117moneypunct_bynameIwLb0EEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__117moneypunct_bynameIwLb0EED0Ev +__ZNSt3__117moneypunct_bynameIwLb0EED1Ev +__ZNSt3__117moneypunct_bynameIwLb0EED2Ev +__ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc +__ZNSt3__117moneypunct_bynameIwLb1EEC1EPKcm +__ZNSt3__117moneypunct_bynameIwLb1EEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__117moneypunct_bynameIwLb1EEC2EPKcm +__ZNSt3__117moneypunct_bynameIwLb1EEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm +__ZNSt3__117moneypunct_bynameIwLb1EED0Ev +__ZNSt3__117moneypunct_bynameIwLb1EED1Ev +__ZNSt3__117moneypunct_bynameIwLb1EED2Ev +__ZNSt3__118__insertion_sort_3IRNS_6__lessIaaEEPaEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIccEEPcEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIddEEPdEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIeeEEPeEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIffEEPfEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIhhEEPhEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIiiEEPiEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIjjEEPjEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIllEEPlEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessImmEEPmEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIssEEPsEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIttEEPtEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIwwEEPwEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIxxEEPxEEvT0_S5_T_ +__ZNSt3__118__insertion_sort_3IRNS_6__lessIyyEEPyEEvT0_S5_T_ +__ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE +__ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE +__ZNSt3__118__time_get_storageIcEC1EPKc +__ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__118__time_get_storageIcEC2EPKc +__ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE +__ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE +__ZNSt3__118__time_get_storageIwEC1EPKc +__ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__118__time_get_storageIwEC2EPKc +__ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__118condition_variable10notify_allEv +__ZNSt3__118condition_variable10notify_oneEv +__ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILx1ELx1000000000EEEEEEE +__ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE +__ZNSt3__118condition_variableD1Ev +__ZNSt3__118condition_variableD2Ev +__ZNSt3__118get_pointer_safetyEv +__ZNSt3__119__shared_weak_count10__add_weakEv +__ZNSt3__119__shared_weak_count12__add_sharedEv +__ZNSt3__119__shared_weak_count14__release_weakEv +__ZNSt3__119__shared_weak_count16__release_sharedEv +__ZNSt3__119__shared_weak_count4lockEv +__ZNSt3__119__shared_weak_countD0Ev +__ZNSt3__119__shared_weak_countD1Ev +__ZNSt3__119__shared_weak_countD2Ev +__ZNSt3__119__start_std_streamsE +__ZNSt3__119__thread_local_dataE +__ZNSt3__119__thread_struct_imp25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE +__ZNSt3__119__thread_struct_imp27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE +__ZNSt3__119__thread_struct_impD1Ev +__ZNSt3__119__thread_struct_impD2Ev +__ZNSt3__119declare_no_pointersEPcm +__ZNSt3__119istreambuf_iteratorIcNS_11char_traitsIcEEE14__test_for_eofEv +__ZNSt3__119istreambuf_iteratorIwNS_11char_traitsIwEEE14__test_for_eofEv +__ZNSt3__119piecewise_constructE +__ZNSt3__120__codecvt_utf8_utf16IjED0Ev +__ZNSt3__120__codecvt_utf8_utf16IjED1Ev +__ZNSt3__120__codecvt_utf8_utf16ItED0Ev +__ZNSt3__120__codecvt_utf8_utf16ItED1Ev +__ZNSt3__120__codecvt_utf8_utf16IwED0Ev +__ZNSt3__120__codecvt_utf8_utf16IwED1Ev +__ZNSt3__120__get_collation_nameEPKc +__ZNSt3__120__throw_system_errorEiPKc +__ZNSt3__120__vector_base_commonILb1EEC1Ev +__ZNSt3__120__vector_base_commonILb1EEC2Ev +__ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv +__ZNSt3__121__thread_specific_ptrINS_15__thread_structEEC2Ev +__ZNSt3__121__throw_runtime_errorEPKc +__ZNSt3__121__undeclare_reachableEPv +__ZNSt3__121recursive_timed_mutex4lockEv +__ZNSt3__121recursive_timed_mutex6unlockEv +__ZNSt3__121recursive_timed_mutex8try_lockEv +__ZNSt3__121recursive_timed_mutexC1Ev +__ZNSt3__121recursive_timed_mutexC2Ev +__ZNSt3__121recursive_timed_mutexD1Ev +__ZNSt3__121recursive_timed_mutexD2Ev +__ZNSt3__121undeclare_no_pointersEPcm +__ZNSt3__123mersenne_twister_engineIjLm32ELm624ELm397ELm31ELj2567483615ELm11ELj4294967295ELm7ELj2636928640ELm15ELj4022730752ELm18ELj1812433253EEclEv +__ZNSt3__125__num_get_signed_integralIlEET_PKcS3_Rji +__ZNSt3__125__num_get_signed_integralIxEET_PKcS3_Rji +__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_ +__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_ +__ZNSt3__127__num_get_unsigned_integralIjEET_PKcS3_Rji +__ZNSt3__127__num_get_unsigned_integralImEET_PKcS3_Rji +__ZNSt3__127__num_get_unsigned_integralItEET_PKcS3_Rji +__ZNSt3__127__num_get_unsigned_integralIyEET_PKcS3_Rji +__ZNSt3__13cinE +__ZNSt3__14cerrE +__ZNSt3__14clogE +__ZNSt3__14copyIPcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEET0_T_S7_S6_ +__ZNSt3__14copyIPwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEET0_T_S7_S6_ +__ZNSt3__14coutE +__ZNSt3__14lockINS_11unique_lockINS_5mutexEEES3_EEvRT_RT0_ +__ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm +__ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm +__ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm +__ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm +__ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi +__ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi +__ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi +__ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi +__ZNSt3__14wcinE +__ZNSt3__15alignEmmRPvRm +__ZNSt3__15ctypeIcE13classic_tableEv +__ZNSt3__15ctypeIcE2idE +__ZNSt3__15ctypeIcEC1EPKjbm +__ZNSt3__15ctypeIcEC2EPKjbm +__ZNSt3__15ctypeIcED0Ev +__ZNSt3__15ctypeIcED1Ev +__ZNSt3__15ctypeIcED2Ev +__ZNSt3__15ctypeIwE2idE +__ZNSt3__15ctypeIwED0Ev +__ZNSt3__15ctypeIwED1Ev +__ZNSt3__15ctypeIwED2Ev +__ZNSt3__15mutex4lockEv +__ZNSt3__15mutex6unlockEv +__ZNSt3__15mutex8try_lockEv +__ZNSt3__15mutexD1Ev +__ZNSt3__15mutexD2Ev +__ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm +__ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm +__ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi +__ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi +__ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi +__ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi +__ZNSt3__15wcerrE +__ZNSt3__15wclogE +__ZNSt3__15wcoutE +__ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_ +__ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_ +__ZNSt3__16chrono12system_clock11from_time_tEl +__ZNSt3__16chrono12system_clock3nowEv +__ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILx1ELx1000000EEEEEEE +__ZNSt3__16chrono15monotonic_clock3nowEv +__ZNSt3__16futureIvE3getEv +__ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE +__ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE +__ZNSt3__16futureIvED1Ev +__ZNSt3__16futureIvED2Ev +__ZNSt3__16gslice6__initEm +__ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl +__ZNSt3__16locale2id5__getEv +__ZNSt3__16locale2id6__initEv +__ZNSt3__16locale2id9__next_idE +__ZNSt3__16locale5facet16__on_zero_sharedEv +__ZNSt3__16locale5facetD0Ev +__ZNSt3__16locale5facetD1Ev +__ZNSt3__16locale5facetD2Ev +__ZNSt3__16locale6globalERKS0_ +__ZNSt3__16locale7classicEv +__ZNSt3__16locale8__globalEv +__ZNSt3__16localeC1EPKc +__ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__16localeC1ERKS0_ +__ZNSt3__16localeC1ERKS0_PKci +__ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi +__ZNSt3__16localeC1ERKS0_S2_i +__ZNSt3__16localeC1Ev +__ZNSt3__16localeC2EPKc +__ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNSt3__16localeC2ERKS0_ +__ZNSt3__16localeC2ERKS0_PKci +__ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi +__ZNSt3__16localeC2ERKS0_S2_i +__ZNSt3__16localeC2Ev +__ZNSt3__16localeD1Ev +__ZNSt3__16localeD2Ev +__ZNSt3__16localeaSERKS0_ +__ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi +__ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi +__ZNSt3__16thread20hardware_concurrencyEv +__ZNSt3__16thread4joinEv +__ZNSt3__16thread6detachEv +__ZNSt3__16threadD1Ev +__ZNSt3__16threadD2Ev +__ZNSt3__16vectorINS_4pairIPNS_18condition_variableEPNS_5mutexEEENS_9allocatorIS6_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS6_RS8_EE +__ZNSt3__16vectorINS_4pairIPNS_18condition_variableEPNS_5mutexEEENS_9allocatorIS6_EEE9push_backERKS6_ +__ZNSt3__16vectorIPNS_17__assoc_sub_stateENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE +__ZNSt3__16vectorIPNS_17__assoc_sub_stateENS_9allocatorIS2_EEE9push_backERKS2_ +__ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lm28EEEE6assignIPS3_EENS_9enable_ifIXsrNS_21__is_forward_iteratorIT_EE5valueEvE4typeESB_SB_ +__ZNSt3__17__sort3IRNS_6__lessIaaEEPaEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIccEEPcEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIddEEPdEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIeeEEPeEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIffEEPfEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIhhEEPhEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIiiEEPiEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIjjEEPjEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIllEEPlEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessImmEEPmEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIssEEPsEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIttEEPtEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIwwEEPwEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIxxEEPxEEjT0_S5_S5_T_ +__ZNSt3__17__sort3IRNS_6__lessIyyEEPyEEjT0_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIaaEEPaEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIccEEPcEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIddEEPdEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIffEEPfEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIhhEEPhEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIiiEEPiEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIjjEEPjEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIllEEPlEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessImmEEPmEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIssEEPsEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIttEEPtEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIxxEEPxEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort4IRNS_6__lessIyyEEPyEEjT0_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIaaEEPaEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIccEEPcEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIddEEPdEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIffEEPfEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIhhEEPhEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIiiEEPiEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIjjEEPjEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIllEEPlEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessImmEEPmEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIssEEPsEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIttEEPtEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIxxEEPxEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17__sort5IRNS_6__lessIyyEEPyEEjT0_S5_S5_S5_S5_T_ +__ZNSt3__17codecvtIcc11__mbstate_tE2idE +__ZNSt3__17codecvtIcc11__mbstate_tED0Ev +__ZNSt3__17codecvtIcc11__mbstate_tED1Ev +__ZNSt3__17codecvtIcc11__mbstate_tED2Ev +__ZNSt3__17codecvtIjc11__mbstate_tE2idE +__ZNSt3__17codecvtIjc11__mbstate_tED0Ev +__ZNSt3__17codecvtIjc11__mbstate_tED1Ev +__ZNSt3__17codecvtIjc11__mbstate_tED2Ev +__ZNSt3__17codecvtItc11__mbstate_tE2idE +__ZNSt3__17codecvtItc11__mbstate_tED0Ev +__ZNSt3__17codecvtItc11__mbstate_tED1Ev +__ZNSt3__17codecvtItc11__mbstate_tED2Ev +__ZNSt3__17codecvtIwc11__mbstate_tE2idE +__ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm +__ZNSt3__17codecvtIwc11__mbstate_tEC1Em +__ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm +__ZNSt3__17codecvtIwc11__mbstate_tEC2Em +__ZNSt3__17codecvtIwc11__mbstate_tED0Ev +__ZNSt3__17codecvtIwc11__mbstate_tED1Ev +__ZNSt3__17codecvtIwc11__mbstate_tED2Ev +__ZNSt3__17collateIcE2idE +__ZNSt3__17collateIcEC1Em +__ZNSt3__17collateIcEC2Em +__ZNSt3__17collateIcED0Ev +__ZNSt3__17collateIcED1Ev +__ZNSt3__17collateIcED2Ev +__ZNSt3__17collateIwE2idE +__ZNSt3__17collateIwEC1Em +__ZNSt3__17collateIwEC2Em +__ZNSt3__17collateIwED0Ev +__ZNSt3__17collateIwED1Ev +__ZNSt3__17collateIwED2Ev +__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC1Em +__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC2Em +__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev +__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED1Ev +__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev +__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC1Em +__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC2Em +__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev +__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED1Ev +__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev +__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC1Em +__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC2Em +__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev +__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED1Ev +__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev +__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC1Em +__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC2Em +__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev +__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED1Ev +__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev +__ZNSt3__17promiseIvE10get_futureEv +__ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr +__ZNSt3__17promiseIvE24set_value_at_thread_exitEv +__ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr +__ZNSt3__17promiseIvE9set_valueEv +__ZNSt3__17promiseIvEC1Ev +__ZNSt3__17promiseIvEC2Ev +__ZNSt3__17promiseIvED1Ev +__ZNSt3__17promiseIvED2Ev +__ZNSt3__18__rs_getEv +__ZNSt3__18ios_base10floatfieldE +__ZNSt3__18ios_base10scientificE +__ZNSt3__18ios_base11adjustfieldE +__ZNSt3__18ios_base15sync_with_stdioEb +__ZNSt3__18ios_base16__call_callbacksENS0_5eventE +__ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi +__ZNSt3__18ios_base2inE +__ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv +__ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv +__ZNSt3__18ios_base3appE +__ZNSt3__18ios_base3ateE +__ZNSt3__18ios_base3decE +__ZNSt3__18ios_base3hexE +__ZNSt3__18ios_base3octE +__ZNSt3__18ios_base3outE +__ZNSt3__18ios_base4InitC1Ev +__ZNSt3__18ios_base4InitC2Ev +__ZNSt3__18ios_base4InitD1Ev +__ZNSt3__18ios_base4InitD2Ev +__ZNSt3__18ios_base4initEPv +__ZNSt3__18ios_base4leftE +__ZNSt3__18ios_base4moveERS0_ +__ZNSt3__18ios_base4swapERS0_ +__ZNSt3__18ios_base5clearEj +__ZNSt3__18ios_base5fixedE +__ZNSt3__18ios_base5imbueERKNS_6localeE +__ZNSt3__18ios_base5iwordEi +__ZNSt3__18ios_base5pwordEi +__ZNSt3__18ios_base5rightE +__ZNSt3__18ios_base5truncE +__ZNSt3__18ios_base6badbitE +__ZNSt3__18ios_base6binaryE +__ZNSt3__18ios_base6eofbitE +__ZNSt3__18ios_base6skipwsE +__ZNSt3__18ios_base6xallocEv +__ZNSt3__18ios_base7copyfmtERKS0_ +__ZNSt3__18ios_base7failbitE +__ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE +__ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE +__ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE +__ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE +__ZNSt3__18ios_base7failureD0Ev +__ZNSt3__18ios_base7failureD1Ev +__ZNSt3__18ios_base7failureD2Ev +__ZNSt3__18ios_base7goodbitE +__ZNSt3__18ios_base7showposE +__ZNSt3__18ios_base7unitbufE +__ZNSt3__18ios_base8internalE +__ZNSt3__18ios_base8showbaseE +__ZNSt3__18ios_base9__xindex_E +__ZNSt3__18ios_base9basefieldE +__ZNSt3__18ios_base9boolalphaE +__ZNSt3__18ios_base9showpointE +__ZNSt3__18ios_base9uppercaseE +__ZNSt3__18ios_baseD0Ev +__ZNSt3__18ios_baseD1Ev +__ZNSt3__18ios_baseD2Ev +__ZNSt3__18messagesIcE2idE +__ZNSt3__18messagesIcEC1Em +__ZNSt3__18messagesIcEC2Em +__ZNSt3__18messagesIcED0Ev +__ZNSt3__18messagesIcED1Ev +__ZNSt3__18messagesIcED2Ev +__ZNSt3__18messagesIwE2idE +__ZNSt3__18messagesIwEC1Em +__ZNSt3__18messagesIwEC2Em +__ZNSt3__18messagesIwED0Ev +__ZNSt3__18messagesIwED1Ev +__ZNSt3__18messagesIwED2Ev +__ZNSt3__18numpunctIcE2idE +__ZNSt3__18numpunctIcEC1Em +__ZNSt3__18numpunctIcEC2Em +__ZNSt3__18numpunctIcED0Ev +__ZNSt3__18numpunctIcED1Ev +__ZNSt3__18numpunctIcED2Ev +__ZNSt3__18numpunctIwE2idE +__ZNSt3__18numpunctIwEC1Em +__ZNSt3__18numpunctIwEC2Em +__ZNSt3__18numpunctIwED0Ev +__ZNSt3__18numpunctIwED1Ev +__ZNSt3__18numpunctIwED2Ev +__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC1Em +__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC2Em +__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev +__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED1Ev +__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev +__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC1Em +__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC2Em +__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev +__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED1Ev +__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev +__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC1EPKcm +__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC1ERKNS_12basic_stringIcS3_NS_9allocatorIcEEEEm +__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC1Em +__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC2EPKcm +__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC2ERKNS_12basic_stringIcS3_NS_9allocatorIcEEEEm +__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC2Em +__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev +__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED1Ev +__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev +__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC1EPKcm +__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC1ERKNS_12basic_stringIcNS2_IcEENS_9allocatorIcEEEEm +__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC1Em +__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC2EPKcm +__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC2ERKNS_12basic_stringIcNS2_IcEENS_9allocatorIcEEEEm +__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC2Em +__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev +__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED1Ev +__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev +__ZNSt3__18valarrayImE6resizeEmm +__ZNSt3__18valarrayImEC1Em +__ZNSt3__18valarrayImEC2Em +__ZNSt3__18valarrayImED1Ev +__ZNSt3__18valarrayImED2Ev +__ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_ +__ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc +__ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_ +__ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_ +__ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw +__ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw +__ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw +__ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_ +__ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE +__ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE +__ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE +__ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE +__ZNSt3__19basic_iosIcNS_11char_traitsIcEEE10exceptionsEj +__ZNSt3__19basic_iosIcNS_11char_traitsIcEEE5clearEj +__ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_ +__ZNSt3__19basic_iosIcNS_11char_traitsIcEEE8setstateEj +__ZNSt3__19basic_iosIcNS_11char_traitsIcEEEC1Ev +__ZNSt3__19basic_iosIcNS_11char_traitsIcEEEC2Ev +__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev +__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev +__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev +__ZNSt3__19basic_iosIwNS_11char_traitsIwEEE10exceptionsEj +__ZNSt3__19basic_iosIwNS_11char_traitsIwEEE5clearEj +__ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_ +__ZNSt3__19basic_iosIwNS_11char_traitsIwEEE8setstateEj +__ZNSt3__19basic_iosIwNS_11char_traitsIwEEEC1Ev +__ZNSt3__19basic_iosIwNS_11char_traitsIwEEEC2Ev +__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev +__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev +__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev +__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_ +__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC1Em +__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEC2Em +__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev +__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED1Ev +__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev +__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_ +__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC1Em +__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEC2Em +__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev +__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED1Ev +__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev +__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC1Em +__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEC2Em +__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED0Ev +__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED1Ev +__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEED2Ev +__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC1Em +__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEC2Em +__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED0Ev +__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED1Ev +__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEED2Ev +__ZNSt3__19strstreamD0Ev +__ZNSt3__19strstreamD1Ev +__ZNSt3__19strstreamD2Ev +__ZNSt3__19to_stringEd +__ZNSt3__19to_stringEe +__ZNSt3__19to_stringEf +__ZNSt3__19to_stringEi +__ZNSt3__19to_stringEj +__ZNSt3__19to_stringEl +__ZNSt3__19to_stringEm +__ZNSt3__19to_stringEx +__ZNSt3__19to_stringEy +__ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_ +__ZNSt8bad_castC1Ev +__ZNSt8bad_castC2Ev +__ZNSt8bad_castD0Ev +__ZNSt8bad_castD1Ev +__ZNSt8bad_castD2Ev +__ZNSt9bad_allocC1Ev +__ZNSt9bad_allocC2Ev +__ZNSt9bad_allocD0Ev +__ZNSt9bad_allocD1Ev +__ZNSt9bad_allocD2Ev +__ZNSt9exceptionD0Ev +__ZNSt9exceptionD1Ev +__ZNSt9exceptionD2Ev +__ZSt10unexpectedv +__ZSt13set_terminatePFvvE +__ZSt14set_unexpectedPFvvE +__ZSt15set_new_handlerPFvvE +__ZSt17__throw_bad_allocv +__ZSt17current_exceptionv +__ZSt17rethrow_exceptionSt13exception_ptr +__ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_ +__ZSt18uncaught_exceptionv +__ZSt7nothrow +__ZSt9terminatev +__ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE +__ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE +__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE +__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE8_NS_13basic_ostreamIcS2_EE +__ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE +__ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE +__ZTCNSt3__19strstreamE8_NS_13basic_ostreamIcNS_11char_traitsIcEEEE +__ZTINSt3__110__time_getE +__ZTINSt3__110__time_putE +__ZTINSt3__110ctype_baseE +__ZTINSt3__110istrstreamE +__ZTINSt3__110money_baseE +__ZTINSt3__110moneypunctIcLb0EEE +__ZTINSt3__110moneypunctIcLb1EEE +__ZTINSt3__110moneypunctIwLb0EEE +__ZTINSt3__110moneypunctIwLb1EEE +__ZTINSt3__110ostrstreamE +__ZTINSt3__111__money_getIcEE +__ZTINSt3__111__money_getIwEE +__ZTINSt3__111__money_putIcEE +__ZTINSt3__111__money_putIwEE +__ZTINSt3__111regex_errorE +__ZTINSt3__112bad_weak_ptrE +__ZTINSt3__112codecvt_baseE +__ZTINSt3__112ctype_bynameIcEE +__ZTINSt3__112ctype_bynameIwEE +__ZTINSt3__112future_errorE +__ZTINSt3__112strstreambufE +__ZTINSt3__112system_errorE +__ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE +__ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE +__ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE +__ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE +__ZTINSt3__113messages_baseE +__ZTINSt3__114__codecvt_utf8IjEE +__ZTINSt3__114__codecvt_utf8ItEE +__ZTINSt3__114__codecvt_utf8IwEE +__ZTINSt3__114__num_get_baseE +__ZTINSt3__114__num_put_baseE +__ZTINSt3__114__shared_countE +__ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE +__ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE +__ZTINSt3__114codecvt_bynameIjc11__mbstate_tEE +__ZTINSt3__114codecvt_bynameItc11__mbstate_tEE +__ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE +__ZTINSt3__114collate_bynameIcEE +__ZTINSt3__114collate_bynameIwEE +__ZTINSt3__114error_categoryE +__ZTINSt3__115__codecvt_utf16IjLb0EEE +__ZTINSt3__115__codecvt_utf16IjLb1EEE +__ZTINSt3__115__codecvt_utf16ItLb0EEE +__ZTINSt3__115__codecvt_utf16ItLb1EEE +__ZTINSt3__115__codecvt_utf16IwLb0EEE +__ZTINSt3__115__codecvt_utf16IwLb1EEE +__ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE +__ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE +__ZTINSt3__115messages_bynameIcEE +__ZTINSt3__115messages_bynameIwEE +__ZTINSt3__115numpunct_bynameIcEE +__ZTINSt3__115numpunct_bynameIwEE +__ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTINSt3__116__narrow_to_utf8ILm16EEE +__ZTINSt3__116__narrow_to_utf8ILm32EEE +__ZTINSt3__117__assoc_sub_stateE +__ZTINSt3__117__widen_from_utf8ILm16EEE +__ZTINSt3__117__widen_from_utf8ILm32EEE +__ZTINSt3__117moneypunct_bynameIcLb0EEE +__ZTINSt3__117moneypunct_bynameIcLb1EEE +__ZTINSt3__117moneypunct_bynameIwLb0EEE +__ZTINSt3__117moneypunct_bynameIwLb1EEE +__ZTINSt3__118__time_get_storageIcEE +__ZTINSt3__118__time_get_storageIwEE +__ZTINSt3__119__shared_weak_countE +__ZTINSt3__120__codecvt_utf8_utf16IjEE +__ZTINSt3__120__codecvt_utf8_utf16ItEE +__ZTINSt3__120__codecvt_utf8_utf16IwEE +__ZTINSt3__120__time_get_c_storageIcEE +__ZTINSt3__120__time_get_c_storageIwEE +__ZTINSt3__15ctypeIcEE +__ZTINSt3__15ctypeIwEE +__ZTINSt3__16locale5facetE +__ZTINSt3__17codecvtIcc11__mbstate_tEE +__ZTINSt3__17codecvtIjc11__mbstate_tEE +__ZTINSt3__17codecvtItc11__mbstate_tEE +__ZTINSt3__17codecvtIwc11__mbstate_tEE +__ZTINSt3__17collateIcEE +__ZTINSt3__17collateIwEE +__ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTINSt3__18ios_base7failureE +__ZTINSt3__18ios_baseE +__ZTINSt3__18messagesIcEE +__ZTINSt3__18messagesIwEE +__ZTINSt3__18numpunctIcEE +__ZTINSt3__18numpunctIwEE +__ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTINSt3__19__num_getIcEE +__ZTINSt3__19__num_getIwEE +__ZTINSt3__19__num_putIcEE +__ZTINSt3__19__num_putIwEE +__ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE +__ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE +__ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTINSt3__19strstreamE +__ZTINSt3__19time_baseE +__ZTISt10bad_typeid +__ZTISt11logic_error +__ZTISt11range_error +__ZTISt12domain_error +__ZTISt12length_error +__ZTISt12out_of_range +__ZTISt13bad_exception +__ZTISt13runtime_error +__ZTISt14overflow_error +__ZTISt15underflow_error +__ZTISt16invalid_argument +__ZTISt16nested_exception +__ZTISt20bad_array_new_length +__ZTISt8bad_cast +__ZTISt9bad_alloc +__ZTISt9exception +__ZTSNSt3__110__time_getE +__ZTSNSt3__110__time_putE +__ZTSNSt3__110ctype_baseE +__ZTSNSt3__110istrstreamE +__ZTSNSt3__110money_baseE +__ZTSNSt3__110moneypunctIcLb0EEE +__ZTSNSt3__110moneypunctIcLb1EEE +__ZTSNSt3__110moneypunctIwLb0EEE +__ZTSNSt3__110moneypunctIwLb1EEE +__ZTSNSt3__110ostrstreamE +__ZTSNSt3__111__money_getIcEE +__ZTSNSt3__111__money_getIwEE +__ZTSNSt3__111__money_putIcEE +__ZTSNSt3__111__money_putIwEE +__ZTSNSt3__111regex_errorE +__ZTSNSt3__112bad_weak_ptrE +__ZTSNSt3__112codecvt_baseE +__ZTSNSt3__112ctype_bynameIcEE +__ZTSNSt3__112ctype_bynameIwEE +__ZTSNSt3__112future_errorE +__ZTSNSt3__112strstreambufE +__ZTSNSt3__112system_errorE +__ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE +__ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE +__ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE +__ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE +__ZTSNSt3__113messages_baseE +__ZTSNSt3__114__codecvt_utf8IjEE +__ZTSNSt3__114__codecvt_utf8ItEE +__ZTSNSt3__114__codecvt_utf8IwEE +__ZTSNSt3__114__num_get_baseE +__ZTSNSt3__114__num_put_baseE +__ZTSNSt3__114__shared_countE +__ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE +__ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE +__ZTSNSt3__114codecvt_bynameIjc11__mbstate_tEE +__ZTSNSt3__114codecvt_bynameItc11__mbstate_tEE +__ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE +__ZTSNSt3__114collate_bynameIcEE +__ZTSNSt3__114collate_bynameIwEE +__ZTSNSt3__114error_categoryE +__ZTSNSt3__115__codecvt_utf16IjLb0EEE +__ZTSNSt3__115__codecvt_utf16IjLb1EEE +__ZTSNSt3__115__codecvt_utf16ItLb0EEE +__ZTSNSt3__115__codecvt_utf16ItLb1EEE +__ZTSNSt3__115__codecvt_utf16IwLb0EEE +__ZTSNSt3__115__codecvt_utf16IwLb1EEE +__ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE +__ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE +__ZTSNSt3__115messages_bynameIcEE +__ZTSNSt3__115messages_bynameIwEE +__ZTSNSt3__115numpunct_bynameIcEE +__ZTSNSt3__115numpunct_bynameIwEE +__ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTSNSt3__116__narrow_to_utf8ILm16EEE +__ZTSNSt3__116__narrow_to_utf8ILm32EEE +__ZTSNSt3__117__assoc_sub_stateE +__ZTSNSt3__117__widen_from_utf8ILm16EEE +__ZTSNSt3__117__widen_from_utf8ILm32EEE +__ZTSNSt3__117moneypunct_bynameIcLb0EEE +__ZTSNSt3__117moneypunct_bynameIcLb1EEE +__ZTSNSt3__117moneypunct_bynameIwLb0EEE +__ZTSNSt3__117moneypunct_bynameIwLb1EEE +__ZTSNSt3__118__time_get_storageIcEE +__ZTSNSt3__118__time_get_storageIwEE +__ZTSNSt3__119__shared_weak_countE +__ZTSNSt3__120__codecvt_utf8_utf16IjEE +__ZTSNSt3__120__codecvt_utf8_utf16ItEE +__ZTSNSt3__120__codecvt_utf8_utf16IwEE +__ZTSNSt3__120__time_get_c_storageIcEE +__ZTSNSt3__120__time_get_c_storageIwEE +__ZTSNSt3__15ctypeIcEE +__ZTSNSt3__15ctypeIwEE +__ZTSNSt3__16locale5facetE +__ZTSNSt3__17codecvtIcc11__mbstate_tEE +__ZTSNSt3__17codecvtIjc11__mbstate_tEE +__ZTSNSt3__17codecvtItc11__mbstate_tEE +__ZTSNSt3__17codecvtIwc11__mbstate_tEE +__ZTSNSt3__17collateIcEE +__ZTSNSt3__17collateIwEE +__ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTSNSt3__18ios_base7failureE +__ZTSNSt3__18ios_baseE +__ZTSNSt3__18messagesIcEE +__ZTSNSt3__18messagesIwEE +__ZTSNSt3__18numpunctIcEE +__ZTSNSt3__18numpunctIwEE +__ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTSNSt3__19__num_getIcEE +__ZTSNSt3__19__num_getIwEE +__ZTSNSt3__19__num_putIcEE +__ZTSNSt3__19__num_putIwEE +__ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE +__ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE +__ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTSNSt3__19strstreamE +__ZTSNSt3__19time_baseE +__ZTSSt10bad_typeid +__ZTSSt11logic_error +__ZTSSt11range_error +__ZTSSt12domain_error +__ZTSSt12length_error +__ZTSSt12out_of_range +__ZTSSt13bad_exception +__ZTSSt13runtime_error +__ZTSSt14overflow_error +__ZTSSt15underflow_error +__ZTSSt16invalid_argument +__ZTSSt16nested_exception +__ZTSSt20bad_array_new_length +__ZTSSt8bad_cast +__ZTSSt9bad_alloc +__ZTSSt9exception +__ZTTNSt3__110istrstreamE +__ZTTNSt3__110ostrstreamE +__ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE +__ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE +__ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE +__ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE +__ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE +__ZTTNSt3__19strstreamE +__ZTVNSt3__110istrstreamE +__ZTVNSt3__110moneypunctIcLb0EEE +__ZTVNSt3__110moneypunctIcLb1EEE +__ZTVNSt3__110moneypunctIwLb0EEE +__ZTVNSt3__110moneypunctIwLb1EEE +__ZTVNSt3__110ostrstreamE +__ZTVNSt3__111regex_errorE +__ZTVNSt3__112bad_weak_ptrE +__ZTVNSt3__112ctype_bynameIcEE +__ZTVNSt3__112ctype_bynameIwEE +__ZTVNSt3__112future_errorE +__ZTVNSt3__112strstreambufE +__ZTVNSt3__112system_errorE +__ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE +__ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE +__ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE +__ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE +__ZTVNSt3__114__codecvt_utf8IjEE +__ZTVNSt3__114__codecvt_utf8ItEE +__ZTVNSt3__114__codecvt_utf8IwEE +__ZTVNSt3__114__shared_countE +__ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE +__ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE +__ZTVNSt3__114codecvt_bynameIjc11__mbstate_tEE +__ZTVNSt3__114codecvt_bynameItc11__mbstate_tEE +__ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE +__ZTVNSt3__114collate_bynameIcEE +__ZTVNSt3__114collate_bynameIwEE +__ZTVNSt3__114error_categoryE +__ZTVNSt3__115__codecvt_utf16IjLb0EEE +__ZTVNSt3__115__codecvt_utf16IjLb1EEE +__ZTVNSt3__115__codecvt_utf16ItLb0EEE +__ZTVNSt3__115__codecvt_utf16ItLb1EEE +__ZTVNSt3__115__codecvt_utf16IwLb0EEE +__ZTVNSt3__115__codecvt_utf16IwLb1EEE +__ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE +__ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE +__ZTVNSt3__115messages_bynameIcEE +__ZTVNSt3__115messages_bynameIwEE +__ZTVNSt3__115numpunct_bynameIcEE +__ZTVNSt3__115numpunct_bynameIwEE +__ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTVNSt3__116__narrow_to_utf8ILm16EEE +__ZTVNSt3__116__narrow_to_utf8ILm32EEE +__ZTVNSt3__117__assoc_sub_stateE +__ZTVNSt3__117__widen_from_utf8ILm16EEE +__ZTVNSt3__117__widen_from_utf8ILm32EEE +__ZTVNSt3__117moneypunct_bynameIcLb0EEE +__ZTVNSt3__117moneypunct_bynameIcLb1EEE +__ZTVNSt3__117moneypunct_bynameIwLb0EEE +__ZTVNSt3__117moneypunct_bynameIwLb1EEE +__ZTVNSt3__119__shared_weak_countE +__ZTVNSt3__120__codecvt_utf8_utf16IjEE +__ZTVNSt3__120__codecvt_utf8_utf16ItEE +__ZTVNSt3__120__codecvt_utf8_utf16IwEE +__ZTVNSt3__120__time_get_c_storageIcEE +__ZTVNSt3__120__time_get_c_storageIwEE +__ZTVNSt3__15ctypeIcEE +__ZTVNSt3__15ctypeIwEE +__ZTVNSt3__16locale5facetE +__ZTVNSt3__17codecvtIcc11__mbstate_tEE +__ZTVNSt3__17codecvtIjc11__mbstate_tEE +__ZTVNSt3__17codecvtItc11__mbstate_tEE +__ZTVNSt3__17codecvtIwc11__mbstate_tEE +__ZTVNSt3__17collateIcEE +__ZTVNSt3__17collateIwEE +__ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTVNSt3__18ios_base7failureE +__ZTVNSt3__18ios_baseE +__ZTVNSt3__18messagesIcEE +__ZTVNSt3__18messagesIwEE +__ZTVNSt3__18numpunctIcEE +__ZTVNSt3__18numpunctIwEE +__ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE +__ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE +__ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE +__ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE +__ZTVNSt3__19strstreamE +__ZTVSt10bad_typeid +__ZTVSt11logic_error +__ZTVSt11range_error +__ZTVSt12domain_error +__ZTVSt12length_error +__ZTVSt12out_of_range +__ZTVSt13bad_exception +__ZTVSt13runtime_error +__ZTVSt14overflow_error +__ZTVSt15underflow_error +__ZTVSt16invalid_argument +__ZTVSt16nested_exception +__ZTVSt20bad_array_new_length +__ZTVSt8bad_cast +__ZTVSt9bad_alloc +__ZTVSt9exception +__ZThn8_NKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__XEv +__ZThn8_NKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__cEv +__ZThn8_NKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__rEv +__ZThn8_NKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__xEv +__ZThn8_NKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE7__am_pmEv +__ZThn8_NKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE7__weeksEv +__ZThn8_NKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__monthsEv +__ZThn8_NKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__XEv +__ZThn8_NKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__cEv +__ZThn8_NKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__rEv +__ZThn8_NKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__xEv +__ZThn8_NKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE7__am_pmEv +__ZThn8_NKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE7__weeksEv +__ZThn8_NKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__monthsEv +__ZThn8_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev +__ZThn8_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev +__ZThn8_NSt3__19strstreamD0Ev +__ZThn8_NSt3__19strstreamD1Ev +__ZTv0_n12_NSt3__110istrstreamD0Ev +__ZTv0_n12_NSt3__110istrstreamD1Ev +__ZTv0_n12_NSt3__110ostrstreamD0Ev +__ZTv0_n12_NSt3__110ostrstreamD1Ev +__ZTv0_n12_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev +__ZTv0_n12_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev +__ZTv0_n12_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev +__ZTv0_n12_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev +__ZTv0_n12_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev +__ZTv0_n12_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev +__ZTv0_n12_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev +__ZTv0_n12_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev +__ZTv0_n12_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev +__ZTv0_n12_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev +__ZTv0_n12_NSt3__19strstreamD0Ev +__ZTv0_n12_NSt3__19strstreamD1Ev +__ZdaPv +__ZdaPvRKSt9nothrow_t +__ZdlPv +__ZdlPvRKSt9nothrow_t +__Znam +__ZnamRKSt9nothrow_t +__Znwm +__ZnwmRKSt9nothrow_t +___cxa_bad_cast +___cxa_bad_typeid Added: libcxx/trunk/lib/libc++abi.exp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/libc%2B%2Babi.exp?rev=113616&view=auto ============================================================================== --- libcxx/trunk/lib/libc++abi.exp (added) +++ libcxx/trunk/lib/libc++abi.exp Fri Sep 10 15:42:36 2010 @@ -0,0 +1,150 @@ +___cxa_allocate_exception +___cxa_end_catch +___cxa_demangle +___cxa_current_exception_type +___cxa_call_unexpected +___cxa_free_exception +___cxa_get_exception_ptr +___cxa_get_globals +___cxa_get_globals_fast +___cxa_guard_abort +___cxa_guard_acquire +___cxa_guard_release +___cxa_rethrow +___cxa_pure_virtual +___cxa_begin_catch +___cxa_throw +___cxa_vec_cctor +___cxa_vec_cleanup +___cxa_vec_ctor +___cxa_vec_delete +___cxa_vec_delete2 +___cxa_vec_delete3 +___cxa_vec_dtor +___cxa_vec_new +___cxa_vec_new2 +___cxa_vec_new3 +___dynamic_cast +___gxx_personality_v0 +__ZTSPm +__ZTSPl +__ZTSPj +__ZTSPi +__ZTSPh +__ZTSPf +__ZTSPe +__ZTSPd +__ZTSPc +__ZTSPb +__ZTSPa +__ZTSPKc +__ZTSPKy +__ZTSPKx +__ZTSPKw +__ZTSPKv +__ZTSPKt +__ZTSPKs +__ZTSPKm +__ZTSPKl +__ZTSPKi +__ZTSPKh +__ZTSPs +__ZTSPt +__ZTSPv +__ZTSPw +__ZTSPKa +__ZTSPx +__ZTSPy +__ZTSPKd +__ZTSPKe +__ZTSPKj +__ZTSPKb +__ZTSPKf +__ZTSv +__ZTSt +__ZTSs +__ZTSm +__ZTSl +__ZTSj +__ZTSi +__ZTSh +__ZTSf +__ZTSe +__ZTSd +__ZTSc +__ZTSw +__ZTSx +__ZTSy +__ZTSb +__ZTSa +__ZTIPKh +__ZTIPKf +__ZTIPKe +__ZTIPKd +__ZTIPKc +__ZTIPKb +__ZTIPKa +__ZTIPy +__ZTIPx +__ZTIPw +__ZTIPv +__ZTIPt +__ZTIPs +__ZTIPm +__ZTIPl +__ZTIPj +__ZTIPi +__ZTIPKi +__ZTIPKj +__ZTIPKl +__ZTIPKm +__ZTIPKs +__ZTIPKt +__ZTIPKv +__ZTIPKw +__ZTIPKx +__ZTIPKy +__ZTIPa +__ZTIPb +__ZTIPc +__ZTIPd +__ZTIPe +__ZTIPf +__ZTIPh +__ZTVN10__cxxabiv129__pointer_to_member_type_infoE +__ZTVN10__cxxabiv116__enum_type_infoE +__ZTVN10__cxxabiv117__array_type_infoE +__ZTVN10__cxxabiv117__class_type_infoE +__ZTVN10__cxxabiv117__pbase_type_infoE +__ZTVN10__cxxabiv119__pointer_type_infoE +__ZTVN10__cxxabiv120__function_type_infoE +__ZTVN10__cxxabiv120__si_class_type_infoE +__ZTVN10__cxxabiv121__vmi_class_type_infoE +__ZTVN10__cxxabiv123__fundamental_type_infoE +__ZTIa +__ZTIb +__ZTIc +__ZTId +__ZTIe +__ZTIf +__ZTIh +__ZTIi +__ZTIj +__ZTIl +__ZTIm +__ZTIs +__ZTIt +__ZTSN10__cxxabiv129__pointer_to_member_type_infoE +__ZTSN10__cxxabiv123__fundamental_type_infoE +__ZTSN10__cxxabiv121__vmi_class_type_infoE +__ZTSN10__cxxabiv120__si_class_type_infoE +__ZTSN10__cxxabiv120__function_type_infoE +__ZTSN10__cxxabiv119__pointer_type_infoE +__ZTSN10__cxxabiv117__pbase_type_infoE +__ZTSN10__cxxabiv117__class_type_infoE +__ZTSN10__cxxabiv117__array_type_infoE +__ZTSN10__cxxabiv116__enum_type_infoE +__ZTIy +__ZTIx +__ZTIw +__ZTIv Added: libcxx/trunk/lib/notweak.exp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/notweak.exp?rev=113616&view=auto ============================================================================== --- libcxx/trunk/lib/notweak.exp (added) +++ libcxx/trunk/lib/notweak.exp Fri Sep 10 15:42:36 2010 @@ -0,0 +1,5 @@ +# Remove the weak-def bit from these external symbols +__ZT* +__ZN* +__ZS* + Added: libcxx/trunk/lib/x86_64.exp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/x86_64.exp?rev=113616&view=auto ============================================================================== --- libcxx/trunk/lib/x86_64.exp (added) +++ libcxx/trunk/lib/x86_64.exp Fri Sep 10 15:42:36 2010 @@ -0,0 +1,2264 @@ +__ZGVNSt3__110moneypunctIcLb0EE2idE +__ZGVNSt3__110moneypunctIcLb1EE2idE +__ZGVNSt3__110moneypunctIwLb0EE2idE +__ZGVNSt3__110moneypunctIwLb1EE2idE +__ZGVNSt3__17collateIcE2idE +__ZGVNSt3__17collateIwE2idE +__ZGVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZGVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZGVNSt3__18messagesIcE2idE +__ZGVNSt3__18messagesIwE2idE +__ZGVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZGVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZGVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZGVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE +__ZGVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE +__ZNKSt10bad_typeid4whatEv +__ZNKSt11logic_error4whatEv +__ZNKSt13bad_exception4whatEv +__ZNKSt13runtime_error4whatEv +__ZNKSt16nested_exception14rethrow_nestedEv +__ZNKSt20bad_array_new_length4whatEv +__ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc +__ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc +__ZNKSt3__110error_code7messageEv +__ZNKSt3__110moneypunctIcLb0EE10neg_formatEv +__ZNKSt3__110moneypunctIcLb0EE10pos_formatEv +__ZNKSt3__110moneypunctIcLb0EE11curr_symbolEv +__ZNKSt3__110moneypunctIcLb0EE11do_groupingEv +__ZNKSt3__110moneypunctIcLb0EE11frac_digitsEv +__ZNKSt3__110moneypunctIcLb0EE13decimal_pointEv +__ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv +__ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv +__ZNKSt3__110moneypunctIcLb0EE13negative_signEv +__ZNKSt3__110moneypunctIcLb0EE13positive_signEv +__ZNKSt3__110moneypunctIcLb0EE13thousands_sepEv +__ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv +__ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv +__ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv +__ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv +__ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv +__ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv +__ZNKSt3__110moneypunctIcLb0EE8groupingEv +__ZNKSt3__110moneypunctIcLb1EE10neg_formatEv +__ZNKSt3__110moneypunctIcLb1EE10pos_formatEv +__ZNKSt3__110moneypunctIcLb1EE11curr_symbolEv +__ZNKSt3__110moneypunctIcLb1EE11do_groupingEv +__ZNKSt3__110moneypunctIcLb1EE11frac_digitsEv +__ZNKSt3__110moneypunctIcLb1EE13decimal_pointEv +__ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv +__ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv +__ZNKSt3__110moneypunctIcLb1EE13negative_signEv +__ZNKSt3__110moneypunctIcLb1EE13positive_signEv +__ZNKSt3__110moneypunctIcLb1EE13thousands_sepEv +__ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv +__ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv +__ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv +__ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv +__ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv +__ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv +__ZNKSt3__110moneypunctIcLb1EE8groupingEv +__ZNKSt3__110moneypunctIwLb0EE10neg_formatEv +__ZNKSt3__110moneypunctIwLb0EE10pos_formatEv +__ZNKSt3__110moneypunctIwLb0EE11curr_symbolEv +__ZNKSt3__110moneypunctIwLb0EE11do_groupingEv +__ZNKSt3__110moneypunctIwLb0EE11frac_digitsEv +__ZNKSt3__110moneypunctIwLb0EE13decimal_pointEv +__ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv +__ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv +__ZNKSt3__110moneypunctIwLb0EE13negative_signEv +__ZNKSt3__110moneypunctIwLb0EE13positive_signEv +__ZNKSt3__110moneypunctIwLb0EE13thousands_sepEv +__ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv +__ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv +__ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv +__ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv +__ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv +__ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv +__ZNKSt3__110moneypunctIwLb0EE8groupingEv +__ZNKSt3__110moneypunctIwLb1EE10neg_formatEv +__ZNKSt3__110moneypunctIwLb1EE10pos_formatEv +__ZNKSt3__110moneypunctIwLb1EE11curr_symbolEv +__ZNKSt3__110moneypunctIwLb1EE11do_groupingEv +__ZNKSt3__110moneypunctIwLb1EE11frac_digitsEv +__ZNKSt3__110moneypunctIwLb1EE13decimal_pointEv +__ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv +__ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv +__ZNKSt3__110moneypunctIwLb1EE13negative_signEv +__ZNKSt3__110moneypunctIwLb1EE13positive_signEv +__ZNKSt3__110moneypunctIwLb1EE13thousands_sepEv +__ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv +__ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv +__ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv +__ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv +__ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv +__ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv +__ZNKSt3__110moneypunctIwLb1EE8groupingEv +__ZNKSt3__112bad_weak_ptr4whatEv +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12__invariantsEv +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm +__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12__invariantsEv +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm +__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm +__ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc +__ZNKSt3__112ctype_bynameIcE10do_tolowerEc +__ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc +__ZNKSt3__112ctype_bynameIcE10do_toupperEc +__ZNKSt3__112ctype_bynameIwE10do_scan_isEjPKwS3_ +__ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw +__ZNKSt3__112ctype_bynameIwE10do_tolowerEw +__ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw +__ZNKSt3__112ctype_bynameIwE10do_toupperEw +__ZNKSt3__112ctype_bynameIwE11do_scan_notEjPKwS3_ +__ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pj +__ZNKSt3__112ctype_bynameIwE5do_isEjw +__ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw +__ZNKSt3__112ctype_bynameIwE8do_widenEc +__ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc +__ZNKSt3__112ctype_bynameIwE9do_narrowEwc +__ZNKSt3__112strstreambuf6pcountEv +__ZNKSt3__113basic_istreamIcNS_11char_traitsIcEEE6gcountEv +__ZNKSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentrycvbEv +__ZNKSt3__113basic_istreamIwNS_11char_traitsIwEEE6gcountEv +__ZNKSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentrycvbEv +__ZNKSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentrycvbEv +__ZNKSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentrycvbEv +__ZNKSt3__113random_device7entropyEv +__ZNKSt3__114__codecvt_utf8IjE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__114__codecvt_utf8IjE11do_encodingEv +__ZNKSt3__114__codecvt_utf8IjE13do_max_lengthEv +__ZNKSt3__114__codecvt_utf8IjE16do_always_noconvEv +__ZNKSt3__114__codecvt_utf8IjE5do_inER11__mbstate_tPKcS5_RS5_PjS7_RS7_ +__ZNKSt3__114__codecvt_utf8IjE6do_outER11__mbstate_tPKjS5_RS5_PcS7_RS7_ +__ZNKSt3__114__codecvt_utf8IjE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__114__codecvt_utf8ItE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__114__codecvt_utf8ItE11do_encodingEv +__ZNKSt3__114__codecvt_utf8ItE13do_max_lengthEv +__ZNKSt3__114__codecvt_utf8ItE16do_always_noconvEv +__ZNKSt3__114__codecvt_utf8ItE5do_inER11__mbstate_tPKcS5_RS5_PtS7_RS7_ +__ZNKSt3__114__codecvt_utf8ItE6do_outER11__mbstate_tPKtS5_RS5_PcS7_RS7_ +__ZNKSt3__114__codecvt_utf8ItE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__114__codecvt_utf8IwE11do_encodingEv +__ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv +__ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv +__ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_ +__ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_ +__ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_ +__ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_ +__ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_ +__ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_ +__ZNKSt3__114error_category10equivalentERKNS_10error_codeEi +__ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE +__ZNKSt3__114error_category23default_error_conditionEi +__ZNKSt3__115__codecvt_utf16IjLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16IjLb0EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16IjLb0EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16IjLb0EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16IjLb0EE5do_inER11__mbstate_tPKcS5_RS5_PjS7_RS7_ +__ZNKSt3__115__codecvt_utf16IjLb0EE6do_outER11__mbstate_tPKjS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16IjLb0EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115__codecvt_utf16IjLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16IjLb1EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16IjLb1EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16IjLb1EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16IjLb1EE5do_inER11__mbstate_tPKcS5_RS5_PjS7_RS7_ +__ZNKSt3__115__codecvt_utf16IjLb1EE6do_outER11__mbstate_tPKjS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16IjLb1EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115__codecvt_utf16ItLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16ItLb0EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16ItLb0EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16ItLb0EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16ItLb0EE5do_inER11__mbstate_tPKcS5_RS5_PtS7_RS7_ +__ZNKSt3__115__codecvt_utf16ItLb0EE6do_outER11__mbstate_tPKtS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16ItLb0EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115__codecvt_utf16ItLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16ItLb1EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16ItLb1EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16ItLb1EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16ItLb1EE5do_inER11__mbstate_tPKcS5_RS5_PtS7_RS7_ +__ZNKSt3__115__codecvt_utf16ItLb1EE6do_outER11__mbstate_tPKtS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16ItLb1EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_ +__ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv +__ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv +__ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv +__ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_ +__ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_ +__ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE4gptrEv +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE4pptrEv +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5ebackEv +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5egptrEv +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5epptrEv +__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbaseEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE4gptrEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE4pptrEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE5ebackEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE5egptrEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE5epptrEv +__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbaseEv +__ZNKSt3__115error_condition7messageEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__XEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__cEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__rEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3__xEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE7__am_pmEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE7__weeksEv +__ZNKSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__monthsEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__XEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__cEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__rEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3__xEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE7__am_pmEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE7__weeksEv +__ZNKSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__monthsEv +__ZNKSt3__117__assoc_sub_state11__has_valueEv +__ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv +__ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv +__ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv +__ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv +__ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv +__ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv +__ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv +__ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv +__ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv +__ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv +__ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv +__ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv +__ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv +__ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv +__ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv +__ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv +__ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv +__ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv +__ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv +__ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv +__ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv +__ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv +__ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv +__ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv +__ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv +__ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv +__ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv +__ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv +__ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv +__ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv +__ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv +__ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv +__ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv +__ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv +__ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv +__ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv +__ZNKSt3__118__time_get_storageIcE15__do_date_orderEv +__ZNKSt3__118__time_get_storageIwE15__do_date_orderEv +__ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info +__ZNKSt3__120__codecvt_utf8_utf16IjE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__120__codecvt_utf8_utf16IjE11do_encodingEv +__ZNKSt3__120__codecvt_utf8_utf16IjE13do_max_lengthEv +__ZNKSt3__120__codecvt_utf8_utf16IjE16do_always_noconvEv +__ZNKSt3__120__codecvt_utf8_utf16IjE5do_inER11__mbstate_tPKcS5_RS5_PjS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16IjE6do_outER11__mbstate_tPKjS5_RS5_PcS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16IjE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__120__codecvt_utf8_utf16ItE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__120__codecvt_utf8_utf16ItE11do_encodingEv +__ZNKSt3__120__codecvt_utf8_utf16ItE13do_max_lengthEv +__ZNKSt3__120__codecvt_utf8_utf16ItE16do_always_noconvEv +__ZNKSt3__120__codecvt_utf8_utf16ItE5do_inER11__mbstate_tPKcS5_RS5_PtS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16ItE6do_outER11__mbstate_tPKtS5_RS5_PcS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16ItE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_ +__ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv +__ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv +__ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv +__ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_ +__ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m +__ZNKSt3__120__time_get_c_storageIcE3__XEv +__ZNKSt3__120__time_get_c_storageIcE3__cEv +__ZNKSt3__120__time_get_c_storageIcE3__rEv +__ZNKSt3__120__time_get_c_storageIcE3__xEv +__ZNKSt3__120__time_get_c_storageIcE7__am_pmEv +__ZNKSt3__120__time_get_c_storageIcE7__weeksEv +__ZNKSt3__120__time_get_c_storageIcE8__monthsEv +__ZNKSt3__120__time_get_c_storageIwE3__XEv +__ZNKSt3__120__time_get_c_storageIwE3__cEv +__ZNKSt3__120__time_get_c_storageIwE3__rEv +__ZNKSt3__120__time_get_c_storageIwE3__xEv +__ZNKSt3__120__time_get_c_storageIwE7__am_pmEv +__ZNKSt3__120__time_get_c_storageIwE7__weeksEv +__ZNKSt3__120__time_get_c_storageIwE8__monthsEv +__ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv +__ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv +__ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv +__ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv +__ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE +__ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE +__ZNKSt3__15ctypeIcE10do_tolowerEPcPKc +__ZNKSt3__15ctypeIcE10do_tolowerEc +__ZNKSt3__15ctypeIcE10do_toupperEPcPKc +__ZNKSt3__15ctypeIcE10do_toupperEc +__ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc +__ZNKSt3__15ctypeIcE8do_widenEc +__ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc +__ZNKSt3__15ctypeIcE9do_narrowEcc +__ZNKSt3__15ctypeIwE10do_scan_isEjPKwS3_ +__ZNKSt3__15ctypeIwE10do_tolowerEPwPKw +__ZNKSt3__15ctypeIwE10do_tolowerEw +__ZNKSt3__15ctypeIwE10do_toupperEPwPKw +__ZNKSt3__15ctypeIwE10do_toupperEw +__ZNKSt3__15ctypeIwE11do_scan_notEjPKwS3_ +__ZNKSt3__15ctypeIwE5do_isEPKwS3_Pj +__ZNKSt3__15ctypeIwE5do_isEjw +__ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw +__ZNKSt3__15ctypeIwE8do_widenEc +__ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc +__ZNKSt3__15ctypeIwE9do_narrowEwc +__ZNKSt3__16locale4nameEv +__ZNKSt3__16locale9has_facetERNS0_2idE +__ZNKSt3__16locale9use_facetERNS0_2idE +__ZNKSt3__16localeeqERKS0_ +__ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_ +__ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv +__ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv +__ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv +__ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_ +__ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_ +__ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m +__ZNKSt3__17codecvtIjc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_ +__ZNKSt3__17codecvtIjc11__mbstate_tE11do_encodingEv +__ZNKSt3__17codecvtIjc11__mbstate_tE13do_max_lengthEv +__ZNKSt3__17codecvtIjc11__mbstate_tE16do_always_noconvEv +__ZNKSt3__17codecvtIjc11__mbstate_tE5do_inERS1_PKcS5_RS5_PjS7_RS7_ +__ZNKSt3__17codecvtIjc11__mbstate_tE6do_outERS1_PKjS5_RS5_PcS7_RS7_ +__ZNKSt3__17codecvtIjc11__mbstate_tE9do_lengthERS1_PKcS5_m +__ZNKSt3__17codecvtItc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_ +__ZNKSt3__17codecvtItc11__mbstate_tE11do_encodingEv +__ZNKSt3__17codecvtItc11__mbstate_tE13do_max_lengthEv +__ZNKSt3__17codecvtItc11__mbstate_tE16do_always_noconvEv +__ZNKSt3__17codecvtItc11__mbstate_tE5do_inERS1_PKcS5_RS5_PtS7_RS7_ +__ZNKSt3__17codecvtItc11__mbstate_tE6do_outERS1_PKtS5_RS5_PcS7_RS7_ +__ZNKSt3__17codecvtItc11__mbstate_tE9do_lengthERS1_PKcS5_m +__ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_ +__ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv +__ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv +__ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv +__ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_ +__ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_ +__ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m +__ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_ +__ZNKSt3__17collateIcE12do_transformEPKcS3_ +__ZNKSt3__17collateIcE4hashEPKcS3_ +__ZNKSt3__17collateIcE7compareEPKcS3_S3_S3_ +__ZNKSt3__17collateIcE7do_hashEPKcS3_ +__ZNKSt3__17collateIcE9transformEPKcS3_ +__ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_ +__ZNKSt3__17collateIwE12do_transformEPKwS3_ +__ZNKSt3__17collateIwE4hashEPKwS3_ +__ZNKSt3__17collateIwE7compareEPKwS3_S3_S3_ +__ZNKSt3__17collateIwE7do_hashEPKwS3_ +__ZNKSt3__17collateIwE9transformEPKwS3_ +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRPv +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRb +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRd +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRe +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRf +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRl +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRm +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRt +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRx +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjRy +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjS8_ +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy +__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_ +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRPv +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRb +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRd +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRe +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRf +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRl +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRm +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRt +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRx +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjRy +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjS8_ +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy +__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_ +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPKv +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcb +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcd +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEce +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcl +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcm +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcx +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcy +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx +__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPKv +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwb +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwd +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwe +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwl +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwm +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwx +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwy +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx +__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy +__ZNKSt3__18ios_base6getlocEv +__ZNKSt3__18messagesIcE3getEP10__nl_cat_diiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNKSt3__18messagesIcE4openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE +__ZNKSt3__18messagesIcE5closeEP10__nl_cat_d +__ZNKSt3__18messagesIcE6do_getEP10__nl_cat_diiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE +__ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE +__ZNKSt3__18messagesIcE8do_closeEP10__nl_cat_d +__ZNKSt3__18messagesIwE3getEP10__nl_cat_diiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE +__ZNKSt3__18messagesIwE4openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE +__ZNKSt3__18messagesIwE5closeEP10__nl_cat_d +__ZNKSt3__18messagesIwE6do_getEP10__nl_cat_diiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE +__ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE +__ZNKSt3__18messagesIwE8do_closeEP10__nl_cat_d +__ZNKSt3__18numpunctIcE11do_groupingEv +__ZNKSt3__18numpunctIcE11do_truenameEv +__ZNKSt3__18numpunctIcE12do_falsenameEv +__ZNKSt3__18numpunctIcE16do_decimal_pointEv +__ZNKSt3__18numpunctIcE16do_thousands_sepEv +__ZNKSt3__18numpunctIwE11do_groupingEv +__ZNKSt3__18numpunctIwE11do_truenameEv +__ZNKSt3__18numpunctIwE12do_falsenameEv +__ZNKSt3__18numpunctIwE16do_decimal_pointEv +__ZNKSt3__18numpunctIwE16do_thousands_sepEv +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10date_orderEv +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11get_weekdayES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13get_monthnameES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_ +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmcc +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8get_dateES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8get_timeES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8get_yearES4_S4_RNS_8ios_baseERjP2tm +__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE +__ZNKSt3__18time_getIwNS_1