summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-11-14 09:54:10 +0000
committerAlexey Samsonov <samsonov@google.com>2013-11-14 09:54:10 +0000
commit84dbdc0d8ee61c416a9d566904b716fd5181ad5f (patch)
treee72117c19054feffb4e7dfbbd2918888ada74c89
parent4d369187ec89acb5780c0041174ff12524ef210f (diff)
downloadbcm5719-llvm-84dbdc0d8ee61c416a9d566904b716fd5181ad5f.tar.gz
bcm5719-llvm-84dbdc0d8ee61c416a9d566904b716fd5181ad5f.zip
[UBSan] Update UBSan location rendering to match r194686
llvm-svn: 194687
-rw-r--r--compiler-rt/lib/ubsan/ubsan_diag.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler-rt/lib/ubsan/ubsan_diag.cc b/compiler-rt/lib/ubsan/ubsan_diag.cc
index 158408b7daf..fa643658ea3 100644
--- a/compiler-rt/lib/ubsan/ubsan_diag.cc
+++ b/compiler-rt/lib/ubsan/ubsan_diag.cc
@@ -77,27 +77,29 @@ static void PrintHex(UIntMax Val) {
}
static void renderLocation(Location Loc) {
+ InternalScopedString LocBuffer(1024);
switch (Loc.getKind()) {
case Location::LK_Source: {
SourceLocation SLoc = Loc.getSourceLocation();
if (SLoc.isInvalid())
- Printf("<unknown>");
+ LocBuffer.append("<unknown>");
else
- PrintSourceLocation(SLoc.getFilename(), SLoc.getLine(), SLoc.getColumn());
+ PrintSourceLocation(&LocBuffer, SLoc.getFilename(), SLoc.getLine(),
+ SLoc.getColumn());
break;
}
case Location::LK_Module:
- PrintModuleAndOffset(Loc.getModuleLocation().getModuleName(),
+ PrintModuleAndOffset(&LocBuffer, Loc.getModuleLocation().getModuleName(),
Loc.getModuleLocation().getOffset());
break;
case Location::LK_Memory:
- Printf("%p", Loc.getMemoryLocation());
+ LocBuffer.append("%p", Loc.getMemoryLocation());
break;
case Location::LK_Null:
- Printf("<unknown>");
+ LocBuffer.append("<unknown>");
break;
}
- Printf(":");
+ Printf("%s:", LocBuffer.data());
}
static void renderText(const char *Message, const Diag::Arg *Args) {
OpenPOWER on IntegriCloud