diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-04-06 15:53:59 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-04-06 15:53:59 +0000 |
commit | 71438373cd57f0d5d8c93bb5cf690844a0fbc9d0 (patch) | |
tree | 59c928209f8007777dd96568b026bdfe200691de /lib/AST | |
parent | ac616af773f5062edaaf1a0bb5610b49a22ac41f (diff) | |
download | FreeBSD-src-71438373cd57f0d5d8c93bb5cf690844a0fbc9d0.zip FreeBSD-src-71438373cd57f0d5d8c93bb5cf690844a0fbc9d0.tar.gz |
Update clang to r100520.
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/ASTImporter.cpp | 3 | ||||
-rw-r--r-- | lib/AST/Stmt.cpp | 14 | ||||
-rw-r--r-- | lib/AST/TypePrinter.cpp | 27 |
3 files changed, 25 insertions, 19 deletions
diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index f7d08e8..5dfb99f 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -3088,8 +3088,7 @@ FileID ASTImporter::Import(FileID FromID) { // FIXME: We want to re-use the existing MemoryBuffer! const llvm::MemoryBuffer *FromBuf = Cache->getBuffer(getDiags()); llvm::MemoryBuffer *ToBuf - = llvm::MemoryBuffer::getMemBufferCopy(FromBuf->getBufferStart(), - FromBuf->getBufferEnd(), + = llvm::MemoryBuffer::getMemBufferCopy(FromBuf->getBuffer(), FromBuf->getBufferIdentifier()); ToID = ToSM.createFileIDForMemBuffer(ToBuf); } diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 8347249..9702382 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -249,14 +249,18 @@ unsigned AsmStmt::AnalyzeAsmString(llvm::SmallVectorImpl<AsmStringPiece>&Pieces, } char CurChar = *CurPtr++; - if (CurChar == '$') { - CurStringPiece += "$$"; - continue; - } else if (CurChar != '%') { + switch (CurChar) { + case '$': CurStringPiece += "$$"; continue; + case '{': CurStringPiece += "$("; continue; + case '|': CurStringPiece += "$|"; continue; + case '}': CurStringPiece += "$)"; continue; + case '%': + break; + default: CurStringPiece += CurChar; continue; } - + // Escaped "%" character in asm string. if (CurPtr == StrEnd) { // % at end of string is invalid (no escape). diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp index 4cf0922..340e373 100644 --- a/lib/AST/TypePrinter.cpp +++ b/lib/AST/TypePrinter.cpp @@ -442,18 +442,21 @@ void TypePrinter::PrintTag(TagDecl *D, std::string &InnerString) { llvm::raw_string_ostream OS(Buffer); OS << "<anonymous"; - // Suppress the redundant tag keyword if we just printed one. - // We don't have to worry about ElaboratedTypes here because you can't - // refer to an anonymous type with one. - if (!HasKindDecoration) - OS << " " << D->getKindName(); - - PresumedLoc PLoc = D->getASTContext().getSourceManager().getPresumedLoc( - D->getLocation()); - OS << " at " << PLoc.getFilename() - << ':' << PLoc.getLine() - << ':' << PLoc.getColumn() - << '>'; + if (Policy.AnonymousTagLocations) { + // Suppress the redundant tag keyword if we just printed one. + // We don't have to worry about ElaboratedTypes here because you can't + // refer to an anonymous type with one. + if (!HasKindDecoration) + OS << " " << D->getKindName(); + + PresumedLoc PLoc = D->getASTContext().getSourceManager().getPresumedLoc( + D->getLocation()); + OS << " at " << PLoc.getFilename() + << ':' << PLoc.getLine() + << ':' << PLoc.getColumn(); + } + + OS << '>'; OS.flush(); } |