diff options
| author | Jordan Rose <jordan_rose@apple.com> | 2013-07-12 00:26:14 +0000 |
|---|---|---|
| committer | Jordan Rose <jordan_rose@apple.com> | 2013-07-12 00:26:14 +0000 |
| commit | 78cd51b2eebc406a887fb1dfe438b235537c01b9 (patch) | |
| tree | 6370d959d2253a744a04dad82870b77aacde085b /clang/lib | |
| parent | fa3c2db211dbc780777ccc8092cee8a7f002739f (diff) | |
| download | bcm5719-llvm-78cd51b2eebc406a887fb1dfe438b235537c01b9.tar.gz bcm5719-llvm-78cd51b2eebc406a887fb1dfe438b235537c01b9.zip | |
[analyzer] Add support for __builtin_addressof.
...so we don't regress on std::addressof.
llvm-svn: 186140
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp index a3327d8b319..5300fae7756 100644 --- a/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp @@ -43,8 +43,11 @@ bool BuiltinFunctionChecker::evalCall(const CallExpr *CE, return false; switch (id) { - case Builtin::BI__builtin_expect: { + case Builtin::BI__builtin_expect: + case Builtin::BI__builtin_addressof: { // For __builtin_expect, just return the value of the subexpression. + // __builtin_addressof is going from a reference to a pointer, but those + // are represented the same way in the analyzer. assert (CE->arg_begin() != CE->arg_end()); SVal X = state->getSVal(*(CE->arg_begin()), LCtx); C.addTransition(state->BindExpr(CE, LCtx, X)); |

