aboutsummaryrefslogtreecommitdiff
path: root/lib/AST
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-04-06 15:53:59 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-04-06 15:53:59 +0000
commit60bfabcd8ce617297c0d231f77d14ab507e98796 (patch)
tree59c928209f8007777dd96568b026bdfe200691de /lib/AST
parent2c56c396ce5990954f85194029eeb391bc3529ff (diff)
downloadsrc-60bfabcd8ce617297c0d231f77d14ab507e98796.tar.gz
src-60bfabcd8ce617297c0d231f77d14ab507e98796.zip
Update clang to r100520.
Notes
Notes: svn path=/vendor/clang/dist/; revision=206275
Diffstat (limited to 'lib/AST')
-rw-r--r--lib/AST/ASTImporter.cpp3
-rw-r--r--lib/AST/Stmt.cpp14
-rw-r--r--lib/AST/TypePrinter.cpp27
3 files changed, 25 insertions, 19 deletions
diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp
index f7d08e8b77bb..5dfb99ff0889 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 8347249a466b..97023820e247 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 4cf0922ee316..340e373af123 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();
}