diff options
author | Tareq A. Siraj <tareq.a.siraj@intel.com> | 2013-08-13 14:58:50 +0000 |
---|---|---|
committer | Tareq A. Siraj <tareq.a.siraj@intel.com> | 2013-08-13 14:58:50 +0000 |
commit | 3baabf396876af59f80a06b6ce5cfac8c2c9afda (patch) | |
tree | 2cf08348e4f268a6a79e14940c6681001b10dfd2 /clang-tools-extra/unittests/cpp11-migrate/Utility.h | |
parent | f77718ad1d2b20c834126ce7884755f97a93eb50 (diff) | |
download | bcm5719-llvm-3baabf396876af59f80a06b6ce5cfac8c2c9afda.tar.gz bcm5719-llvm-3baabf396876af59f80a06b6ce5cfac8c2c9afda.zip |
cpp11-migrate: Write header replacements to disk
Another attempt to commit r187204 after windows related problems has
been fixed. Note that changes to this patch reflect the current behavior
of cpp11-migrate.
Header replacements are now written to disk in YAML format for an external tool
to merge. A unique file will be created in the same directory as the header
with all replacements that came from a source file that included the header
file. The YAML file will have:
- Name of the header file
- Name of the source file that included the header file
- Transform ID that generated the replacement
- Offset
- Length
- Replacement text
Any tool reading these replacements should read them using the
HeaderChangeDocument struct.
Differential Revision: http://llvm-reviews.chandlerc.com/D1369
llvm-svn: 188274
Diffstat (limited to 'clang-tools-extra/unittests/cpp11-migrate/Utility.h')
-rw-r--r-- | clang-tools-extra/unittests/cpp11-migrate/Utility.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/cpp11-migrate/Utility.h b/clang-tools-extra/unittests/cpp11-migrate/Utility.h new file mode 100644 index 00000000000..54291d941a3 --- /dev/null +++ b/clang-tools-extra/unittests/cpp11-migrate/Utility.h @@ -0,0 +1,25 @@ +//=-- cpp11-migrate/Utility.h - Utility functions and macros-----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef CPP11_MIGRATE_UNITTESTS_UTILITY_H +#define CPP11_MIGRATE_UNITTESTS_UTILITY_H + +// FIXME: copied from unittests/Support/Path.cpp +#define ASSERT_NO_ERROR(x) \ + if (llvm::error_code ASSERT_NO_ERROR_ec = x) { \ + llvm::SmallString<128> MessageStorage; \ + llvm::raw_svector_ostream Message(MessageStorage); \ + Message << #x ": did not return errc::success.\n" \ + << "error number: " << ASSERT_NO_ERROR_ec.value() << "\n" \ + << "error message: " << ASSERT_NO_ERROR_ec.message() << "\n"; \ + GTEST_FATAL_FAILURE_(MessageStorage.c_str()); \ + } else { \ + } + +#endif // CPP11_MIGRATE_UNITTESTS_UTILITY_H |