• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2011, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "rsl_assert.h"
18 
19 #include <llvm/Support/raw_ostream.h>
20 
21 #include <stdlib.h>
22 
23 #ifdef __arm__
24 #define LOG_TAG "bcc"
25 #include <cutils/log.h>
26 #endif
27 
ASSERT_FAILED(char const * file,unsigned line,char const * expr)28 extern "C" void ASSERT_FAILED(char const *file,
29                               unsigned line,
30                               char const *expr) {
31 #ifndef __arm__
32   llvm::errs() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
33   llvm::errs() << "rslAssert [" << file << ":" << line << "] " << expr << "\n";
34   llvm::errs() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
35 #else
36   LOGE("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
37   LOGE("rslAssert [%s:%d] %s\n", file, line, expr);
38   LOGE("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
39 #endif
40 
41   abort();
42 }
43