TargetInfo no longer includes a reference to SourceManager.
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:
FullLoc.getManager().someMethod(FullLoc.getLocation());
instead we have:
FullLoc.someMethod();
Modified TextDiagnostics (and related classes) to use this short-hand.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44957 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Expr.cpp b/AST/Expr.cpp
index c6a6ab3..11aef7f 100644
--- a/AST/Expr.cpp
+++ b/AST/Expr.cpp
@@ -625,7 +625,9 @@
Result = Ctx.getTypeAlign(Exp->getSubExpr()->getType(),
Exp->getOperatorLoc());
} else {
- unsigned CharSize = Ctx.Target.getCharWidth(Exp->getOperatorLoc());
+ unsigned CharSize =
+ Ctx.Target.getCharWidth(Ctx.getFullLoc(Exp->getOperatorLoc()));
+
Result = Ctx.getTypeSize(Exp->getSubExpr()->getType(),
Exp->getOperatorLoc()) / CharSize;
}