Skip to content
This repository has been archived by the owner on Sep 2, 2018. It is now read-only.

Compilation Fails with createMCInstPrinter Error #3

Closed
seanmkauffman opened this issue Apr 23, 2015 · 2 comments
Closed

Compilation Fails with createMCInstPrinter Error #3

seanmkauffman opened this issue Apr 23, 2015 · 2 comments

Comments

@seanmkauffman
Copy link

llvm[4]: Compiling ParseStmtAsm.cpp for Debug+Asserts build
/home/seanmk/workspace/llvm/tools/clang/lib/Parse/ParseStmtAsm.cpp:533:38: error: 
      reference to type 'const llvm::Triple' could not bind to an rvalue of type
      'int'
      TheTarget->createMCInstPrinter(1, *MAI, *MII, *MRI, *STI));
                                     ^
/home/seanmk/workspace/llvm/include/llvm/Support/TargetRegistry.h:411:54: note: 
      passing argument to parameter 'T' here
    MCInstPrinter *createMCInstPrinter(const Triple &T, unsigned SyntaxVariant,
                                                     ^
1 error generated.
@dylanmckay
Copy link
Member

I have llvm and clang at master (llvm: 7e8c7af2, clang: 00a0b38), and compilation is successful - I am not getting this error.

@dylanmckay
Copy link
Member

Note that Target::createMCInstPrinter is declared at TargetRegistry.h:414 (see the file here).

It seems like you have the incorrect version of TargetRegistry. One which has a different signature and defined on a different line.

dylanmckay pushed a commit that referenced this issue Jan 19, 2016
1) Instead of using pairs of From/To* fields, combine fields into a struct
TemplateArgInfo and have two in each DiffNode.
2) Use default initialization in DiffNode so that the constructor shows the
only field that is initialized differently on construction.
3) Use Set and Get functions per each DiffKind to make sure all fields for the
diff is set.  In one case, the Expr fields were not set.
4) Don't print boolean literals for boolean template arguments.  This prevents
printing 'false aka 0'

Only #3 has a functional change, which is reflected in the test change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257831 91177308-0d34-0410-b5e6-96231b3b80d8
dylanmckay pushed a commit that referenced this issue Sep 15, 2016
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281197 91177308-0d34-0410-b5e6-96231b3b80d8
dylanmckay pushed a commit that referenced this issue Sep 24, 2016
Currently, the Clang version is computed as follows:

 1. LLVM defines major, minor, and patch versions, all statically set. Today,
    these are 4, 0, and 0, respectively.
 2. The static version numbers are combined into PACKAGE_VERSION along with a
    suffix, so the result today looks like "4.0.0svn".
 3. Clang extracts CLANG_VERSION from PACKAGE_VERSION using a regexp. The regexp
    allows the patch level to omitted, and drops any non-digit trailing values.
    Today, this result looks like "4.0.0".
 4. CLANG_VERSION is then split further into CLANG_VERSION_MAJOR and
    CLANG_VERSION_MINOR. Today, these resolve to 4 and 0, respectively.
 5. If CLANG_VERSION matches a regexp with three version components, then
    CLANG_VERSION_PATCHLEVEL is extracted and the CLANG_HAS_VERSION_PATCHLEVEL
    variable is set to 1. Today, these values are 0 and 1, respectively.
 6. The CLANG_VERSION_* variables (and CLANG_HAS_VERSION_PATCHLEVEL) are
    configured into [llvm/tools/clang/]include/clang/Basic/Version.inc
    verbatim by CMake.
 7. In [llvm/tools/clang/]include/clang/Basic/Version.h, macros are defined
    conditionally, based on CLANG_HAS_VERSION_PATCHLEVEL, to compute
    CLANG_VERSION_STRING as either a two- or three-level version number. Today,
    this value is "4.0.0", because despite the patchlevel being 0, it was
    matched by regexp and is thus "HAS"ed by the preprocessor. This string is
    then used wherever Clang's "version" is needed [*].

[*] Including, notably, by compiler-rt, for computing its installation path.

This change collapses steps 2-5 by defaulting Clang to use LLVM's (non-string)
version components for the Clang version (see [*] for why not PACKAGE_VERSION),
and collapses steps 6 and 7 by simply writing CLANG_VERSION_STRING into
Version.inc. The Clang version today always uses the patchlevel form, so the
collapsed Version.inc does not have logic for a version without a patch level.

Historically speaking, this technique began with the VER file in r82085 (which
survives in the form of the regexp in #3). The major, minor, and patchlevel
versions were introduced by r106863 (which remains in #4-6). The VER file itself
was deleted in favor of the LLVM version number in r106914. On the LLVM side,
the individual LLVM_VERSION_MAJOR, LLVM_VERSION_MINOR, and PACKAGE_VERSION
weren't introduced for nearly two more years, until r150405.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281666 91177308-0d34-0410-b5e6-96231b3b80d8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants