Files
android_development/vndk/tools/header-checker/tests/input/example2.h
Jayant Chowdhary 83fc92bb30 Introduce recursive dumping/diffing of types.
1) Types are now quantifed into one of the following:
	a) RecordType - structures/ unions/ classes.
	b) EnumType - enumerated types.
	c) QualifiedType - types with qualifiers intact.
	d) PointerType - pointer to a type.
	e) LvalueReferenceType
	f) RvalueReferenceType
	g) ArrayType

2) ABI diffing now diffs based on types directly / indirectly reachable
by function signatures / global variable types by default. Also added an option
to header-abi-diff:

-check-all-apis : Include changes to all APIs exported via exported
headers whether directly / indirectly used by function signatures /
global variable types or not.

3) Introduced an internal representation of abi information. This
enables us to switch formats of abi-dumps / abi-diffs more easily
without changing the AST parsing code. For example: In the future, if we
wanted to add options to view the abi-dumps in html / xml we could just
add classes which extended IRDumper and implement dumping methods.

4) The linked ABI dump of a shared library also includes a list of the
exported functions and objects collected from the .dynsym table. This makes it
possible to avoid false reports of ABI breakages when functions/ global
variables are moved to assembly files.

Test: abi-dumping and linking: make -j64 from ToT
      abi_diffing: change parameter types directly, indirectly.
      Ran tests/test.py with soong running the built tool, all tests passed.

Bug: 62060883

Bug: 63865902

Change-Id: Id9ef757165a1669049fde20bda4147d5074cc191
2017-08-16 19:26:08 -07:00

83 lines
1.3 KiB
C++

#ifndef EXAMPLE2_H_
#define EXAMPLE2_H_
#include <memory>
#include <vector>
#include <string>
#include <tuple>
#include "example3.h"
template <typename T, int size>
class fooray {
T foor[size];
};
template <class _T1, class _T2>
struct __find_exactly_one_check {
static constexpr bool __matches[] = {std::is_same<_T1, _T2>::value};
};
namespace test2 {
struct HelloAgain {
std::vector<HelloAgain *> foo_again;
int bar_again;
static int hello_forever;
virtual int again();
virtual ~HelloAgain() {}
};
struct NowWeCrash;
} // namespace test2
enum Foo_s {
foosball = 10,
foosbat
};
static constexpr bool __test_var[] = {true, false};
namespace test3 {
template <typename T>
struct ByeAgain {
T foo_again;
int bar_again;
T method_foo(T);
};
template<>
struct ByeAgain<float> {
float foo_again;
static int foo_forever;
float bar_Again;
float method_foo(int);
};
ByeAgain<double> double_bye;
template <typename T1, typename T2>
bool Begin( T1 arg1, T2 arg2, int c);
bool End ( float arg = 2.0) {
bool ret = Begin(arg, 2, 2);
return true;
}
enum Kind {
kind1 = 24,
kind2 = 2312
};
class Outer {
public:
int a;
private:
class Inner {
int b;
};
};
std::vector<int *> Dummy(int t);
} // namespace test3
#endif // EXAMPLE2_H_